API Keys

Create an API key

Create a new API key.

post/v0.1/merchants/{merchant_code}/api-keys

Path parameters

merchant_codestring required
Example:MC0X0ABC

Unique identifier of the merchant account.

Request body

namestring required

Name of the API key.

scopesstring[] required

Example request

{
  "name": "New Key Name",
  "scopes": [
    "invoices.read",
    "invoices.write",
    "products",
    "user.app-settings"
  ]
}

Response

Created API key.

created_atstring date-time required

The timestamp of when the API key was created.

idstring required

Unique identifier of the API Key.

namestring required

User-assigned name of the API Key.

plaintextstring

The plaintext value of the API key. This field is returned only in the response to API key creation and is never again available in the plaintext form.

previewstring required

Last 8 characters of the API key.

scopesstring[] required
type'public' | 'secret' required
updated_atstring date-time required

The timestamp of when the API key was last updated.

Example response

{
  "created_at": "2023-01-20T15:16:17Z",
  "id": "sup_pk_0D1FIpM6xqueY3L4Y994nseK0xMfOjPAU",
  "name": "My API Key",
  "plaintext": "sup_sk_LZFWoLydp6S4S4KQpGVs1POzzp6cL1vyZ",
  "preview": "p6cL1vyZ",
  "scopes": [
    "invoices.read",
    "invoices.write",
    "products",
    "user.app-settings"
  ],
  "type": "secret",
  "updated_at": "2023-01-20T15:16:17Z"
}

Changes