API keys

Key fields
FieldTypeReturnedDescription
idstring (UUID)AlwaysRow identifier; used as :id in the update, rotate, and revoke paths.
namestringAlwaysA label you choose, up to 50 characters.
privateKeystringAlwaysExample: priv_4b870aa6-1f20-4889-b666-b16d33dd65e6 — identifies the key; not a secret.
secretKeystringOn create and rotate onlyExample: sec_kTn0aVQ7l9pS2xY4uZ8bC1dE3fG5hJ7kL9mN0pQ2rS4 — signs your requests.
webhookSecretstringOn create and rotate onlyExample: whsec_Xy2Zb4Nc6Vd8Ef0Gh2Ij4Kl6Mn8Op0Qr2St4Uv6Wx8 — signs the webhooks TEDR Pay sends you.
webhookUrlstring | nullAlwaysWhere to send webhook notifications. See the webhooks reference for its URL requirements.
rotatedAtdatetime | nullAlwaysWhen the key was last rotated; null if it never has been.
revokedAtdatetime | nullNeverInternal revoke marker; not included in API responses.
createdAtdatetimeAlwaysWhen the key was issued.

Create an API key

POST/merchants/api-keys

Auth: Session JWT only — how to get a JWT.

Issues the merchant’s active API key. Fails if one already exists — revoke it first.

Body parameters
NameTypeRequiredDefaultDescription
namestringRequiredA label for the key, up to 50 characters.
webhookUrlstringOptionalWhere to send webhook notifications for this key. See the webhooks reference for its URL requirements.
POST/merchants/api-keys
curl -X POST 'https://dev-app.tedr.com/api/merchants/api-keys' \
  -H 'Authorization: Bearer YOUR_SESSION_JWT' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Production Store", "webhookUrl": "https://myshop.com/api/webhooks/tedr"}'

Response: 201

{
  "id": "b923bb15-aeb3-493a-a06f-8babc0b92fef",
  "name": "Production Store",
  "privateKey": "priv_4b870aa6-1f20-4889-b666-b16d33dd65e6",
  "secretKey": "sec_kTn0aVQ7l9pS2xY4uZ8bC1dE3fG5hJ7kL9mN0pQ2rS4",
  "webhookSecret": "whsec_Xy2Zb4Nc6Vd8Ef0Gh2Ij4Kl6Mn8Op0Qr2St4Uv6Wx8",
  "webhookUrl": "https://myshop.com/api/webhooks/tedr",
  "rotatedAt": null,
  "createdAt": "2026-07-31T12:52:23.000Z"
}
Errors
CodeStatusWhen
API_KEY_LIMIT_REACHED403This merchant already has an active key.
VALIDATION_ERROR400name is empty or longer than 50 characters, or webhookUrl is invalid.

Get the active API key

GET/merchants/api-keys

Auth: Session JWT only — how to get a JWT.

Returns the merchant’s active API key, without secrets.

GET/merchants/api-keys
curl 'https://dev-app.tedr.com/api/merchants/api-keys' \
  -H 'Authorization: Bearer YOUR_SESSION_JWT'

Response: 200

{
  "apiKey": {
    "id": "b923bb15-aeb3-493a-a06f-8babc0b92fef",
    "name": "Production Store",
    "privateKey": "priv_4b870aa6-1f20-4889-b666-b16d33dd65e6",
    "webhookUrl": "https://myshop.com/api/webhooks/tedr",
    "rotatedAt": null,
    "createdAt": "2026-07-31T12:52:23.000Z"
  }
}

If there is no active key, the response is { "apiKey": null } — this is a normal state, not an error.

Update an API key

PATCH/merchants/api-keys/:id

Auth: Session JWT only — how to get a JWT.

Renames the key and/or changes its webhook URL. Key material is not affected.

