Base URL versioning
Use versioned paths under /api/v1. Breaking API changes move to a new version while compatible additions remain in the active v1 contract.
Public integration foundations for Billie API consumers: versioned URLs, key headers and prefixes, idempotent writes, request tracing, errors, limits and contract downloads.
Use versioned paths under /api/v1. Breaking API changes move to a new version while compatible additions remain in the active v1 contract.
Merchant API keys go in the X-PayMate-Merchant-Key header: live keys start with sk_live_, test keys with sk_test_; the prefix selects the mode, so no extra header is needed. Sandbox developer keys start with pm_sandbox_ and go in X-PayMate-Developer-Key. A key is shown once; never expose one in browser code.
Use the developer sandbox (pm_sandbox_ keys) for test traffic and sk_live_ keys only after operational approval. Sandbox checkout sessions belong to an isolated sandbox merchant.
Send Idempotency-Key on every write that can create money movement or external side effects; money routes (payments, refunds, payouts) refuse a missing key. Reuse a key only for the same logical retry: the same key with a different body is refused with IDEMPOTENCY_CONFLICT.
Send X-Request-Id for caller-side tracing. Billie returns a request identifier on responses so support can correlate logs, metrics, retries, and audit records.
Errors use a consistent JSON body with code, message, type, request_id, doc_url and optional field details. Clients should branch on code rather than parsing human text.
Authenticated answers carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (X-RateLimit-* are sent alongside). A 429 adds Retry-After. Sign-up and verify-email are limited per client address.
Start with the contract links, then use this cURL shape for sandbox write calls that need authentication, idempotency, and request tracing.
curl --request POST https://api.billie.co.zw/api/v1/developer/sandbox/checkout-sessions \
--header 'X-PayMate-Developer-Key: pm_sandbox_xxx' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: checkout-demo-0001' \
--header 'X-Request-Id: req-demo-0001' \
--data '{"merchantReference":"INV-1001","title":"School fees","amount":25.50,"currency":"USD"}'