Skip to content

Hosted payment page (Checkout)

A checkout is a payment page hosted by Senfenico. You create a checkout on your server, redirect the customer to its authorization_url, and the customer picks their operator and pays on that page.

There is no phone number form, OTP field or waiting screen to build. Checkout suits a website or an app that can open a web page. To keep the customer inside your own interface, or to collect payments in Benin, use direct charges.

  1. Your server calls POST /v1/payment/checkouts/initialize/ with the amount and two return URLs.
  2. You store the checkout reference with your order, then redirect the customer to authorization_url.
  3. On the page, the customer picks an operator, enters their number and confirms (OTP or approval on their phone).
  4. The page shows “payment done” with a Poursuivre (Continue) button leading to your success_url?reference=….
  5. Your server confirms the payment (webhook or API call) before you fulfill the order.
POST/v1/payment/checkouts/initialize/
Parameter Type Description
amount integer, required Amount in XOF, whole number. Minimum 100. Stay at 1000000 or below (see Limits).
success_url URL, required Page on your site the customer returns to after a successful payment.
cancel_url URL, required Page on your site the customer returns to if they give up after a failure.
email email, optional Customer email. Stored on the checkout and usable as a list filter.

A checkout has no ext_id or metadata field. The returned reference links it to your order, so store it.

  1. Initialize the checkout from your server

    Fenêtre de terminal
    curl https://api.senfenico.com/v1/payment/checkouts/initialize/ \
    -H "X-API-KEY: $SENFENICO_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "amount": 1000,
    "email": "customer@example.com",
    "success_url": "https://shop.example.com/thanks",
    "cancel_url": "https://shop.example.com/cart"
    }'

    The Node.js examples use top-level await. Run them as ES modules (a .mjs file or "type": "module" in package.json), or wrap them in an async function.

    201 Created response:

    {
    "status": true,
    "message": "Checkout initialized",
    "data": {
    "reference": "CHK261126-101431--9f8e7d6c5b",
    "authorization_url": "https://api.senfenico.com/v1/checkout_payment/payment_page/CHK261126-101431--9f8e7d6c5b/",
    "live_mode": false
    }
    }

    Treat reference as an opaque string. Its format has already changed (older checkouts start with chk_) and may change again.

  2. Store the reference with your order

    Before redirecting, save reference in your orders table (for example a senfenico_checkout_ref column). It is the only way to find the order when the webhook or the customer comes back.

  3. Redirect the customer to authorization_url

    An HTTP 302 redirect, a link or window.location all work. In a mobile app, open the URL in the browser or a WebView.

  4. Confirm the payment on your server

    See Confirm the payment server-side below. Never fulfill an order just because the customer landed on success_url.

The page lists the operators enabled on your account among Orange Money, Moov Money, Coris Money and Sank Money (Burkina Faso). Benin (MTN, Moov) is not offered on the page; use direct charges.

Operator picked What the customer does on the page
Orange Money Dials *144*4*6*amount#, gets an OTP by SMS and types it in. See Orange Money.
Moov Money Gets an OTP by SMS and types it in. Depending on your account configuration, they may instead approve on their phone while the page waits. See Moov Money.
Coris Money Gets an OTP by SMS and types it in.
Sank Money Gets an OTP by SMS and types it in.

Every attempt on the page creates a charge. After a failure, the page offers to retry (new charge, same checkout) or to go back to your site.

The page is in French.

Situation What the page offers
Successful payment A confirmation screen with a Poursuivre (Continue) button pointing to success_url?reference=<checkout reference>. There is no automatic redirect, and the customer may close the page without clicking.
Failure A Réessayer (Retry) button, or a link to cancel_url?reference=<checkout reference>.

On your success_url page, read reference, find the order, then ask the API for the real state of the payment.

Never fulfill an order because the customer came back to success_url. Anyone can open that URL with any reference, and a customer can also pay without ever coming back.

The checkout status is updated by the payment page. If the customer approves on their phone and then closes the page early, the charge becomes success while the checkout stays pending, and the checkout.success webhook is not sent. So subscribe to both of these webhooks (see Webhooks):

Webhook When it arrives
checkout.success The payment is confirmed while the page is still open.
charge.success The charge created by the page succeeded, even if the customer closed the page. Find the checkout with the charge_reference filter of the checkout list.

Before you fulfill the order, and to catch up on orders still waiting, check the state through the API:

  1. Fetch the checkout by its reference. If it is success, check amount and live_mode, then fulfill the order.
  2. If it is still pending or failed and charge_reference is set, fetch that charge. If it is success, the customer has paid.
