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. The key names the brand, so a brandId in the path must be your own brand. Older Way-Brand-Id + Way-Secret-Key credentials still work: see Legacy authentication.

Path Parameters

brandId
string
required

The brand's ID. With a brand key this must be your own brand; with an organization key it can be any brand in the organization.

cartId
string
required

The cart's ID, the client-generated UUID used at checkout.

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"