JavaScript
import CheckoutIntents from 'checkout-intents'; const client = new CheckoutIntents({ apiKey: 'My API Key', }); const checkoutIntent = await client.checkoutIntents.addPayment('id', { paymentMethod: { stripeToken: 'tok_1RkrWWHGDlstla3f1Fc7ZrhH', type: 'stripe_token' }, }); console.log(checkoutIntent);
{ "buyer": { "postalCode": "10001", "country": "United States", "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", "variantSelections": [ { "value": "Small, Red, XS, L, etc.", "label": "Size, Color, etc." } ] }
Add payment details to a checkout intent
Rye API key
The id of the checkout intent to add payment details to
The request body containing the payment details
Show child attributes
"tok_1RkrWWHGDlstla3f1Fc7ZrhH"
stripe_token
"stripe_token"
Payment response
255
"10001"
"United States"
"NY"
"New York"
"123 Main St"
"+1234567890"
"[email protected]"
"Doe"
"John"
"Apt 1"
retrieving_offer
30
"Small, Red, XS, L, etc."
"Size, Color, etc."
Was this page helpful?