APICheckout
Create a session
Create a Checkout session and get the payment link to send to the customer.
POST https://business.novasend.app/v2/payin/sessionsCreates a payment session and returns the checkoutUrl link to the hosted page. No debit happens until the customer pays on that page.
Call this endpoint from your server only: it uses your API credentials, which must never be exposed in a browser or mobile app.
Request headers
| Value | Description | Required |
|---|---|---|
| Authorization | API authentication, Basic base64(api_key:api_client) | ✅ |
| X-Idempotency-Key | Prevents the same session from being created twice when you retry. Must be a UUID | ✅ |
| Content-Type | application/json | ✅ |
| Accept-Language | Language of error messages: en, fr |
Request
| Field | Type | Description | Required |
|---|---|---|---|
| reference | string | Unique merchant-side payment identifier (UUID recommended). | ✅ |
| amount | number | Amount to collect, as a whole number with no decimals. | ✅ |
| currency | string | ISO currency: XAF or XOF. | ✅ |
| country | string | ISO country code (CM, CI). Sets the Mobile Money operators and dialling code offered. | ✅ |
| flow | string | Always checkout. | ✅ |
| allowedPaymentMethods | string[] | Methods offered to the customer: mobile_money, card, or both. | ✅ |
| returnUrls.success | url | Page on your site the customer returns to after a successful payment (HTTPS). | ✅ |
| returnUrls.failure | url | Page on your site the customer returns to after a failure (HTTPS). | ✅ |
{
"reference": "0f3fed58-0590-434e-8a00-5d6cd3560382",
"amount": 12500,
"currency": "XAF",
"country": "CM",
"flow": "checkout",
"allowedPaymentMethods": ["mobile_money", "card"],
"returnUrls": {
"success": "https://your-site.com/order/success",
"failure": "https://your-site.com/order/failure"
}
}Example
curl -X POST https://business.novasend.app/v2/payin/sessions \
-H "Authorization: Basic $(printf '%s' "$API_KEY:$API_SECRET" | base64)" \
-H "X-Idempotency-Key: $(uuidgen | tr 'A-Z' 'a-z')" \
-H "Content-Type: application/json" \
-d '{"reference":"0f3fed58-0590-434e-8a00-5d6cd3560382","amount":12500,"currency":"XAF","country":"CM","flow":"checkout","allowedPaymentMethods":["mobile_money","card"],"returnUrls":{"success":"https://your-site.com/order/success","failure":"https://your-site.com/order/failure"}}'Response
{
"id": "tr_bbodj27lqhckrc7yomyjlo",
"reference": "0f3fed58-0590-434e-8a00-5d6cd3560382",
"status": "created",
"amount": 12500,
"fee": 150,
"chargedAmount": 12650,
"currency": "XAF",
"country": "CM",
"phoneCode": "+237",
"allowedPaymentMethods": ["mobile_money", "card"],
"selectedPaymentMethod": null,
"expiresAt": "2026-10-27T10:30:00.000Z",
"checkoutUrl": "https://pay.novasend.app/checkout?session=<token>",
"returnUrls": {
"success": "https://your-site.com/order/success",
"failure": "https://your-site.com/order/failure"
}
}Response fields
| Field | Description |
|---|---|
| id | Unique Novasend transaction identifier. |
| reference | Reference provided by the merchant. |
| status | Session status: created, processing, pending, completed, failed, expired. |
| amount | Requested amount. |
| fee | Fees applied. |
| chargedAmount | Total amount paid by the customer, shown on the Checkout page. |
| currency | Session currency. |
| country / phoneCode | Session country and dialling code offered for the Mobile Money number. |
| allowedPaymentMethods | Payment methods offered to the customer. |
| selectedPaymentMethod | Method chosen by the customer (mobile_money, card), null until a payment starts. |
| expiresAt | Deadline to start the payment. After it, the session becomes expired. |
| checkoutUrl | Payment page link to redirect the customer to. |
| returnUrls | Session return URLs. |
After the redirect
- Redirect the customer to
checkoutUrl(HTTP303redirect or link). - Wait for the webhook: verify the HMAC signature, then update the order from
statusandreference. - On your
returnUrlspages, show a waiting message if the webhook has not arrived yet: the status can stayprocessingfor a few seconds after the redirect.
If a network error occurs while creating the session, retry with the same
X-Idempotency-Key to avoid creating a second session.