--- title: refund - GraphQL Admin description: >- Retrieves a [refund](https://shopify.dev/docs/api/admin-graphql/latest/objects/Refund) by its ID. A refund represents a financial record of money returned to a customer from an order. It provides a comprehensive view of all refunded amounts, transactions, and restocking instructions associated with returning products or correcting order issues. Use the `refund` query to retrieve information associated with the following workflows: - Displaying refund details in order management interfaces - Building customer service tools for reviewing refund history - Creating reports on refunded amounts and reasons - Auditing refund transactions and payment gateway records - Tracking inventory impacts from refunded items A refund is associated with an [order](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) and includes [refund line items](https://shopify.dev/docs/api/admin-graphql/latest/objects/RefundLineItem) that specify which items were refunded. Each refund processes through [order transactions](https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderTransaction) that handle the actual money transfer back to the customer. api_version: 2026-01 api_name: admin type: query api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/refund' md: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/refund.md' --- # refund query Requires `read_orders` access scope or `read_marketplace_orders` access scope. Retrieves a [refund](https://shopify.dev/docs/api/admin-graphql/latest/objects/Refund) by its ID. A refund represents a financial record of money returned to a customer from an order. It provides a comprehensive view of all refunded amounts, transactions, and restocking instructions associated with returning products or correcting order issues. Use the `refund` query to retrieve information associated with the following workflows: * Displaying refund details in order management interfaces * Building customer service tools for reviewing refund history * Creating reports on refunded amounts and reasons * Auditing refund transactions and payment gateway records * Tracking inventory impacts from refunded items A refund is associated with an [order](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) and includes [refund line items](https://shopify.dev/docs/api/admin-graphql/latest/objects/RefundLineItem) that specify which items were refunded. Each refund processes through [order transactions](https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderTransaction) that handle the actual money transfer back to the customer. ## Arguments * id *** ## Possible returns * Refund *** ## Examples * ### Get refund duties #### Description The following query retrieves a refund by its ID and returns the refund duties. #### Query ```graphql query refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } } ``` #### Variables ```json { "input": "gid://shopify/Refund/850600470" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } }", "variables": { "input": "gid://shopify/Refund/850600470" } }' ``` #### 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 refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } }`, { variables: { "input": "gid://shopify/Refund/850600470" }, }, ); 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 refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } } QUERY variables = { "input": "gid://shopify/Refund/850600470" } 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 refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } }`, "variables": { "input": "gid://shopify/Refund/850600470" }, }, }); ``` #### Response ```json { "refund": { "duties": [ { "originalDuty": { "countryCodeOfOrigin": "US" }, "amountSet": { "shopMoney": { "amount": "6.0" } } } ] } } ``` * ### Get the total refunded amount #### Description The following query retrieves a refund by its ID and returns the total refunded amount. #### Query ```graphql query refund($input: ID!) { refund(id: $input) { totalRefundedSet { shopMoney { amount currencyCode } } } } ``` #### Variables ```json { "input": "gid://shopify/Refund/196417871" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query refund($input: ID!) { refund(id: $input) { totalRefundedSet { shopMoney { amount currencyCode } } } }", "variables": { "input": "gid://shopify/Refund/196417871" } }' ``` #### 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 refund($input: ID!) { refund(id: $input) { totalRefundedSet { shopMoney { amount currencyCode } } } }`, { variables: { "input": "gid://shopify/Refund/196417871" }, }, ); 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 refund($input: ID!) { refund(id: $input) { totalRefundedSet { shopMoney { amount currencyCode } } } } QUERY variables = { "input": "gid://shopify/Refund/196417871" } 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 refund($input: ID!) { refund(id: $input) { totalRefundedSet { shopMoney { amount currencyCode } } } }`, "variables": { "input": "gid://shopify/Refund/196417871" }, }, }); ``` #### Response ```json { "refund": { "totalRefundedSet": { "shopMoney": { "amount": "5.75", "currencyCode": "USD" } } } } ``` * ### Retrieves a specific refund #### Query ```graphql query RefundShow($id: ID!) { refund(id: $id) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } } ``` #### Variables ```json { "id": "gid://shopify/Refund/196417871" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query RefundShow($id: ID!) { refund(id: $id) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } }", "variables": { "id": "gid://shopify/Refund/196417871" } }' ``` #### 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 RefundShow($id: ID!) { refund(id: $id) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } }`, { variables: { "id": "gid://shopify/Refund/196417871" }, }, ); 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 RefundShow($id: ID!) { refund(id: $id) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } } QUERY variables = { "id": "gid://shopify/Refund/196417871" } 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 RefundShow($id: ID!) { refund(id: $id) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } }`, "variables": { "id": "gid://shopify/Refund/196417871" }, }, }); ``` #### Response ```json { "refund": { "id": "gid://shopify/Refund/196417871", "note": "free shipping", "totalRefundedSet": { "presentmentMoney": { "amount": "5.75", "currencyCode": "USD" } } } } ```