Backend API
Retrieve an existing gift card using the ID that was returned when created.
Arguments
idobjectIdrequired
ID of the gift card to retrieve.
expandstring
Expanding link fields and child collections is performed using the expand argument.
- For example, expand=account would return a related customer account if one exists.
When the field represents a collection, you can specify the query limit.
- For example, expand=variants:10 would return up to 10 records of the variants collection.
See expanding for more details.
fieldsstring
Return only the specified fields in the result. For example fields=name,slug would return only the fields name and slug in the response. Supports nested object and array fields using dot-notation. For example, items.product_id. The gift card id is always returned.
includestring
Include one or more arbitrary queries in the response, possibly related to the main query.
See including for more details.
GET/giftcards/:id
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.get('/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
}