Skip to content
ajar.Get started

Checkout create

booking.checkout.create

View connector

Prepare a selected room and guest details for pay-at-property checkout

POST /v1/operations/booking.checkout.create

Headers

Authorization: Bearer YOUR_CONNECTOR_TOKEN
x-booking-token: YOUR_BOOKING_TOKEN
x-idempotency-key: YOUR_UNIQUE_ATTEMPT_KEY
Content-Type: application/json

x-idempotency-key identifies one intended action. Generate a unique value, such as crypto.randomUUID(), before sending it. Use 1–128 letters, numbers, hyphens, underscores or periods. A duplicate attempt is rejected; it does not return a cached success. If a request times out, check the provider’s state before starting a new attempt with a new key. See the idempotency guide.

Use your connector bearer token and caller-held guest token in x-booking-token.

Inputs

ParameterExample typeExample value
search_refstring"fictional-search-ref"
property_refstring"fictional-property-ref"
rate_idstring"fictional-rate"
guestobject{"first_name":"Alex","last_name":"Example","email":"alex@example.com","phone":"+447700900123","country":"GB"}
confirm_preparebooleantrue

Example input

{
  "search_ref": "fictional-search-ref",
  "property_ref": "fictional-property-ref",
  "rate_id": "fictional-rate",
  "guest": {
    "first_name": "Alex",
    "last_name": "Example",
    "email": "alex@example.com",
    "phone": "+447700900123",
    "country": "GB"
  },
  "confirm_prepare": true
}
Open JSON schema

Input schema

{
  "$id": "https://useajar.com/schemas/booking/checkout-create.input.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "confirm_prepare": {
      "const": true
    },
    "guest": {
      "additionalProperties": false,
      "properties": {
        "country": {
          "pattern": "^[A-Z]{2}$",
          "type": "string"
        },
        "email": {
          "maxLength": 254,
          "minLength": 1,
          "type": "string"
        },
        "first_name": {
          "maxLength": 120,
          "minLength": 1,
          "type": "string"
        },
        "last_name": {
          "maxLength": 120,
          "minLength": 1,
          "type": "string"
        },
        "phone": {
          "maxLength": 40,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "first_name",
        "last_name",
        "email",
        "phone",
        "country"
      ],
      "type": "object"
    },
    "property_ref": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    },
    "rate_id": {
      "maxLength": 256,
      "minLength": 1,
      "type": "string"
    },
    "search_ref": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "search_ref",
    "property_ref",
    "rate_id",
    "guest",
    "confirm_prepare"
  ],
  "type": "object"
}