Skip to content

Initialize direct checkout

POST
/api/checkout
curl --request POST \
--url https://api.wink.travel/api/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Wink-Version: 2.0' \
--data '{ "shoppingCartIdentifier": "", "customizationIdentifier": "", "redirectUrl": "https://ota.wink.travel/thank-you", "ga4ClientId": "", "ga4SessionId": "", "ga4MeasurementId": "" }'

Creates initialized bookings and a single Stripe PaymentIntent in one step, preparing the shopping cart for payment. Returns the PaymentIntent client secret and ephemeral key needed by the frontend Stripe payment sheet, along with booking confirmation codes and group identifier.

Wink-Version
string
default: 2.0.0
Allowed values: 2.0
Media type application/json
object
shoppingCartIdentifier
required

Shopping cart identifier to send to TripPay for payment processing

string format: uuid
"" >= 1 characters
Example
a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42
customizationIdentifier

Wink affiliate customization identifier for tracking and branding

string format: uuid
""
Example
c4f3e1d2-6g9d-5f5c-1b4e-3c8d7g0f5h64
redirectUrl
required

Redirect URL to return to after successful payment completion

string
default: https://ota.wink.travel/thank-you >= 1 characters
Example
https://ota.wink.travel/thank-you
ga4ClientId

GA4 client ID extracted from the _ga cookie for analytics tracking

string
""
Example
G-XHFTY1BDSD
ga4SessionId

GA4 session ID extracted from the ga<CONTAINER_ID> cookie for session tracking

string
""
Example
GA.1.1.123456789.1234567890
ga4MeasurementId

GA4 Measurement ID identifying the data stream for analytics collection

string
""
Example
GA.1.1.123456789.1234567890

Checkout initialized successfully with payment intent details

Media type application/json
object
clientSecret
required

Stripe PaymentIntent client secret used by the frontend payment sheet to authorize payment.

string
"" >= 1 characters
ephemeralKey
required

Stripe EphemeralKey secret for establishing a temporary customer session with Stripe.

string
"" >= 1 characters
customerId
required

Stripe Customer ID for the authenticated user’s payment methods and history.

string
"" >= 1 characters
groupIdentifier
required

Unique group identifier linking all bookings created in this checkout transaction.

string format: uuid
"" >= 1 characters
bookingCodes
required
Array<string>
>= 1 items
key
additional properties
""
Example

Invalid checkout request (missing cart, invalid dates, etc.)

object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}

Unauthorized - valid authentication required

Media type */*
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties

Forbidden

Media type */*
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties

Shopping cart validation failed or inventory unavailable

Media type application/json
object
clientSecret
required

Stripe PaymentIntent client secret used by the frontend payment sheet to authorize payment.

string
"" >= 1 characters
ephemeralKey
required

Stripe EphemeralKey secret for establishing a temporary customer session with Stripe.

string
"" >= 1 characters
customerId
required

Stripe Customer ID for the authenticated user’s payment methods and history.

string
"" >= 1 characters
groupIdentifier
required

Unique group identifier linking all bookings created in this checkout transaction.

string format: uuid
"" >= 1 characters
bookingCodes
required
Array<string>
>= 1 items
Example
{
"clientSecret": "",
"ephemeralKey": "",
"customerId": "",
"groupIdentifier": "",
"bookingCodes": [
""
]
}

Internal Server Error

object
Example generated
{}