Inbound stock
The inbound stock API allows you to view the products that are set within pending purchase orders (the purchase orders with any status other than atum_received). Each item of the response is a purchase order line item, so the same product can be listed several times if it's in multiple purchase orders.
The inbound stock endpoints are only available when the ATUM Purchase Orders module is enabled, and they require the ATUM read_inbound_stock capability.
Inbound stock properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the resource. read-only |
name | string | Product name. read-only |
type | string | Product type. Options: simple, grouped, external, variable and any other product type registered in the store (such as the Product Levels' product-part, raw-material, variable-product-part and variable-raw-material). For variations, it's variation (or the add-on's variation type, such as product-part-variation). Default is simple. read-only |
sku | string | Product's Stock Keeping Unit. read-only |
inbound_stock | number | The quantity of the product set within the purchase order. read-only |
date_ordered | date-time | The date when the Purchase Order was created, in the site's timezone. read-only |
date_ordered_gmt | date-time | The date when the Purchase Order was created, as GMT. read-only |
date_expected | date-time | The date when the Purchase Order is expected, in the site's timezone. Empty if the Purchase Order has no expected date. read-only |
date_expected_gmt | date-time | The date when the Purchase Order is expected, as GMT. Empty if the Purchase Order has no expected date. read-only |
purchase_order | integer | Unique identifier for the Purchase Order. read-only |
Retrieve an inbound product
This API lets you retrieve and view the inbound stock for a specific product by ID.
If the product is in several pending purchase orders, the response is an array with one item for each purchase order line. If it's only in one, the response is a single object.
HTTP request
/wp-json/wc/v3/atum/inbound-stock/<id>curl https://example.com/wp-json/wc/v3/atum/inbound-stock/175 \
-u consumer_key:consumer_secret[
{
"id": 175,
"name": "Product Part 1",
"type": "product-part",
"sku": "PART1",
"inbound_stock": 1,
"date_ordered": "2019-04-30T15:17:00",
"date_ordered_gmt": "2019-04-30T13:17:00",
"date_expected": "2019-04-30T13:20:00",
"date_expected_gmt": "2019-04-30T11:20:00",
"purchase_order": 843,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/175"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 175,
"name": "Product Part 1",
"type": "product-part",
"sku": "PART1",
"inbound_stock": 1,
"date_ordered": "2018-10-26T12:16:00",
"date_ordered_gmt": "2018-10-26T10:16:00",
"date_expected": "2018-10-26T11:21:00",
"date_expected_gmt": "2018-10-26T09:21:00",
"purchase_order": 618,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/175"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
}
]List all inbound products
This API helps you to view all the inbound products.
HTTP request
/wp-json/wc/v3/atum/inbound-stockcurl https://example.com/wp-json/wc/v3/atum/inbound-stock \
-u consumer_key:consumer_secret[
{
"id": 507,
"name": "ABC 123 XPTO",
"type": "simple",
"sku": "",
"inbound_stock": 5,
"date_ordered": "2019-10-24T10:16:12",
"date_ordered_gmt": "2019-10-24T08:16:12",
"date_expected": "2019-11-11T09:55:31",
"date_expected_gmt": "2019-11-11T08:55:31",
"purchase_order": 1927,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/507"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 23,
"name": "Ship Your Idea 2 - Black",
"type": "variation",
"sku": "",
"inbound_stock": 1,
"date_ordered": "2019-10-24T10:16:12",
"date_ordered_gmt": "2019-10-24T08:16:12",
"date_expected": "2019-11-11T09:55:31",
"date_expected_gmt": "2019-11-11T08:55:31",
"purchase_order": 1927,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/23"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 93,
"name": "Woo Single #1",
"type": "simple",
"sku": "Back Orders",
"inbound_stock": 2,
"date_ordered": "2019-10-04T11:35:00",
"date_ordered_gmt": "2019-10-04T09:35:00",
"date_expected": "2019-10-05T10:00:00",
"date_expected_gmt": "2019-10-05T08:00:00",
"purchase_order": 1841,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/93"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 23,
"name": "Ship Your Idea 2 - Black",
"type": "variation",
"sku": "",
"inbound_stock": 1,
"date_ordered": "2019-10-04T11:35:00",
"date_ordered_gmt": "2019-10-04T09:35:00",
"date_expected": "2019-10-05T10:00:00",
"date_expected_gmt": "2019-10-05T08:00:00",
"purchase_order": 1841,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/23"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 175,
"name": "Product Part 1",
"type": "product-part",
"sku": "PART1",
"inbound_stock": 1,
"date_ordered": "2019-04-30T15:17:00",
"date_ordered_gmt": "2019-04-30T13:17:00",
"date_expected": "2019-04-30T13:20:00",
"date_expected_gmt": "2019-04-30T11:20:00",
"purchase_order": 843,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/175"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 513,
"name": "Variable Product Part 1 - Black",
"type": "product-part-variation",
"sku": "VPART1",
"inbound_stock": 1,
"date_ordered": "2019-04-30T15:17:00",
"date_ordered_gmt": "2019-04-30T13:17:00",
"date_expected": "2019-04-30T13:20:00",
"date_expected_gmt": "2019-04-30T11:20:00",
"purchase_order": 843,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/513"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 507,
"name": "ABC 123 XPTO",
"type": "simple",
"sku": "",
"inbound_stock": 1,
"date_ordered": "2019-03-21T12:55:00",
"date_ordered_gmt": "2019-03-21T11:55:00",
"date_expected": "2019-03-12T12:56:00",
"date_expected_gmt": "2019-03-12T11:56:00",
"purchase_order": 709,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/507"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 90,
"name": "Woo Album #3",
"type": "simple",
"sku": "WOO3",
"inbound_stock": 1,
"date_ordered": "2019-03-11T09:35:00",
"date_ordered_gmt": "2019-03-11T08:35:00",
"date_expected": "2019-03-11T09:36:00",
"date_expected_gmt": "2019-03-11T08:36:00",
"purchase_order": 701,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/90"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
},
{
"id": 76,
"name": "Woo Ninja",
"type": "simple",
"sku": "",
"inbound_stock": 1,
"date_ordered": "2019-03-11T09:27:00",
"date_ordered_gmt": "2019-03-11T08:27:00",
"date_expected": "2019-03-11T09:27:31",
"date_expected_gmt": "2019-03-11T08:27:31",
"purchase_order": 698,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock/76"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/atum/inbound-stock"
}
]
}
}
]Available parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Current page of the collection. Default is 1. |
per_page | integer | Maximum number of items to be returned in result set. Default is 10. Maximum is 100. |
search | string | Limit results to those matching a string. If it's numeric, it's used as a product ID; otherwise, it searches in the line item names. |
after | string | Limit response to products within purchase orders created after a given ISO8601 compliant date. |
before | string | Limit response to products within purchase orders created before a given ISO8601 compliant date. |
exclude | array | Ensure result set excludes specific product IDs. |
include | array | Limit result set to specific product IDs. |
offset | integer | Offset the result set by a specific number of items. |
order | string | Order sort attribute ascending or descending. Options: asc and desc. Default is desc. |
orderby | string | Sort collection by object attribute. Options: date, id, include, title, slug, modified, menu_order, price, popularity and rating. Default is date. Only title (the line item name) and id (the line item ID) change the order; any other value sorts the results by purchase order ID. |
include_po | array | Limit result set to products with specified Purchase Order IDs. ATUM |
exclude_po | array | Ensure result set excludes specific Purchase Order IDs. ATUM |
expected_after | string | Limit response to purchase orders expected after a given ISO8601 compliant date. ATUM |
expected_before | string | Limit response to purchase orders expected before a given ISO8601 compliant date. ATUM |