curl --request POST \
--url https://api.stablepay.ai/v1/payments/in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"fiatAmount": "5000",
"sourceCurrency": "KES",
"destinationCurrency": "USDC",
"blockchain": "SOLANA",
"paymentMethod": "MOMO",
"accountNumber": "+254712345678",
"accountName": "Jane Doe",
"paymentCode": "MPESA",
"reference": "order_abc123",
"rateId": "RATE_RIXX01ARZ3NDEKTSV4RRFFQ69G5FAV"
}
'{
"paymentId": "pay_01123KZMRJPQR9S7T3XABCDEF",
"status": "provider_accepted",
"createdAt": "2023-11-07T05:31:56Z",
"providerRef": "<string>",
"redirectUrl": "https://express.opaycheckout.com/apiCashier/redirect/payment/checkoutHome?orderToken=TOKEN.abc233f3nfonc8a0a076dd7"
}{
"statusCode": 400,
"message": "fiatAmount must be a positive number.",
"code": "validation_error"
}{
"statusCode": 400,
"message": "fiatAmount must be a positive number.",
"code": "validation_error"
}{
"statusCode": 422,
"code": "validation_error",
"message": "KES requires blockchain=SOLANA for MOMO payments."
}Create Payin
Submit a fiat-to-stablecoin payin.
curl --request POST \
--url https://api.stablepay.ai/v1/payments/in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"fiatAmount": "5000",
"sourceCurrency": "KES",
"destinationCurrency": "USDC",
"blockchain": "SOLANA",
"paymentMethod": "MOMO",
"accountNumber": "+254712345678",
"accountName": "Jane Doe",
"paymentCode": "MPESA",
"reference": "order_abc123",
"rateId": "RATE_RIXX01ARZ3NDEKTSV4RRFFQ69G5FAV"
}
'{
"paymentId": "pay_01123KZMRJPQR9S7T3XABCDEF",
"status": "provider_accepted",
"createdAt": "2023-11-07T05:31:56Z",
"providerRef": "<string>",
"redirectUrl": "https://express.opaycheckout.com/apiCashier/redirect/payment/checkoutHome?orderToken=TOKEN.abc233f3nfonc8a0a076dd7"
}{
"statusCode": 400,
"message": "fiatAmount must be a positive number.",
"code": "validation_error"
}{
"statusCode": 400,
"message": "fiatAmount must be a positive number.",
"code": "validation_error"
}{
"statusCode": 422,
"code": "validation_error",
"message": "KES requires blockchain=SOLANA for MOMO payments."
}Authorizations
Stablepay API key. Include as Authorization: Bearer <key>.
Headers
Client-generated UUID. Required to prevent duplicate payments.
Body
The payment amount in local currency.
"1000"
Fiat currency sent onchain for payment settlement.
GHS, KES, NGN, TZS, UGX, ZMW, ZAR, XAF, XOF, CDF Stablecoin received by the recipient.
USDC Supported blockchains for onchain settlement.
SOLANA The supported payment method used to deliver funds to the recipient.
MOMO, BANK Wallet issuer's unique reference.
"csh-txn-20260506-001"
The account number of the payment method. Must be in E.164 format with the + prefix when paymentMethod is MOMO.
"+254712345678"
Recipient full name associated with the payment method. Required when paymentMethod is MOMO; optional otherwise.
"Jane Doe"
Required when paymentMethod is MOMO or OPAY. Available MOMO options: MPESA, MTN, AIRTEL, TIGO, ZAMTEL, HALOTEL, VODAFONE, VODACOM, ORANGE, MOOV, FREE. Available BANK options: OPAY.
Customer's email address. Required when paymentMethod is BANK; optional otherwise.
"jane@example.com"
A method-specific identifier required for processing the payment. Examples include BVN (BANK) or other market specific references.
The URL to redirect to after payment completion.
"https://your-app.example.com/return"
The customer this payment is for. Required when KYC is enabled for your account.
"cus_01KXG3R0X8DXTKB849FFFEPT7Y"
Identifier for the quoted rate. Locked for 1 hour.
"RATE_RIXX01ARZ3NDEKTSV4RRFFQ69G5FAV"
Response
Payment accepted. The provider will collect fiat from the customer asynchronously.
Listen for the payment.succeeded webhook for finality.
Use this ID to track the payment status.
"pay_01HV8KZMRJPQR9S7T3XABCDEF"
"provider_accepted"
Provider's internal transaction ID.
For bank payins that require the customer to transfer fiat into a provided account.
Show child attributes
Show child attributes
Hosted checkout URL the customer must be redirected to complete the payment (e.g. OPAY deeplink). Null when not applicable.
"https://express.opaycheckout.com/apiCashier/redirect/payment/checkoutHome?orderToken=TOKEN.abc233f3nfonc8a0a076dd7"

