How to sell gift certificates using suite script?
Answered
I am currently creating sales orders using the suite script successfully. But now I want to sell gift certificates using the same script. So how can it be possible to sell gift certificates using a suite script while creating order? Please share a demo code with me if possible.
Best answer
It’s been a while and I wasn’t doing it all from script but I’m pretty sure you should be able to do this.
The fields are on the item sublist itself (as opposed to a subrecord) and you can find them in the record browser:
giftcertfrom
giftcertmessage
giftcertrecipientemail
giftcertrecipientname
Plus there’s giftcertnumber which doesn’t seem to be in the records browser.
So you set them like:
.setSublistValue({ sublistId: 'item', fieldId: 'giftcertnumber', line: i, value: ... });