Payment SDK API Key Management

Issue API Key

Issue a new API key for the Payment Element, scoped to one or more properties.

The response includes both the identity (public) and the secret (private). The secret is only returned once at creation time and cannot be retrieved later.

Important: Treat the secret as a password. Store it in a secure vault or secrets manager. Do not log it, commit it to source control, or expose it in client-side code.

Using with the Payment Webcomponent

To initialize the payment webcomponent your backend must produce a token from the identity and secret, then populate the webcomponents api-key field. The token format is:

{identity}.{base64(HMAC_SHA256(message, secret))}

Where:

  • message is the literal string "{identity}|{property_id}" (UTF-8 bytes, pipe-separated, no surrounding whitespace).
  • secret is the value returned by this endpoint, used as-is (its raw ASCII bytes). Do not base64-decode it before signing.
  • The HMAC digest is the raw 32 bytes of HMAC-SHA256, then standard base64 encoded (not base64url, no = stripping).
  • The token is the identity, a literal ., then the base64 digest.
post/v1/keys

Request

  • Base URL
    https://api.cloudbeds.com/payments/sdk-api
  • URL
    https://api.cloudbeds.com/payments/sdk-api/v1/keys
  • Auth
    HTTP bearer

Request body

property_idsstring[] required

Array of property IDs to scope the key to. At least one is required and must be scoped to your JWT key

Example request

{
  "property_ids": [
    12345,
    67890
  ]
}

Response

Successful operation

identitystring required

Public key identifier (e.g. pek_a1b2c3d4e5f6g7h8i9j0k1l2).

secretstring required

Private key secret. Only returned once at creation. Store securely and never expose publicly.

property_idsstring[] required

Property IDs the key is scoped to.

statusstring required

Key status.

created_atstring date-time required

ISO 8601 creation timestamp.

Example response

{
  "identity": "pek_a1b2c3d4e5f6g7h8i9j0k1l2",
  "secret": "hNRMf27aSRBJcSUNhFbeoJFkvEehq2pmSjnc6PTWoT",
  "property_ids": [
    12345,
    67890
  ],
  "status": "active",
  "created_at": "2026-03-10T14:30:00.000000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.