Gift cards
Gift cards and their balances. A card's code is shown once, when it's issued.
Endpoints#
- GET
/gift_cards.jsonList gift cards - GET
/gift_cards/count.jsonCount gift cards - GET
/gift_cards/search.jsonSearch gift cards - POST
/gift_cards/search.jsonSearch gift cards (body) - GET
/gift_cards/{id}.jsonGet a gift card - POST
/gift_cards.jsonIssue a gift card - PUT
/gift_cards/{id}.jsonUpdate a gift card - POST
/gift_cards/{id}/disable.jsonDisable a gift card - POST
/gift_cards/{id}/enable.jsonEnable a disabled gift card
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The gift card object#
What the endpoints below return for one gift card, and the payload of the gift_cards/create, gift_cards/update webhooks.
{
"id": "cm2gift01",
"last_characters": "2345",
"initial_value": "50.00",
"balance": "32.00",
"currency": "USD",
"expires_on": null,
"disabled_at": null,
"customer_id": "cm2cust01",
"order_id": null,
"note": "Apology for a delayed order",
"created_at": "2026-10-11T10:00:00.000Z",
"updated_at": "2026-10-14T16:20:00.000Z"
}List gift cards#
/gift_cards.jsonread_gift_cards| Parameter | Description |
|---|---|
limit | Results per page, 1–250 (default 50). |
page_info | Cursor from the Link header for the next or previous page. |
since_id | Only results after this id. |
ids | Comma-separated ids. |
status | enabled or disabled, or active, expired or spent. |
customer_id | Cards assigned to this customer. |
created_at_min / created_at_max, updated_at_min / updated_at_max | ISO 8601 bounds. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "gift_cards": [ … ] }Count gift cards#
/gift_cards/count.jsonread_gift_cards| Parameter | Description |
|---|---|
status, customer_id, created_at_*, updated_at_* | Same filters as the list. |
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/count.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "count": 3 }Search gift cards#
/gift_cards/search.jsonread_gift_cardsquery matches the last characters ("last_characters:2345"), the customer's email ("email:[email protected]"), a full code, or plain text against the last characters, customer email and note.
| Parameter | Description |
|---|---|
query | What to look for (see above). |
limit | Results per page, 1–250 (default 50). |
page_info | Cursor from the Link header for the next or previous page. |
since_id | Only results after this id. |
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/search.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "gift_cards": [ … ] }Search gift cards (body)#
/gift_cards/search.jsonread_gift_cardsThe same search with the query in a JSON body, for codes you'd rather not put in a URL. query matches the last characters ("last_characters:2345"), the customer's email ("email:[email protected]"), a full code, or plain text against the last characters, customer email and note.
{ "query": "ABCD EFGH JKMN 2345" }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/gift_cards/search.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "query": "ABCD EFGH JKMN 2345" }'Example responseShowHide
{ "gift_cards": [ … ] }Get a gift card#
/gift_cards/{id}.jsonread_gift_cardscurl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/$GIFT_CARD_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"gift_card": {
"id": "cm2gift01",
"last_characters": "2345",
"initial_value": "50.00",
"balance": "32.00",
"currency": "USD",
"expires_on": null,
"disabled_at": null,
"customer_id": "cm2cust01",
"order_id": null,
"note": "Apology for a delayed order",
"created_at": "2026-10-11T10:00:00.000Z",
"updated_at": "2026-10-14T16:20:00.000Z"
}
}Issue a gift card#
/gift_cards.jsonwrite_gift_cardsinitial_value is required. code is optional (12–20 letters and digits, without 0, O, 1, I or L); one is generated otherwise. The full code is only in this response: store it or send it now. send_email: true emails the code to the customer (customer_id needed).
{
"gift_card": {
"initial_value": "50.00",
"note": "Thanks for being a regular",
"expires_on": "2027-12-31",
"customer_id": "cm2cust01",
"send_email": true
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/gift_cards.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"gift_card": {
"initial_value": "50.00",
"note": "Thanks for being a regular",
"expires_on": "2027-12-31",
"customer_id": "cm2cust01",
"send_email": true
}
}'Example responseShowHide
{ "gift_card": { "id": "cm2gift09", "code": "ABCDEFGHJKMN2345", "last_characters": "2345", "initial_value": "50.00", "balance": "50.00", … } }Update a gift card#
/gift_cards/{id}.jsonwrite_gift_cardsChange note, expires_on (a date, or null for never), customer_id (or null), or disabled (true or false). The value and balance can't be changed.
{ "gift_card": { "note": "Extended as a thank you", "expires_on": "2028-06-30" } }curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/gift_cards/$GIFT_CARD_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "gift_card": { "note": "Extended as a thank you", "expires_on": "2028-06-30" } }'Example responseShowHide
{
"gift_card": {
"id": "cm2gift01",
"last_characters": "2345",
"initial_value": "50.00",
"balance": "32.00",
"currency": "USD",
"expires_on": null,
"disabled_at": null,
"customer_id": "cm2cust01",
"order_id": null,
"note": "Apology for a delayed order",
"created_at": "2026-10-11T10:00:00.000Z",
"updated_at": "2026-10-14T16:20:00.000Z"
}
}Disable a gift card#
/gift_cards/{id}/disable.jsonwrite_gift_cardsIt can't be used at checkout until it's enabled again. The balance is kept.
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/gift_cards/$GIFT_CARD_ID/disable.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"gift_card": {
"id": "cm2gift01",
"last_characters": "2345",
"initial_value": "50.00",
"balance": "32.00",
"currency": "USD",
"expires_on": null,
"disabled_at": null,
"customer_id": "cm2cust01",
"order_id": null,
"note": "Apology for a delayed order",
"created_at": "2026-10-11T10:00:00.000Z",
"updated_at": "2026-10-14T16:20:00.000Z"
}
}Enable a disabled gift card#
/gift_cards/{id}/enable.jsonwrite_gift_cardscurl -X POST "https://store.weftgrid.com/api/admin/2026-10/gift_cards/$GIFT_CARD_ID/enable.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"gift_card": {
"id": "cm2gift01",
"last_characters": "2345",
"initial_value": "50.00",
"balance": "32.00",
"currency": "USD",
"expires_on": null,
"disabled_at": null,
"customer_id": "cm2cust01",
"order_id": null,
"note": "Apology for a delayed order",
"created_at": "2026-10-11T10:00:00.000Z",
"updated_at": "2026-10-14T16:20:00.000Z"
}
}