refund
Requires access scope or
access scope.
Returns a Refund resource by ID.
Anchor to Possible returnsPossible returns
- Anchor to RefundRefund•
The record of the line items and transactions that were refunded to a customer, along with restocking instructions for refunded line items.
- created
At •DateTime The date and time when the refund was created.
- duties•[Refund
Duty!] A list of the refunded duties as part of this refund.
- id•ID!non-null
A globally-unique ID.
- legacy
Resource •Id Unsignednon-nullInt64! The ID of the corresponding resource in the REST Admin API.
- note•String
The optional note associated with the refund.
- order•Order!non-null
The order associated with the refund.
- refund
Line Items • Refundnon-nullLine Item Connection! The
resources attached to the refund.
- refund
Shipping Lines • Refundnon-nullShipping Line Connection! The
resources attached to the refund.
- return•Return
The return associated with the refund.
- staff
Member •StaffMember The staff member who created the refund.
- total
Refunded •Set Moneynon-nullBag! The total amount across all transactions for the refund, in shop and presentment currencies.
- transactions
• Ordernon-nullTransaction Connection! The transactions associated with the refund.
- updated
At •Datenon-nullTime! The date and time when the refund was updated.
- total
Refunded •Moneynon-nullV2! The total amount across all transactions for the refund.
- created
- Get refund duties
- Get the total refunded amount
- Retrieves a specific refund
Examples
query refund($input: ID!) {
refund(id: $input) {
duties {
originalDuty {
countryCodeOfOrigin
}
amountSet {
shopMoney {
amount
}
}
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-07/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"
}
}'
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 data = await response.json();
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"
},
},
});
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)