---
title: "Submit, confirm or renew a checkout"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit, confirm or renew a checkout

Path: Nicer API › Commerce

`POST /commerce/orders/{orderId}/checkout-actions`

URL: `https://api.nicer.travel/commerce/orders/{orderId}/checkout-actions`

The pay page's checkout actions on one order. The caller is whoever holds the order's payment link (its token as `Authorization: PaymentLink <token>` or `X-Payment-Link-Token`), a checkout session made from that link, or a signed-in person with access to the order; a link that expired without being revoked may still renew, within 24 hours of its end. SUBMIT_CHECKOUT commits the travelers and the accepted terms, and starts a flight's hold or a booking that needs no payment. CONFIRM_NICER_PAYMENT reports that a payment attempt of the order finished: an authorized or succeeded one sends the order on to be booked. Neither charges a card: `POST /commerce/orders/{orderId}/payments` does. RENEW_CHECKOUT renews expired payment access: an unpaid checkout is priced again into a successor order, and a held flight is verified with the provider and keeps the same order, reservation and payment deadline. EXCHANGE_CHECKOUT_SESSION trades the one-time code of a link its creator made for themselves for a checkout session in that person's name. Order management (payment links, cancellation) is not accepted here: it is `POST /commerce/orders/{orderId}/actions`. Requires an Idempotency-Key; at most 30 calls a minute from one address.

## Authentication

Requires one of the following:

- 
- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `orderId` (`commerce.orders.checkoutActions.create.path.orderId`; string, required)

## Header parameters

