MageSmith
POSTSales · Magento 2.4.9 Admin · Magento_Sales::creditmemo

POST /V1/order/:orderId/refund

POST /V1/order/:orderId/refund is a Magento 2 REST endpoint in the Sales module. Create offline refund for order. Requires an admin Bearer token with ACL Magento_Sales::creditmemo.

Last verified: against Magento 2.4.9.

Returns

int

Service contract

Magento\Sales\Api\RefundOrderInterface::execute

Authorization

Admin Bearer token with ACL:

  • Magento_Sales::creditmemo

Path parameters

orderId int Required

Body parameters

items Magento\Sales\Api\Data\CreditmemoItemCreationInterface[] default: []
notify bool default: false
appendComment bool default: false
comment Magento\Sales\Api\Data\CreditmemoCommentCreationInterface default: null
arguments Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface default: null

Example request

Auto-generated from the service contract — paste-ready against your store's /rest/default base. Replace the host, store code, ACL token, and any required values before running.

Headers

Accept
application/json
Content-Type
application/json
Authorization
Bearer <ACCESS_TOKEN> admin token with ACL: Magento_Sales::creditmemo

Path

/V1/order/{orderId}/refund

Body

{
  "appendComment": false,
  "arguments": {
    "adjustment_negative": 0,
    "adjustment_positive": 0,
    "extension_attributes": {},
    "shipping_amount": 0
  },
  "comment": {
    "comment": "",
    "extension_attributes": {},
    "is_visible_on_front": 0
  },
  "items": [
    {
      "extension_attributes": {},
      "order_item_id": 0,
      "qty": 0
    }
  ],
  "notify": false
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.