Create offline refund for order

POST /V1/order/{orderId}/refund

Create offline refund for order

Body

  • items array[object]

    Interface CreditmemoItemCreationInterface

    Hide items attributes Show items attributes object
    • ExtensionInterface class for @see \Magento\Sales\Api\Data\CreditmemoItemCreationInterface

      Hide extension_attributes attribute Show extension_attributes attribute object
    • order_item_id integer Required

      Order item ID.

    • qty number Required

      Quantity.

  • notify boolean
  • comment object

    Interface CreditmemoCommentCreationInterface

    Hide comment attributes Show comment attributes object
  • Interface CreditmemoCreationArgumentsInterface

    Hide arguments attributes Show arguments attributes object

Responses

  • 200 Success.

  • 401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Hide errors attributes Show errors attributes object
    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Hide parameters attributes Show parameters attributes object
    • trace string

      Stack trace

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Hide errors attributes Show errors attributes object
    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Hide parameters attributes Show parameters attributes object
    • trace string

      Stack trace

POST /V1/order/{orderId}/refund
curl \
 -X POST https://magento2.winkelstraat.mac/rest/all/V1/order/{orderId}/refund \
 -d '{"items":[{"extension_attributes":{"status":"string"},"order_item_id":42,"qty":42.0}],"notify":true,"appendComment":true,"comment":{"extension_attributes":{},"comment":"string","is_visible_on_front":42},"arguments":{"shipping_amount":42.0,"adjustment_positive":42.0,"adjustment_negative":42.0,"extension_attributes":{"return_to_stock_items":[42]}}}'
Request examples
{
  "items": [
    {
      "extension_attributes": {
        "status": "string"
      },
      "order_item_id": 42,
      "qty": 42.0
    }
  ],
  "notify": true,
  "appendComment": true,
  "comment": {
    "extension_attributes": {},
    "comment": "string",
    "is_visible_on_front": 42
  },
  "arguments": {
    "shipping_amount": 42.0,
    "adjustment_positive": 42.0,
    "adjustment_negative": 42.0,
    "extension_attributes": {
      "return_to_stock_items": [
        42
      ]
    }
  }
}
Response examples (200)
42
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}