Skip to main content

addToCart

Redirects to the customization page to fill in the details and add to cart. Details can also be passed in the payload and will be pre-filled in the customization page.

It is not currently possible to bypass the customization page when adding to the cart.

note

If other commands other than this one are issued before customization is completed, the giftcard will not be added to the cart.

note

Only visible giftcards can be added, calculated after the filterList command.

Example

rpt({
widget: 'giftcards',
command: 'addToCart',
payload: {
id: 254,
price: 300,
sender: {
name: 'John',
email: 'sender@example.com',
},
recipient: {
name: 'Doe',
email: 'recipient@example.com',
message: 'Have fun!',
},
},
})

Payload

PropertyTypeDescription
pricenumberPrice of the giftcard. Mandatory if its an open giftcard,
ignored if it is not
idnumberId of the giftcard
sender{ name: string, email: string }Sender details
recipient{ name: string, email: string, message: string }Recipient details