Browse the API docs

Gift cards

Gift cards and their balances. A card's code is shown once, when it's issued.

Endpoints#

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.

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"
}

List gift cards#

GET/gift_cards.jsonread_gift_cards
Query parameters
ParameterDescription
limitResults per page, 1–250 (default 50).
page_infoCursor from the Link header for the next or previous page.
since_idOnly results after this id.
idsComma-separated ids.
statusenabled or disabled, or active, expired or spent.
customer_idCards assigned to this customer.
created_at_min / created_at_max, updated_at_min / updated_at_maxISO 8601 bounds.
fieldsComma-separated fields to return.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "gift_cards": [ … ] }

Count gift cards#

GET/gift_cards/count.jsonread_gift_cards
Query parameters
ParameterDescription
status, customer_id, created_at_*, updated_at_*Same filters as the list.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/count.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "count": 3 }

Search gift cards#

GET/gift_cards/search.jsonread_gift_cards

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 parameters
ParameterDescription
queryWhat to look for (see above).
limitResults per page, 1–250 (default 50).
page_infoCursor from the Link header for the next or previous page.
since_idOnly results after this id.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/search.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "gift_cards": [ … ] }

Search gift cards (body)#

POST/gift_cards/search.jsonread_gift_cards

The 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.

Request body
{ "query": "ABCD EFGH JKMN 2345" }
Request with curl
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 responseShow
{ "gift_cards": [ … ] }

Get a gift card#

GET/gift_cards/{id}.jsonread_gift_cards
Request
curl "https://store.weftgrid.com/api/admin/2026-10/gift_cards/$GIFT_CARD_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "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#

POST/gift_cards.jsonwrite_gift_cards

initial_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).

Request body
{
  "gift_card": {
    "initial_value": "50.00",
    "note": "Thanks for being a regular",
    "expires_on": "2027-12-31",
    "customer_id": "cm2cust01",
    "send_email": true
  }
}
Request with curl
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 responseShow
{ "gift_card": { "id": "cm2gift09", "code": "ABCDEFGHJKMN2345", "last_characters": "2345", "initial_value": "50.00", "balance": "50.00", … } }

Update a gift card#

PUT/gift_cards/{id}.jsonwrite_gift_cards

Change 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.

Request body
{ "gift_card": { "note": "Extended as a thank you", "expires_on": "2028-06-30" } }
Request with curl
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 responseShow
{
  "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#

POST/gift_cards/{id}/disable.jsonwrite_gift_cards

It can't be used at checkout until it's enabled again. The balance is kept.

Request
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 responseShow
{
  "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#

POST/gift_cards/{id}/enable.jsonwrite_gift_cards
Request
curl -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 responseShow
{
  "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"
  }
}