> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usebila.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Get up and running with the Bila API in minutes

export const DCard = ({title, description, href, icon}) => <a href={href} style={{
  textDecoration: 'none',
  borderBottom: 'none',
  border: 'none',
  display: 'block'
}}>
    <div style={{
  borderRadius: '16px',
  padding: '32px',
  height: '160px',
  display: 'flex',
  flexDirection: 'column',
  justifyContent: 'flex-end',
  background: 'transparent',
  border: '0.5px solid #f16101',
  cursor: 'pointer',
  transition: 'all 0.15s ease-in-out',
  boxShadow: '0 4px 14px 0 rgba(241, 97, 1, 0.1)'
}} onMouseEnter={e => {
  e.currentTarget.style.background = 'rgba(241, 97, 1, 0.05)';
  e.currentTarget.style.boxShadow = '0 6px 20px 0 rgba(241, 97, 1, 0.2)';
  e.currentTarget.style.transform = 'translateY(-2px)';
}} onMouseLeave={e => {
  e.currentTarget.style.background = 'transparent';
  e.currentTarget.style.boxShadow = '0 4px 14px 0 rgba(241, 97, 1, 0.1)';
  e.currentTarget.style.transform = 'none';
}}>
      <div style={{
  fontSize: '24px',
  marginBottom: '8px'
}}>{icon}</div>
      <div style={{
  fontWeight: '500',
  fontSize: '16px'
}}>{title}</div>
      <div style={{
  opacity: 0.6,
  fontSize: '13px',
  marginTop: '4px'
}}>{description}</div>
    </div>
  </a>;

export const DGrid = ({children}) => <div style={{
  display: 'grid',
  gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))',
  gap: '24px'
}}>
    {children}
  </div>;

<Steps>
  <Step title="Get your API keys">
    Log in to the [Bila Console](https://app.usebila.com) and navigate to **Settings → API Keys**.

    | Key type | Prefix     | Environment |
    | -------- | ---------- | ----------- |
    | Test     | `sk_test_` | Sandbox     |
    | Live     | `sk_live_` | Production  |

    <Warning>Never expose API keys in client-side code or public repositories.</Warning>
  </Step>

  <Step title="Fetch your accounts">
    Confirm your key works by listing your accounts:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X GET "https://api.usebila.com/api/v1/bila/accounts" \
        -H "x-api-key: sk_test_your_api_key_here"
      ```

      ```javascript Node.js theme={null}
      const res = await fetch('https://api.usebila.com/api/v1/bila/accounts', {
        headers: { 'x-api-key': 'sk_test_your_api_key_here' }
      });
      const data = await res.json();
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "status": true,
      "message": "Accounts retrieved successfully",
      "data": { "data": [...], "meta": { "total": 1, "page": 1, "perPage": 50 } }
    }
    ```
  </Step>

  <Step title="Collect a payment">
    Trigger a USSD push to collect from a mobile money wallet:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "https://api.usebila.com/api/v1/bila/collections/mobile-money" \
        -H "x-api-key: sk_test_your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
          "amount": 100,
          "reference": "order-12345",
          "phone": "0977123456",
          "operator": "airtel",
          "country": "zm",
          "walletId": "your-wallet-id",
          "customerName": "John Doe",
          "narration": "Payment for Order #12345"
        }'
      ```

      ```javascript Node.js theme={null}
      const res = await fetch('https://api.usebila.com/api/v1/bila/collections/mobile-money', {
        method: 'POST',
        headers: { 'x-api-key': 'sk_test_your_api_key_here', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          amount: 100, reference: 'order-12345', phone: '0977123456',
          operator: 'airtel', country: 'zm', walletId: 'your-wallet-id',
          customerName: 'John Doe', narration: 'Payment for Order #12345'
        })
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Send a payout">
    Initiate a bank account transfer:

    ```bash cURL theme={null}
    curl -X POST "https://api.usebila.com/api/v1/bila/transfers/bank-account" \
      -H "x-api-key: sk_test_your_api_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "accountId": "your-account-id",
        "amount": 500,
        "reference": "payout-12345",
        "accountNumber": "1234567890",
        "bankId": "bank-id",
        "country": "zm",
        "narration": "Salary payment"
      }'
    ```
  </Step>
</Steps>

## Next Steps

<DGrid>
  <DCard title="Authentication" description="Secure requests with API keys" href="/docs/developers/authentication" icon="△" />

  <DCard title="Collections" description="Accept payments from customers" href="/docs/developers/collections/overview" icon="○" />

  <DCard title="Transfers" description="Send payouts to recipients" href="/docs/developers/transfers/overview" icon="⇒" />

  <DCard title="API Reference" description="Explore all API endpoints" href="/docs/api-reference" icon="⟡" />
</DGrid>
