Card Tokenization

Tokenize a Card

Accepts card data along with optional billing details, tokenizes the card, and securely stores the tokenized payment method. Returns a token ID that can be used in place of the card number for future transactions.

Authentication is done via Cloudbeds JWT

Test mode

When the property's payment gateway is in test mode, send the CB-Tokenization-Mode: test header so the card is tokenized in the test environment. Omit the header for gateways in live mode.

curl -X POST https://api.payments.cloudbeds.com/vault/v1/tokens/card \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Property-Id: 123456789" \
  -H "CB-Tokenization-Mode: test" \
  -H "Content-Type: application/json" \
  -d '{
    "card_number": "4111111111111111",
    "cvv": "123",
    "cardholder_name": "Sara Ryder",
    "expiration": { "month": "08", "year": "2028" }
  }'
post/vault/v1/tokens/card

Request

  • Base URL
    https://api.payments.cloudbeds.com
  • URL
    https://api.payments.cloudbeds.com/vault/v1/tokens/card
  • Auth
    HTTP bearer

Headers

X-Property-Idstring
CB-Tokenization-Mode'test'

Required when the property's payment gateway is in test mode; the only accepted value is test. Omit this header for gateways in live mode.

Request body

card_numberstring required

The full card number.

cvvstring required

The card verification value.

card_brandstring

The card brand. Supported values: VISA, MASTERCARD, AMEX, DISCOVER, etc. Defaults to VISA when omitted.

cardholder_namestring required

The name on the card.

Example request

{
  "card_number": "4111111111111111",
  "cvv": "123",
  "card_brand": "VISA",
  "cardholder_name": "Sara Ryder",
  "expiration": {
    "month": "08",
    "year": "2028"
  },
  "billing_details": {
    "address1": "3033 5th Ave.",
    "address2": "Ste 100",
    "city": "San Diego",
    "country": "US",
    "document_number": "142-test",
    "name": "Denise Foreman",
    "postal_code": "60601",
    "phone": "1234567890",
    "state": "IL"
  }
}

Response

idstring

The UUID of the tokenized payment method.

Example response

{
  "id": "019c4d7e-4feb-73af-99f2-34c2771042f6"
}

Changes

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