Skip to main content
POST
Price a collection before charging

Authorizations

X-AptaPay-Signature
string
header
required

v1={hex HMAC-SHA256} over the ten-field canonical string. Sent alongside X-AptaPay-Key, X-AptaPay-Timestamp and X-AptaPay-Nonce — all four are required. OpenAPI can only model one header per scheme, so the other three are described in the Authentication section above.

Body

application/json
amount_minor
integer
required

An integer count of the currency's smallest unit. NEVER a float, and never a decimal major amount. The _minor suffix on a field name is part of the contract: amount could be read as 20.00 or 2000, whereas amount_minor can only be read one way.

The exponent is PER CURRENCY. There is no universal "cents":

So 2000 UGX is two thousand shillings, while 2000 KES is twenty. Applying a blanket x100 to a zero-decimal currency is a 100x money error — the kind that reconciles to nothing months later.

To send an amount, multiply the major amount by 10^exponent and confirm the result is an exact integer (KES 19.99 -> 1999). To display one, divide by 10^exponent for presentation only — keep the minor-unit integer as the value you store, compare, and sum.

Rules the gateway enforces:

  • An unknown currency is rejected, never defaulted. A currency with no declared exponent fails with unknown_currency rather than assuming 2, because a silent wrong exponent is worse than a loud failure.
  • A non-exact amount is rejected, never rounded. KES 19.999 fails with inexact_amount. AptaPay will not decide on your behalf which way to round someone's money.
  • Amounts are never floats internally. Providers send amounts as strings ("2000") AND sometimes as numbers, so parsing is deliberate at the adapter boundary and converts to an exact integer or fails.

A field's exponent always follows the currency named alongside it. On an FX quote, source_amount_minor and destination_amount_minor routinely use DIFFERENT exponents in the same response.

Example:

2000

currency
enum<string>
required
Available options:
UGX,
RWF,
XAF,
XOF,
KES,
GHS,
NGN,
TZS,
ZMW,
USD,
EUR,
GBP
country
string
required
Example:

"UG"

method
enum<string>
required
Available options:
momo,
bank

Response

The fee quote. Nothing was reserved and nothing expires.

The single response envelope, used by EVERY endpoint so a consuming app parses one shape everywhere.

code
integer
required
Example:

200

message
string
required
Example:

"OK"

data
any

Present on success. Shape varies per endpoint.

error
object

Machine-readable error classification. EXACTLY ONE of terminal/retriable/ ambiguous is true. laces_api inferred this from the HTTP status and got it wrong, stranding real money twice (2026-08-15, 2026-08-16). Branch on these booleans, never on the status code:

terminal -> the provider refused. Reverse the debit and tell the user. retriable -> safe to retry with the SAME Idempotency-Key. ambiguous -> the outcome is UNKNOWN. Do NOT reverse. Poll instead.