Payment API
Initialize payments using a public key, send customers to hosted checkout, and verify transaction status or signed webhook events before updating your orders.
Overview
All endpoints use the versioned API base https://nmafort.site/api/v1. Payment initialization and status verification use a Bearer public key. Test and live keys select the transaction environment automatically.
| Environment | Key to use | Behavior |
|---|---|---|
| Test | Test public key | Creates and verifies test transactions; test checkout confirmation is not a real money movement. |
| Live | Live public key | Creates and verifies live transactions. Bank-transfer account details are provisioned when the checkout is opened. |
Public keys are designed to be included in browser integrations. Keep secret keys in a server-side environment variable or secrets manager; secret keys are used to verify webhook signatures and must never be exposed in source control, URLs, or browser code.
Accept payments
Send POST https://nmafort.site/api/v1/transaction/initialize with an Authorization header of Bearer YOUR_PUBLIC_KEY and a JSON body. email, name, phone, and integer amount are required. Amount is in naira (not kobo) and must be at least NGN 100; currency is currently NGN.
{
"email": "customer@example.com",
"name": "Ada Okafor",
"phone": "08000000000",
"amount": 2500,
"currency": "NGN",
"reference": "order_2026_0001",
"callback_url": "https://shop.example.com/payment/return",
"meta": { "order_id": "order_2026_0001" }
}
reference, callback_url, and meta are optional. A supplied reference must be 8–32 characters and unique. The successful response is HTTP 201:
{
"status": "success",
"reference": "order_2026_0001",
"environment": "test",
"checkout_url": "https://your-gateway.example/api/v1/checkout/..."
}
Redirect the customer to checkout_url. The optional callback URL is both the customer return destination and one of the configured notification targets; query parameters on the browser return are not proof of payment.
Webhooks
When a payment succeeds, the gateway sends a JSON transaction.paid event to the configured webhook URL and callback URL. Return a successful HTTP response after safely recording the event. Events can be delivered again, so deduplicate using the event id and make fulfillment idempotent.
{
"id": "evt_123",
"event": "transaction.paid",
"data": {
"reference": "order_2026_0001",
"status": "success",
"amount": 2500,
"currency": "NGN",
"environment": "test",
"payer": {
"name": "Ada Okafor",
"email": "customer@example.com",
"phone": "08000000000"
},
"paid_at": "2026-10-16T09:00:00+00:00"
}
}
The request includes X-TJGateway-Event and X-TJGateway-Signature. The signature is a lowercase hex HMAC-SHA256 of the exact raw JSON request body, using the matching test or live secret key. Compare in constant time. Secret keys are for server-side signature verification only; never include one in a browser application.
// Node.js webhook handler: rawBody must be the exact request bytes.
import { createHmac, timingSafeEqual } from "node:crypto";
function isValidSignature(rawBody, suppliedSignature, secret) {
const expected = createHmac("sha256", secret).update(rawBody).digest();
if (!/^[a-f0-9]{64}$/i.test(suppliedSignature)) return false;
const supplied = Buffer.from(suppliedSignature, "hex");
return supplied.length === expected.length && timingSafeEqual(supplied, expected);
}
Verify payment
Request GET https://nmafort.site/api/v1/transaction/verify/{reference} with the public key for the same environment used to initialize the transaction. The endpoint only returns transactions belonging to that key’s merchant and environment; unknown and out-of-scope references return 404.
curl -X GET "https://nmafort.site/api/v1/transaction/verify/order_2026_0001" \
-H "Authorization: Bearer YOUR_TEST_PUBLIC_KEY" \
-H "Accept: application/json"
A successful lookup returns HTTP 200 with payment status and transaction details:
{
"status": "success",
"message": "Transaction status retrieved successfully",
"data": {
"reference": "order_2026_0001",
"status": "success",
"amount": 2500,
"currency": "NGN",
"environment": "test",
"paid_at": "2026-10-16T09:00:00.000000Z"
}
}
Possible transaction statuses include pending, success, and failed. Treat only success as paid, and compare the returned reference, amount, currency, and environment with your own order before fulfillment. The browser return URL and its query parameters are not proof of payment.
Payment channel
Customers pay through the hosted checkout; the API does not accept card details. In live mode, the current checkout provisions a temporary virtual bank account for transfer and checks payment notifications with the provider. Test mode provides a simulated checkout confirmation. Available channels depend on the environment and checkout configuration; do not assume card or USSD acceptance.
Manage disputes
A public disputes API is not currently available. Review transaction details in the merchant dashboard and contact support to investigate a dispute. Keep your order records, customer communications, and fulfillment evidence so your team can respond promptly.
Refund
A public refund endpoint is not currently available. Do not simulate a refund by changing your local order status; contact support or use the merchant dashboard’s available operational process to request help with a transaction.
Gateway responses
| HTTP status | Meaning | What to do |
|---|---|---|
| 200 | Transaction verification completed | Check data.status and reconcile the reference, amount, currency, and environment with your order. |
| 201 | Payment initialized | Use the returned checkout URL and retain the transaction reference. |
| 401 | Authorization missing or public key invalid | Check the Bearer public key and make sure it matches the intended environment. |
| 404 | Transaction not found for this merchant and environment | Check the exact reference and use the matching test or live public key. |
| 422 | Request validation failed | Correct the required fields, email, amount, currency, or reference, then retry. |
| 429 | Rate limit reached | Back off before retrying and avoid creating duplicate orders. |
| 5xx / network error | Server or connection issue | Do not assume the payment failed. Reconcile by reference before retrying. |
Validation and other errors may include an error, message, or field-level errors object. Handle non-2xx responses explicitly.