Skip to main content
POST
Create a payment intent

Authorizations

Authorization
string
header
required

Your brand's secret API key, e.g. Bearer way_sk_live_bhEqcn0i1fRoUEHBPjJkQA. Older Way-Brand-Id + Way-Secret-Key credentials still work: see Legacy authentication.

Path Parameters

brandId
string
required

The brand's ID - must match the brand your API key identifies (or the Way-Brand-Id header when one is sent).

cartId
string
required

Only bookings created from this cart.

Body

application/json
data
object[]
required

The cart items to price, in the same shape as the book-bulk data[] items. Send the exact items you intend to book so the payment intent amount matches the booking.

getOnlyTotalNetAmount
boolean

When true, prices the cart and returns totalNetAmount without initializing a payment - paymentIntentSecret comes back null. Use it to show a running total before checkout.

convertToUsd
boolean
default:false

When true and the cart's currency is not USD, prices the cart in USD using Way's conversion rate. Defaults to false.

paymentIntentRevision
number

Monotonically increasing revision number for this cart's payment intent, protecting against stale or duplicate requests: if the value is lower than or equal to the cart's stored revision, Way returns the existing intent instead of updating it. Omit if you only create the intent once per cart.

Example:

1

Response

201 - application/json
totalNetAmount
number
required

Total amount to charge for the cart after discounts and credits, in the brand's currency (USD when convertToUsd is true). Matches the amount the booking call will charge if the cart is unchanged.

Example:

200

paymentIntentSecret
string | null
required

Stripe client secret for the created payment intent - use it to initialize Stripe Elements. Null when getOnlyTotalNetAmount is true. The booking response's clientSecret is the definitive secret to confirm the charge against.

Example:

"pi_3Tso72FpAKNo2Ml2_secret_REDACTED"