Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

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

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

SingularConsul
Shopify Partner
5 0 0

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.

Replies 4 (4)

Kyle_liu
Shopify Partner
441 55 80

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"
      }
    ]
  }
}

 

 

 

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
SingularConsul
Shopify Partner
5 0 0

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.

SingularConsul_0-1722936721922.png

This would be the expected result:

SingularConsul_2-1722937362696.png

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?

 

Kyle_liu
Shopify Partner
441 55 80

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"
      }
    ]
  }
}

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
Kyle_liu
Shopify Partner
441 55 80

before:

Kyle_liu_0-1723015146998.png

 

after:

Kyle_liu_1-1723015182469.png

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee