The Gift Certificate can be applied to a Sales Order in NetSuite under the Billing Subtab > Payments > Gift Certificate
The Gift Certificate can be applied only if the sales order in which the gift card was purchased is billed.
A Gift Certificate item when ordered in NetSuite creates a respective automated unique Gift Certificate with a unique code. This code is applied to the payments.
Navigation:
Lists -> Accounting -> Gift Certificates
The following is the code snippet:
salesOrder.selectNewLine({ sublistId: 'giftcertredemption' });
salesOrder.setCurrentSublistValue({ sublistId: 'giftcertredemption', fieldId: 'authcode', value: netSuiteGiftCardId });
salesOrder.setCurrentSublistValue({ sublistId: 'giftcertredemption', fieldId: 'amount', value: giftCard.amount });
salesOrder.commitLine({ sublistId: 'giftcertredemption' });