---
title: "Convert USD to KES"
method: POST
path: "/v1/conversions"
tags: ["Partner API"]
---

# Convert USD to KES

`POST /v1/conversions`

## Request

- Base URL: `https://sandbox.onlink.africa`
- URL: `https://sandbox.onlink.africa/v1/conversions`
- Auth: API key in header `X-OnLink-Key`

Debits the USD from your USD account and credits the KES to your KES account, asynchronously. Poll GET /v1/conversions/:id or wait for conversion.settled or conversion.failed. If the exchange cannot be completed after your USD was debited, the USD is returned to you and the conversion ends failed with the reason. No confirmation code: both accounts are your own.

## Request body

- PartnerCreateConversionDto
  - `from` string, required: The currency you convert from. Only USD is supported.
  - `to` string, required: The currency you receive. Only KES is supported.
  - `amount` string, required: The amount of `from` to convert, as a decimal string with at most 2 decimal places.
  - `partnerReference` string, required: Your own reference for this conversion, stored for your records and returned on reads.
  - `idempotencyKey` string, required: Makes the create safe to retry: the same key with the same body returns the same conversion; the same key with a different body is refused IDEMPOTENCY_KEY_REUSED (422). 8 to 64 characters from A-Z, a-z, 0-9, _ and -.

## Response `202`

The conversion was accepted and is processing.

- PartnerConversionAcceptedDto
  - `id` string, required: The conversion id. Poll GET /v1/conversions/:id with it.
  - `status` 'processing' | 'settled' | 'failed', required: processing, settled or failed.

## Other responses

- `404`: PARTNER_NOT_FOUND.
- `409`: PARTNER_SUSPENDED.
- `422`: CONVERSION_PAIR_UNSUPPORTED, CONVERSION_AMOUNT_INVALID, CONVERSION_AMOUNT_BELOW_MINIMUM, CONVERSION_AMOUNT_ABOVE_MAXIMUM, CONVERSION_INSUFFICIENT_BALANCE or IDEMPOTENCY_KEY_REUSED. Nothing was created.
- `503`: PARTNER_CONVERSIONS_DISABLED, MONEY_MOVEMENT_PAUSED, CONVERSION_RATE_UNAVAILABLE, CONVERSION_BALANCE_UNAVAILABLE, CONVERSIONS_UNAVAILABLE, one of the account refusals (PARTNER_VA_NOT_ALLOCATED / _ACTIVATING / _SUSPENDED) or TREASURY_ACCOUNT_NOT_REGISTERED / TREASURY_ACCOUNT_UNAVAILABLE. Nothing was created.

---

[API](https://skmtc.dev/onlink/apis/onlink-partner-api.md) - [All operations](https://skmtc.dev/onlink/apis/onlink-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/onlink/apis/onlink-partner-api/revisions/1d1c6a3671f2?raw)
