Gift Cards API Routes
A gift card is a prepaid card that can be used to pay for items during checkout. Gift cards can be purchased by customers, or created by admin users. When a gift card is redeemed, its amount is added to the customer's store credit account, which can then be used to pay for items during checkout. These API routes allow admin users to manage gift cards, transfer gift cards between customers, and more.
Gift Card routes are only available through the Loyalty Plugin.
GET /admin/gift-cards#
List Gift Cards
Retrieve a list of gift cards. The gift cards can be filtered by fields such as id. The gift cards can also be sorted or paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
idstring | string[]Optionalcustomer_idstring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumbergift_cardsobject[]The list of gift cards.
gift_cardsobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/gift-cards#
Create Gift Card
Create a gift card.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request body (application/json)
codestringvaluenumber20currency_codestringusdexpires_atstringreference_idstringreferencestringline_item_idstringcustomer_idstringmetadataobjectRequest examples
Responses
200 OK
gift_cardobjectThe gift card's details.
gift_cardobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/gift-cards/{id}#
Get a Gift Card
Retrieve a gift card by its ID. You can expand the gift card's relations or select the fields that should be returned.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
gift_cardobjectThe gift card's details.
gift_cardobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/gift-cards/{id}#
Update a Gift Card
Update a gift card's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
status"pending" | "redeemed"OptionalvaluenumberOptionalcustomer_idstringOptionalcurrency_codestringOptionalusdnotestringOptionalexpires_atstringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
gift_cardobjectThe gift card's details.
gift_cardobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/gift-cards/{id}/orders#
List Gift Card's Orders
Retrieve the list of orders that a gift card was used in.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.