What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Admin API "refundCreate" not deducting specified shipping from app

Admin API "refundCreate" not deducting specified shipping from app

dpiccolo
Shopify Partner
5 0 3

This is a repost from here, I found the correct community afterwards, my mistake!

 

So, I'm trying to process a line item refund with a specified amount of shipping to also refund.

 

The query works in so much as it removes the line item and refunds it, but the amount specified for shipping is not refunded (see the query variable below).

 

In the order timeline the refund note **does** **show** the shipping amount I specified, for example "Shipping ($3.13 of $35.80)", but the shipping total is not deducted in the order summary, nor is the amount added to the total refund received.

 

In the example below, I am trying to refund a line item whose total is $10, and $1 of shipping. But the amount refunded is only $10.

 

The documentation on this is minimal and vague, I hope someone can help illuminate this for me, thank you!


Query variable:

        $variable=[
            "input" => [
                "orderId" => $orderId,
                "currency" => $currency,
                "notify" => true,
                "refundLineItems" => [
                    "lineItemId" => $lineItemId,
                    "locationId" => $locationId,
                    "quantity" => $quantity,
                    "restockType" => "RETURN",
                ],
                "shipping" => [
                    "amount" => "1.00", //$shippingRefund,
                ],
                "transactions" => [
                    "amount" => "10.00" //$lineItemRefundAmount,
                    "kind" => "REFUND",
                    "gateway" => "shopify_payments",
                    "orderId" => $orderId,
                    "parentId" => $transactionId
                ]
            ],
        ];
Replies 0 (0)