API reference / Customer keys and view-as
Mint a customer API key
POST/v1/platforms/{orgId}/customers/{customerId}/api-keys
Mint an ordinary customer API key for a linked customer (platform:customer_keys). The secret is returned once and then calls the customer API on its own. Omitted scopes are the read-only customer set. platform:* and api_keys:manage cannot be granted. Money, team and approval scopes are opt-in. Staging mints pz_test_. Production mints pz_live_ only when that customer organization is active and holds the staff production-API grant.
When to use it
Your servers need to act for a linked customer - list their accounts, add recipients, send payments. Grant only the scopes you need; money, team and approval scopes are opt-in. The secret is returned once.
Before you call it
- Organization
platform (active) - Permission
platform:customer_keys - NoteThe customer must be active for a live key.
Parameters
| Parameter | What it does |
|---|---|
orgIdpath, uuidrequired | The organization the call acts on. For platform calls, your platform's id; for customer calls, the customer's organization id. Get them from getMe or the customer list. |
customerIdpath, uuidrequired | A customer organization linked to your platform. |
Request body
| Field | What it does |
|---|---|
namestringrequired | No description in the spec yet. |
scopesstring[] | No description in the spec yet. |
allowliststring[] | CIDR networks. Empty means any IP. |
expires_atstring (date-time) | No description in the spec yet. |
Response 201
The new customer key, including its secret
| Field | What it does |
|---|---|
idstring (uuid)required | No description in the spec yet. |
public_idstringrequired | No description in the spec yet. |
modeenumrequired | No description in the spec yet. One of |
namestringrequired | No description in the spec yet. |
scopesstring[]required | No description in the spec yet. |
allowliststring[]required | No description in the spec yet. |
expires_atstring (date-time)required | No description in the spec yet. |
overlap_untilstring (date-time) | No description in the spec yet. |
revoked_atstring (date-time) | No description in the spec yet. |
last_used_atstring (date-time) | No description in the spec yet. |
created_atstring (date-time)required | No description in the spec yet. |
minted_by_platform_idstring (uuid) | Set when a platform minted this key for the customer. Absent for keys created on the Developer page. |
secretstringrequired | Shown once. Store it now. |
Errors to handle
| Code | What it means and what to do |
|---|---|
invalid_scope422 | scope is not allowed on a customer API key: |
scope_not_held403 | The API key was created without the scope this operation needs, or you asked for a scope you do not hold. Keys' scopes are frozen at creation. Create a new key that includes the scope; a key's scopes can only be a subset of its creator's permissions. |
api_access_revoked403 | Production API access is not granted for this organization, or it was revoked, or the organization is not active. Ask Payezy to grant production API access once the organization is active. Staging keys are unaffected. |
Every error is a Problem document. Branch on code; quote request_id to support.