Anchor to return
return
query
Requires access scope.
Returns a Return resource by ID.
Anchor to Possible returnsPossible returns
- Anchor to ReturnReturn•
Represents a return.
- decline•Return
Decline Additional information about the declined return.
- exchange
Line Items • Exchangenon-nullLine Item Connection! The exchange line items attached to the return.
- id•ID!non-null
A globally-unique ID.
- name•String!non-null
The name of the return.
- order•Order!non-null
The order that the return belongs to.
- refunds
• Refundnon-nullConnection! The list of refunds associated with the return.
- return
Line Items • Returnnon-nullLine Item Type Connection! The return line items attached to the return.
- return
Shipping •Fees [Returnnon-nullShipping Fee!]! The return shipping fees for the return.
- reverse
Fulfillment Orders • Reversenon-nullFulfillment Order Connection! The list of reverse fulfillment orders for the return.
- status•Returnnon-null
Status! The status of the return.
- suggested
Refund •SuggestedReturn Refund A suggested refund for the return.
- total
Quantity •Int!non-null The sum of all return line item quantities for the return.
- decline•
Was this section helpful?
- Get status and return line items for a return
- Get status and return line items for a return (API Version 2024-04 and older)
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
return(id: "gid://shopify/Return/945000954") {
status
name
order {
id
}
returnLineItems(first: 10) {
edges {
node {
... on ReturnLineItem {
fulfillmentLineItem {
lineItem {
name
}
}
totalWeight {
value
}
}
quantity
returnReason
returnReasonNote
}
}
}
}
}`,
);
const data = await response.json();
query {
return(id: "gid://shopify/Return/945000954") {
status
name
order {
id
}
returnLineItems(first: 10) {
edges {
node {
... on ReturnLineItem {
fulfillmentLineItem {
lineItem {
name
}
}
totalWeight {
value
}
}
quantity
returnReason
returnReasonNote
}
}
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { return(id: \"gid://shopify/Return/945000954\") { status name order { id } returnLineItems(first: 10) { edges { node { ... on ReturnLineItem { fulfillmentLineItem { lineItem { name } } totalWeight { value } } quantity returnReason returnReasonNote } } } } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
return(id: "gid://shopify/Return/945000954") {
status
name
order {
id
}
returnLineItems(first: 10) {
edges {
node {
... on ReturnLineItem {
fulfillmentLineItem {
lineItem {
name
}
}
totalWeight {
value
}
}
quantity
returnReason
returnReasonNote
}
}
}
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
return(id: "gid://shopify/Return/945000954") {
status
name
order {
id
}
returnLineItems(first: 10) {
edges {
node {
... on ReturnLineItem {
fulfillmentLineItem {
lineItem {
name
}
}
totalWeight {
value
}
}
quantity
returnReason
returnReasonNote
}
}
}
}
}`,
});
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 {
return(id: "gid://shopify/Return/945000954") {
status
name
order {
id
}
returnLineItems(first: 10) {
edges {
node {
... on ReturnLineItem {
fulfillmentLineItem {
lineItem {
name
}
}
totalWeight {
value
}
}
quantity
returnReason
returnReasonNote
}
}
}
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"return": {
"status": "OPEN",
"name": "#1001-R1",
"order": {
"id": "gid://shopify/Order/625362839"
},
"returnLineItems": {
"edges": [
{
"node": {
"fulfillmentLineItem": {
"lineItem": {
"name": "Draft - 151cm"
}
},
"totalWeight": {
"value": 1500
},
"quantity": 1,
"returnReason": "UNKNOWN",
"returnReasonNote": ""
}
}
]
}
}
}