Backend API
Update an existing gift card using the ID that was returned when created.
Arguments
Unique identifier for the gift card.
Initial gift card value. Minimum of 0.01.
Expandable link to an account where the value was redeemed as account credit, if applicable.
ID of an account where the value was redeemed as account credit, if applicable.
Amount of the gift card that has been spent on orders.
Remaining balance on the gift card.
A brief description of the occasion for generating a batch of gift cards.
ID of the associated bundle item, if applicable.
Unique code to identify the gift card.
Formatted gift card code for display purposes.
String pattern used to display the code in a human-friendly format.
Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
Currency percentage used in calculating the fixed amount.
If the gift card was generated in bulk, this will be the date it was generated.
Date the gift card will expire and can no longer be spent or redeemed. Defaults to the time period defined in gift card settings.
Expandable list of debit transactions created when the gift card is spent.
Indicates the gift card is disabled and can't be spent or redeemed further.
Last four digits of the gift card code.
Expandable link to the order that originated the gift card, if applicable.
ID of the order that originated the gift card, if applicable.
ID of the order item that originated the gift card, if applicable.
ID of the product that originated the gift card, if applicable.
Indicates the gift card was fully redeemed for account credit to account_id.
Email address of the gift card recipient, if applicable.
Customer note sent to the gift card recipient by email, if applicable.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/giftcards/{id}', {
id: '60f199509111e70000000022'
});
The gift card model
{
"id": "60f199509111e70000000022",
"amount": 100,
"amount_spent": 25,
"balance": 75,
"code": "C9X9L7D9Q3MAXC3P",
"code_formatted": "C9X9 L7D9 Q3MA XC3P",
"code_pattern": "{XXXX} {XXXX} {XXXX} {XXXX}",
"currency": "USD",
"date_created": "2021-07-16T14:36:00.142Z",
"date_updated": "2021-07-16T14:36:00.142Z",
"last4": "XC3P",
"redeemed": false,
"send_email": "friend@example.com",
"send_note": null
}