OnLink
API reference

Create a customer

Creates a customer of yours at pending_kyc and sends customer.created. The customer has no login: it is an account holder you act for. externalRef is your own id for them and must be unique among your customers; phone is E.164 (any country) and countryOfResidence an ISO 3166-1 alpha-2 code of a country we can open accounts in: a customer who lives anywhere else is refused with 422 CUSTOMER_RESIDENCE_NOT_SUPPORTED, naming the country. A field this call does not take is refused with 400 UNKNOWN_BODY_FIELD, naming it in details.fields.

POST
/v1/customers

Authorization

partner-key
X-OnLink-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers" \  -H "Content-Type: application/json" \  -d '{    "type": "individual",    "displayName": "Amina Wanjiru",    "email": "amina@example.com",    "phone": "+447700900123",    "countryOfResidence": "GB"  }'
{  "id": "5f0c1a3e-2d4b-4c6a-8e9f-0a1b2c3d4e5f",  "type": "individual",  "status": "pending_kyc",  "externalRef": "acme-cust-0042",  "displayName": "Amina Wanjiru",  "email": "amina@example.com",  "phone": "+447700900123",  "countryOfResidence": "GB",  "legalName": null,  "createdAt": "2026-11-17T09:30:00.000Z",  "updatedAt": "2026-11-17T09:30:00.000Z",  "closedAt": null}

Pay out of a customer account POST

Sends money from one of your customers’ accounts to a bank account or mobile wallet, over the same rails as a payout from your own account: KES on mpesa, pesalink, rtgs and eft, USD on rtgs, eft and swift, GBP and EUR on swift. The customer must be verified and hold an account in the currency. The amount, the transfer fee and your own fee are reserved on the customer account until the payout ends. Nothing is sent until the code delivered to your confirmation contact (or your webhook, as confirmation.code_issued) is verified with POST /v1/confirmations/:id, unless OnLink has enabled confirmation waiving for your account and the API key has an IP allowlist, in which case the payout is returned already confirmed and runs at once. A partnerFee is paid from the customer account to your own account after the payout settles: at most the lower of a share and a ceiling set for your account; with no terms set only "0.00" is accepted. The outcome is announced as customer.transfer.updated.

Ask a payer to send you KES over M-PESA POST

Sends an STK Push prompt to the number you name. The payer approves it on their own handset with their PIN — there is no OTP for you to handle and no way for you to complete it on their behalf. The deposit lands in your own KES account, which is resolved from your verified business and is not something you can specify. This returns as soon as the prompt is out, so treat the response as pending: the completion signal is the credit.received webhook, and a prompt the payer declines or ignores produces no event at all. There is no idempotency key. A repeated call is a second prompt, and if the payer approves both then both deposits land and each raises its own credit.received.