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

# Collections

> Create customer collection requests.

Use collections when you want to request money from a customer.

## Endpoint

`POST /v3/collect`

## Required fields

| Field                | Description                                                    |
| -------------------- | -------------------------------------------------------------- |
| `currency`           | Customer payment currency.                                     |
| `source`             | Use `mobile`.                                                  |
| `amount`             | Amount to collect.                                             |
| `phone_number`       | Customer phone number.                                         |
| `external_reference` | Unique reference from your system.                             |
| `callback_url`       | URL that should receive status callbacks.                      |
| `quote`              | Set `true` to quote only, or `false` to create the collection. |

## Quote first

```bash theme={null}
curl https://serviceapi.sarafa.ss/v3/collect \
  -H "x-api-key: YOUR_API_KEY" \
  -H "environment: sandbox" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "KES",
    "source": "mobile",
    "amount": 25,
    "phone_number": "+254700000000",
    "external_reference": "order-1001",
    "callback_url": "https://example.com/sarafa/callback",
    "quote": true
  }'
```

## Create the collection

Send the same request with `quote: false`.

Use a new `external_reference` for every collection. Duplicate references return an error.
