--- title: Gift Card description: Create and manage gift card codes, which can be entered at checkout to pay using a gift card. api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card md: https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Gift Card Requires `gift_cards` access scope. Note You need to contact Shopify Support to request the `write_gift_cards` and `read_gift_cards` [access scopes](https://shopify.dev/docs/admin-api/access-scopes). A gift card is an alternative payment method. Each gift card has a unique code that is entered during checkout. Its balance can be redeemed over multiple checkouts. Optionally, a gift card can assigned to a specific customer. Gift card codes cannot be retrieved after they're created—only the last four characters can be retrieved. You can use the GiftCard resource to create, retrieve, and update gift cards for a store. After a gift card is created, only the expiry date, note, and template suffix can be updated. Note You can't delete gift cards, but you can disable them. You can't enable gift cards that were previously disabled. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#post-gift-cards) [/admin/api/latest/gift\_​cards.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#post-gift-cards) Creates a gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardCreate?example=creates-a-gift-card) [giftCardCreate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardCreate?example=creates-a-gift-card) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#post-gift-cards-gift-card-id-disable) [/admin/api/latest/gift\_​cards/{gift\_​card\_​id}/disable.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#post-gift-cards-gift-card-id-disable) Disables a gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardDeactivate?example=disables-a-gift-card) [giftCardDeactivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardDeactivate?example=disables-a-gift-card) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards?status=enabled) [/admin/api/latest/gift\_​cards.​json?status=enabled](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards?status=enabled) Retrieves a list of gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=retrieves-a-list-of-gift-cards) [giftCards](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=retrieves-a-list-of-gift-cards) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-gift-card-id) [/admin/api/latest/gift\_​cards/{gift\_​card\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-gift-card-id) Retrieves a single gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard?example=retrieves-a-single-gift-card) [giftCard](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard?example=retrieves-a-single-gift-card) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-count) [/admin/api/latest/gift\_​cards/count.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-count) Retrieves a count of gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCardsCount?example=retrieves-a-count-of-gift-cards) [giftCardsCount](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCardsCount?example=retrieves-a-count-of-gift-cards) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-search?query=last-characters:mnop) [/admin/api/latest/gift\_​cards/search.​json?query=last\_​characters:mnop](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#get-gift-cards-search?query=last-characters:mnop) Searches for gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=searches-for-gift-cards) [giftCards](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=searches-for-gift-cards) * [put](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#put-gift-cards-gift-card-id) [/admin/api/latest/gift\_​cards/{gift\_​card\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card#put-gift-cards-gift-card-id) Updates an existing gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardUpdate) [giftCardUpdate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardUpdate) *** ## The Gift Card resource ### Properties *** api\_client\_id deprecated The ID of the client that issued the gift card. *** balance string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.balance) [balance](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.balance) The balance of the gift card. *** code The gift card code, which is a string of alphanumeric characters. For security reasons, this is available only upon creation of the gift card. (minimum: 8 characters, maximum: 20 characters) *** created\_at -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.createdAt) [createdAt](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.createdAt) The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the gift card was created. *** currency string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.balance) [balance](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.balance) The currency of the gift card. *** customer\_id -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.customer) [customer](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.customer) The ID of the customer associated with this gift card. *** disabled\_at -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.deactivatedAt) [deactivatedAt](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.deactivatedAt) The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the gift card was disabled. *** expires\_on -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.expiresOn) [expiresOn](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.expiresOn) The date (`YYYY-MM-DD` format) when the gift card expires. Returns `null` if the gift card doesn't have an expiration date. *** id -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.id) [id](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.id) The ID of the gift card. *** initial\_value string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.initialValue) [initialValue](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.initialValue) The initial value of the gift card when it was created. *** last\_characters -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.lastCharacters) [lastCharacters](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard#field-GiftCard.fields.lastCharacters) The last four characters of the gift card code. Because gift cards are alternative payment methods, the full code cannot be retrieved. *** line\_item\_id deprecated The ID of the line item that initiated the creation of this gift card, if it was created by an order. *** {} ## The Gift Card resource ```json { "api_client_id": 431223487, "balance": "80.17", "code": "1234 4567 8901 2ABC", "created_at": "2008-12-31T19:00:00-05:00", "currency": "CAD", "customer_id": 368407052327, "disabled_at": "2009-01-31T19:00:00-05:00", "expires_on": "2020-01-31", "id": 989034056, "initial_value": "100.00", "last_characters": "2ABC", "line_item_id": 241253183, "note": "A note", "order_id": 241253183, "template_suffix": "birthday", "user_id": 876543210, "updated_at": "2009-01-31T19:00:00-05:00" } ``` *** ## postCreates a gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardCreate?example=creates-a-gift-card) [giftCardCreate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardCreate?example=creates-a-gift-card) Creates a gift card. There are additional optional parameters that can be specified in the body of the request when creating a gift card: ### Parameters *** api\_version string required *** customer\_id The ID of the customer that purchased the gift card. *** recipient\_id The ID of the intended recipient of the gift card. This property should be used if the recipientis different from the purchaser. The customer with this ID must have an email address. *** ### Examples Create a gift card with a custom code Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.note:​"This is a note" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-note) [note](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-note) An optional note that a merchant can attach to the gift card that isn't visible to customers. gift\_​card.initial\_​value:​"100.00" string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) [initialValue](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) The initial value of the gift card when it was created. gift\_​card.code:​"ABCD EFGH IJKL MNOP" The gift card code, which is a string of alphanumeric characters. For security reasons, this is available only upon creation of the gift card. (minimum: 8 characters, maximum: 20 characters) gift\_​card.template\_​suffix:​"gift\_cards.birthday.liquid" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-templateSuffix) [templateSuffix](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-templateSuffix) The suffix of the Liquid template that's used to render the gift card online. For example, if the value is `birthday`, then the gift card is rendered using the template `gift_card.birthday.liquid`. When the value is `null`, the default `gift_card.liquid` template is used. Create a gift card with an automatically generated code Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.initial\_​value:​"25.00" string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) [initialValue](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) The initial value of the gift card when it was created. Create a scheduled gift card with a recipient and a message Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.initial\_​value:​"100.00" string -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) [initialValue](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardCreateInput#fields-initialValue) The initial value of the gift card when it was created. post ## /admin/api/2025-10/gift\_​cards.​json ```bash curl -d '{"gift_card":{"note":"This is a note","initial_value":"100.00","code":"ABCD EFGH IJKL MNOP","template_suffix":"gift_cards.birthday.liquid"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "gift_card": { "id": 1063936321, "balance": "100.00", "created_at": "2025-10-01T15:04:48-04:00", "updated_at": "2025-10-01T15:04:48-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop" } } ``` ### examples * #### Create a gift card with a custom code ##### ```curl curl -d '{"gift_card":{"note":"This is a note","initial_value":"100.00","code":"ABCD EFGH IJKL MNOP","template_suffix":"gift_cards.birthday.liquid"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.note = "This is a note"; gift_card.initial_value = "100.00"; gift_card.code = "ABCD EFGH IJKL MNOP"; gift_card.template_suffix = "gift_cards.birthday.liquid"; await gift_card.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.note = "This is a note" gift_card.initial_value = "100.00" gift_card.code = "ABCD EFGH IJKL MNOP" gift_card.template_suffix = "gift_cards.birthday.liquid" gift_card.save! ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.note = "This is a note"; gift_card.initial_value = "100.00"; gift_card.code = "ABCD EFGH IJKL MNOP"; gift_card.template_suffix = "gift_cards.birthday.liquid"; await gift_card.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"gift_card":{"id":1063936321,"balance":"100.00","created_at":"2025-10-01T15:04:48-04:00","updated_at":"2025-10-01T15:04:48-04:00","currency":"USD","initial_value":"100.00","disabled_at":null,"line_item_id":null,"api_client_id":755357713,"user_id":null,"customer_id":null,"note":"This is a note","expires_on":null,"template_suffix":"gift_cards.birthday.liquid","last_characters":"mnop","order_id":null,"code":"abcdefghijklmnop"}} ``` * #### Create a gift card with an automatically generated code ##### ```curl curl -d '{"gift_card":{"initial_value":"25.00"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.initial_value = "25.00"; await gift_card.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.initial_value = "25.00" gift_card.save! ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.initial_value = "25.00"; await gift_card.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"gift_card":{"id":1063936319,"balance":"25.00","created_at":"2025-10-01T15:04:46-04:00","updated_at":"2025-10-01T15:04:46-04:00","currency":"USD","initial_value":"25.00","disabled_at":null,"line_item_id":null,"api_client_id":755357713,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"last_characters":"9ea8","order_id":null,"code":"aa445b29ag249ea8"}} ``` * #### Create a scheduled gift card with a recipient and a message ##### ```curl curl -d '{"gift_card":{"initial_value":"100.00","recipient_id":207119551,"message":"Happy birthday!","send_on":"2023-12-31"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.initial_value = "100.00"; gift_card.recipient_id = 207119551; gift_card.message = "Happy birthday!"; gift_card.send_on = "2023-12-31"; await gift_card.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.initial_value = "100.00" gift_card.recipient_id = 207119551 gift_card.message = "Happy birthday!" gift_card.send_on = "2023-12-31" gift_card.save! ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.initial_value = "100.00"; gift_card.recipient_id = 207119551; gift_card.message = "Happy birthday!"; gift_card.send_on = "2023-12-31"; await gift_card.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"gift_card":{"id":1063936318,"balance":"100.00","created_at":"2023-11-30T19:00:00-05:00","updated_at":"2023-11-30T19:00:00-05:00","currency":"USD","initial_value":"100.00","disabled_at":null,"line_item_id":null,"api_client_id":755357713,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"last_characters":"9993","order_id":null,"code":"g68fd93eb4de9993"}} ``` *** ## postDisables a gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardDeactivate?example=disables-a-gift-card) [giftCardDeactivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardDeactivate?example=disables-a-gift-card) Disables a gift card. This action can't be undone. ### Parameters *** api\_version string required *** gift\_card\_id string required *** ### Examples Disable a gift card Path parameters gift\_​card\_​id=​1035197676 string required Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.id:​1035197676 The ID of the gift card. post ## /admin/api/2025-10/gift\_​cards/1035197676/disable.​json ```bash curl -d '{"gift_card":{"id":1035197676}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676/disable.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "gift_card": { "disabled_at": "2025-10-01T15:04:36-04:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "id": 1035197676, "created_at": "2025-10-01T15:04:04-04:00", "updated_at": "2025-10-01T15:04:36-04:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null } } ``` ### examples * #### Disable a gift card ##### ```curl curl -d '{"gift_card":{"id":1035197676}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676/disable.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.id = 1035197676; await gift_card.disable({ body: {"gift_card": {"id": 1035197676}}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.id = 1035197676 gift_card.disable( session: test_session, body: {"gift_card" => {"id" => 1035197676}}, ) ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; await gift_card.disable({ body: {"gift_card": {"id": 1035197676}}, }); ``` #### response ```json HTTP/1.1 201 Created{"gift_card":{"disabled_at":"2025-10-01T15:04:36-04:00","template_suffix":null,"initial_value":"100.00","balance":"100.00","id":1035197676,"created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:36-04:00","currency":"USD","line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"last_characters":"0d0d","order_id":null}} ``` *** ## getRetrieves a list of gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=retrieves-a-list-of-gift-cards) [giftCards](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=retrieves-a-list-of-gift-cards) Retrieves a list of gift cards. **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** limit ≤ 250 default 50 The maximum number of results to show. *** since\_id Restrict results to after the specified ID. *** status Retrieve gift cards with a given status. Valid values: Show status properties * **enabled**: Restrict results to only enabled gift cards * **disabled**: Restrict results to only disabled gift cards *** ### Examples Retrieve a list of all enabled gift cards Query parameters status=​enabled Retrieve gift cards with a given status. Valid values: Show status properties * **enabled**: Restrict results to only enabled gift cards * **disabled**: Restrict results to only disabled gift cards Retrieve a list of all gift cards get ## /admin/api/2025-10/gift\_​cards.​json?status=​enabled ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json?status=enabled" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "gift_cards": [ { "id": 766118925, "balance": "25.00", "created_at": "2025-10-01T15:04:04-04:00", "updated_at": "2025-10-01T15:04:04-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2024-10-01", "template_suffix": null, "notify": true, "last_characters": "0e0e", "order_id": null }, { "id": 10274553, "balance": "0.00", "created_at": "2025-10-01T15:04:04-04:00", "updated_at": "2025-10-01T15:04:04-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "0y0y", "order_id": null } ] } ``` ### examples * #### Retrieve a list of all enabled gift cards ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json?status=enabled" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.all({ session: session, status: "enabled", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.all( session: test_session, status: "enabled", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.all({ session: session, status: "enabled", }); ``` #### response ```json HTTP/1.1 200 OK{"gift_cards":[{"id":766118925,"balance":"25.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"50.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":"2024-10-01","template_suffix":null,"notify":true,"last_characters":"0e0e","order_id":null},{"id":10274553,"balance":"0.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"50.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"notify":true,"last_characters":"0y0y","order_id":null}]} ``` * #### Retrieve a list of all gift cards ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.all({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"gift_cards":[{"id":1035197676,"balance":"100.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"100.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"notify":true,"last_characters":"0d0d","order_id":null},{"id":766118925,"balance":"25.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"50.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":"2024-10-01","template_suffix":null,"notify":true,"last_characters":"0e0e","order_id":null},{"id":10274553,"balance":"0.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"50.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"notify":true,"last_characters":"0y0y","order_id":null}]} ``` *** ## getRetrieves a single gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard?example=retrieves-a-single-gift-card) [giftCard](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard?example=retrieves-a-single-gift-card) Retrieves a single gift card by its ID ### Parameters *** api\_version string required *** gift\_card\_id string required *** ### Examples Retrieve a single gift card Path parameters gift\_​card\_​id=​1035197676 string required get ## /admin/api/2025-10/gift\_​cards/1035197676.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "gift_card": { "id": 1035197676, "balance": "100.00", "created_at": "2025-10-01T15:04:04-04:00", "updated_at": "2025-10-01T15:04:04-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null } } ``` ### examples * #### Retrieve a single gift card ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.find({ session: session, id: 1035197676, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.find( session: test_session, id: 1035197676, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.find({ session: session, id: 1035197676, }); ``` #### response ```json HTTP/1.1 200 OK{"gift_card":{"id":1035197676,"balance":"100.00","created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:04-04:00","currency":"USD","initial_value":"100.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"last_characters":"0d0d","order_id":null}} ``` *** ## getRetrieves a count of gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCardsCount?example=retrieves-a-count-of-gift-cards) [giftCardsCount](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCardsCount?example=retrieves-a-count-of-gift-cards) Retrieves a count of gift cards with a given status. ### Parameters *** api\_version string required *** status Count gift cards with a given status. Valid values: Show status properties * **enabled**: Count only enabled gift cards * **disabled**: Count only disabled gift cards *** ### Examples Retrieve a count of all gift cards Retrieve a count of enabled gift cards Query parameters status=​enabled Count gift cards with a given status. Valid values: Show status properties * **enabled**: Count only enabled gift cards * **disabled**: Count only disabled gift cards get ## /admin/api/2025-10/gift\_​cards/count.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "count": 3 } ``` ### examples * #### Retrieve a count of all gift cards ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.count({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.count( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.count({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"count":3} ``` * #### Retrieve a count of enabled gift cards ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/count.json?status=enabled" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.count({ session: session, status: "enabled", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.count( session: test_session, status: "enabled", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.count({ session: session, status: "enabled", }); ``` #### response ```json HTTP/1.1 200 OK{"count":3} ``` *** ## getSearches for gift cards [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=searches-for-gift-cards) [giftCards](https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCards?example=searches-for-gift-cards) Searches for gift cards that match a supplied query. The following fields are indexed by search: * `created_at` * `updated_at` * `disabled_at` * `balance` * `initial_value` * `amount_spent` * `email` * `last_characters` **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** created\_at\_max date ISO 8601 Show gift cards created at or before date. *** created\_at\_min date ISO 8601 Show gift cards created at or after date. *** fields Show only certain fields, specified by a comma-separated list of field names. *** limit ≤ 250 default 50 The maximum number of results to retrieve. *** order default disabled\_at DESC The field and direction to order results by. *** query The text to search for. *** updated\_at\_max date ISO 8601 Show gift cards last updated at or before date. *** updated\_at\_min date ISO 8601 Show gift cards last updated at or after date. *** ### Examples Retrieve all gift cards with the last characters "mnop" Query parameters query=​last\_characters:mnop The text to search for. get ## /admin/api/2025-10/gift\_​cards/search.​json?query=​last\_characters:mnop ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/search.json?query=last_characters%3Amnop" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "gift_cards": [ { "id": 1063936322, "balance": "10.00", "created_at": "2025-10-01T15:04:49-04:00", "updated_at": "2025-10-01T15:04:49-04:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "mnop", "order_id": null } ] } ``` ### examples * #### Retrieve all gift cards with the last characters "mnop" ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/search.json?query=last_characters%3Amnop" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.GiftCard.search({ session: session, query: "last_characters:mnop", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::GiftCard.search( session: test_session, query: "last_characters:mnop", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.GiftCard.search({ session: session, query: "last_characters:mnop", }); ``` #### response ```json HTTP/1.1 200 OK{"gift_cards":[{"id":1063936322,"balance":"10.00","created_at":"2025-10-01T15:04:49-04:00","updated_at":"2025-10-01T15:04:49-04:00","currency":"USD","initial_value":"10.00","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"expires_on":null,"template_suffix":null,"notify":true,"last_characters":"mnop","order_id":null}]} ``` *** ## putUpdates an existing gift card [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardUpdate) [giftCardUpdate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/giftCardUpdate) Updates an existing gift card. Expiry date, note, and template suffix properties of a gift card can be changed via the API. A customer ID can only be set if the current value is \`null\`. ### Parameters *** api\_version string required *** gift\_card\_id string required *** ### Examples Update the expiry date of a gift card Path parameters gift\_​card\_​id=​1035197676 string required Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.id:​1035197676 The ID of the gift card. gift\_​card.expires\_​on:​"2020-01-01" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardUpdateInput#fields-expiresOn) [expiresOn](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardUpdateInput#fields-expiresOn) The date (`YYYY-MM-DD` format) when the gift card expires. Returns `null` if the gift card doesn't have an expiration date. Update the note of a gift card Path parameters gift\_​card\_​id=​1035197676 string required Request body gift\_​card​ Gift\_card resource Show gift\_card properties gift\_​card.id:​1035197676 The ID of the gift card. gift\_​card.note:​"Updating with a new note" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardUpdateInput#fields-note) [note](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/GiftCardUpdateInput#fields-note) An optional note that a merchant can attach to the gift card that isn't visible to customers. put ## /admin/api/2025-10/gift\_​cards/1035197676.​json ```bash curl -d '{"gift_card":{"id":1035197676,"expires_on":"2020-01-01"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "gift_card": { "expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "id": 1035197676, "created_at": "2025-10-01T15:04:04-04:00", "updated_at": "2025-10-01T15:04:40-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "last_characters": "0d0d", "order_id": null } } ``` ### examples * #### Update the expiry date of a gift card ##### ```curl curl -d '{"gift_card":{"id":1035197676,"expires_on":"2020-01-01"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.id = 1035197676; gift_card.expires_on = "2020-01-01"; await gift_card.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.id = 1035197676 gift_card.expires_on = "2020-01-01" gift_card.save! ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; gift_card.expires_on = "2020-01-01"; await gift_card.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"gift_card":{"expires_on":"2020-01-01","template_suffix":null,"initial_value":"100.00","balance":"100.00","id":1035197676,"created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:40-04:00","currency":"USD","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"note":null,"last_characters":"0d0d","order_id":null}} ``` * #### Update the note of a gift card ##### ```curl curl -d '{"gift_card":{"id":1035197676,"note":"Updating with a new note"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/gift_cards/1035197676.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const gift_card = new admin.rest.resources.GiftCard({session: session}); gift_card.id = 1035197676; gift_card.note = "Updating with a new note"; await gift_card.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session gift_card = ShopifyAPI::GiftCard.new(session: test_session) gift_card.id = 1035197676 gift_card.note = "Updating with a new note" gift_card.save! ``` ##### ```node // Session is built by the OAuth process const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; gift_card.note = "Updating with a new note"; await gift_card.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"gift_card":{"note":"Updating with a new note","template_suffix":null,"initial_value":"100.00","balance":"100.00","id":1035197676,"created_at":"2025-10-01T15:04:04-04:00","updated_at":"2025-10-01T15:04:49-04:00","currency":"USD","disabled_at":null,"line_item_id":null,"api_client_id":null,"user_id":null,"customer_id":null,"expires_on":null,"last_characters":"0d0d","order_id":null}} ```