Initialize direct checkout
const url = 'https://api.wink.travel/api/checkout';const options = { method: 'POST', headers: { 'Wink-Version': '2.0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"customizationIdentifier":"c4f3e1d2-6a9d-5f5c-1b4e-3c8d7b0f5c64","ga4ClientId":"G-XHFTY1BDSD","ga4MeasurementId":"GA.1.1.123456789.1234567890","ga4SessionId":"GA.1.1.123456789.1234567890","quotedTotal":{"displayAmount":4480,"displayCurrency":"THB","sourceAmount":4480,"sourceCurrency":"THB"},"redirectUrl":"https://book.wink.travel/thank-you","shoppingCartIdentifier":"a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 '{ "customizationIdentifier": "c4f3e1d2-6a9d-5f5c-1b4e-3c8d7b0f5c64", "ga4ClientId": "G-XHFTY1BDSD", "ga4MeasurementId": "GA.1.1.123456789.1234567890", "ga4SessionId": "GA.1.1.123456789.1234567890", "quotedTotal": { "displayAmount": 4480, "displayCurrency": "THB", "sourceAmount": 4480, "sourceCurrency": "THB" }, "redirectUrl": "https://book.wink.travel/thank-you", "shoppingCartIdentifier": "a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42" }'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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Checkout payload containing the shopping cart reference, selected payment method and guest contact details
Request payload to initiate the checkout flow for a previously assembled shopping cart, including payment routing and analytics tracking parameters.
object
Wink affiliate customization identifier for tracking and branding
Example
c4f3e1d2-6a9d-5f5c-1b4e-3c8d7b0f5c64GA4 client ID extracted from the _ga cookie for analytics tracking
Example
G-XHFTY1BDSDGA4 Measurement ID identifying the data stream for analytics collection
Example
GA.1.1.123456789.1234567890GA4 session ID extracted from the ga<CONTAINER_ID> cookie for session tracking
Example
GA.1.1.123456789.1234567890GA4 session IDs the browser captured before the Stripe redirect, keyed by Measurement ID (G-XXXX -> session_id). Lets the server continue each measurement ID’s original session when firing the purchase server-side.
object
Identifier of the shareable link the guest arrived through, when the booking started from one. Omit otherwise.
The cart total the client displayed to the guest. Asserted against the server’s own re-price before any payment object is created; never used as a price. Optional so older clients keep working while the guard rolls out.
object
Total in the guest’s display currency, exactly as rendered on the confirm step
Example
4480ISO 4217 code of the guest’s display currency
Example
THBTotal in the property’s own (source) currency, if the client can independently attest one. Omit rather than echoing back a server-supplied figure.
Example
4480ISO 4217 code of the property’s own (source) currency. Required when sourceAmount is present.
Example
THBExample
{ "displayAmount": 4480, "displayCurrency": "THB", "sourceAmount": 4480, "sourceCurrency": "THB"}Redirect URL to return to after successful payment completion
Example
https://book.wink.travel/thank-youShopping cart identifier to send to TripPay for payment processing
Example
a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42Where the booking started (one of LINK, BOOK_NOW_LINK, EMBED_REDIRECT, EMBED_MODAL, WINKLINKS). Free-form on the wire so a value this server does not know yet is never rejected; the server interprets it leniently. Omit when unknown.
Example
{ "customizationIdentifier": "c4f3e1d2-6a9d-5f5c-1b4e-3c8d7b0f5c64", "ga4ClientId": "G-XHFTY1BDSD", "ga4MeasurementId": "GA.1.1.123456789.1234567890", "ga4SessionId": "GA.1.1.123456789.1234567890", "quotedTotal": { "displayAmount": 4480, "displayCurrency": "THB", "sourceAmount": 4480, "sourceCurrency": "THB" }, "redirectUrl": "https://book.wink.travel/thank-you", "shoppingCartIdentifier": "a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42"}Responses
Section titled “Responses”Checkout initialized successfully with payment intent details
Result returned to the frontend after a successful checkout initiation, containing the Stripe credentials needed to render the PaymentSheet and the booking identifiers for post-payment confirmation.
object
Stripe PaymentIntent client secret used by the frontend payment sheet to authorize payment.
Stripe Customer ID for the authenticated user’s payment methods and history.
Stripe EphemeralKey secret for establishing a temporary customer session with Stripe.
Unique group identifier linking all bookings created in this checkout transaction.
Example
{ "bookingCodes": [ "WNK4ZQ7P", "WNK8XR3M" ], "clientSecret": "pi_1A2B3C4D5E6F7G8H_secret_9I0J1K2L3M4N5O6P", "customerId": "cus_A1B2C3D4E5F6G7H", "ephemeralKey": "ek_live_A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P", "groupIdentifier": "a1f4c9e2-7b3d-4e8a-9c21-6f0b5d8e3a47"}Bad Request — missing or invalid request parameter or body
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Unauthorized — authentication is required or the session has expired
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Forbidden — authenticated but lacking the required permission or scope
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Not Found — the requested resource does not exist
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Method Not Allowed — the HTTP verb is not supported on this endpoint
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}An identical checkout for this cart is already being processed and did not finish within the bounded wait (about 10 seconds); reason CHECKOUT_IN_PROGRESS. Retry the same request: once the first checkout completes, a duplicate is answered with that same checkout (same group, bookings and Stripe session) rather than creating a second one. Reason CHECKOUT_INTERRUPTED means the wait was cut short and the request should simply be retried.
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Unsupported Media Type — use application/json
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Shopping cart validation failed or inventory unavailable at time of checkout
Result returned to the frontend after a successful checkout initiation, containing the Stripe credentials needed to render the PaymentSheet and the booking identifiers for post-payment confirmation.
object
Stripe PaymentIntent client secret used by the frontend payment sheet to authorize payment.
Stripe Customer ID for the authenticated user’s payment methods and history.
Stripe EphemeralKey secret for establishing a temporary customer session with Stripe.
Unique group identifier linking all bookings created in this checkout transaction.
Example
{ "bookingCodes": [ "WNK4ZQ7P", "WNK8XR3M" ], "clientSecret": "pi_1A2B3C4D5E6F7G8H_secret_9I0J1K2L3M4N5O6P", "customerId": "cus_A1B2C3D4E5F6G7H", "ephemeralKey": "ek_live_A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P", "groupIdentifier": "a1f4c9e2-7b3d-4e8a-9c21-6f0b5d8e3a47"}Internal Server Error — an unexpected failure occurred on the server
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}An earlier identical checkout exists but Stripe could not confirm its state right now (reason CHECKOUT_REPLAY_UNAVAILABLE). Nothing was created or discarded; retry the same request shortly.
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}