API
Money
All monetary fields are integers in pesewas (Minor). The API never returns formatted currency strings.
GHS 10.00 is sent and returned as amount_minor: 1000.
Format amounts for display in your app (divide by 100). Convert user input back to pesewas before calling Payloqa (multiply by 100 and round to an integer).
Never use floating-point arithmetic for money.
Example — create session with pesewas
POST/v1/payments/sessions
Auth: Authorization: Bearer sk_test_ or sk_live_
Request body
{
"msisdn": "233244123456",
"amount_minor": 1000,
"network": "mtn"
}201
{
"goods_minor": 1000,
"amount_minor": 1000
}curl 'https://api.payloqa.com/v1/payments/sessions' \
-X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk_test_...' \
-H 'Idempotency-Key: pay-create-001' \
-d '{
"msisdn": "233244123456",
"amount_minor": 1000,
"network": "mtn"
}'Helpers (yours to copy)
These snippets are educational. Payloqa does not require an SDK. Put the equivalent in your app.
curl 'https://api.payloqa.com/v1/payments/sessions' \
-X POST \
-H 'Authorization: Bearer sk_test_...' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 8f3c1a2e-4b9d-4e11-9c0a-2d6f8a1b7c3e' \
-d '{
"msisdn": "233244123456",
"amount_minor": 1000,
"network": "mtn"
}'
# 1000 pesewas = GHS 10.00
# Never send 10.00 or 10 in amount_minor