Skip to main content
The Platform API authenticates every request with an HMAC-signed API key. When your access is issued you receive two credentials: an API key, sent with every request, and an API secret, used to sign requests.
Keep your secret safe. The API secret must be kept confidential. Do not embed it in client-side code, mobile apps, or version control. If a secret is exposed, contact support to rotate it.
Your API key identifies your organization, and requests can only access resources that belong to it. A known top-level customer or account owned by another organization returns 403; an unknown id returns 404. Once an authorized customer or account has been resolved, a child resource that does not exist within that parent returns 404.

Required headers

Include these four headers on every request:
string
required
Your API key.
string
required
Unix epoch seconds as a string. Requests more than 300 seconds off server time are rejected.
string
required
A unique value per request (e.g. a UUID). A replayed nonce is rejected for 300 seconds.
string
required
Hex-encoded HMAC-SHA256 of the signature string (below), keyed with your API secret.

Signature string

Concatenate the following components exactly, with no separators:
Signature string
string
Uppercase method: GET, POST, PATCH, PUT.
string
The request path including the leading slash and, if present, ? plus the raw query string, e.g. /customers/cus_x7k2m9p4q1w8e5r3t6y0u2i4/accounts?page=1&size=10.
string
The exact raw request body string you transmit. For GET and other no-body requests this is the empty string "".
Sign the same bytes you transmit. Build the JSON body once and use that exact string both in the signature and on the wire (e.g. curl -d '<json>') — re-serializing the object can change whitespace or key order and invalidate the signature.

Building a signed request

sign and send a POST
worked signature example
The server rebuilds the same signature string and compares. A signature mismatch, a timestamp more than 300 seconds off, or a replayed nonce all return 401.