Billie API docs

Public integration foundations for Billie API consumers: versioned URLs, key headers and prefixes, idempotent writes, request tracing, errors, limits and contract downloads.

Foundation

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.

API key authentication

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.

Sandbox vs live

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.

Operational contract

Idempotency-Key

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.

X-Request-Id

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.

Error model

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.

Rate-limit headers

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.

Example request and contracts

Start with the contract links, then use this cURL shape for sandbox write calls that need authentication, idempotency, and request tracing.

curl
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"}'