Menu
returnReasonDefinitions
Returns the full library of available return reason definitions. Use this query to retrieve the standardized return reasons available for creating returns.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the returnReasonDefinitions action (under Return).
- Fill in the fields below, then reference the result from later steps as
{{returnreasondefinitions.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query ReturnReasonDefinitions($ids: [ID!], $handles: [String!], $first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: ReturnReasonDefinitionSortKeys, $query: String) {
returnReasonDefinitions(
ids: $ids
handles: $handles
first: $first
after: $after
last: $last
before: $before
reverse: $reverse
sortKey: $sortKey
query: $query
) {
edges {
cursor
node {
deleted
handle
id
name
}
}
nodes {
deleted
handle
id
name
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"ids": [
"string"
],
"handles": [
"string"
],
"first": 0,
"after": "string",
"last": 0,
"before": "string",
"reverse": false,
"sortKey": "HANDLE",
"query": "string"
}
Response
Read the result with {{returnreasondefinitions.response.data.data.returnReasonDefinitions}}. If the API returns errors, the step fails and they are at {{returnreasondefinitions.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?