---
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: unstable
api_name: admin
source_url:
html: 'https://shopify.dev/docs/api/admin-graphql/unstable/queries/refund'
md: 'https://shopify.dev/docs/api/admin-graphql/unstable/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
[ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID)
required
The ID of the Refund to return.
***
## Possible returns
* Refund
[Refund](https://shopify.dev/docs/api/admin-graphql/unstable/objects/Refund)
The `Refund` object 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.
The `Refund` object provides information to:
* Process customer returns and issue payments back to customers
* Handle partial or full refunds for line items with optional inventory restocking
* Refund shipping costs, duties, and additional fees
* Issue store credit refunds as an alternative to original payment method returns
* Track and reconcile all financial transactions related to refunds
Each `Refund` object maintains detailed records of what was refunded, how much was refunded, which payment transactions were involved, and any inventory restocking that occurred. The refund can include multiple components such as product line items, shipping charges, taxes, duties, and additional fees, all calculated with proper currency handling for international orders.
Refunds are always associated with an [order](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) and can optionally be linked to a [return](https://shopify.dev/docs/api/admin-graphql/latest/objects/Return) if the refund was initiated through the returns process. The refund tracks both the presentment currency (what the customer sees) and the shop currency for accurate financial reporting.
***
**Note:** The existence of a \Refund\ object doesn\'t guarantee that the money has been returned to the customer. The actual financial processing happens through associated \\\Order\Transaction\\\ objects, which can be in various states, such as pending, processing, success, or failure. To determine if money has actually been refunded, check the \status\ of the associated transactions.
***
Learn more about [managing returns](https://shopify.dev/docs/apps/build/orders-fulfillment/returns-apps/build-return-management), [refunding duties](https://shopify.dev/docs/apps/build/orders-fulfillment/returns-apps/view-and-refund-duties), and [processing refunds](https://shopify.dev/docs/api/admin-graphql/latest/mutations/refundCreate).
* additionalFees
[\[RefundAdditionalFee!\]!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/RefundAdditionalFee)
non-null
A list of the refunded additional fees as part of this refund.
* createdAt
[DateTime](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime)
The date and time when the refund was created.
* duties
[\[RefundDuty!\]](https://shopify.dev/docs/api/admin-graphql/unstable/objects/RefundDuty)
A list of the refunded duties as part of this refund.
* id
[ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID)
non-null
A globally-unique ID.
* legacyResourceId
[UnsignedInt64!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/UnsignedInt64)
non-null
The ID of the corresponding resource in the REST Admin API.
* note
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The optional note associated with the refund.
* order
[Order!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/Order)
non-null
The order associated with the refund.
* orderAdjustments
[OrderAdjustmentConnection!](https://shopify.dev/docs/api/admin-graphql/unstable/connections/OrderAdjustmentConnection)
non-null
The order adjustments that are attached with the refund.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
***
* processedAt
[DateTime!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime)
non-null
The date and time when the refund was processed.
* refundLineItems
[RefundLineItemConnection!](https://shopify.dev/docs/api/admin-graphql/unstable/connections/RefundLineItemConnection)
non-null
The `RefundLineItem` resources attached to the refund.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
***
* refundShippingLines
[RefundShippingLineConnection!](https://shopify.dev/docs/api/admin-graphql/unstable/connections/RefundShippingLineConnection)
non-null
The `RefundShippingLine` resources attached to the refund.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
***
* return
[Return](https://shopify.dev/docs/api/admin-graphql/unstable/objects/Return)
The return associated with the refund.
* staffMember
[StaffMember](https://shopify.dev/docs/api/admin-graphql/unstable/objects/StaffMember)
The staff member who created the refund.
* totalRefundedSet
[MoneyBag!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/MoneyBag)
non-null
The total amount across all transactions for the refund, in shop and presentment currencies.
* includeIncompleteTransactions
[Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean)
Default:false
### Arguments
Whether to include refund transactions which have not completed yet (e.g delayed refunds).
***
* transactions
[OrderTransactionConnection!](https://shopify.dev/docs/api/admin-graphql/unstable/connections/OrderTransactionConnection)
non-null
The transactions associated with the refund.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
***
* updatedAt
[DateTime!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime)
non-null
The date and time when the refund was updated.
* totalRefunded
[MoneyV2!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/MoneyV2)
non-nullDeprecated
***
## 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/unstable/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"
},
},
});
```
#### Shopify CLI
```bash
shopify app execute \
--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/unstable/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"
},
},
});
```
#### Shopify CLI
```bash
shopify app execute \
--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/unstable/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"
},
},
});
```
#### Shopify CLI
```bash
shopify app execute \
--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"
}
}
}
}
```