API Authentication

The first step to using Lydian's API suite is to create an API token. This can be done through the merchant portal.

Lydian uses 3 different types of API / signing keys:

  • API Key: This key is used for any direct server to server communication between your backend and Lydian's backend
  • Publishable Key: This key is used in any frontend calls, most notably, for creating transactions within Lydian.
  • Signing Key: This key is used to verify webhooks have originated from our servers.

Sandbox Configuration

Production Configuration


API Key Management

API keys can be managed through the Merchant Portal or programmatically using the endpoints below.

Create API Key

POST /accounts/{accountUUID}/keys

POST
/accounts/{accountUUID}/keys
curl --location '{API_BASE_URL}/accounts/{AccountUUID}/keys' \
--header 'X-Api-Key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "keyType": "{KEY_TYPE}",
    "name": "{KEY_NAME}"
}'

keyType must be one of: api or publishable.

Create API Key Response

  • Name
    generatedKey
    Type
    string
    Description

    The generated key. API keys are prefixed with ak_, publishable keys with pk_.

  • Name
    privateKey
    Type
    string
    Description

    Base64-encoded private key. Only returned for API keys, empty for publishable keys. Store this securely — it cannot be retrieved again.

example response

{
    "generatedKey": "ak_1a2b3c4d5e6f7890",
    "privateKey": "LS0tLS1CRUdJTi..."
}

List API Keys

GET /accounts/{accountUUID}/keys

GET
/accounts/{accountUUID}/keys
curl --location '{API_BASE_URL}/accounts/{AccountUUID}/keys' \
--header 'X-Api-Key: {API_KEY}' \
--header 'Content-Type: application/json'

List API Keys Response

  • Name
    keys
    Type
    object
    Description

    Object containing key arrays grouped by type.

    • Name
      api
      Type
      array
      Description

      List of API keys, each with uuid, key, status, role, and name.

    • Name
      publishable
      Type
      array
      Description

      List of publishable keys, each with uuid, key, status, and name.

example response

{
    "keys": {
        "api": [
            {
                "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                "key": "ak_1a2b3c4d5e6f7890",
                "status": 1,
                "role": "admin",
                "name": "Production API Key"
            }
        ],
        "publishable": [
            {
                "uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                "key": "pk_9a8b7c6d5e4f3210",
                "status": 1,
                "name": "Checkout Publishable Key"
            }
        ]
    }
}

Revoke API Key

DELETE /accounts/{accountUUID}/keys/{keyUUID}

DELETE
/accounts/{accountUUID}/keys/{keyUUID}
curl --location --request DELETE '{API_BASE_URL}/accounts/{AccountUUID}/keys/{keyUUID}' \
--header 'X-Api-Key: {API_KEY}' \
--header 'Content-Type: application/json'

Returns 204 No Content on success.