Path parameters
NameTypeRequiredDefaultDescription
idstring (UUID)RequiredThe key's id, from the create, rotate, or list response.
Body parameters
NameTypeRequiredDefaultDescription
namestringOptionalNew label for the key. Omit to leave it unchanged.
webhookUrlstring | nullOptionalNew webhook URL. Send null to clear it, or omit to leave it unchanged. See the webhooks reference for its URL requirements.
PATCH/merchants/api-keys/:id
curl -X PATCH 'https://dev-app.tedr.com/api/merchants/api-keys/b923bb15-aeb3-493a-a06f-8babc0b92fef' \
  -H 'Authorization: Bearer YOUR_SESSION_JWT' \
  -H 'Content-Type: application/json' \
  -d '{"webhookUrl": "https://myshop.com/api/webhooks/tedr-v2"}'

Response: 200

{
  "apiKey": {
    "id": "b923bb15-aeb3-493a-a06f-8babc0b92fef",
    "name": "Production Store",
    "privateKey": "priv_4b870aa6-1f20-4889-b666-b16d33dd65e6",
    "webhookUrl": "https://myshop.com/api/webhooks/tedr-v2",
    "rotatedAt": null,
    "createdAt": "2026-07-31T12:52:23.000Z"
  }
}
Errors
CodeStatusWhen
API_KEY_NOT_FOUND404No key with this id exists, is no longer active (revoked), or belongs to a different merchant.
VALIDATION_ERROR400name or webhookUrl fails validation.

An empty request body returns the key unchanged — send only the fields you want to update.

Rotate an API key

POST/merchants/api-keys/:id/rotate

Auth: Session JWT only — how to get a JWT.

Reissues all key material for the same key.

Path parameters
NameTypeRequiredDefaultDescription
idstring (UUID)RequiredThe key's id, from the create, rotate, or list response.
POST/merchants/api-keys/:id/rotate
curl -X POST 'https://dev-app.tedr.com/api/merchants/api-keys/b923bb15-aeb3-493a-a06f-8babc0b92fef/rotate' \
  -H 'Authorization: Bearer YOUR_SESSION_JWT'

Response: 200

{
  "id": "b923bb15-aeb3-493a-a06f-8babc0b92fef",
  "name": "Production Store",
  "privateKey": "priv_4b870aa6-1f20-4889-b666-b16d33dd65e6",
  "secretKey": "sec_kTn0aVQ7l9pS2xY4uZ8bC1dE3fG5hJ7kL9mN0pQ2rS4",
  "webhookSecret": "whsec_Xy2Zb4Nc6Vd8Ef0Gh2Ij4Kl6Mn8Op0Qr2St4Uv6Wx8",
  "webhookUrl": "https://myshop.com/api/webhooks/tedr-v2",
  "rotatedAt": "2026-08-15T09:03:11.000Z",
  "createdAt": "2026-07-31T12:52:23.000Z"
}
Errors
CodeStatusWhen
API_KEY_NOT_FOUND404No key with this id exists, is no longer active (revoked), or belongs to a different merchant.

privateKey, secretKey, and webhookSecret are all replaced; id, name, webhookUrl, and createdAt stay the same. The previous secretKey and webhookSecret stop working immediately. This is a POST, not a PATCH, because it is not idempotent — every call issues new material. Do not retry it after a timeout; check the key state with GET first.

Revoke an API key

DELETE/merchants/api-keys/:id

Auth: Session JWT only — how to get a JWT.

Revokes the key (a soft delete — the row is not removed) and frees the active-key slot for this merchant.

Path parameters
NameTypeRequiredDefaultDescription
idstring (UUID)RequiredThe key's id, from the create, rotate, or list response.
DELETE/merchants/api-keys/:id
curl -X DELETE 'https://dev-app.tedr.com/api/merchants/api-keys/b923bb15-aeb3-493a-a06f-8babc0b92fef' \
  -H 'Authorization: Bearer YOUR_SESSION_JWT'

Response: 204

Errors
CodeStatusWhen
API_KEY_NOT_FOUND404No key with this id exists or it was already revoked.

Returns 204 with no response body. Calling this again on the same key returns 404 API_KEY_NOT_FOUND.