Fenêtre de terminal
REF="CHK261126-101431--9f8e7d6c5b"
curl "https://api.senfenico.com/v1/payment/checkouts/$REF/" \
-H "X-API-KEY: $SENFENICO_KEY"
# if status != success and charge_reference is set:
curl "https://api.senfenico.com/v1/payment/charges/CH261126-101502-ORANGE_BF-4c1d2e3f4a/" \
-H "X-API-KEY: $SENFENICO_KEY"

An sk_test_ key only sees test checkouts, an sk_live_ key only live ones. A checkout created with the other key returns 404.

GET/v1/payment/checkouts/{reference}/
{
"status": true,
"message": "Checkout details retrieved",
"data": {
"email": "customer@example.com",
"reference": "CHK261126-101431--9f8e7d6c5b",
"charge_reference": "CH261126-101502-ORANGE_BF-4c1d2e3f4a",
"amount": 1000,
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart",
"phone": "76000000",
"provider": "orange_bf",
"live_mode": false,
"created_at": "2026-11-26T10:14:31.208411Z",
"updated_at": "2026-11-26T10:15:40.517093Z",
"status": "success"
}
}
Field Type Description
reference string Checkout identifier. Store it with your order.
status string pending, success or failed. See Statuses.
amount integer Requested amount, in XOF.
charge_reference string or null Reference of the latest charge attempted on the page. null until the customer submits the form.
provider string Operator picked by the customer (orange_bf, moov_bf, coris_bf, sank_bf). Empty before the choice.
phone string Number entered by the customer. Empty before the choice.
email string or null Email sent at initialization.
success_url, cancel_url URL Return URLs sent at initialization.
live_mode boolean true in live mode, false in test mode.
created_at, updated_at ISO 8601 date (UTC) Creation and last update.
  1. pendingCreated, waiting for the customer
  2. successPaid
    failedAttempt failed, customer can retry
Checkout status lifecycle
Status Meaning Webhook What to do
pending Checkout created, payment not yet confirmed on the page. checkout.pending (sent at creation) Wait. Check the linked charge if the order stays pending.
success The payment was confirmed on the page. checkout.success Check the amount and live_mode, then fulfill the order.
failed The page saw a phone approval fail. After a rejected OTP, the checkout usually stays pending. checkout.failed Don’t cancel right away. The customer can retry on the same page, and the checkout can then become success.

Each status, for both charges and checkouts, is detailed in Payment lifecycle.

GET/v1/payment/checkouts/

The list returns 10 results per page (page parameter, for example ?page=2). Available filters:

Filter Example Effect
status success pending, success or failed.
reference CHK2611 Reference containing this value.
charge_reference CH261126-… Finds the checkout of a charge (handy when a charge.success arrives).
provider, phone, email orange_bf Exact match (email is case-insensitive).
date_from, date_to 2026-11-01 Creation date, inclusive, YYYY-MM-DD.
amount_min, amount_max 5000 Amount in XOF.
order_by -amount created_at, -created_at (default), amount, -amount, status, -status.
Fenêtre de terminal
curl "https://api.senfenico.com/v1/payment/checkouts/?status=success&date_from=2026-11-01" \
-H "X-API-KEY: $SENFENICO_KEY"
{
"status": true,
"message": "Checkout list retrieved",
"data": [ { "reference": "CHK261126-101431--9f8e7d6c5b", "status": "success", "amount": 1000, "…": "…" } ],
"pagination": {
"count": 1,
"total_pages": 1,
"current_page": 1,
"page_size": 10,
"has_next": false,
"has_previous": false
}
}

With an sk_test_ key, the payment page works end to end with the numbers below. Create the checkout with the amount paired with the number you will enter.

HTTP error_code Cause
400 INVALID_DATA Missing or invalid field, for example an amount below 100 or an invalid URL. Details in errors.
403 none Missing or invalid API key (No API key provided. or Invalid API Key.). status is a string here, see Missing or invalid key.
404 none Checkout not found. The reference is unknown, or the checkout was created with the other key (test or live).
{
"status": false,
"message": "Invalid data provided. Please check the input and try again.",
"error_code": "INVALID_DATA",
"errors": { "amount": ["Ensure this value is greater than or equal to 100."] }
}
Limit Consequence
Maximum amount Initialization accepts more than 1,000,000 XOF, but the payment then fails on the page, because charges are capped at 1,000,000. Stay at 1,000,000 or below.
No idempotency Calling initialize twice creates two checkouts. Reuse the stored reference if the customer comes back to pay the same order.
No expiry The authorization_url link stays usable. If you canceled an order, don’t fulfill it when a payment arrives later; refund it if needed (see Refunds).
One charge reference charge_reference only holds the latest attempted charge.
Webhook mode Check the live_mode field received in checkout.* events before acting.