Javascript
import CheckoutIntents from 'checkout-intents'; const client = new CheckoutIntents(); const checkoutIntent = await client.checkoutIntents.create({ buyer: { address1: '123 Main St', city: 'New York', country: 'US', email: 'john.doe@example.com', firstName: 'John', lastName: 'Doe', phone: '5555555555', postalCode: '10001', province: 'NY', }, productUrl: 'productUrl', quantity: 0, }); console.log(checkoutIntent);
{ "variantSelections": [ { "value": "Small, Red, XS, L, etc.", "label": "Size, Color, etc." } ], "buyer": { "postalCode": "10001", "country": "US", "province": "NY", "city": "New York", "address2": "Apt 1", "address1": "123 Main St", "phone": "5555555555", "email": "john.doe@example.com", "lastName": "Doe", "firstName": "John" }, "quantity": 123, "productUrl": "<string>", "createdAt": "2023-11-07T05:31:56Z", "id": "<string>", "state": "retrieving_offer" }
Create a checkout intent with the given request body.
Rye API key. Format: Bearer <RYE_API_KEY>
Bearer <RYE_API_KEY>
Show child attributes
Created
retrieving_offer
Was this page helpful?