Skip to main content
POST

Authorizations

Authorization
string
header
required

Authorization: Bearer ck_test_… or ck_live_…. There is no other auth scheme — no query-string keys, no request signing, no OAuth.

Body

application/json

The top level is strict: an unrecognised field is a 400 with an unrecognized_keys issue, not a field the server drops for you. The field most worth misspelling here is subject, and a 201 carrying an untagged row is an isolation control that failed open on a typo.

mode
enum<string>
default:test

test keys are confined to sandbox merchants no matter how the account is configured.

Available options:
test,
live
label
string
Maximum string length: 200
scopes
enum<string>[]

Omit for full access (["*"]).

Required array length: 1 - 32 elements

<resource>.read or <resource>.write, or the wildcard *. write implies read on the same resource. Resources are exactly the route groups under /v1.

Available options:
*,
checkouts.read,
checkouts.write,
buyer-profiles.read,
buyer-profiles.write,
buyer-sessions.read,
buyer-sessions.write,
webhooks.read,
webhooks.write,
api-keys.read,
api-keys.write,
usage.read,
usage.write
subject
string

Bind the key to one of your end users — your own opaque id, 1 to 200 characters after trimming. Omit for a tenant-wide key, which is what every key issued before this existed already is. "" is a 400, not a tenant-wide key by another name.

A bound key sees and creates only that subject's checkouts and buyer profiles, and is refused outright on the account-wide endpoints (GET/DELETE /v1/api-keys, /v1/usage, /v1/webhooks).

Minting from a bound key inherits the binding: omitting subject gives another key for the same end user, not a tenant-wide one, and naming a different subject is a 403. Fixed at creation — there is no rebinding and no unbinding.

Required string length: 1 - 200
Example:

"user_a91f"

Response

Created. key appears here and nowhere else, ever.

id
string<uuid>
required
mode
enum<string>
required
Available options:
test,
live
scopes
enum<string>[]
required

<resource>.read or <resource>.write, or the wildcard *. write implies read on the same resource. Resources are exactly the route groups under /v1.

Available options:
*,
checkouts.read,
checkouts.write,
buyer-profiles.read,
buyer-profiles.write,
buyer-sessions.read,
buyer-sessions.write,
webhooks.read,
webhooks.write,
api-keys.read,
api-keys.write,
usage.read,
usage.write
keyPrefix
string
required
Example:

"ck_live_9Hf2QzT"

key
string
required

The plaintext key. Returned here and nowhere else, ever.

subject
string

The end user this key acts for. Present only when the key is bound — a tenant-wide key's creation response has no subject field at all.

Example:

"user_a91f"