Skip to main content
POST
/
v1
/
api-keys
Create an API key
curl --request POST \
  --url http://localhost:8080/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production Key",
  "environment": "test"
}
'
{
  "key": {
    "id": "<string>",
    "merchant_id": "<string>",
    "name": "<string>",
    "prefix": "ak_live_",
    "environment": "test",
    "expires_at": "2023-11-07T05:31:56Z",
    "last_used_at": "2023-11-07T05:31:56Z",
    "revoked_at": "2023-11-07T05:31:56Z",
    "created_at": "2023-11-07T05:31:56Z"
  },
  "raw_key": "ak_live_cq1234567890abcdef_sEcReTkEyVaLuE"
}

Authorizations

Authorization
string
header
required

Merchant API key: ak_live_... or ak_test_...

Body

application/json
name
string
required
Example:

"Production Key"

environment
enum<string>
required
Available options:
test,
live

Response

201 - application/json

API key created (raw key is only returned once)

key
object
raw_key
string

Full API key value, only returned at creation time

Example:

"ak_live_cq1234567890abcdef_sEcReTkEyVaLuE"