Skip to content

CheckoutRequestBody

CheckoutRequestBody = object

What a browser posts to buy an offer a decision returned. The body is checked strictly: any key not listed here is a 400, so raw card data is refused too.

  • No siteId: the client is pinned to one site and sends it in the x-edgekit-site-id header.
  • No offerId: CheckoutRequestBody.offerToken names the offer.
  • No userId: a body carrying one is a 403. The buyer is anonymous, and email is how the purchase finds the user.
  • No coupon or other field passed on to the billing provider.

optional country?: string

Where the buyer is taxed: a two-letter country code such as de. Required for a token from a checkout page that charges tax, and ignored for any other. Under Recurly, put the same country in the Recurly.js form: Recurly taxes the address on the card token.


optional currency?: string

The currency to charge in, as a three-letter ISO 4217 code such as eur. Send the currency the page showed. Without it, the site’s own currency applies. An offer with no price in the currency is refused with offer_not_priced_in_currency; checkout never charges another currency instead.


email: string

The buyer’s email address, unverified. The grant goes to the user with this address, and a new user is created when there is none. A purchase never marks the address as verified.


optional firstName?: string

The buyer’s name as typed on the card form. Used only when the purchase creates a new user, and never applied to a user that already exists: the request is unauthenticated, so anyone who knows an address could otherwise rename that user. Optional, because your form decides which fields it collects.


optional lastName?: string


offerToken: string

The offer_token field of the outcome that offered the purchase. Opaque: it names one offer on one site and can be reused until it expires.


optional paymentMethod?: "card" | "apple_pay" | "google_pay" | "paypal" | "link"

What the buyer pays with. Without it, card. Under Stripe the subscription then takes that method only, so mount the same one in Stripe.js: card for a typed card, Apple Pay and Google Pay alike, paypal, or link. link is refused under Recurly. After PayPal sends the buyer back to your return_url, call checkout again with the same offerToken until it answers granted.


optional postalCode?: string

The buyer’s postal code, beside country: needed in the United States and Canada.


optional recurlyTokenId?: string

The card token Recurly.js created on your page. Required when the site sells through Recurly; refused when it sells through Stripe, where the card is confirmed in Stripe.js after this call answers requires_confirmation.


optional threeDSecureActionResultTokenId?: string

The 3-D Secure result token id from Recurly.js. Send it only to finish a purchase refused with three_d_secure_required, together with the same offerToken and recurlyTokenId as the first request.

The refusal’s details carry threeDSecureActionTokenId. Pass that to Recurly.js to run the challenge, then send the result token it returns here. Sending the action token instead starts the challenge again.

edgekit.ai