Pay-ins API
Last updated: 2026-11-10
Pay-in operations use a secret key (sk_*). Monetary amounts use minor units
and must follow the amount representation rules.
Initialize a hosted pay-in
POST /merchant/api/v1/payins/initialize
Auth: Secret key
| Body field | Type | Presence | Meaning |
|---|---|---|---|
amount | string (int64) | Required | Positive amount in minor units |
currencyCode | string | Required | ISO 4217 currency |
countryCode | string | Required | ISO 3166-1 alpha-2 country code of the selected payment market; it is never inferred from currency or payment method |
paymentSubMethod | string | Optional | Supported only for bank transfer; current value is moniepoint |
paymentMethod | enum | Required | Selected PAYMENT_METHOD_* value |
merchantReference | string | Required | Merchant-side payment reference |
redirectUrl | string | Required | Customer return URL |
trafficVertical | enum | Optional | Traffic classification for this request; an explicit supported value takes precedence over the account default |
customerSegment | enum | Optional | Customer segment; defaults when omitted |
mobileMoneyOperator | string | Conditional | Public operator code for operator-required standard mobile money; required transfer rail code for mobile money transfer |
{
"amount": "10000",
"currencyCode": "NGN",
"countryCode": "NG",
"paymentMethod": "PAYMENT_METHOD_BANK_ACCOUNT",
"merchantReference": "MR-1001",
"redirectUrl": "https://merchant.example/return",
"trafficVertical": "TRAFFIC_VERTICAL_OTHER"
}
The response contains paymentOrder and expiresAt. A new, unsubmitted hosted
form has a 30-minute window from payment creation; expiresAt marks that window.
It is not a payment-completion or cancellation signal. Once the payment is
PENDING, follow its current status and any instruction expiry. Redirect the
customer only when paymentOrder.paymentUrl is returned, and reconcile the
payment after the customer returns. See the retry rules below for the special
case of pending bank transfers.
Create a direct pay-in
POST /merchant/api/v1/payins/create
Auth: Secret key
The core fields are the same as hosted initialization, except that redirectUrl
is required only for PAYMENT_METHOD_BANK_ACCOUNT and for
PAYMENT_METHOD_MOBILE_MONEY when the payment uses WAVE, including when
routing selects it. It is optional for other
direct pay-ins, including M-Pesa, OTP mobile money, bank transfer, and mobile
money transfer. Hosted initialization always requires redirectUrl.
Other direct pay-ins can also return a browser payment link. Supply the optional
redirectUrl when the customer should return to your site after following a
returned paymentUrl. Without it, the customer returns to the Transcore payment
page. A browser return does not confirm payment completion.
Direct requests put method-specific input in exactly one matching detail block. Use
paymentSubMethod only with bank transfer; the current supported value is
moniepoint.
| Detail block | Used with | Fields |
|---|---|---|
bankAccountDetails | PAYMENT_METHOD_BANK_ACCOUNT | name and bankCode required; email optional |
bankTransferDetails | PAYMENT_METHOD_BANK_TRANSFER | email optional |
mobileMoneyDetails | PAYMENT_METHOD_MOBILE_MONEY | mobileNumber required; operator and voucherPin conditional; email optional |
mobileMoneyTransferDetails | PAYMENT_METHOD_MOBILE_MONEY_TRANSFER | operator and mobileNumber required |
cardDetails | PAYMENT_METHOD_CARD | Schema-visible only; card creation is not currently supported |
Example direct M-Pesa request without a return URL. Use MPESA only when it is
returned by pay-in operator discovery for the selected
market and request context:
{
"amount": "8500",
"currencyCode": "KES",
"countryCode": "KE",
"paymentMethod": "PAYMENT_METHOD_MOBILE_MONEY",
"merchantReference": "MM-2001",
"mobileMoneyDetails": {
"mobileNumber": "<customer_msisdn>",
"operator": "MPESA"
}
}
Method-specific response details can include:
bankAccountDetails.redirectUrlfor an authorization redirect;- bank transfer account instructions and
expiresAt; - mobile money instructions,
displayMessage, andisOtpAuthRequired; - mobile money transfer
instructions,expiresAt, anddisplayMessage.
Treat displayMessage as optional plain-text customer guidance, and display it
only for a flow whose customer-facing copy your integration has reviewed. Do
not parse it as a payment status, failure reason, or payment requisite. It can
be absent while a pending payment is being reconciled. Later payment reads do
not include mobileMoneyDetails, so retain the create response
if you need to keep showing the guidance.
isOtpAuthRequired is a continuation signal and does not identify an OTP
operation by itself. When discovery returned ORANGE for the current account
and realm in one of the markets below, a create response with true requires
the OTP authorization operation. For another operator, follow its
method-specific contract.
See Mobile money transfer objects for its direct request, response, and instruction fields.
Retry pay-in creation
Retry the same endpoint in the same realm with the same merchantReference
and an equivalent request. Both direct creation and hosted initialization keep
the original payment ID and current status, including EXPIRED and CANCELLED;
they do not create a replacement payment. Direct creation can return the
current payment or repeat the original error. Changing essential request data
while keeping a reserved reference returns a reference conflict.
If a read confirms PAYMENT_ORDER_STATUS_REJECTED, the request was declined
before execution. An equivalent same-reference repeat returns the same
rejected attempt and does not start processing again. This also applies when
the initial create or initialize call returned only a generic error, including
HTTP 503 with retry details. Resolve
the condition and use a new reference for a deliberate new intended attempt.
Do not apply this rule to an unknown timeout or to ordinary FAILED payments
that still require reconciliation.
For POST /merchant/api/v1/payins/initialize, returning the existing payment
does not always return a usable payment page. An unexpired CREATED form
retains its page URL, and a PENDING bank transfer can return its existing
instructions page. Other PENDING methods and all terminal statuses return
the existing payment without a payment page URL. An unsubmitted form whose
30-minute window has elapsed returns the original payment as EXPIRED.
Ignore expiresAt for REJECTED; no payment form exists.
Expiry or cancellation does not free a pay-in reference. Use a new reference for a new intended payment. Before requesting another payment for the same purchase, reconcile the original. If an older payment's request cannot be matched, its reference remains reserved and a retry can return a reference conflict. Use a payment read and contact support if needed.
An EXPIRED or CANCELLED attempt already sent for payment can still receive
a verified late confirmation and become COMPLETED on its original ID.
Persist that ID, reconcile it before asking the customer to pay again, and
continue accepting verified updates even if a separate payment has since
been created. For older histories containing several attempts under one
reference, keep each payment ID: reference lookup does not replace reading
the original attempt. Do not treat an unknown outcome as cancellation or
expiry, or switch between create and initialize to bypass a reference conflict.
For example, if a create request times out, keep its reference and request data. Read the payment by reference. An equivalent retry of the same endpoint reuses that attempt. Do not generate a new reference just because the response was lost.
A reserved-reference conflict returns HTTP 400 / INVALID_ARGUMENT with a
google.rpc.BadRequest violation for PayIn/#merchant_reference and description
Taken. See the reference conflict example.
If retries repeat the same error, including HTTP 500, stop automatic retries
and read the payment by reference. Ask support if its outcome remains unclear.
Changing mobileMoneyDetails.voucherPin while keeping the same reference does
not start a new attempt or correct the original payment. Reconcile the existing
attempt first; contact support if the PIN needs to be corrected after a failed
attempt. Do not create a replacement while the earlier payment may still complete.
Authorize pay-in OTP
POST /merchant/api/v1/payins/authorize-otp
Auth: Secret key
Use this operation when discovery selected ORANGE for a direct pay-in in a
market listed below, the create response returns
mobileMoneyDetails.isOtpAuthRequired: true, and your flow has collected the
customer's OTP.
The operator contract covers nine country/currency pairs: BF / XOF, CI /
XOF, SN / XOF, ML / XOF, CM / XAF, CF / XAF, GQ / XAF,
CD / CDF, and SL / SLE. This is not an availability list: use ORANGE
only when discovery returns it for the current account and realm. There is no
separate OTP activation.
First create the payment with the public operator code ORANGE when discovery
returns it for the current account and realm. When the create response returns
mobileMoneyDetails.isOtpAuthRequired: true, submit the customer-provided OTP
within 15 minutes of payment creation.
| Body field | Type | Presence |
|---|---|---|
paymentOrderId | string (UUID) | Required |
token | string | Required |
{
"paymentOrderId": "<payment_order_id>",
"token": "<customer_provided_otp>"
}
The response contains:
isAuthorized— whether OTP authorization was accepted;isStkPromptRequired— whether the flow continues with an STK prompt;displayMessage— optional plain-text customer guidance; do not parse it as payment state or a failure reason.
{
"isAuthorized": true,
"isStkPromptRequired": false,
"displayMessage": "Payment is being processed."
}
isAuthorized: true means the OTP was accepted. It does not mean the payment
is complete: the payment can remain PENDING and must still be reconciled.
Outcomes
Pay-in operations can return INVALID_ARGUMENT for missing, malformed, or
unavailable request values. A route that is temporarily unavailable can return
the public method_unavailable reason. OTP authorization can also return
NOT_FOUND for an unknown payment order. An invalid OTP returns
INVALID_ARGUMENT for token; a corrected OTP can be submitted before the
authorization deadline. A retryable authorization condition returns HTTP 503 /
UNAVAILABLE with Retry-After: 2. Handle all non-success responses using
Errors.
Related guide: Pay-ins.