Payment Collection & Checkout

Universal Hosted Checkout

MonieFlex's hosted checkout collects bank transfers against a one-time virtual account issued through PalmPay. Point customers at your payment link (/pay/{slug}), initiate a payment, then poll the status endpoint until the transfer lands.

Payment flow

  • 1. Merchant creates a payment link (in the dashboard or via the Payment Links API) with a fixed or flexible amount
  • 2. Customer opens {{SITE_URL}}/pay/{slug}
  • 3. Client (or your server) POSTs to /checkout/{slug}/initiate with the customer's details
  • 4. MonieFlex returns a one-time PalmPay virtual account + total_kobo + expires_at (30 min)
  • 5. Customer transfers the exact amount from their banking app
  • 6. Poll GET /checkout/status/{reference} every ~5s — when paid is true, deliver value
No authentication required
Checkout initiation and status endpoints are public so your frontend can call them directly. They are scoped by the link slug and the payment reference.
Exact-amount transfers
Customers must transfer total_kobo exactly. If they underpay or overpay, the credit is held for manual reconciliation. Show total_kobo prominently on your checkout screen.
POST /checkout/{slug}/initiate

Initiate a checkout payment

Generate a one-time virtual account for the customer to transfer to. Public — no auth required.

Request Parameters
Field Type Required Description
slug string Yes The payment link's slug (from the URL).
customer_name string Yes Payer's full name.
customer_email string Yes Payer's email address.
customer_phone string Optional Payer's phone (E.164 preferred).
amount_kobo integer Optional Only for flexible-amount links. Ignored for fixed-amount links.
Code Samples
cURL
curl -X POST {{API_BASE_URL}}/v1/checkout/my-link-slug/initiate \
  -H "Content-Type: application/json" \
  -d '{
    "customer_name": "Adaeze Okafor",
    "customer_email": "adaeze.okafor@example.com",
    "customer_phone": "+2348031234567",
    "amount_kobo": 250000
  }'
Node.js
const res = await fetch(
  "{{API_BASE_URL}}/v1/checkout/my-link-slug/initiate",
  {

method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      customer_name: "Adaeze Okafor",
      customer_email: "adaeze.okafor@example.com",
      customer_phone: "+2348031234567",
      amount_kobo: 250000,
    }),
  },
);
const { payment } = await res.json();
// Show payment.account_number, payment.total_kobo, payment.expires_at
PHP
<?php
$ch = curl_init("{{API_BASE_URL}}/v1/checkout/my-link-slug/initiate");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode([
    "customer_name" => "Adaeze Okafor",
    "customer_email" => "adaeze.okafor@example.com",
    "customer_phone" => "+2348031234567",
    "amount_kobo" => 250000,
  ]),
]);
$payment = json_decode(curl_exec($ch), true)["payment"];
Success Response (200 OK)
{
  "payment": {
    "reference": "KVN_CHK_8F32AB19",
    "account_number": "9021847356",
    "bank_name": "PalmPay",
    "account_name": "MonieFlex / Adaeze Okafor",
    "amount_kobo": 250000,
    "total_kobo": 250000,
    "expires_at": "2026-07-19T13:11:07Z"
  }
}
Error Response
{
  "ok": false,
  "code": "link_not_found",
  "message": "Payment link does not exist or has been deactivated"
}
GET /checkout/status/{reference}

Check payment status

Poll for the state of a checkout payment. Public — no auth required.

Request Parameters
Field Type Required Description
reference string Yes The reference returned by /checkout/{slug}/initiate.
Code Samples
cURL
curl {{API_BASE_URL}}/v1/checkout/status/KVN_CHK_8F32AB19
Node.js
const res = await fetch(
  `{{API_BASE_URL}}/v1/checkout/status/${reference}`,
);
const { state, paid } = await res.json();
if (paid) {
  // deliver value
}
PHP
<?php
$ch = curl_init("{{API_BASE_URL}}/v1/checkout/status/" . $reference);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = json_decode(curl_exec($ch), true);
if ($body["paid"]) {
  // deliver value
}
Success Response (200 OK)
{
  "state": "paid",
  "paid": true
}
Error Response
{
  "ok": false,
  "code": "not_found",
  "message": "No payment found for that reference"
}