Build payments
into your business.
A clear interface between your business and IdeaPay. Start with merchant authentication, retrieve your transactions, and prepare your integration for hosted checkout.
Authenticate your merchant backend
IdeaPay automatically issues an API access code, terminal ID, salt, and token when you open your merchant workspace. Find them under Developers → API credentials → Sandbox. All four values must belong to the same active set.
| Field | Type | Description |
|---|---|---|
Authorization | header | Required. Bearer followed by your IdeaPay token. |
X-IdeaPay-Access-Code | header | Required. Your IdeaPay API access code. |
X-IdeaPay-Terminal-ID | header | Required. Your IdeaPay terminal identifier, not a bank credential. |
X-IdeaPay-Salt | header | Required. The static salt issued with the same set; not a per-request nonce. |
Authorization: Bearer YOUR_IDEAPAY_TOKEN
X-IdeaPay-Access-Code: YOUR_ACCESS_CODE
X-IdeaPay-Terminal-ID: YOUR_TERMINAL_ID
X-IdeaPay-Salt: YOUR_SALT
X-IdeaPay-Environment: sandboxKeep credentials in server environment variables. Make API calls from your backend, not browser or mobile code. Normal dashboard reads mask secrets; authenticated owners can reveal and copy them. Revoked sets cannot authenticate.
Keep sandbox and live separate
Build and verify
Automatically issued credentials support transaction reads. No charge is made by the documentation or request builder.
Production access
Live credentials are automatically issued separately from sandbox. Live processing requires an active merchant and matching Live credentials. Send X-IdeaPay-Environment: live for live reads; sandbox is the default. Each environment rejects the other’s credentials and reads only its own payment records.
Base URL
Use https://api.ideapay.bz for merchant integrations. Complete IdeaPay credentials route requests to the IdeaPay backend; existing legacy clients retain their separate credential contract. Never combine the two credential schemes. Internal portal/admin calls use a separate backend address.
IDEAPAY_BASE_URL=https://api.ideapay.bz
# Set credentials privately in your own server environment.
# Never paste real secrets into a public documentation console.Amounts and currency
Payment amounts are integer minor units. For BZD, 10000 represents BZ$100.00. Do not use floating-point values as financial records.
List merchant payments
/paymentsAvailable · both environmentsReturn payments scoped to your authenticated merchant, newest first. No customer or merchant records are accessible without valid credentials. An account with no recorded payments returns an empty list.
| Field | Type | Description |
|---|---|---|
limit | integer · optional | Page size, default 20. Values are bounded to 1–100; use a whole number. |
after | string · optional | Pass next_cursor from the preceding response. Omit on the first page. |
curl --request GET \
"$IDEAPAY_BASE_URL/payments?limit=20" \
--header "Authorization: Bearer $IDEAPAY_TOKEN" \
--header "X-IdeaPay-Access-Code: $IDEAPAY_ACCESS_CODE" \
--header "X-IdeaPay-Terminal-ID: $IDEAPAY_TERMINAL_ID" \
--header "X-IdeaPay-Salt: $IDEAPAY_SALT"{
"data": [],
"has_more": false,
"next_cursor": null
}Payment fields
| Field | Type | Description |
|---|---|---|
id | string | IdeaPay payment identifier. |
reference | string | Recorded merchant order reference. |
amount | integer | Payment amount in minor currency units. |
currency | string | Recorded currency; the current workspace uses BZD. |
status | string | Recorded payment outcome; separate from bank settlement and merchant payout. |
created_at | string | Recorded creation timestamp. |
Pagination metadata includes has_more and next_cursor. These examples describe the implemented read endpoint; they do not imply that bank payment creation is active.
Create an IdeaPay checkout session
Send this request from your server using all four IdeaPay credentials. It creates a 15-minute order session with server-calculated fees, not a bank payment. Live processing is enabled for approved merchants using their Live credential set. Sessions open IdeaPay checkout with secure card fields for their assigned environment.
POST $IDEAPAY_BASE_URL/checkout-sessions
Content-Type: application/json
Authorization: Bearer YOUR_IDEAPAY_TOKEN
X-IdeaPay-Access-Code: YOUR_ACCESS_CODE
X-IdeaPay-Terminal-ID: YOUR_TERMINAL_ID
X-IdeaPay-Salt: YOUR_SALT
X-IdeaPay-Environment: sandbox
{
"amount": 5000,
"currency": "BZD",
"reference": "YOUR_ORDER_REFERENCE",
"description": "Your order description"
}The response includes checkout_url, session_token, environment, expiresAt, processingAvailable, and quote. The quote records the order amount, final customer amount, bank fee, IdeaPay fee, transaction settlement fee, and merchant net in integer cents. Merchant overrides take precedence over the global default. Rates are snapshotted for the session.
Redirect your customer to checkout_url. The session token is a short-lived access credential in the URL fragment. Do not log or publish it. Never place merchant credentials or card details in a checkout link. Each creation request produces a new session; it does not reserve or charge funds.
Redirect the customer to checkout_url; the IdeaPay checkout UI manages its private session reads, cancellation and payment submission. Do not call private portal session routes on the public merchant API. Live processing requires an active merchant and matching Live credentials. No card data is accepted by IdeaPay.
There is a per-merchant limit of 30 new sessions per minute; excess requests return 429. Invalid requests return 400, missing fees return 409, and unsupported fee calculations return 422.
View checkout design previewCreate a sandbox payment
/paymentsSandbox onlySend all four IdeaPay credentials from your backend, X-IdeaPay-Environment: sandbox, and an Idempotency-Key of 8–100 letters, digits or ._:-. The amount is the merchant’s sale amount in BZD cents. IdeaPay calculates the final customer charge from assigned fees. Do not send card numbers, expiry dates or CVVs.
POST $IDEAPAY_BASE_URL/payments
Content-Type: application/json
Idempotency-Key: YOUR_UNIQUE_ORDER_ATTEMPT
Authorization: Bearer YOUR_IDEAPAY_TOKEN
X-IdeaPay-Access-Code: YOUR_ACCESS_CODE
X-IdeaPay-Terminal-ID: YOUR_TERMINAL_ID
X-IdeaPay-Salt: YOUR_SALT
X-IdeaPay-Environment: sandbox
{ "amount": 5000, "currency": "BZD", "reference": "YOUR_ORDER", "description": "Your order" }The response includes the IdeaPay payment id, sale_amount, final amount, status, registration state and checkout_url. Send the customer to the IdeaPay-domain checkout_url. Secure card fields load directly from the bank within IdeaPay checkout. Registration alone does not charge a card. Canonical IdeaPay routes have no /v1 prefix. Legacy integrations remain available under their existing credential contract.
Reuse the same idempotency key for the same request. A conflicting payload returns 409. If registration has an unknown outcome, do not create a replacement with a new key; operator reconciliation is required. Live requests require a matching Live credential set and an active merchant account.
Read and verify
GET /payments/ID returns your recorded payment. POST /payments/ID/refresh performs an authoritative bank lookup; send no body. Match fulfillment to succeeded, not a browser redirect or successful registration. A bank-verified deposit is still separate from merchant payout settlement.
Full refund
POST /payments/ID/refunds accepts an independent Idempotency-Key and JSON containing amount equal to the full customer charge. Only verified, unrefunded payments without a payout allocation are supported. Partial refunds are disabled. Full refunds use the environment of the original verified payment. Unknown refund outcomes must be verified, never blindly retried. Refund fee retention and bank costs require a separate commercial policy.
Verify signed webhook deliveries
Configure an enabled public HTTPS endpoint in your merchant workspace, generate its signing secret, and use Send endpoint test. Endpoint tests use endpoint.test. Verified sandbox payments can also publish payment.succeeded, payment.failed and payment.refunded events. Delivery history and manual retries are available in Event logs.
| Field | Type | Description |
|---|---|---|
IdeaPay-Signature | header | t=<Unix seconds>,v1=<HMAC-SHA256 hex digest>. |
IdeaPay-Event-Id | header | Stable event identifier. Use it to deduplicate retries. |
Content-Type | header | application/json. Signature verification uses the exact raw body. |
import { createHmac, timingSafeEqual } from 'node:crypto';
export function validSignature(rawBody, header, secret) {
const parts = Object.fromEntries(
header.split(',').map(part => part.trim().split('='))
);
if (!/^\d+$/.test(parts.t || '') ||
!/^[a-f0-9]{64}$/i.test(parts.v1 || '')) return false;
const timestamp = Number(parts.t);
if (!Number.isSafeInteger(timestamp) ||
Math.abs(Date.now() / 1000 - timestamp) > 300) return false;
const expected = createHmac('sha256', secret)
.update(parts.t + '.').update(rawBody).digest();
const received = Buffer.from(parts.v1, 'hex');
return received.length === expected.length &&
timingSafeEqual(expected, received);
}
// Persist event IDs to prevent processing the same event twice.
// Use a trusted, bounded raw-body reader in your server framework.Return a 2xx status to acknowledge delivery. Endpoint tests require HTTPS on port 443 and public IPv4 DNS. Requests time out after eight seconds and do not follow redirects. Failed deliveries support manual retries, capped at ten attempts. Payment-event deliveries are queued for background retries with backoff; the maintenance worker runs every five minutes. Endpoint tests retain their manual retry controls.
Errors you can act on
Error responses use a JSON object with an error message. Do not parse the human-readable message to decide payment success.
| Field | Type | Description |
|---|---|---|
400 | Invalid request | For example, an invalid pagination cursor. |
401 | Authentication failed | Missing, mismatched, invalid, or revoked credentials. |
403 | Access denied | A protected workspace action or request origin was rejected. |
413 | Request too large | A dashboard configuration request exceeded its body limit. |
503 | Service unavailable | Bank processing is disconnected or required backend access is unavailable. |
{ "error": "All four IdeaPay credential fields are required." }Payment creation requires an Idempotency-Key, and each merchant order reference is unique. A new key cannot create a replacement for an existing order reference. Checkout session creation has its own documented limit.
Build a transaction-list request
Adjust pagination and copy the generated command to run on your own backend. This public page does not collect merchant credentials or send API requests.
curl --request GET \
"$IDEAPAY_BASE_URL/payments?limit=20" \
--header "Authorization: Bearer $IDEAPAY_TOKEN" \
--header "X-IdeaPay-Access-Code: $IDEAPAY_ACCESS_CODE" \
--header "X-IdeaPay-Terminal-ID: $IDEAPAY_TERMINAL_ID" \
--header "X-IdeaPay-Salt: $IDEAPAY_SALT"Know what is available
| Field | Type | Description |
|---|---|---|
Checkout sessions | Available · sandbox checkout | Expiring order previews, authoritative fee quotes, and cancellation. Both environments use bank-hosted fields inside IdeaPay checkout. |
Merchant credentials | Available | Automatic sandbox and live issuance and owner-only reveal/copy. |
Transaction reads | Available | Authenticated merchant-scoped GET endpoint. |
Webhook endpoint tests | Available | Signed test events, verified sandbox payment events, delivery history and retries. |
Hosted checkout & payments | Sandbox | Separate Sandbox and Live adapters; production requires approved merchant credentials. |
Refunds & capture | Full refunds | Full refund endpoint available in both environments; partial refunds and separate capture remain unsupported. |
Settlements & payouts | Dashboard / operator backend | Merchant reporting and operator records; no public transfer API. |
Live credentials | Available | Issued independently of payment processing readiness. |
Ready to connect your business?
Sign in to access your private IdeaPay credentials.
Open merchant workspace