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 null

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

Checkout payload containing the shopping cart reference, selected payment method and guest contact details

Media type application/json

Request payload to initiate the checkout flow for a previously assembled shopping cart, including payment routing and analytics tracking parameters.

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-6a9d-5f5c-1b4e-3c8d7b0f5c64
redirectUrl
required

Redirect URL to return to after successful payment completion

string format: uri
default: https://book.wink.travel/thank-you >= 1 characters
Example
https://book.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
Example
{
"shoppingCartIdentifier": "a2f1c9d8-4e7b-4d3a-9f2c-1a6b5e8d3f42",
"customizationIdentifier": "c4f3e1d2-6a9d-5f5c-1b4e-3c8d7b0f5c64",
"redirectUrl": "https://book.wink.travel/thank-you",
"ga4ClientId": "G-XHFTY1BDSD",
"ga4SessionId": "GA.1.1.123456789.1234567890",
"ga4MeasurementId": "GA.1.1.123456789.1234567890"
}

Checkout initialized successfully with payment intent details

Media type application/json

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
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
{
"clientSecret": "pi_1A2B3C4D5E6F7G8H_secret_9I0J1K2L3M4N5O6P",
"ephemeralKey": "ek_live_A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P",
"customerId": "cus_A1B2C3D4E5F6G7H",
"groupIdentifier": "a1f4c9e2-7b3d-4e8a-9c21-6f0b5d8e3a47",
"bookingCodes": [
"WNK4ZQ7P",
"WNK8XR3M"
]
}

Bad Request — missing or invalid request parameter or body

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Unauthorized — authentication is required or the session has expired

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Forbidden — authenticated but lacking the required permission or scope

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Not Found — the requested resource does not exist

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Method Not Allowed — the HTTP verb is not supported on this endpoint

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Unsupported Media Type — use application/json

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Shopping cart validation failed or inventory unavailable at time of checkout

Media type application/json

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
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
null

Internal Server Error — an unexpected failure occurred on the server

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Service Unavailable — a downstream dependency is unreachable

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example