Skip to main content
POST
/
api
/
v1
/
betas
/
checkout-sessions
JavaScript
import CheckoutIntents from 'checkout-intents';

const client = new CheckoutIntents({
  apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
});

const checkoutSession = await client.betas.checkoutSessions.create({
  productUrl: 'productUrl',
  quantity: 1,
});

console.log(checkoutSession.url);
{
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

Rye API key

Body

application/json

The request body containing the checkout session parameters

productUrl
string
required
quantity
number<integer>
required
Example:

1

variantSelections
object[]
promoCodes
string[]
Maximum array length: 16
constraints
object
buyer
object

Optional buyer information, used to pre-fill the checkout form with the buyer's information.

Response

Checkout session

A checkout session represents a hosted checkout form that shoppers can use to complete their purchases.

Checkout sessions provide a pre-built UI for collecting payment and shipping information, allowing you to quickly integrate checkout functionality without building your own forms.

url
string
required

URL to send your user to for checkout. This URL is valid for 4 hours.