Is it possible to reestock and refund separately? VIA API.

Hello,

I need to process the return of an order via API. Up to the point of the return, I have no problems, but I need the restocking of the same product in stock to be possible, without the need to make the refund of the corresponding order.

Is this possible, as I have already tried with the refund api… but it does the whole process as a whole and not separately.

Greetings.

Hi @SingularConsul

Here are the parameters of my request for your reference,

refundCreate (shopify.dev)

{
  "input": {
    "orderId": "gid://shopify/Order/5884669821203",
    "note": "Want to exchange for a different item",
    "currency":"CAD",
    "refundLineItems": [
      {
        "lineItemId": "gid://shopify/LineItem/14963264258323",
        "quantity": 1
      }
    ],
    "transactions": [
      {
        "orderId": "gid://shopify/Order/5884669821203",
        "gateway": "bogus",
        "kind": "REFUND",
        "amount": "157",
        "parentId": "gid://shopify/OrderTransaction/7178048143635"
      }
    ]
  }
}

Hi , thanks for replying,

But this will also generate the refund for me, I just need the status to change from Processed to Return in progress and the products to be restocked in the corresponding warehouse.

This would be the expected result:

I point out in yellow, the button that performs the subsequent action I want to do, the restock. But only up to that point, I do not want to do the restocking together.

Do you think it can be done?

Hi @SingularConsul

These two parameters are useful for you:

refundLineItems->restockType=“CANCEL”,

transactions->amount: 0

{
  "input": {
    "orderId": "gid://shopify/Order/5884669821203",
    "note": "Want to exchange for a different item",
    "currency":"CAD",
    "refundLineItems": [
      {
        "lineItemId": "gid://shopify/LineItem/14963264291091",
        "quantity": 1,
        "restockType":"CANCEL",
        "locationId":"gid://shopify/Location/85112553747"
      }
    ],
    "transactions": [
      {
        "orderId": "gid://shopify/Order/5884669821203",
        "gateway": "bogus",
        "kind": "REFUND",
        "amount": "0",
        "parentId": "gid://shopify/OrderTransaction/7178048143635"
      }
    ]
  }
}

before:

after: