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 checkoutIntent = await client.checkoutIntents.create({ buyer: { address1: '123 Main St', city: 'New York', country: 'US', email: '[email protected]', firstName: 'John', lastName: 'Doe', phone: '1234567890', postalCode: '10001', province: 'NY', }, productUrl: 'productUrl', quantity: 1, }); console.log(checkoutIntent);
{ "buyer": { "postalCode": "10001", "country": "US", "province": "NY", "city": "New York", "address1": "123 Main St", "phone": "1234567890", "email": "[email protected]", "lastName": "Doe", "firstName": "John", "address2": "Apt 1" }, "quantity": 123, "productUrl": "<string>", "createdAt": "2023-11-07T05:31:56Z", "id": "<string>", "state": "retrieving_offer", "promoCodes": [ "<string>" ], "variantSelections": [ { "value": "Small, Red, XS, L, etc.", "label": "Size, Color, etc." } ] }
Create a checkout intent with the given request body.
Rye API key
Show child attributes
1
Created
retrieving_offer
Was this page helpful?