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

# Quickstart

> Create your first crypto payment in under 5 minutes.

## Prerequisites

Before you begin, make sure you have:

1. An Orafi account — [sign up here](https://dashboard.orafi.app)
2. A completed business profile (onboarding)
3. Your **test** API key from the dashboard

<Info>
  Both test and live environments use the same base URL: `https://api.orafi.app`. Your API key determines which mode you're operating in.
</Info>

***

## Step 1 — Create a payment

Use the hosted checkout flow to create a payment. Orafi returns a `checkoutUrl` that you redirect your customer to.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.orafi.app/transactions/payment/create \
    -H "Content-Type: application/json" \
    -H "x-api-key: ora_test_your_api_key" \
    -d '{
      "amount": 10000,
      "customer": {
        "fullname": "John Doe",
        "email": "john@example.com"
      },
      "txRef": "order_12345",
      "redirectUrl": "https://yourapp.com/payment/success"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.orafi.app/transactions/payment/create", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "ora_test_your_api_key"
    },
    body: JSON.stringify({
      amount: 10000,
      customer: {
        fullname: "John Doe",
        email: "john@example.com"
      },
      txRef: "order_12345",
      redirectUrl: "https://yourapp.com/payment/success"
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.orafi.app/transactions/payment/create",
      headers={
          "Content-Type": "application/json",
          "x-api-key": "ora_test_your_api_key"
      },
      json={
          "amount": 10000,
          "customer": {
              "fullname": "John Doe",
              "email": "john@example.com"
          },
          "txRef": "order_12345",
          "redirectUrl": "https://yourapp.com/payment/success"
      }
  )

  print(response.json())
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": true,
  "message": "Payment created successfully",
  "data": {
    "payment": {
      "id": "cmjw65j510001v81cilq0u13v",
      "depositAddress": "0x02c362...82f66",
      "amount": 10000,
      "amountInUSDC": 6.92,
      "redirectUrl": "https://yourapp.com/payment/success"
    },
    "checkoutUrl": "https://checkout.orafi.app/cmjw65j4z0000v81c16vtqj14"
  }
}
```

Redirect your customer to the `checkoutUrl`. They'll complete the payment there, then be sent back to your `redirectUrl`.

***

## Step 2 — Verify the payment

Once the customer is redirected back, verify the payment status server-side.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.orafi.app/transactions/payment/verify \
    -H "Content-Type: application/json" \
    -d '{
      "paymentId": "cmjw65j510001v81cilq0u13v"
    }'
  ```

  ```javascript Node.js theme={null}
  const verification = await fetch("https://api.orafi.app/transactions/payment/verify", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      paymentId: "cmjw65j510001v81cilq0u13v"
    })
  });

  const result = await verification.json();
  console.log(result);
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": true,
  "message": "Payment verification completed",
  "data": {
    "status": "completed",
    "paymentId": "cmjw65j510001v81cilq0u13v"
  }
}
```

***

## Step 3 — Listen for webhooks (recommended)

Instead of polling, register a webhook to get notified in real-time when payments complete or fail.

```bash theme={null}
curl -X POST https://api.orafi.app/v1/webhook/register \
  -H "Content-Type: application/json" \
  -H "x-api-key: ora_test_your_api_key" \
  -d '{
    "url": "https://yourapp.com/webhooks/orafi"
  }'
```

Then subscribe to events:

```bash theme={null}
curl -X POST https://api.orafi.app/webhook/subscribe \
  -H "Content-Type: application/json" \
  -H "x-api-key: ora_test_your_api_key" \
  -d '{
    "event": "payment.success"
  }'
```

See the [Webhooks guide](/api-reference/endpoint/webhooks) for full setup details.

***

## Next steps

<CardGroup cols={2}>
  <Card title="Set up webhooks" icon="bell" href="/api-reference/endpoint/webhooks">
    Receive real-time payment notifications.
  </Card>

  <Card title="Create paylinks" icon="link" href="/api-reference/endpoint/paylinks">
    No-code shareable payment pages.
  </Card>

  <Card title="Configure payouts" icon="money-bill-transfer" href="/api-reference/endpoint/payouts">
    Withdraw settled funds to crypto or fiat.
  </Card>

  <Card title="Full API reference" icon="code" href="/api-reference/introduction">
    Explore every endpoint.
  </Card>
</CardGroup>