- `Idempotency-Key` (`commerce.orders.checkoutActions.create.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.

## Request body

_Required._

Every option has:

- `type` (`<option>.type`; string, required)

One of the following, each adding:

- `object` (`commerce.orders.checkoutActions.create.1`)
  - `code` (`commerce.orders.checkoutActions.create.1.code`; string, required)
    - pattern: `^[A-Za-z0-9_-]{43}$`
- `object` (`commerce.orders.checkoutActions.create.2`)
- `object` (`commerce.orders.checkoutActions.create.3`)
  - `acceptedTermsDigest` (`commerce.orders.checkoutActions.create.3.acceptedTermsDigest`; string, required)
    - pattern: `^sha256:[a-f0-9]{64}$`
  - `participants` (`commerce.orders.checkoutActions.create.3.participants`; array of object, required)
    - `address` (`commerce.orders.checkoutActions.create.3.participants.address`; any of, required) — The person's postal address; null when unknown.
      - any of the following: `PersonAddress`, `null`
    - `birthDate` (`commerce.orders.checkoutActions.create.3.participants.birthDate`; any of, required) — The person's date of birth, YYYY-MM-DD; null when unknown.
      - any of the following: `string`, `null`
    - `contact` (`commerce.orders.checkoutActions.create.3.participants.contact`; object, required) — How to reach the person.
      - `email` (`commerce.orders.checkoutActions.create.3.participants.contact.email`; any of, required)
        - any of the following: `string`, `null`
      - `phone` (`commerce.orders.checkoutActions.create.3.participants.contact.phone`; any of, required)
        - any of the following: `E164Phone`, `null`
    - `documents` (`commerce.orders.checkoutActions.create.3.participants.documents`; array of object, required) — The person's travel documents (passport, visa, national ID), up to 12; empty when there are none.
      - `expirationDate` (`commerce.orders.checkoutActions.create.3.participants.documents.expirationDate`; any of, required) — The day the document expires, YYYY-MM-DD; null for one that does not.
        - any of the following: `string`, `null`
      - `issuingCountryCode` (`commerce.orders.checkoutActions.create.3.participants.documents.issuingCountryCode`; any of, required) — The country that issued the document, as an ISO 3166-1 alpha-2 country code; null when unknown.
        - any of the following: `CountryCode`, `null`
      - `kind` (`commerce.orders.checkoutActions.create.3.participants.documents.kind`; string, required) — What the document is.
        - one of `"DRIVER_LICENSE"`, `"KNOWN_TRAVELER_NUMBER"`, `"NATIONAL_ID"`, `"PASSPORT"`, `"REDRESS_NUMBER"`, `"RESIDENCE_PERMIT"`, `"VISA"`
      - `number` (`commerce.orders.checkoutActions.create.3.participants.documents.number`; string, required) — The document's number, in full, 1 to 100 characters.
        - maxLength: `100` · minLength: `1`
      - `citizenshipCountry` (`commerce.orders.checkoutActions.create.3.participants.documents.citizenshipCountry`; any of, optional) — The citizenship stated on this document, as an ISO 3166-1 alpha-2 country code; it is not always the person's nationality. Null or absent when the document states none.
        - any of the following: `CountryCode`, `null`
      - `issueDate` (`commerce.orders.checkoutActions.create.3.participants.documents.issueDate`; any of, optional) — The day the document was issued, YYYY-MM-DD; null or absent when unknown.
        - any of the following: `string`, `null`
      - `placeOfBirth` (`commerce.orders.checkoutActions.create.3.participants.documents.placeOfBirth`; any of, optional) — The place of birth printed on the document; null or absent when unknown.
        - any of the following: `string`, `null`
      - `placeOfIssue` (`commerce.orders.checkoutActions.create.3.participants.documents.placeOfIssue`; any of, optional) — Where the document was issued; null or absent when unknown.
        - any of the following: `string`, `null`
    - `name` (`commerce.orders.checkoutActions.create.3.participants.name`; object, required) — The person's legal name, as printed on their travel document.
      - `familyName` (`commerce.orders.checkoutActions.create.3.participants.name.familyName`; string, required)
        - maxLength: `100` · minLength: `1`
      - `givenName` (`commerce.orders.checkoutActions.create.3.participants.name.givenName`; string, required)
        - maxLength: `100` · minLength: `1`
      - `middleName` (`commerce.orders.checkoutActions.create.3.participants.name.middleName`; any of, required)
        - any of the following: `string`, `null`
    - `nationalityCountryCode` (`commerce.orders.checkoutActions.create.3.participants.nationalityCountryCode`; any of, required) — The person's nationality, as an ISO 3166-1 alpha-2 country code; null when unknown.
      - any of the following: `CountryCode`, `null`
    - `participantId` (`commerce.orders.checkoutActions.create.3.participants.participantId`; string, required) — An id you make up for this participant, such as P1, unique among the participants of the order.
      - minLength: `1`
    - `sex` (`commerce.orders.checkoutActions.create.3.participants.sex`; any of, required) — The sex marker printed on the person's travel document; null when unknown.
      - any of the following: `ParticipantSex`, `null`
    - `hotelMembership` (`commerce.orders.checkoutActions.create.3.participants.hotelMembership`; any of, optional) — The person's membership number with the hotel chain (chainCode), for a hotel booking; null or left out when there is none.
      - any of the following: `HotelMembership`, `null`
    - `frequentFlyerPrograms` (`commerce.orders.checkoutActions.create.3.participants.frequentFlyerPrograms`; array of object, optional) — The person's airline loyalty memberships, up to 8, sent with a flight booking.
      - `airlineIataCode` (`commerce.orders.checkoutActions.create.3.participants.frequentFlyerPrograms.airlineIataCode`; string, required)
        - pattern: `^[A-Z0-9]{2,3}$`
      - `memberNumber` (`commerce.orders.checkoutActions.create.3.participants.frequentFlyerPrograms.memberNumber`; string, required)
        - maxLength: `100` · minLength: `1`
    - `travelerId` (`commerce.orders.checkoutActions.create.3.participants.travelerId`; string, optional) — The CRM traveler this participant was filled from, as GET /crm/trips/{travelersTripId} answers it. Leave it out when the details were typed in.
      - minLength: `1`
  - `airPlanningFeeMinor` (`commerce.orders.checkoutActions.create.3.airPlanningFeeMinor`; integer, optional) — Air planning fee in USD cents for the whole reservation.
    - maximum: `100000000`
  - `paymentTermsKind` (`commerce.orders.checkoutActions.create.3.paymentTermsKind`; string, optional) — HOLD requires a confirmed airline deadline at least 12 hours away and gives the customer half the remaining window to pay. PAY_NOW books with the card sent next. Omitted means HOLD where allowed. An unsupported hold answers 409 COMMERCE_HOLD_NOT_ALLOWED; a window that no longer qualifies answers 409 COMMERCE_HOLD_WINDOW_UNAVAILABLE.
    - one of `"HOLD"`, `"PAY_NOW"`
  - `specialRequest` (`commerce.orders.checkoutActions.create.3.specialRequest`; any of, optional)
    - default: `null`
    - any of the following: `string`, `null`
  - `notifyTravelers` (`commerce.orders.checkoutActions.create.3.notifyTravelers`; boolean, optional) — False sends this order's emails (its booking confirmation and its hold, declined-payment, ticketing and cancellation notices) to its advisor alone, never to its travelers or payer. The payer still gets the receipt of a card payment, and sendOrderConfirmation still reaches the addresses it names. Omitted means true.
  - `validatingCarrier` (`commerce.orders.checkoutActions.create.3.validatingCarrier`; string, optional) — The airline that issues a flight's ticket, one of productSnapshot.validatingCarriers. The default (the first) or an absent choice leaves issuance to the provider. The choice is the agency's: only an advisor or staff caller, or the agency's own payment link, may send a code; a traveler or a traveler link answers 403 COMMERCE_VALIDATING_CARRIER_ADVISOR_ONLY, and a code the fare does not offer answers 409 COMMERCE_VALIDATING_CARRIER_NOT_OFFERED.
    - pattern: `^[A-Z0-9]{2,3}$`
- `object` (`commerce.orders.checkoutActions.create.4`)
  - `paymentAttemptId` (`commerce.orders.checkoutActions.create.4.paymentAttemptId`; string, required)
    - minLength: `1`

## Example request

```json
{
  "type": "EXCHANGE_CHECKOUT_SESSION",
  "code": "string"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "Idempotency-Key": process.env.NICER_IDEMPOTENCY_KEY },
});

