ATUM REST API

Order notes

ATUM

ATUM extends the official WC's order notes endpoint (/wp-json/wc/v3/orders/<order_id>/notes) with extra info about the notes added by ATUM and its add-ons (stock changes, inventories used, etc.), so apps can parse and translate them instead of reading the note text.

This page only describes the ATUM additions. For the rest of the fields and the available operations (create, retrieve, list and delete order notes), see the WC REST API Docs.

The ATUM fields are included in the responses of all the order notes operations, and they're also added to the purchase order notes and inventory log notes endpoints.

Order note properties

AttributeTypeDescription
actionstringAction described in the note. Empty when the note has no ATUM data (for example, the notes added by WooCommerce or by hand). See the available actions. Only included when context is view. read-only ATUM
paramsarrayList of parameters to parse the action. It usually contains one object with the action's data, such as the product, inventory and stock levels involved. Empty when the note has no ATUM data. Only included when context is view. read-only ATUM

Order note actions

These are the values that the action field can take. Some of them only appear when the related add-on is active (e.g. the inventory actions need Multi-Inventory) or are only used in ATUM orders (purchase orders and inventory logs).

ActionDescription
setStatusThe order status was set.
changeStatusThe order status was changed.
ajaxNoteNote added by a user from the order's edit page.
apiNoteNote added through the ATUM REST API.
increaseStockThe stock of the order items was increased.
decreaseStockThe stock of the order items was decreased.
increaseItemStockThe stock of an order item was increased.
addedLineItemsLine items were added to the order.
deletedLineItemsLine items were deleted from the order.
deletedAdjustedLineItemsLine items with adjusted stock were deleted from the order.
stockLevelsIncreasedStock levels increased.
stockLevelsProductIncreasedStock levels of a product increased (e.g. after a refund).
stockLevelsReducedStock levels reduced.
stockLevelsChangedStock levels changed.
unableRestoreThe stock of an order item couldn't be restored.
unableRestoreInventoryThe stock of an order item's inventory couldn't be restored.
unableReduceThe stock of an order item couldn't be reduced.
unableReduceInventoryThe stock of an order item's inventory couldn't be reduced.
unableIncreaseStockThe stock of an order item couldn't be increased.
unableDecreaseStockThe stock of an order item couldn't be decreased.
unableIncreaseInventoryStockThe stock of an order item's inventory couldn't be increased.
unableDecreaseInventoryStockThe stock of an order item's inventory couldn't be decreased.

Retrieve an order note

This API lets you retrieve and view a specific note from an order, including the ATUM fields.

HTTP request

GET/wp-json/wc/v3/orders/<order_id>/notes/<id>
curl https://example.com/wp-json/wc/v3/orders/727/notes/2286 \
	-u consumer_key:consumer_secret
JSON response example
{
  "id": 2286,
  "author": "system",
  "date_created": "2019-03-22T16:28:08",
  "date_created_gmt": "2019-03-22T19:28:08",
  "note": "Stock levels reduced: Woo Single #1 (WOO-SINGLE-1)",
  "customer_note": false,
  "action": "stockLevelsReduced",
  "params": [
    {
      "changes": [
        {
          "inventory_sku": "WOO-SINGLE-1",
          "inventory_name": "Main Inventory",
          "product_id": 93,
          "item_name": "Woo Single #1 (WOO-SINGLE-1)",
          "old_stock": 25,
          "new_stock": 24
        }
      ]
    }
  ],
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v3/orders/727/notes/2286"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v3/orders/727/notes"
      }
    ],
    "up": [
      {
        "href": "https://example.com/wp-json/wc/v3/orders/727"
      }
    ]
  }
}

List all order notes

This API helps you to view all the notes from an order, including the ATUM fields.

HTTP request

GET/wp-json/wc/v3/orders/<order_id>/notes
curl https://example.com/wp-json/wc/v3/orders/727/notes \
	-u consumer_key:consumer_secret
JSON response example
[
  {
    "id": 2287,
    "author": "system",
    "date_created": "2019-03-22T16:28:08",
    "date_created_gmt": "2019-03-22T19:28:08",
    "note": "Order status changed from Pending payment to Processing.",
    "customer_note": false,
    "action": "",
    "params": [],
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727/notes/2287"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727/notes"
        }
      ],
      "up": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727"
        }
      ]
    }
  },
  {
    "id": 2286,
    "author": "system",
    "date_created": "2019-03-22T16:28:08",
    "date_created_gmt": "2019-03-22T19:28:08",
    "note": "Stock levels reduced: Woo Single #1 (WOO-SINGLE-1)",
    "customer_note": false,
    "action": "stockLevelsReduced",
    "params": [
      {
        "changes": [
          {
            "inventory_sku": "WOO-SINGLE-1",
            "inventory_name": "Main Inventory",
            "product_id": 93,
            "item_name": "Woo Single #1 (WOO-SINGLE-1)",
            "old_stock": 25,
            "new_stock": 24
          }
        ]
      }
    ],
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727/notes/2286"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727/notes"
        }
      ],
      "up": [
        {
          "href": "https://example.com/wp-json/wc/v3/orders/727"
        }
      ]
    }
  }
]

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view. The ATUM fields are only included in the view context.
typestringLimit result to customers or internal notes. Options: any, customer and internal. Default is any.

On this page