@KyleG-Shopify,thanks for your reply. We can get the amount from the returnAgreement, but we cannot find the transaction that links to the return. Compare to the old exchangeV2s object, there are 2 parts are missing:
- The total amount in the return.
- The relationship between the return and transaction.
Example scenario:
-
The store sells two products: LEGO ($100) and Laptop ($500).
-
Step 1: Create a POS order with 3 LEGO sets ($100 each) and complete the order.
-
Step 2: Create an exchange: return 1 LEGO and exchange it for 1 Laptop ($500). The customer pays an additional $400. Complete the exchange.
-
Step 3: Create a second exchange: return 1 LEGO and exchange it for 1 Laptop ($500). The customer again pays an additional $400. Complete the exchange.
After these steps, the order now has 3 separate transactions:
-
The original order
-
The first return and exchange
-
The second return and exchange
When importing the order into our ERP system, we need to know which transaction belongs to each event.
In the old ExchangeV2S object, it was easy to retrieve the transaction details directly. However, in the new Return object, this information cannot be clearly identified.
query Order {
order(id: "gid://shopify/Order/6432653246662") {
id
returns(first:5){
nodes{
id
createdAt
}
}
transactions{
id, kind, amount
}
exchangeV2s(first:5){
nodes{
id
totalPriceSet{
presentmentMoney{
amount
}
}
transactions{
id, amount
}
}
}
agreements(first: 10) {
nodes {
... on ReturnAgreement {
reason
id
sales(first: 10) {
nodes {
actionType
lineType
totalAmount {
shopMoney {
amount
}
}
}
}
}
}
}
}
}
You can compare the result between the return object and exchangeV2s object:
{
"data": {
"order": {
"id": "gid://shopify/Order/6432653246662",
"returns": {
"nodes": [
{
"id": "gid://shopify/Return/16702275782",
"createdAt": "2025-09-23T16:55:48Z"
},
{
"id": "gid://shopify/Return/16702308550",
"createdAt": "2025-09-23T16:56:41Z"
}
]
},
"transactions": [
{
"id": "gid://shopify/OrderTransaction/7864299323590",
"kind": "SALE",
"amount": "318.00"
},
{
"id": "gid://shopify/OrderTransaction/7864301813958",
"kind": "SALE",
"amount": "424.00"
},
{
"id": "gid://shopify/OrderTransaction/7864303812806",
"kind": "SALE",
"amount": "424.00"
}
],
"exchangeV2s": {
"nodes": [
{
"id": "gid://shopify/ExchangeV2/1423409350",
"totalPriceSet": {
"presentmentMoney": {
"amount": "424.0"
}
},
"transactions": [
{
"id": "gid://shopify/OrderTransaction/7864301813958",
"amount": "424.00"
}
]
},
{
"id": "gid://shopify/ExchangeV2/1423442118",
"totalPriceSet": {
"presentmentMoney": {
"amount": "424.0"
}
},
"transactions": [
{
"id": "gid://shopify/OrderTransaction/7864303812806",
"amount": "424.00"
}
]
}
]
},
"agreements": {
"nodes": [
{},
{
"reason": "RETURN",
"id": "gid://shopify/SalesAgreement/6900450197702",
"sales": {
"nodes": [
{
"actionType": "ORDER",
"lineType": "PRODUCT",
"totalAmount": {
"shopMoney": {
"amount": "530.0"
}
}
},
{
"actionType": "RETURN",
"lineType": "PRODUCT",
"totalAmount": {
"shopMoney": {
"amount": "-106.0"
}
}
}
]
}
},
{},
{
"reason": "RETURN",
"id": "gid://shopify/SalesAgreement/6900451246278",
"sales": {
"nodes": [
{
"actionType": "ORDER",
"lineType": "PRODUCT",
"totalAmount": {
"shopMoney": {
"amount": "530.0"
}
}
},
{
"actionType": "RETURN",
"lineType": "PRODUCT",
"totalAmount": {
"shopMoney": {
"amount": "-106.0"
}
}
}
]
}
},
{}
]
}
}
}