Adds a comment to a specified order

POST /V1/orders/{id}/comments

Adds a comment to a specified order.

Path parameters

  • id integer Required

    The order ID.

Body

  • statusHistory object Required

    Order status history interface. An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as a purchase order, is emailed to the customer.

    Hide statusHistory attributes Show statusHistory attributes object
    • comment string Required

      Comment.

    • created_at string

      Created-at timestamp.

    • entity_id integer

      Order status history ID.

    • entity_name string

      Entity name.

    • is_customer_notified integer Required

      Is-customer-notified flag value.

    • is_visible_on_front integer Required

      Is-visible-on-storefront flag value.

    • parent_id integer Required

      Parent ID.

    • status string

      Status.

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Sales\Api\Data\OrderStatusHistoryInterface

Responses

  • 200

    200 Success.

  • 401

    401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/orders/{id}/comments
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/orders/{id}/comments' \
 --data '{"statusHistory":{"comment":"string","created_at":"string","entity_id":42,"entity_name":"string","is_customer_notified":42,"is_visible_on_front":42,"parent_id":42,"status":"string","extension_attributes":{}}}'
Request examples
{
  "statusHistory": {
    "comment": "string",
    "created_at": "string",
    "entity_id": 42,
    "entity_name": "string",
    "is_customer_notified": 42,
    "is_visible_on_front": 42,
    "parent_id": 42,
    "status": "string",
    "extension_attributes": {}
  }
}
Response examples (200)
true
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"
}