await nicer.commerce.orders.checkoutActions.create({
  "orderId": "string",
  "type": "EXCHANGE_CHECKOUT_SESSION",
  "code": "string"
});
```

### Nicer CLI

```bash
nicer commerce orders checkout-actions create --order-id 'string' --input - <<'JSON'
{
  "type": "EXCHANGE_CHECKOUT_SESSION",
  "code": "string"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/commerce/orders/<orderId>/checkout-actions' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --data '
{
  "type": "EXCHANGE_CHECKOUT_SESSION",
  "code": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/orders/<orderId>/checkout-actions';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'Idempotency-Key': 'string'},
  body: JSON.stringify({type: 'EXCHANGE_CHECKOUT_SESSION', code: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/commerce/orders/<orderId>/checkout-actions"

payload = {
    "type": "EXCHANGE_CHECKOUT_SESSION",
    "code": "string"
}
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "checkoutSession": {
    "token": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  },
  "expiresAt": "2019-08-24T14:15:22Z",
  "orderId": "string",
  "orderStatus": "DRAFT",
  "paymentUrl": "http://example.com",
  "status": "ACCEPTED",
  "type": "EXCHANGE_CHECKOUT_SESSION"
}
```

- `expiresAt` (`commerce.orders.checkoutActions.create.response.200.expiresAt`; any of, required)
  - any of the following: `string`, `null`
- `orderId` (`commerce.orders.checkoutActions.create.response.200.orderId`; string, required)
  - minLength: `1`
- `orderStatus` (`commerce.orders.checkoutActions.create.response.200.orderStatus`; string, required)
  - one of `"DRAFT"`, `"AWAITING_PAYMENT"`, `"HOLDING"`, `"HELD"`, `"PAYMENT_PROCESSING"`, `"TICKETING"`, `"BOOKED"`, `"CANCELLATION_PROCESSING"`, `"CANCELLED"`, `"EXPIRED"`, `"NEEDS_ATTENTION"`, `"FAILED"`
- `paymentUrl` (`commerce.orders.checkoutActions.create.response.200.paymentUrl`; any of, required)
  - any of the following: `string`, `null`
- `status` (`commerce.orders.checkoutActions.create.response.200.status`; string, required)
  - one of `"ACCEPTED"`, `"COMPLETED"`
- `type` (`commerce.orders.checkoutActions.create.response.200.type`; string, required)
  - one of `"EXCHANGE_CHECKOUT_SESSION"`, `"RENEW_CHECKOUT"`, `"SUBMIT_CHECKOUT"`, `"CREATE_PAYMENT_LINK"`, `"CONFIRM_NICER_PAYMENT"`, `"CANCEL"`, `"REVOKE_PAYMENT_LINK"`
- `checkoutSession` (`commerce.orders.checkoutActions.create.response.200.checkoutSession`; object, optional)
  - `token` (`commerce.orders.checkoutActions.create.response.200.checkoutSession.token`; string, required)
    - minLength: `1`
  - `expiresAt` (`commerce.orders.checkoutActions.create.response.200.checkoutSession.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))$`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.checkoutActions.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.orders.checkoutActions.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.checkoutActions.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.orders.checkoutActions.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.checkoutActions.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.orders.checkoutActions.create.response.403.errorMessage`; string, required)

### 429

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.checkoutActions.create.response.429.errorCode`; string, required)
- `errorMessage` (`commerce.orders.checkoutActions.create.response.429.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Commerce/commerce.orders.checkoutActions.create/index.md
