Order Processing with REST APIs Tutorial
Step 10. Issue a partial refund
Magento 2.1.3 introduced two endpoints that streamline the process of issuing a refund by creating a creditmemo and updating the order or invoice in one call.
||Issues an offline refund|
||Issue a refund with an online payment system|
In this example, the customer did not like the fit of the Radiant T-M-Orange shirt and wants a refund.
Since the customer paid for the order with a bank transfer, we’ll call
POST /V1/order/<order ID>/refund. The
order_item_id for the Radiant Tee-M-Orange is
arguments object allows you to adjust the amount of the credit to be refunded. Since the customer used the
tablerate shipping method, which applied to the whole order, we’ll assume that a refund can’t be applied to the shipping costs. Therefore, the shipping_amount is set to
If the customer had selected the
flatrate shipping method ($5 per item), we would set the value of
return_to_stock_items array specifies which
order_item_ids can be returned to stock and be resold.
Bearer <administrator token>
A credit memo id, such as
Verify this step
Log in to Admin. Click Sales > Credit memos. The credit memo is displayed in the grid.