API keys
Your project's keys: your keys; mint a key; get API key; rename, re-scope, pin to IPs, or toggle signing; revoke, immediately and permanently; replace a key…
/v1/api_keysNever the secret — key_id and last4 are all that is stored. created_by: molnpay_staff marks a key our support minted for you. limit_per_kind and default_scopes are what a create call is measured against.
Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Query Parameters
"0"Value in
- "0"
- "1"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/api_keys"{ "object": "list", "has_more": true, "next_cursor": "string", "data": [ { "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z" } ], "limit_per_kind": 0, "default_scopes": { "property1": [ "string" ], "property2": [ "string" ] }, "verified_domain": "string"}/v1/api_keysThe response carries token — the only time it is ever shown. We store a peppered hash; nothing can return it later. A lost key is rolled, never recovered.
The key's mode follows the project: a live project mints mp…, a test project mptest….
scopes defaults to the kind's read+write set (see default_scopes on the list). payouts:create is never a default. signing_enabled is the third factor a payout key needs to move funds, on top of kind and scope.
ip_allowlist: exact IPs or CIDR blocks, v4 or v6, up to 32. Empty means any source. The address judged is the one your server presents to us. Leave it empty on serverless platforms.
origin_allowlist: https origins (scheme and host), up to 16, each on your verified domain or a subdomain of it. https://*.example.com covers every subdomain of example.com at any depth, but not example.com itself — list both for the whole site (the console does, by default). Required once your domain is verified (origin_required); refused while it is not (domain_not_verified). A request whose Origin header names another site is refused; server calls send no Origin and are unaffected. It is a lock, not a CORS grant.
Five enabled keys per kind.
Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/api_keys" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "kind": "checkout" }'{ "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z", "token": "string"}/v1/api_keys/{id}Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/api_keys/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z"}/v1/api_keys/{id}Takes effect within a minute everywhere. An empty ip_allowlist clears the restriction. origin_allowlist follows the create rules: it cannot be emptied while your domain is verified.
Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Path Parameters
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/v1/api_keys/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z"}/v1/api_keys/{id}Idempotent. The row stays, marked revoked_at, so the audit trail keeps its name.
Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/api_keys/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z"}/v1/api_keys/{id}/rollMints a new key with identical grants and gives the old one grace_hours (default 24, max 168) to live — both work until then, so deploy the new key before the old one dies. The new token is shown only in this response.
Authorization
apiKey Authorization: Bearer mp<64 hex> for live, mptest<64 hex> for test.
The token is the prefix plus 64 lowercase hex characters (32 CSPRNG bytes) and nothing else — no separators, no embedded fields — so nothing in it needs quoting, escaping or encoding.
Send it in the Authorization header and nowhere else. Never put it in a query string: URLs reach access logs, proxy logs, browser history and Referer headers, and a key that lands in any of those is a leaked key.
A key's KIND (checkout, payout or wallet) is a property of the key, not of the string: it is chosen at creation, returned by GET /v1/ping, and decides which routes the key may reach.
The full key is shown exactly once, at creation. No endpoint can return it afterwards. Moving funds additionally requires signing to be enabled globally, for your project, and for that key — so a read-only key is a supported configuration.
In: header
Path Parameters
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/api_keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/roll" \ -H "Content-Type: application/json" \ -d '{}'{ "object": "api_key", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "key_id": "mp3f9c1a77", "env": "live", "kind": "checkout", "name": "string", "last4": "string", "scopes": [ "string" ], "ip_allowlist": [ "string" ], "origin_allowlist": [ "string" ], "signing_enabled": true, "created_by": "merchant", "rotated_from": "c5500ae4-3bf4-4b9d-9292-5dcc0d464d8b", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "use_count": "string", "created_at": "2019-08-24T14:15:22Z", "token": "string", "old_key_expires_at": "2019-08-24T14:15:22Z"}Events
Every event your project emitted — the log the webhooks were fanned out from: what changed since you last asked — for polling instead of webhooks; every event…
Test mode
A test project's stand-in for the chain: simulate a deposit to one of your test addresses; a pending test deposit reaches finality and is credited; a pending…