Refund Create Not working

Hi All,

I’m getting an invalid ID error that I cant really make heads or tails of.

I have an order that I am getting the suggested refund to return an item. The order exists and the result appears correct.

{

    "orderId": "gid://shopify/Order/6207980994765",
    "refundLineItems": [
        {
          "lineItemId": "gid://shopify/LineItem/15546619199693",
          "quantity": 1,
          "restockType": "NO_RESTOCK"
        }
      ]
}
"data": {
    "order": {
      "suggestedRefund": {
        "suggestedTransactions": [
          {
            "gateway": "manual",
            "parentTransaction": {
              "id": "gid://shopify/OrderTransaction/7478517301453"
            },
            "amountSet": {
              "presentmentMoney": {
                "amount": "48.0",
                "currencyCode": "CHF"
              }
            }
          }
        ]
      }
    }
  },

However, when trying to use the returned suggested transaction in the refundCreate I get an error.

{
  "input": {
    "orderId": "gid://shopify/Order/6207980994765",
    "refundLineItems": [
      {
        "lineItemId": "gid://shopify/LineItem/15546619199693",
        "restockType": "NO_RESTOCK",
        "quantity": 1
      }
    ],
    "transactions": [
      {
        "orderId": "gid://shopify/order/6207980994765",
        "kind": "REFUND",
        "gateway": "manual",
        "amount": 48.00
      }
    ]
  }
}
"errors": [
    {
      "message": "invalid id",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "refundCreate"
      ]
    }
  ],

Not sure how any of the ids can be invalid. Unfortunately line 2, column 3 also doesnt really help me figure it out. The orderId is definitely correct, since its the once i used to generate the suggested refund in the first place.

anyone run into something similar or have an idea what the issue is?

Cheers,
Gary

What API Version are you using? :thinking:

using version 2025-01.

I couldn’t figure it out so I decided to do a rather long winded work around.

  1. get returnablefulfillments
  2. figure out which fulfillmentlineitems to return
  3. start the return using returnCreate
  4. get the refund line items
  5. calculate the refund using suggestedRefund
  6. issue a refund using returnRefund

instead of the 2 step approach it should be… I was really hoping to avoid having to use the returnableFulfillments way cause If I have mutliple fulfillment orders I have to figure out how many items of each fulfillmentLineItem I need to return for a given lineItemId where using the refundCreate mutation I only need to know which lineItemIds and the quantity I want to return.

Update:

The query now magically works when I tried it again this morning. I did nothing differently as far as I am aware. Executed the queries via graphiql app.

However now that it works, the returned items are not showing up on the Order in the admin as I would expect them to.

The below image shows a partial refund.

I had expected to see something like this showing that the items have been returned.

However, not only do I not see this, in the event history it does not show that I selected no_restock for the second order, or restocked the items in the first, and only after doing a manual refund/return did the number of items ordered get reduced from the original 7 down to 5

Whats bothering the most is that there is no indication that the rest of the original 7 items have been returned as I expected. Is this a bug @Liam-Shopify ?

Cheers,
Gary