--- title: giftCard - GraphQL Admin description: Returns a gift card resource by ID. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard?example=retrieves-a-single-gift-card md: https://shopify.dev/docs/api/admin-graphql/latest/queries/giftCard.md?example=retrieves-a-single-gift-card --- # gift​Card query Requires `read_gift_cards` access scope. Returns a gift card resource by ID. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the GiftCard to return. *** ## Possible returns * Gift​Card [Gift​Card](https://shopify.dev/docs/api/admin-graphql/latest/objects/GiftCard) Represents an issued gift card. *** ## Examples * ### Receive a list of all Gift Card Adjustments #### Query ```graphql query GiftCardTransactionList($id: ID!, $firstTransactions: Int) { giftCard(id: $id) { id balance { amount currencyCode } transactions(first: $firstTransactions) { nodes { amount { amount currencyCode } } } } } ``` #### Variables ```json { "id": "gid://shopify/GiftCard/411106674", "firstTransactions": 5 } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query GiftCardTransactionList($id: ID!, $firstTransactions: Int) { giftCard(id: $id) { id balance { amount currencyCode } transactions(first: $firstTransactions) { nodes { amount { amount currencyCode } } } } }", "variables": { "id": "gid://shopify/GiftCard/411106674", "firstTransactions": 5 } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query GiftCardTransactionList($id: ID!, $firstTransactions: Int) { giftCard(id: $id) { id balance { amount currencyCode } transactions(first: $firstTransactions) { nodes { amount { amount currencyCode } } } } }`, { variables: { "id": "gid://shopify/GiftCard/411106674", "firstTransactions": 5 }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query GiftCardTransactionList($id: ID!, $firstTransactions: Int) { giftCard(id: $id) { id balance { amount currencyCode } transactions(first: $firstTransactions) { nodes { amount { amount currencyCode } } } } } QUERY variables = { "id": "gid://shopify/GiftCard/411106674", "firstTransactions": 5 } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query GiftCardTransactionList($id: ID!, $firstTransactions: Int) { giftCard(id: $id) { id balance { amount currencyCode } transactions(first: $firstTransactions) { nodes { amount { amount currencyCode } } } } }`, "variables": { "id": "gid://shopify/GiftCard/411106674", "firstTransactions": 5 }, }, }); ``` #### Response ```json { "giftCard": { "id": "gid://shopify/GiftCard/411106674", "balance": { "amount": "25.0", "currencyCode": "USD" }, "transactions": { "nodes": [] } } } ``` * ### Retrieves a single gift card #### Description The following query takes a gift card ID, and returns the balance of the gift card. #### Query ```graphql query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { giftCard(id: \"gid://shopify/GiftCard/411106674\") { balance { amount currencyCode } } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } }`, }); ``` #### Response ```json { "giftCard": { "balance": { "amount": "25.0", "currencyCode": "USD" } } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20%7B%0A%20%20giftCard\(id%3A%20%22gid%3A%2F%2Fshopify%2FGiftCard%2F411106674%22\)%20%7B%0A%20%20%20%20balance%20%7B%0A%20%20%20%20%20%20amount%0A%20%20%20%20%20%20currencyCode%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } }`, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { giftCard(id: \"gid://shopify/GiftCard/411106674\") { balance { amount currencyCode } } }" }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } }`, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } }`, }); ``` ##### Ruby ``` session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { giftCard(id: "gid://shopify/GiftCard/411106674") { balance { amount currencyCode } } } QUERY response = client.query(query: query) ``` ## Response JSON ```json { "giftCard": { "balance": { "amount": "25.0", "currencyCode": "USD" } } } ```