Transaction for the order exchange item

In the Return object, I cannot find a Transaction node.

When exchanging for an item with a higher price, there should be a Transaction record for the price difference. However:

  • The Return object does not include a Transaction node.

  • The Transaction object only provides an Order field to link to the associated order.

In the older ExchangeV2S object for Shopify POS exchanges, the Transaction field was available.

In the refund object, the Transaction field is available. Why to remove the Transaction field in the new return object?
As we migrate our integration from the old ExchangeV2S to the new Return object, we cannot find an effective way to handle this scenario.

We check the SalesAgreement object as well, but it doesn’t have the relationship between the return and the transaction information.

Could you consider adding a Transaction field to the Return object in a future API version?

1 Like

Hey @Simon_Liang,

Thanks for sharing that. I see what you mean in exchanges for a higher price, it’s not easy to see the transactions associated with it.

I did some testing and this query here including only the returnAgreement (I’ve simplified it to show the basic fields) does return the agreement and the financial relationships between it. In this scenario I exchanged a $15 product with a $50 product. Let me know if I’m missing something crucial here:

Query:

query Return {
    return(id: "gid://shopify/Return/123456789") {
        id
        name
        order {
            agreements(first: 10) {
                nodes {
                    ... on ReturnAgreement {
                        reason
                        id
                        sales(first: 10) {
                            nodes {
                                actionType
                                lineType
                                totalAmount {
                                    shopMoney {
                                        amount
                                        currencyCode
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Returns:

"order": {
                "agreements": {
                    "nodes": [
                        {},
                        {
                            "reason": "RETURN",
                            "id": "gid://shopify/SalesAgreement/16754321",
                            "sales": {
                                "nodes": [
                                    {
                                        "actionType": "ORDER",
                                        "lineType": "PRODUCT",
                                        "totalAmount": {
                                            "shopMoney": {
                                                "amount": "50.0",
                                                "currencyCode": "USD"
                                            }
                                        }
                                    },
                                    {
                                        "actionType": "RETURN",
                                        "lineType": "PRODUCT",
                                        "totalAmount": {
                                            "shopMoney": {
                                                "amount": "-15.0",
                                                "currencyCode": "USD"
                                            }
                                        }
                                    }
                                ]
                            }
                        },

@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:

  1. The total amount in the return.
  2. 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:

  1. The original order

  2. The first return and exchange

  3. 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"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    {}
                ]
            }
        }
    }

Thanks for that clarity Simon. I’ve set up an order with the exact scenario you have outlined and I also can’t find a way to make this association.

I’m digging in to this further to see if this is expected and any other workarounds. I’ll follow up once I have more to share.