> ## 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.

# Swaps

> Swap one wallet currency for another.

Use swaps to convert one merchant wallet balance into another supported currency.

## Endpoint

`POST /v3/swap`

## Required fields

| Field         | Description                                              |
| ------------- | -------------------------------------------------------- |
| `_from`       | Source currency.                                         |
| `_to`         | Destination currency.                                    |
| `amount`      | Amount to convert.                                       |
| `external_id` | Optional unique reference from your system.              |
| `fee_percent` | Optional fee percentage.                                 |
| `quote`       | Set `true` to quote only, or `false` to create the swap. |

## Quote a swap

```bash theme={null}
curl https://serviceapi.sarafa.ss/v3/swap \
  -H "x-api-key: YOUR_API_KEY" \
  -H "environment: sandbox" \
  -H "Content-Type: application/json" \
  -d '{
    "_from": "USD",
    "_to": "SSP",
    "amount": 50,
    "external_id": "swap-1001",
    "quote": true
  }'
```

## Create a swap

Send the request with `quote: false` after reviewing the quote. A completed swap returns debit and credit transaction records.
