Discussing APIs and development related to customers, discounts, and order management.
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
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.
Here are the parameters of my request for your reference,
{
"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?
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: