Skip to content
Navigation

Prepare an unpaid checkout from an offer

POST
https://api.nicer.travel/commerce/checkouts

Turns a live search offer into an unpaid order: it re-validates the offer with the provider, prices it, and creates the order on the trip; paymentUrl is null, and createPaymentLink makes the link. Nothing is paid, held or reserved. Calling it twice for the same offer on the same trip returns the same order rather than a second one — the key is the offer and the trip, so no caller has to invent one. status is OK with the order, PRICE_CHANGED when the provider now charges something else (search again and use the new offer), or UNAVAILABLE when the offer is gone.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • x-nicer-company
    string
    required

    Company context. Authentication and tenant membership are validated by the API.

Request body JSON required

  • offerReference
    string
    required

    The offer to buy, from a hotel, flight or car search.

    minLength: 1
  • travelersTripId
    string
    required

    The trip the order belongs to.

    minLength: 1

Returns

200

OK

JSON
  • status
    OK
    or
    PRICE_CHANGED
    or
    UNAVAILABLE
    required
  • checkout
    required

    Any of the following:

    • object
      • currency
        string
        required
        pattern: ^[A-Z]{3}$
      • expiresAt
        string
        required
        format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      • orderId
        string
        required
        minLength: 1
      • paymentUrl
        required

        Any of the following:

        • string
        • null
      • title
        string
        required
        maxLength: 512 · minLength: 1
      • totalMinor
        integer
        required
        maximum: 9007199254740991 · minimum: 0
    • null
  • reason
    required

    Any of the following:

    • string
    • null

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close