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

# Quickstart

> Get up and running with the Afriex Business API in minutes

## Quickstart Guide

Get up and running with the Afriex Business API in three simple steps.

## Prerequisites

Before you begin, you'll need:

* An Afriex Business account ([Sign up here](https://business.afriex.com/))
* Your API key from the dashboard
* A tool for making HTTP requests (cURL, Postman, or your preferred HTTP client)

## Step 1: Get your API key

<AccordionGroup>
  <Accordion icon="key" title="Obtain your API credentials">
    1. Log in to the [Afriex Dashboard](https://business.afriex.com/)
    2. Navigate to **Settings** > **API Keys**
    3. Generate a new API key for your integration
    4. Copy and securely store your API key

    <Note>
      The dashboard has a **Test / Live toggle** at the top. Make sure you are in **Test** mode while developing so you use sandbox credentials. Switch to **Live** mode only when you are ready to go to production. Each mode has different API keys.
    </Note>

    <Warning>
      Keep your API key secure and never expose it in client-side code or public repositories.
    </Warning>
  </Accordion>
</AccordionGroup>

## Step 2: Make your first API call

<AccordionGroup>
  <Accordion icon="code" title="Test the API with cURL">
    Create your first customer:

    ```bash theme={null}
    curl -X POST https://sandbox.api.afriex.com/api/v1/customer \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{
    "fullName": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+2348192837465",
    "countryCode": "NG"
    }'
    ```

    <Tip>
      Use the staging environment for testing. Switch to `https://api.afriex.com` for production.
    </Tip>
  </Accordion>

  <Accordion icon="check" title="Verify the response">
    A successful response will return the created customer:

    ```json theme={null}
    {
      "data": {
        "customerId": "69516dd0464b2213bd74cfad",
        "name": "John Doe",
        "email": "john.doe@example.com",
        "phone": "+2348192837465",
        "countryCode": "NG"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Step 3: Process your first transaction

<AccordionGroup>
  <Accordion icon="money-bill" title="Create a transaction">
    Once you have a customer and payment method set up, you can create a transaction:

    ```bash theme={null}
    curl -X POST https://sandbox.api.afriex.com/api/v1/transaction \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{
    "customerId": "CUSTOMER_ID",
    "type": "WITHDRAW",
    "sourceAmount": "10",
    "destinationAmount": 5000,
    "sourceCurrency": "USD",
    "destinationCurrency": "NGN",
    "destinationId": "PAYMENT_METHOD_ID",
    "meta": {
      "reference": "order-12345",
      "idempotencyKey": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
    }'
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  In **sandbox**, this transaction settles automatically within \~1-2 minutes so you can test the full flow. To test your failure handling, set `meta.reference` to a value containing `fail` and the transaction settles as `FAILED` (otherwise `SUCCESS`). See [Testing transaction outcomes in sandbox](/development#testing-transaction-outcomes-in-sandbox).
</Tip>

## Next Steps

Now that you've made your first API calls, explore these guides:

<Info>
  **Planning to use webhooks?** Allowlist these Afriex IP addresses on your server so webhook deliveries are not blocked:

  * Sandbox: `34.234.189.210`
  * Production: `34.197.33.100`

  See [Webhook setup](/api-reference/endpoint/webhooks/introduction) for full details.
</Info>

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Explore all available endpoints and their parameters.
  </Card>

  <Card title="Customers" icon="users" href="/api-reference/endpoint/customers/create">
    Learn how to manage customer profiles and KYC.
  </Card>

  <Card title="Payment Methods" icon="credit-card" href="/api-reference/endpoint/payment-methods/create">
    Set up bank accounts and mobile money wallets.
  </Card>

  <Card title="Webhooks" icon="bell" href="/api-reference/endpoint/webhooks/introduction">
    Receive real-time notifications for events.
  </Card>
</CardGroup>

## Support

Need help? Contact us at [support@afriex.com](mailto:support@afriex.com).
