Skip to navigation

Create an Apple Pay session for a cart

Mints the merchant session Apple Pay requires before the payment sheet can open, for the merchant account this cart’s order is charged through, whatever currency the shopper pays in. Call this when the shopper taps the Apple Pay button on the cart, then pass the returned merchantSession unchanged to ApplePaySession.completeMerchantValidation. Offer Apple Pay only when the cart lists APPLE_PAY in options.paymentMethods. Sessions are short-lived, so mint one per payment attempt rather than caching. The Origin request header must carry the domain the shopper is paying on, and that domain must be registered with Apple Pay.

Authentication

X-TT-API-Keystring
API Key authentication via header

Path parameters

cartIdstringRequired

Cart ID (UUID)

Headers

X-TT-PlatformenumRequired
Identifies the platform the request comes from.
Allowed values:
X-TT-RetailerstringRequired
Your retailer identifier, provided during onboarding. It must be a retailer your API key was issued for.

Response headers

X-RateLimit-Limitinteger
How many requests this API key may make for this retailer in the current window. Sent only when the request was counted against that limit. A response served from cache was not counted and repeats the value it was cached with.
X-RateLimit-Remaininginteger
How many requests this API key has left for this retailer in the current window. Sent only when the request was counted against that limit. A response served from cache was not counted and repeats the value it was cached with.

Response

Apple Pay merchant session.
dataobject
The Apple Pay merchant session a client needs to open the Apple Pay payment sheet.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
410
Gone Error
429
Too Many Requests Error
503
Service Unavailable Error