Purchase order notes
ATUM
JSON response example
JSON response example
JSON response example
JSON response example
The purchase order notes API allows you to create, view, and delete individual purchase order notes.
Purchase order notes are added by administrators and programmatically to store data about a purchase order, or its events.
Purchase order note properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the resource. read-only |
author | string | Purchase order note author: the name of the user that added it, or ATUM for the system notes. read-only |
date_created | date-time | The date the purchase order note was created, in the site's timezone. read-only |
date_created_gmt | date-time | The date the purchase order note was created, as GMT. read-only |
note | string | Purchase order note content. mandatory |
added_by_user | boolean | If true, this note will be attributed to the current user. If false, the note will be attributed to the system. Default is false. |
action | string | Action described in the note. For example: apiNote (note added through the API), changeStatus, increaseStock, decreaseStock or stockLevelsChanged. read-only |
params | array | List of parameters to parse the action (for example, the old and new statuses of a changeStatus note). read-only |
The action and params fields are only included in the view context, so they aren't returned when creating or deleting a note (these requests use the edit context).
Create a purchase order note
This API helps you to create a new note for a purchase order.
HTTP request
POST
/wp-json/wc/v3/atum/purchase-orders/<id>/notescurl -X POST https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"note": "FROM REST ok!!!",
"added_by_user": true
}'{
"id": 4226,
"author": "John Doe",
"date_created": "2019-11-12T10:40:51",
"date_created_gmt": "2019-11-12T09:40:51",
"note": "FROM REST ok!!!",
"added_by_user": true,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
}Retrieve a purchase order note
This API lets you retrieve and view a specific note from a purchase order.
HTTP request
GET
/wp-json/wc/v3/atum/purchase-orders/<id>/notes/<note_id>curl https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226 \
-u consumer_key:consumer_secret{
"id": 4226,
"author": "John Doe",
"date_created": "2019-11-12T10:40:51",
"date_created_gmt": "2019-11-12T09:40:51",
"note": "FROM REST ok!!!",
"added_by_user": true,
"action": "apiNote",
"params": [
[]
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
}Available parameters
| Parameter | Type | Description |
|---|---|---|
context | string | Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view. |
List all purchase order notes
This API helps you to view all the notes from a purchase order.
HTTP request
GET
/wp-json/wc/v3/atum/purchase-orders/<id>/notescurl https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes \
-u consumer_key:consumer_secret[
{
"id": 4226,
"author": "John Doe",
"date_created": "2019-11-12T10:40:51",
"date_created_gmt": "2019-11-12T09:40:51",
"note": "FROM REST ok!!!",
"added_by_user": true,
"action": "apiNote",
"params": [
[]
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
},
{
"id": 3770,
"author": "ATUM",
"date_created": "2019-10-03T12:01:16",
"date_created_gmt": "2019-10-03T10:01:16",
"note": "Order status changed from Receiving to Received.",
"added_by_user": false,
"action": "changeStatus",
"params": [
{
"old_status": "atum_receiving",
"new_status": "atum_received"
}
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/3770"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
},
{
"id": 3769,
"author": "ATUM",
"date_created": "2019-10-03T12:01:16",
"date_created_gmt": "2019-10-03T10:01:16",
"note": "Stock levels increased: Woo Single #1 22→23",
"added_by_user": false,
"action": "increaseStock",
"params": [
{
"item_name": "Woo Single #1",
"product_id": 93,
"old_stock": 22,
"new_stock": 23,
"stock_change": 1
}
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/3769"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
},
{
"id": 3752,
"author": "ATUM",
"date_created": "2019-10-02T13:36:44",
"date_created_gmt": "2019-10-02T11:36:44",
"note": "Order status changed from Pending to Receiving.",
"added_by_user": false,
"action": "changeStatus",
"params": [
{
"old_status": "atum_pending",
"new_status": "atum_receiving"
}
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/3752"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
}
]Available parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Limit result to user or system notes. Options: any, user and system. Default is any. |
Delete a purchase order note
This API helps you delete a purchase order note.
HTTP request
DELETE
/wp-json/wc/v3/atum/purchase-orders/<id>/notes/<note_id>curl -X DELETE https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226?force=true \
-u consumer_key:consumer_secret{
"id": 4226,
"author": "John Doe",
"date_created": "2019-11-12T10:40:51",
"date_created_gmt": "2019-11-12T09:40:51",
"note": "FROM REST ok!!!",
"added_by_user": true,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes/4226"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852/notes"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
}
]
}
}Available parameters
| Parameter | Type | Description |
|---|---|---|
force | boolean | Required to be true, as resource does not support trashing. Default is false. |