ATUM REST API

Purchase orders

ATUM

The purchase orders API allows you to create, view, update, and delete individual, or a batch, of purchase orders.

Purchase order properties

AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
statusstringPurchase order status. Options: atum_pending, atum_ordered, atum_onthewayin, atum_receiving, atum_received and trash. Default is atum_pending. The Purchase Orders PRO add-on replaces these statuses with its own.
currencystringCurrency the purchase order was created with, in ISO format. Options: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYR, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, IRT, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PRB, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR and ZMW. Default is the store's currency.
date_createddate-timeThe date the purchase order was created, in the site's timezone.
date_created_gmtdate-timeThe date the purchase order was created, as GMT.
date_modifieddate-timeThe date the purchase order was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the purchase order was last modified, as GMT. read-only
discount_totalstringTotal discount amount for the purchase order. read-only
discount_taxstringTotal discount tax amount for the purchase order. read-only
shipping_totalstringTotal shipping amount for the purchase order. read-only
shipping_taxstringTotal shipping tax amount for the purchase order. read-only
cart_taxstringSum of line item taxes only. read-only
totalstringGrand total, including tax. read-only
total_taxstringSum of all taxes. read-only
prices_include_taxbooleanWhether the prices included tax when the purchase order was created. read-only
date_completeddate-timeThe date the purchase order was completed, in the site's timezone.
date_completed_gmtdate-timeThe date the purchase order was completed, as GMT.
supplierintegerThe supplier ID linked to the purchase order.
multiple_suppliersbooleanWhether the multiple suppliers switch is enabled or not. If the purchase order has no supplier, it's set to true automatically.
date_expecteddate-timeThe date when the purchase order is expected at location, in the site's timezone.
date_expected_gmtdate-timeThe date when the purchase order is expected at location, as GMT.
line_itemsarrayLine items data. See Purchase Order - Line items properties
tax_linesarrayTax lines data. See Purchase Order - Tax lines properties read-only
shipping_linesarrayShipping lines data. See Purchase Order - Shipping lines properties
fee_linesarrayFee lines data. See Purchase Order - Fee lines properties
meta_dataarrayMeta data. See Purchase Order - Meta data properties. When updating a purchase order, only the meta keys that match a purchase order prop are saved.
descriptionstringThe purchase order description.
db_statusstringThe post status saved in the database. Only included when it differs from status (for example, trash for a purchase order that was moved to the trash). read-only

When sending dates, you can use either the site's timezone version or the _gmt one. If both are sent, the _gmt value prevails.

Purchase Order - Meta data properties

AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuemixedMeta value.
display_keystringMeta key for UI display. Only for the meta data of the order items. read-only
display_valuemixedMeta value for UI display. Only for the meta data of the order items. read-only

Purchase Order - Line items properties

AttributeTypeDescription
idintegerItem ID. Send it to update an existing item. read-only
namestringProduct name.
product_idintegerProduct ID. Send it as null (or send the item's quantity as 0) to remove the item from the purchase order.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classstringSlug of the tax class of product.
subtotalstringLine subtotal, excluding tax (before discounts).
subtotal_taxstringLine subtotal tax (before discounts). read-only
totalstringLine total, excluding tax (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Purchase Order - Taxes properties read-only
stock_changedstringWhether the stock was already changed for this item. Options: yes and no.
meta_dataarrayMeta data. See Purchase Order - Meta data properties
skustringProduct SKU. When adding an item, it can be sent instead of product_id to find the product.
global_unique_idstringProduct's GTIN, UPC, EAN or ISBN. read-only
pricenumberProduct unit price (line total divided by the quantity). When adding or updating an item, you can send the unit price instead of the subtotal and total, and both are calculated as price × quantity. When adding a product without any of them, the product's purchase price is used.
imageobjectProperties of the main product image: id (image ID) and src (image URL). read-only
parent_namestringParent product name if the product is a variation. null otherwise. read-only
mi_inventoriesarrayMulti-Inventory order items. See Purchase Order - MI Order Items properties Multi-Inventory
bom_itemsarrayBOM order items. See Purchase Order - BOM Order Items properties read-only Product Levels

Purchase Order - Tax lines properties

AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idintegerTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
meta_dataarrayMeta data. See Purchase Order - Meta data properties

Purchase Order - Shipping lines properties

AttributeTypeDescription
idintegerItem ID. Send it to update an existing item. read-only
method_titlestringShipping method name. Send it as null to remove the item.
method_idstringShipping method ID. Required when adding a shipping line.
totalstringShipping total, excluding tax.
total_taxstringShipping total tax. read-only
taxesarrayLine taxes. See Purchase Order - Taxes properties read-only
meta_dataarrayMeta data. See Purchase Order - Meta data properties

Purchase Order - Fee lines properties

AttributeTypeDescription
idintegerItem ID. Send it to update an existing item. read-only
namestringFee name. Required when adding a fee line. Send it as null to remove the item.
tax_classstringTax class of fee.
tax_statusstringTax status of fee. Options: taxable and none.
totalstringFee total, excluding tax.
total_taxstringFee total tax. read-only
taxesarrayLine taxes. See Purchase Order - Taxes properties read-only
meta_dataarrayMeta data. See Purchase Order - Meta data properties

Purchase Order - Taxes properties

AttributeTypeDescription
idintegerTax rate ID. read-only
totalstringTax total. read-only
subtotalstringTax subtotal. Empty for shipping lines. read-only

Purchase Order - MI Order Items properties

Multi-Inventory
AttributeTypeDescription
idintegerThe order item inventory ID. read-only
inventory_idintegerThe inventory ID linked to the order item. It must be an inventory of the line item's product (or variation). Required when adding or editing order item inventories.
qtynumberThe quantity of the specified inventory that is used on the order item. Default is 0.
subtotalnumberOrder item inventory's subtotal. If not sent, it's calculated from the inventory's (or the product's) purchase price.
totalnumberOrder item inventory's total. If not sent, it's calculated from the inventory's (or the product's) purchase price.
refund_qtynumberOrder item inventory's refund quantity.
refund_totalnumberOrder item inventory's refund total.
reduced_stocknumberOrder item inventory's already reduced stock. read-only
extra_datastringOrder item inventory's extra data: a serialized array with the inventory details (name, SKU, supplier SKU, barcode, BBE date, lot, regions, locations, etc.) to keep them in the order if the inventory gets deleted. read-only
deletebooleanSet to true to delete the order item inventory with the specified inventory_id. Default is false. write-only
order_item_idintegerThe order item ID linked to this order item inventory. It's always taken from the parent line item. write-only
product_idintegerThe product ID from where the inventory comes. write-only
order_typeintegerThe type of order (WC Order = 1, Purchase Order = 2, Inventory Log = 3). write-only

When the mi_inventories array is sent for a line item, the inventories that aren't included in it are kept as they are, the ones included are updated (matched by inventory_id) or added, and the ones with delete set to true are removed. The line item's quantity and totals are then recalculated from its inventories.

Purchase Order - BOM Order Items properties

Product Levels
AttributeTypeDescription
idintegerThe BOM order item ID. Not included in the responses. read-only
bom_idintegerThe BOM product ID associated to the BOM order item. read-only
bom_typestringThe BOM product type. Options: product_part and raw_material. read-only
qtynumberThe quantity of the specified BOM that is used on the order item (the sum of all the order items of that BOM). read-only

Purchase Order - Purchase Orders PRO properties

Purchase Orders PRO

When the Purchase Orders PRO add-on is active, the purchase orders endpoints accept and return these extra properties:

AttributeTypeDescription
numberstringThe number/name of the purchase order. Purchase Orders PRO
purchaser_addressstringThe address of the purchaser. Purchase Orders PRO
purchaser_citystringThe city where the purchaser is. Purchase Orders PRO
purchaser_statestringThe state where the purchaser is. Purchase Orders PRO
purchaser_postal_codestringThe zip code for the purchaser address. Purchase Orders PRO
purchaser_countrystringThe country where the purchaser is. Purchase Orders PRO
has_taxes_enabledbooleanWhether the purchase order has the taxes enabled or not. Purchase Orders PRO
ship_viastringThe ship via field value. Purchase Orders PRO
supplier_codestringThe code/ID of the supplier. Purchase Orders PRO
supplier_currencystringThe currency used by the supplier. Purchase Orders PRO
supplier_discountnumberThe discount to be applied to the items from the supplier. Purchase Orders PRO
exchange_ratenumberThe exchange rate for the supplier currency. Purchase Orders PRO
price_num_decimalsintegerThe number of decimals used in the prices. Purchase Orders PRO
deliveriesarrayThe purchase order's deliveries list. See Purchase Order - Deliveries and invoices properties read-only Purchase Orders PRO
invoicesarrayThe purchase order's invoices list. See Purchase Order - Deliveries and invoices properties read-only Purchase Orders PRO

Purchase Orders PRO also replaces the purchase order statuses. These are the values allowed for the status property and the status filter when the add-on is active:

StatusLabel
atum_pendingDraft
atum_newNew
atum_approvalAwaiting Approval
atum_approvedNew (Approved)
atum_orderedSent
atum_vendor_receivedReceived by Vendor
atum_onthewayinOn the Way In
atum_receivingReceiving
atum_part_receivingPartially Receiving
atum_quality_checkQuality Check
atum_addedAdded
atum_partially_addedPartially Added
atum_receivedCompleted
atum_cancelledCancelled
atum_returningReturning
atum_returnedReturned
trashArchived
Purchase Orders PRO data in a purchase order response
{
    "id": 2156,
    "status": "atum_approved",
    "number": "PO-2156",
    "purchaser_address": "Main Street, 1",
    "purchaser_city": "Valencia",
    "purchaser_state": "V",
    "purchaser_postal_code": "46001",
    "purchaser_country": "ES",
    "has_taxes_enabled": true,
    "ship_via": "UPS",
    "supplier_code": "SUP-399",
    "supplier_currency": "EUR",
    "supplier_discount": 5,
    "exchange_rate": 1,
    "price_num_decimals": 2,
    "deliveries": [
        {
            "id": 2160,
            "name": "Delivery #1",
            "document_number": "DN-0001",
            "date_created": "2019-11-15 10:21:00"
        }
    ],
    "invoices": [
        {
            "id": 2161,
            "name": "Invoice #1",
            "document_number": "INV-0001",
            "date_created": "2019-11-15 10:25:00"
        }
    ]
}

Purchase Order - Deliveries and invoices properties

Purchase Orders PRO
AttributeTypeDescription
idintegerThe delivery or invoice ID. See Purchase order deliveries and Purchase order invoices. read-only
namestringThe delivery or invoice name. read-only
document_numberstringThe document number of the delivery note or the invoice. read-only
date_createdstringThe date the delivery or invoice was created, in the site's timezone (Y-m-d H:i:s format). read-only

Create a purchase order

This API helps you to create a new purchase order.

HTTP request

POST/wp-json/wc/v3/atum/purchase-orders
curl -X POST https://example.com/wp-json/wc/v3/atum/purchase-orders \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
  "supplier": 399,
  "date_expected": "2019-11-11T11:26:41",
  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
  "status": "atum_ordered",
  "line_items": [
    {
      "product_id": 93,
      "quantity": 2,
      "mi_inventories": [
        {
          "inventory_id": 152,
          "qty": 1
        },
        {
          "inventory_id": 126,
          "qty": 1
        }
      ]
    },
    {
      "product_id": 22,
      "variation_id": 23,
      "quantity": 1,
      "mi_inventories": [
        {
          "inventory_id": 112,
          "qty": 1
        }        
      ]
    }
  ]
}'
JSON response example
{
    "id": 2156,
    "status": "atum_ordered",
    "currency": "EUR",
    "prices_include_tax": false,
    "date_created": "2019-11-12T09:37:12",
    "date_modified": "2019-11-12T09:37:13",
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "0.00",
    "shipping_tax": "0.00",
    "cart_tax": "1.20",
    "total": "13.20",
    "total_tax": "1.20",
    "date_completed": "2019-11-12T09:37:14",
    "line_items": [
        {
            "id": 337,
            "name": "Woo Single #1",
            "product_id": 93,
            "variation_id": 0,
            "quantity": 2,
            "tax_class": "",
            "subtotal": "6.00",
            "subtotal_tax": "1.20",
            "total": "6.00",
            "total_tax": "1.20",
            "taxes": [
                {
                    "id": 1,
                    "total": "1.2",
                    "subtotal": "1.2"
                }
            ],
            "stock_changed": "no",
            "meta_data": [],
            "sku": "Back Orders",
            "global_unique_id": "",
            "price": 3,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": null,
            "mi_inventories": [
                {
                    "id": 201,
                    "inventory_id": 152,
                    "qty": 1,
                    "subtotal": 3,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:11:{s:4:\"name\";s:14:\"Main Inventory\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;s:7:\"is_main\";s:3:\"yes\";}"
                },
                {
                    "id": 202,
                    "inventory_id": 126,
                    "qty": 1,
                    "subtotal": 3,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 2\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                }
            ],
            "bom_items": []
        },
        {
            "id": 338,
            "name": "Ship Your Idea 2 - Black",
            "product_id": 22,
            "variation_id": 23,
            "quantity": 1,
            "tax_class": "",
            "subtotal": "0.00",
            "subtotal_tax": "0.00",
            "total": "0.00",
            "total_tax": "0.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "0",
                    "subtotal": "0"
                }
            ],
            "stock_changed": "no",
            "meta_data": [
                {
                    "id": 2872,
                    "key": "pa_color",
                    "value": "black",
                    "display_key": "Color",
                    "display_value": "Black"
                }
            ],
            "sku": "",
            "global_unique_id": "",
            "price": 0,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": "Ship Your Idea 2",
            "mi_inventories": [
                {
                    "id": 203,
                    "inventory_id": 112,
                    "qty": 1,
                    "subtotal": 0,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 3\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                }
            ],
            "bom_items": []
        }
    ],
    "tax_lines": [
        {
            "id": 339,
            "rate_code": "GB-VAT-1",
            "rate_id": 1,
            "label": "VAT",
            "compound": false,
            "tax_total": "1.20",
            "shipping_tax_total": "0.00",
            "meta_data": []
        }
    ],
    "shipping_lines": [],
    "fee_lines": [],
    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    "supplier": 399,
    "multiple_suppliers": false,
    "date_expected": "2019-11-11T11:26:41",
    "date_created_gmt": "2019-11-12T08:37:12",
    "date_modified_gmt": "2019-11-12T09:37:13",
    "date_completed_gmt": "2019-11-12T08:37:14",
    "date_expected_gmt": "2019-11-11T10:26:41",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/2156"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
            }
        ]
    }
}

Retrieve a purchase order

This API lets you retrieve and view a specific purchase order.

HTTP request

GET/wp-json/wc/v3/atum/purchase-orders/<id>
curl https://example.com/wp-json/wc/v3/atum/purchase-orders/1841 \
	-u consumer_key:consumer_secret
JSON response example
{
    "id": 1841,
    "status": "atum_receiving",
    "currency": "EUR",
    "prices_include_tax": false,
    "date_created": "2019-10-04T09:35:00",
    "date_modified": "2019-10-15T11:36:18",
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "0.00",
    "shipping_tax": "0.00",
    "cart_tax": "5.20",
    "total": "31.20",
    "total_tax": "5.20",
    "date_completed": "2019-11-12T09:42:58",
    "line_items": [
        {
            "id": 313,
            "name": "Woo Single #1",
            "product_id": 93,
            "variation_id": 0,
            "quantity": 2,
            "tax_class": "",
            "subtotal": "6.00",
            "subtotal_tax": "1.20",
            "total": "6.00",
            "total_tax": "1.20",
            "taxes": [
                {
                    "id": 1,
                    "total": "1.2",
                    "subtotal": "1.2"
                }
            ],
            "stock_changed": "no",
            "meta_data": [
                {
                    "id": 2703,
                    "key": "final",
                    "value": "version",
                    "display_key": "final",
                    "display_value": "version"
                }
            ],
            "sku": "Back Orders",
            "global_unique_id": "",
            "price": 3,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": null,
            "mi_inventories": [],
            "bom_items": []
        },
        {
            "id": 314,
            "name": "Ship Your Idea 2 - Black",
            "product_id": 22,
            "variation_id": 23,
            "quantity": 1,
            "tax_class": "",
            "subtotal": "20.00",
            "subtotal_tax": "4.00",
            "total": "20.00",
            "total_tax": "4.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "4",
                    "subtotal": "4"
                }
            ],
            "stock_changed": "no",
            "meta_data": [
                {
                    "id": 2633,
                    "key": "pa_color",
                    "value": "black",
                    "display_key": "Color",
                    "display_value": "Black"
                }
            ],
            "sku": "",
            "global_unique_id": "",
            "price": 20,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": "Ship Your Idea 2",
            "mi_inventories": [],
            "bom_items": []
        }
    ],
    "tax_lines": [
        {
            "id": 315,
            "rate_code": "GB-VAT-1",
            "rate_id": 1,
            "label": "VAT",
            "compound": false,
            "tax_total": "5.20",
            "shipping_tax_total": "0.00",
            "meta_data": []
        }
    ],
    "shipping_lines": [],
    "fee_lines": [],
    "description": "",
    "supplier": 399,
    "multiple_suppliers": false,
    "date_expected": "2019-10-05T08:00:00",
    "date_created_gmt": "2019-10-04T09:35:00",
    "date_modified_gmt": "2019-10-15T11:36:18",
    "date_completed_gmt": "2019-11-12T08:42:58",
    "date_expected_gmt": "2019-10-05T08:00:00",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/1841"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
            }
        ]
    }
}

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
dpintegerNumber of decimal points to use in each resource. Default is 2.

List all purchase orders

This API helps you to view all the purchase orders.

HTTP request

GET/wp-json/wc/v3/atum/purchase-orders
curl https://example.com/wp-json/wc/v3/atum/purchase-orders \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "id": 1927,
        "status": "atum_pending",
        "currency": "EUR",
        "prices_include_tax": false,
        "date_created": "2019-10-24T10:16:12",
        "date_modified": "2019-10-24T10:16:13",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "20.00",
        "shipping_tax": "2.00",
        "cart_tax": "4.00",
        "total": "66.00",
        "total_tax": "6.00",
        "date_completed": "2019-11-12T09:45:21",
        "line_items": [
            {
                "id": 316,
                "name": "ABC 123 XPTO",
                "product_id": 507,
                "variation_id": 0,
                "quantity": 5,
                "tax_class": "",
                "subtotal": "0.00",
                "subtotal_tax": "0.00",
                "total": "0.00",
                "total_tax": "0.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "stock_changed": "no",
                "meta_data": [],
                "sku": "",
                "global_unique_id": "",
                "price": 0,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": null,
                "mi_inventories": [
                    {
                        "id": 189,
                        "inventory_id": 152,
                        "qty": 3,
                        "subtotal": 60,
                        "total": 60,
                        "refund_qty": 0,
                        "refund_total": 0,
                        "reduced_stock": 0,
                        "extra_data": "a:11:{s:4:\"name\";s:14:\"Main Inventory\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;s:7:\"is_main\";s:3:\"yes\";}"
                    },
                    {
                        "id": 190,
                        "inventory_id": 126,
                        "qty": 2,
                        "subtotal": 20,
                        "total": 20,
                        "refund_qty": 0,
                        "refund_total": 0,
                        "reduced_stock": 0,
                        "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 2\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                    }
                ],
                "bom_items": []
            },
            {
                "id": 317,
                "name": "Ship Your Idea 2 - Black",
                "product_id": 22,
                "variation_id": 23,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "20.00",
                "subtotal_tax": "4.00",
                "total": "20.00",
                "total_tax": "4.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "4",
                        "subtotal": "4"
                    }
                ],
                "stock_changed": "no",
                "meta_data": [
                    {
                        "id": 2722,
                        "key": "pa_color",
                        "value": "black",
                        "display_key": "Color",
                        "display_value": "Black"
                    }
                ],
                "sku": "",
                "global_unique_id": "",
                "price": 20,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": "Ship Your Idea 2",
                "mi_inventories": [],
                "bom_items": []
            }
        ],
        "tax_lines": [
            {
                "id": 319,
                "rate_code": "GB-VAT-1",
                "rate_id": 1,
                "label": "VAT",
                "compound": false,
                "tax_total": "4.00",
                "shipping_tax_total": "2.00",
                "meta_data": []
            }
        ],
        "shipping_lines": [
            {
                "id": 318,
                "method_title": "Flat Rate",
                "method_id": "flat_rate",
                "total": "10.00",
                "total_tax": "2.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "2",
                        "subtotal": ""
                    }
                ],
                "meta_data": []
            }
        ],
        "fee_lines": [],
        "description": "",
        "supplier": false,
        "multiple_suppliers": true,
        "date_expected": "2019-11-12T09:45:21",
        "date_created_gmt": "2019-10-24T08:16:12",
        "date_modified_gmt": "2019-10-24T10:16:13",
        "date_completed_gmt": "2019-11-12T08:45:21",
        "date_expected_gmt": "2019-11-12T08:45:21",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/1927"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                }
            ]
        }
    },
    {
        "id": 852,
        "status": "atum_received",
        "currency": "USD",
        "prices_include_tax": false,
        "date_created": "2019-04-30T18:35:00",
        "date_modified": "2019-10-03T12:01:16",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "10.00",
        "shipping_tax": "2.00",
        "cart_tax": "2.00",
        "total": "24.00",
        "total_tax": "4.00",
        "date_completed": "2019-11-12T09:45:21",
        "line_items": [
            {
                "id": 283,
                "name": "Variable Raw Material - Orange",
                "product_id": 639,
                "variation_id": 0,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "0.00",
                "subtotal_tax": "0.00",
                "total": "0.00",
                "total_tax": "0.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "stock_changed": "yes",
                "meta_data": [
                    {
                        "id": 2337,
                        "key": "pa_color",
                        "value": "orange",
                        "display_key": "Color",
                        "display_value": "Orange"
                    }
                ],
                "sku": "",
                "global_unique_id": "",
                "price": 0,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": null,
                "mi_inventories": [],
                "bom_items": []
            }
        ],
        "tax_lines": [
            {
                "id": 287,
                "rate_code": "GB-VAT-1",
                "rate_id": 1,
                "label": "VAT",
                "compound": false,
                "tax_total": "2.00",
                "shipping_tax_total": "2.00",
                "meta_data": []
            }
        ],
        "shipping_lines": [
            {
                "id": 286,
                "method_title": "Flat rate",
                "method_id": "flat_rate",
                "total": "10.00",
                "total_tax": "2.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "2",
                        "subtotal": ""
                    }
                ],
                "meta_data": []
            }
        ],
        "fee_lines": [
            {
                "id": 288,
                "name": "Fee Edited",
                "tax_class": "",
                "tax_status": "taxable",
                "total": "10.00",
                "total_tax": "2.00",
                "taxes": [
                    {
                        "id": 1,
                        "total": "2",
                        "subtotal": ""
                    }
                ],
                "meta_data": []
            }
        ],
        "description": "",
        "supplier": false,
        "multiple_suppliers": true,
        "date_expected": "2019-04-30T16:35:00",
        "date_created_gmt": "2019-04-30T18:35:00",
        "date_modified_gmt": "2019-10-03T12:01:16",
        "date_completed_gmt": "2019-11-12T08:45:21",
        "date_expected_gmt": "2019-04-30T16:35:00",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/852"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                }
            ]
        }
    },
    {
        "id": 851,
        "status": "atum_received",
        "currency": "EUR",
        "prices_include_tax": false,
        "date_created": "2019-04-30T17:40:00",
        "date_modified": "2019-04-30T17:48:14",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "cart_tax": "0.00",
        "total": "0.00",
        "total_tax": "0.00",
        "date_completed": "2019-11-12T09:45:21",
        "line_items": [
            {
                "id": 282,
                "name": "Variable Raw Material - Orange",
                "product_id": 639,
                "variation_id": 0,
                "quantity": 2,
                "tax_class": "",
                "subtotal": "0.00",
                "subtotal_tax": "0.00",
                "total": "0.00",
                "total_tax": "0.00",
                "taxes": [],
                "stock_changed": "yes",
                "meta_data": [
                    {
                        "id": 2288,
                        "key": "pa_color",
                        "value": "orange",
                        "display_key": "Color",
                        "display_value": "Orange"
                    }
                ],
                "sku": "",
                "global_unique_id": "",
                "price": 0,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": null,
                "mi_inventories": [],
                "bom_items": []
            }
        ],
        "tax_lines": [],
        "shipping_lines": [],
        "fee_lines": [],
        "description": "",
        "supplier": false,
        "multiple_suppliers": true,
        "date_expected": "2019-04-30T15:47:00",
        "date_created_gmt": "2019-04-30T17:40:00",
        "date_modified_gmt": "2019-04-30T17:48:14",
        "date_completed_gmt": "2019-11-12T08:45:21",
        "date_expected_gmt": "2019-04-30T15:47:00",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/851"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                }
            ]
        }
    },
    {
        "id": 843,
        "status": "atum_pending",
        "currency": "EUR",
        "prices_include_tax": false,
        "date_created": "2019-04-30T13:17:00",
        "date_modified": "2019-09-10T12:26:12",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "cart_tax": "0.00",
        "total": "14.10",
        "total_tax": "0.00",
        "date_completed": "2019-11-12T09:45:22",
        "line_items": [
            {
                "id": 278,
                "name": "Product Part 1",
                "product_id": 175,
                "variation_id": 0,
                "quantity": 1,
                "tax_class": "zero-rate",
                "subtotal": "12.00",
                "subtotal_tax": "0.00",
                "total": "12.00",
                "total_tax": "0.00",
                "taxes": [],
                "stock_changed": "no",
                "meta_data": [],
                "sku": "PART1",
                "global_unique_id": "",
                "price": 12,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": null,
                "mi_inventories": [],
                "bom_items": []
            },
            {
                "id": 279,
                "name": "Variable Product Part 1 - Black",
                "product_id": 512,
                "variation_id": 513,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "2.10",
                "subtotal_tax": "0.00",
                "total": "2.10",
                "total_tax": "0.00",
                "taxes": [],
                "stock_changed": "no",
                "meta_data": [
                    {
                        "id": 2256,
                        "key": "pa_color",
                        "value": "black",
                        "display_key": "Color",
                        "display_value": "Black"
                    }
                ],
                "sku": "VPART1",
                "global_unique_id": "",
                "price": 2.1,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": "Variable Product Part 1",
                "mi_inventories": [],
                "bom_items": []
            }
        ],
        "tax_lines": [],
        "shipping_lines": [],
        "fee_lines": [],
        "description": "",
        "supplier": false,
        "multiple_suppliers": true,
        "date_expected": "2019-04-30T11:20:00",
        "date_created_gmt": "2019-04-30T13:17:00",
        "date_modified_gmt": "2019-09-10T12:26:12",
        "date_completed_gmt": "2019-11-12T08:45:22",
        "date_expected_gmt": "2019-04-30T11:20:00",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/843"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                }
            ]
        }
    },
    {
        "id": 797,
        "status": "atum_received",
        "currency": "EUR",
        "prices_include_tax": false,
        "date_created": "2019-04-23T08:33:00",
        "date_modified": "2019-05-27T09:16:09",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "cart_tax": "0.00",
        "total": "4.00",
        "total_tax": "0.00",
        "date_completed": "2019-11-12T09:45:22",
        "line_items": [
            {
                "id": 274,
                "name": "ABC 123 XPTO",
                "product_id": 507,
                "variation_id": 0,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "4.00",
                "subtotal_tax": "0.00",
                "total": "4.00",
                "total_tax": "0.00",
                "taxes": [],
                "stock_changed": "yes",
                "meta_data": [],
                "sku": "",
                "global_unique_id": "",
                "price": 4,
                "image": {
                    "id": 0,
                    "src": ""
                },
                "parent_name": null,
                "mi_inventories": [],
                "bom_items": []
            }
        ],
        "tax_lines": [],
        "shipping_lines": [],
        "fee_lines": [],
        "description": "",
        "supplier": 426,
        "multiple_suppliers": false,
        "date_expected": "2019-06-28T00:00:00",
        "date_created_gmt": "2019-04-23T08:33:00",
        "date_modified_gmt": "2019-05-27T09:16:09",
        "date_completed_gmt": "2019-11-12T08:45:22",
        "date_expected_gmt": "2019-06-28T00:00:00",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/797"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                }
            ]
        }
    }
]

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
modified_afterstringLimit response to resources modified after a given ISO8601 compliant date.
modified_beforestringLimit response to resources modified before a given ISO8601 compliant date.
dates_are_gmtbooleanWhether to consider GMT post dates when limiting response by published or modified date. Default is false.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title, slug and modified. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
statusarrayLimit result set to purchase orders assigned a specific status. Options: any, atum_pending, atum_ordered, atum_onthewayin, atum_receiving, atum_received and trash (or the Purchase Orders PRO statuses when the add-on is active). Default is any.
productintegerLimit result set to purchase orders assigned a specific product.
dpintegerNumber of decimal points to use in each resource. Default is 2.
order_item_display_metabooleanOnly show the line items' meta which is meant to be displayed (the variation attributes already included in the item name are excluded). Default is false.
include_metaarrayLimit meta_data to specific keys. Inherited from the WooCommerce orders endpoint: it currently has no effect on purchase orders.
exclude_metaarrayEnsure meta_data excludes specific keys. Inherited from the WooCommerce orders endpoint: it currently has no effect on purchase orders.
created_viaarrayLimit result set to orders created via specific sources. Inherited from the WooCommerce orders endpoint: it currently has no effect on purchase orders.
date_expectedstringLimit result set to purchase orders expected at location on a given ISO8601 compliant date.
supplierintegerLimit result set to purchase orders linked to the specified supplier ID.
multiple_suppliersbooleanLimit result set to purchase orders depending on their multiple suppliers switch status.

Update a purchase order

This API lets you make changes to a purchase order.

HTTP Request

PUT/wp-json/wc/v3/atum/purchase-orders/<id>
curl -X PUT https://example.com/wp-json/wc/v3/atum/purchase-orders/1927 \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
          "status": "atum_received"
        }'
JSON response example
{
    "id": 1927,
    "status": "atum_received",
    "currency": "EUR",
    "prices_include_tax": false,
    "date_created": "2019-10-24T10:16:12",
    "date_modified": "2019-11-12T10:15:56",
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "20.00",
    "shipping_tax": "2.00",
    "cart_tax": "4.00",
    "total": "66.00",
    "total_tax": "6.00",
    "date_completed": "2019-11-12T10:15:58",
    "line_items": [
        {
            "id": 316,
            "name": "ABC 123 XPTO",
            "product_id": 507,
            "variation_id": 0,
            "quantity": 5,
            "tax_class": "",
            "subtotal": "0.00",
            "subtotal_tax": "0.00",
            "total": "0.00",
            "total_tax": "0.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "0",
                    "subtotal": "0"
                }
            ],
            "stock_changed": "yes",
            "meta_data": [],
            "sku": "",
            "global_unique_id": "",
            "price": 0,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": null,
            "mi_inventories": [
                {
                    "id": 189,
                    "inventory_id": 152,
                    "qty": 3,
                    "subtotal": 60,
                    "total": 60,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 3,
                    "extra_data": "a:11:{s:4:\"name\";s:14:\"Main Inventory\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;s:7:\"is_main\";s:3:\"yes\";}"
                },
                {
                    "id": 190,
                    "inventory_id": 126,
                    "qty": 2,
                    "subtotal": 20,
                    "total": 20,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 2,
                    "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 2\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                }
            ],
            "bom_items": [
                {
                    "bom_id": 183,
                    "bom_type": "raw_material",
                    "qty": 10
                },
                {
                    "bom_id": 184,
                    "bom_type": "product_part",
                    "qty": 5
                }
            ]
        },
        {
            "id": 317,
            "name": "Ship Your Idea 2 - Black",
            "product_id": 22,
            "variation_id": 23,
            "quantity": 1,
            "tax_class": "",
            "subtotal": "20.00",
            "subtotal_tax": "4.00",
            "total": "20.00",
            "total_tax": "4.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "4",
                    "subtotal": "4"
                }
            ],
            "stock_changed": "yes",
            "meta_data": [
                {
                    "id": 2722,
                    "key": "pa_color",
                    "value": "black",
                    "display_key": "Color",
                    "display_value": "Black"
                }
            ],
            "sku": "",
            "global_unique_id": "",
            "price": 20,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": "Ship Your Idea 2",
            "mi_inventories": [],
            "bom_items": []
        }
    ],
    "tax_lines": [
        {
            "id": 319,
            "rate_code": "GB-VAT-1",
            "rate_id": 1,
            "label": "VAT",
            "compound": false,
            "tax_total": "4.00",
            "shipping_tax_total": "2.00",
            "meta_data": []
        }
    ],
    "shipping_lines": [
        {
            "id": 318,
            "method_title": "Flat Rate",
            "method_id": "flat_rate",
            "total": "10.00",
            "total_tax": "2.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "2",
                    "subtotal": ""
                }
            ],
            "meta_data": []
        }
    ],
    "fee_lines": [],
    "description": "",
    "supplier": false,
    "multiple_suppliers": true,
    "date_expected": "2019-11-12T10:15:58",
    "date_created_gmt": "2019-10-24T08:16:12",
    "date_modified_gmt": "2019-11-12T10:15:56",
    "date_completed_gmt": "2019-11-12T09:15:58",
    "date_expected_gmt": "2019-11-12T09:15:58",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/1927"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
            }
        ]
    }
}

Delete a purchase order

This API helps you delete a purchase order.

HTTP request

DELETE/wp-json/wc/v3/atum/purchase-orders/<id>
curl -X DELETE https://example.com/wp-json/wc/v3/atum/purchase-orders/2156?force=true \
	-u consumer_key:consumer_secret
JSON response example
{
    "id": 2156,
    "status": "atum_ordered",
    "currency": "EUR",
    "prices_include_tax": false,
    "date_created": "2019-11-12T09:37:12",
    "date_modified": "2019-11-12T09:37:13",
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "0.00",
    "shipping_tax": "0.00",
    "cart_tax": "1.20",
    "total": "13.20",
    "total_tax": "1.20",
    "date_completed": "2019-11-12T10:18:43",
    "line_items": [
        {
            "id": 337,
            "name": "Woo Single #1",
            "product_id": 93,
            "variation_id": 0,
            "quantity": 2,
            "tax_class": "",
            "subtotal": "6.00",
            "subtotal_tax": "1.20",
            "total": "6.00",
            "total_tax": "1.20",
            "taxes": [
                {
                    "id": 1,
                    "total": "1.2",
                    "subtotal": "1.2"
                }
            ],
            "stock_changed": "no",
            "meta_data": [],
            "sku": "Back Orders",
            "global_unique_id": "",
            "price": 3,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": null,
            "mi_inventories": [
                {
                    "id": 201,
                    "inventory_id": 152,
                    "qty": 1,
                    "subtotal": 3,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:11:{s:4:\"name\";s:14:\"Main Inventory\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;s:7:\"is_main\";s:3:\"yes\";}"
                },
                {
                    "id": 202,
                    "inventory_id": 126,
                    "qty": 1,
                    "subtotal": 3,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 2\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                }
            ],
            "bom_items": []
        },
        {
            "id": 338,
            "name": "Ship Your Idea 2 - Black",
            "product_id": 22,
            "variation_id": 23,
            "quantity": 1,
            "tax_class": "",
            "subtotal": "0.00",
            "subtotal_tax": "0.00",
            "total": "0.00",
            "total_tax": "0.00",
            "taxes": [
                {
                    "id": 1,
                    "total": "0",
                    "subtotal": "0"
                }
            ],
            "stock_changed": "no",
            "meta_data": [
                {
                    "id": 2872,
                    "key": "pa_color",
                    "value": "black",
                    "display_key": "Color",
                    "display_value": "Black"
                }
            ],
            "sku": "",
            "global_unique_id": "",
            "price": 0,
            "image": {
                "id": 0,
                "src": ""
            },
            "parent_name": "Ship Your Idea 2",
            "mi_inventories": [
                {
                    "id": 203,
                    "inventory_id": 112,
                    "qty": 1,
                    "subtotal": 0,
                    "total": 0,
                    "refund_qty": 0,
                    "refund_total": 0,
                    "reduced_stock": 0,
                    "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 3\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                }
            ],
            "bom_items": []
        }
    ],
    "tax_lines": [
        {
            "id": 339,
            "rate_code": "GB-VAT-1",
            "rate_id": 1,
            "label": "VAT",
            "compound": false,
            "tax_total": "1.20",
            "shipping_tax_total": "0.00",
            "meta_data": []
        }
    ],
    "shipping_lines": [],
    "fee_lines": [],
    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    "supplier": 399,
    "multiple_suppliers": false,
    "date_expected": "2019-11-11T11:26:41",
    "date_created_gmt": "2019-11-12T08:37:12",
    "date_modified_gmt": "2019-11-12T09:37:13",
    "date_completed_gmt": "2019-11-12T09:18:43",
    "date_expected_gmt": "2019-11-11T10:26:41",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/2156"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
            }
        ]
    }
}

Available parameters

ParameterTypeDescription
forcebooleanUse true to permanently delete the purchase order. If false, the purchase order is moved to the trash. Default is false.

Batch update purchase orders

This API helps you to batch create, update and delete multiple purchase orders.

Note: By default it's limited to up to 100 objects to be created, updated or deleted.

HTTP request

POST/wp-json/wc/v3/atum/purchase-orders/batch

Example of Create, Update and Delete items in bulk

curl -X POST https://example.com/wp-json/wc/v3/atum/purchase-orders/batch \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
      "create": [
        {
          "supplier": 399,
          "status": "atum_onthewayin",
          "line_items": [
            {
              "product_id": 79,
              "quantity": 1,
              "mi_inventories": [
                {
                  "inventory_id": 13,
                  "qty": 1
                }
              ] 
            },
            {
              "product_id": 93,
              "quantity": 1,
              "mi_inventories": [
                {
                  "inventory_id": 14,
                  "qty": 1
                }
              ] 
            },
            {
              "product_id": 22,
              "variation_id": 23,
              "quantity": 1,
              "mi_inventories": [
                {
                  "inventory_id": 58,
                  "qty": 1
                }
              ] 
            }
          ],
          "shipping_lines": [
            {
              "method_id": "flat_rate",
              "method_title": "Flat Rate",
              "total": 30
            }
          ]
        },
        {
          "multiple_suppliers": true,
          "status": "atum_pending",
          "line_items": [
            {
              "product_id": 22,
              "variation_id": 23,
              "quantity": 1,
              "mi_inventories": [
                {
                  "inventory_id": 59,
                  "qty": 1
                }
              ] 
            },
            {
              "product_id": 22,
              "variation_id": 24,
              "quantity": 1
            }
          ],
          "shipping_lines": [
            {
              "method_id": "flat_rate",
              "method_title": "Flat Rate",
              "total": 20
            }
          ]
        }
      ],
      "update": [
        {
          "id": 1841,         
          "date_expected": "2019-11-11T12:15:14"
        }
      ],
      "delete": [
        1927
      ]
    }'
JSON response example
{
    "create": [
        {
            "id": 2157,
            "status": "atum_onthewayin",
            "currency": "EUR",
            "prices_include_tax": false,
            "date_created": "2019-11-12T10:24:07",
            "date_modified": "2019-11-12T10:24:08",
            "discount_total": "0.00",
            "discount_tax": "0.00",
            "shipping_total": "60.00",
            "shipping_tax": "6.00",
            "cart_tax": "3.60",
            "total": "105.60",
            "total_tax": "9.60",
            "date_completed": "2019-11-12T10:24:08",
            "line_items": [
                {
                    "id": 340,
                    "name": "Woo Logo",
                    "product_id": 79,
                    "variation_id": 0,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "15.00",
                    "subtotal_tax": "3.00",
                    "total": "15.00",
                    "total_tax": "3.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "3",
                            "subtotal": "3"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 15,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": null,
                    "mi_inventories": [
                        {
                            "id": 204,
                            "inventory_id": 13,
                            "qty": 1,
                            "subtotal": 15,
                            "total": 0,
                            "refund_qty": 0,
                            "refund_total": 0,
                            "reduced_stock": 0,
                            "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 8\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                        }
                    ],
                    "bom_items": []
                },
                {
                    "id": 341,
                    "name": "Woo Single #1",
                    "product_id": 93,
                    "variation_id": 0,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "3.00",
                    "subtotal_tax": "0.60",
                    "total": "3.00",
                    "total_tax": "0.60",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "0.6",
                            "subtotal": "0.6"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [],
                    "sku": "Back Orders",
                    "global_unique_id": "",
                    "price": 3,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": null,
                    "mi_inventories": [
                        {
                            "id": 205,
                            "inventory_id": 14,
                            "qty": 1,
                            "subtotal": 3,
                            "total": 0,
                            "refund_qty": 0,
                            "refund_total": 0,
                            "reduced_stock": 0,
                            "extra_data": "a:10:{s:4:\"name\";s:12:\"Warehouse 10\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                        },
                        {
                            "id": 206,
                            "inventory_id": 58,
                            "qty": 1,
                            "subtotal": 9,
                            "total": 0,
                            "refund_qty": 0,
                            "refund_total": 0,
                            "reduced_stock": 0,
                            "extra_data": "a:10:{s:4:\"name\";s:12:\"Warehouse 11\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                        }
                    ],
                    "bom_items": []
                },
                {
                    "id": 342,
                    "name": "Ship Your Idea 2 - Black",
                    "product_id": 22,
                    "variation_id": 23,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "0.00",
                    "subtotal_tax": "0.00",
                    "total": "0.00",
                    "total_tax": "0.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "0",
                            "subtotal": "0"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [
                        {
                            "id": 2905,
                            "key": "pa_color",
                            "value": "black",
                            "display_key": "Color",
                            "display_value": "Black"
                        }
                    ],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 0,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": "Ship Your Idea 2",
                    "mi_inventories": [],
                    "bom_items": []
                }
            ],
            "tax_lines": [
                {
                    "id": 344,
                    "rate_code": "GB-VAT-1",
                    "rate_id": 1,
                    "label": "VAT",
                    "compound": false,
                    "tax_total": "3.60",
                    "shipping_tax_total": "6.00",
                    "meta_data": []
                }
            ],
            "shipping_lines": [
                {
                    "id": 343,
                    "method_title": "Flat Rate",
                    "method_id": "flat_rate",
                    "total": "30.00",
                    "total_tax": "6.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "6",
                            "subtotal": ""
                        }
                    ],
                    "meta_data": []
                }
            ],
            "fee_lines": [],
            "description": "",
            "supplier": 399,
            "multiple_suppliers": false,
            "date_expected": "2019-11-12T10:24:08",
            "date_created_gmt": "2019-11-12T09:24:07",
            "date_modified_gmt": "2019-11-12T10:24:08",
            "date_completed_gmt": "2019-11-12T09:24:08",
            "date_expected_gmt": "2019-11-12T09:24:08",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/2157"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                    }
                ]
            }
        },
        {
            "id": 2158,
            "status": "atum_pending",
            "currency": "EUR",
            "prices_include_tax": false,
            "date_created": "2019-11-12T10:24:09",
            "date_modified": "2019-11-12T10:24:11",
            "discount_total": "0.00",
            "discount_tax": "0.00",
            "shipping_total": "40.00",
            "shipping_tax": "4.00",
            "cart_tax": "4.00",
            "total": "88.00",
            "total_tax": "8.00",
            "date_completed": "2019-11-12T10:24:11",
            "line_items": [
                {
                    "id": 345,
                    "name": "Ship Your Idea 2 - Black",
                    "product_id": 22,
                    "variation_id": 23,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "0.00",
                    "subtotal_tax": "0.00",
                    "total": "0.00",
                    "total_tax": "0.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "0",
                            "subtotal": "0"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [
                        {
                            "id": 2924,
                            "key": "pa_color",
                            "value": "black",
                            "display_key": "Color",
                            "display_value": "Black"
                        }
                    ],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 0,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": "Ship Your Idea 2",
                    "mi_inventories": [],
                    "bom_items": []
                },
                {
                    "id": 346,
                    "name": "Ship Your Idea 2 - Green",
                    "product_id": 22,
                    "variation_id": 24,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "20.00",
                    "subtotal_tax": "4.00",
                    "total": "20.00",
                    "total_tax": "4.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "4",
                            "subtotal": "4"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [
                        {
                            "id": 2934,
                            "key": "pa_color",
                            "value": "green",
                            "display_key": "Color",
                            "display_value": "Green"
                        }
                    ],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 20,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": "Ship Your Idea 2",
                    "mi_inventories": [],
                    "bom_items": []
                }
            ],
            "tax_lines": [
                {
                    "id": 348,
                    "rate_code": "GB-VAT-1",
                    "rate_id": 1,
                    "label": "VAT",
                    "compound": false,
                    "tax_total": "4.00",
                    "shipping_tax_total": "4.00",
                    "meta_data": []
                }
            ],
            "shipping_lines": [
                {
                    "id": 347,
                    "method_title": "Flat Rate",
                    "method_id": "flat_rate",
                    "total": "20.00",
                    "total_tax": "4.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "4",
                            "subtotal": ""
                        }
                    ],
                    "meta_data": []
                }
            ],
            "fee_lines": [],
            "description": "",
            "supplier": false,
            "multiple_suppliers": true,
            "date_expected": "2019-11-12T10:24:12",
            "date_created_gmt": "2019-11-12T09:24:09",
            "date_modified_gmt": "2019-11-12T10:24:11",
            "date_completed_gmt": "2019-11-12T09:24:11",
            "date_expected_gmt": "2019-11-12T09:24:12",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/2158"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                    }
                ]
            }
        }
    ],
    "update": [
        {
            "id": 1841,
            "status": "atum_receiving",
            "currency": "EUR",
            "prices_include_tax": false,
            "date_created": "2019-10-04T09:35:00",
            "date_modified": "2019-11-12T10:24:12",
            "discount_total": "0.00",
            "discount_tax": "0.00",
            "shipping_total": "0.00",
            "shipping_tax": "0.00",
            "cart_tax": "5.20",
            "total": "31.20",
            "total_tax": "5.20",
            "date_completed": "2019-11-12T10:24:12",
            "line_items": [
                {
                    "id": 313,
                    "name": "Woo Single #1",
                    "product_id": 93,
                    "variation_id": 0,
                    "quantity": 2,
                    "tax_class": "",
                    "subtotal": "6.00",
                    "subtotal_tax": "1.20",
                    "total": "6.00",
                    "total_tax": "1.20",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "1.2",
                            "subtotal": "1.2"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [
                        {
                            "id": 2703,
                            "key": "final",
                            "value": "version",
                            "display_key": "final",
                            "display_value": "version"
                        }
                    ],
                    "sku": "Back Orders",
                    "global_unique_id": "",
                    "price": 3,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": null,
                    "mi_inventories": [],
                    "bom_items": []
                },
                {
                    "id": 314,
                    "name": "Ship Your Idea 2 - Black",
                    "product_id": 22,
                    "variation_id": 23,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "20.00",
                    "subtotal_tax": "4.00",
                    "total": "20.00",
                    "total_tax": "4.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "4",
                            "subtotal": "4"
                        }
                    ],
                    "stock_changed": "no",
                    "meta_data": [
                        {
                            "id": 2633,
                            "key": "pa_color",
                            "value": "black",
                            "display_key": "Color",
                            "display_value": "Black"
                        }
                    ],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 20,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": "Ship Your Idea 2",
                    "mi_inventories": [],
                    "bom_items": []
                }
            ],
            "tax_lines": [
                {
                    "id": 315,
                    "rate_code": "GB-VAT-1",
                    "rate_id": 1,
                    "label": "VAT",
                    "compound": false,
                    "tax_total": "5.20",
                    "shipping_tax_total": "0.00",
                    "meta_data": []
                }
            ],
            "shipping_lines": [],
            "fee_lines": [],
            "description": "",
            "supplier": 399,
            "multiple_suppliers": false,
            "date_expected": "2019-11-11T12:15:14",
            "date_created_gmt": "2019-10-04T09:35:00",
            "date_modified_gmt": "2019-11-12T10:24:12",
            "date_completed_gmt": "2019-11-12T09:24:12",
            "date_expected_gmt": "2019-11-11T11:15:14",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/1841"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                    }
                ]
            }
        }
    ],
    "delete": [
        {
            "id": 1927,
            "status": "atum_received",
            "currency": "EUR",
            "prices_include_tax": false,
            "date_created": "2019-10-24T10:16:12",
            "date_modified": "2019-11-12T10:15:56",
            "discount_total": "0.00",
            "discount_tax": "0.00",
            "shipping_total": "20.00",
            "shipping_tax": "2.00",
            "cart_tax": "4.00",
            "total": "66.00",
            "total_tax": "6.00",
            "date_completed": "2019-11-12T10:24:12",
            "line_items": [
                {
                    "id": 316,
                    "name": "ABC 123 XPTO",
                    "product_id": 507,
                    "variation_id": 0,
                    "quantity": 5,
                    "tax_class": "",
                    "subtotal": "0.00",
                    "subtotal_tax": "0.00",
                    "total": "0.00",
                    "total_tax": "0.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "0",
                            "subtotal": "0"
                        }
                    ],
                    "stock_changed": "yes",
                    "meta_data": [],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 0,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": null,
                    "mi_inventories": [
                        {
                            "id": 189,
                            "inventory_id": 152,
                            "qty": 3,
                            "subtotal": 60,
                            "total": 60,
                            "refund_qty": 0,
                            "refund_total": 0,
                            "reduced_stock": 3,
                            "extra_data": "a:11:{s:4:\"name\";s:14:\"Main Inventory\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;s:7:\"is_main\";s:3:\"yes\";}"
                        },
                        {
                            "id": 190,
                            "inventory_id": 126,
                            "qty": 2,
                            "subtotal": 20,
                            "total": 20,
                            "refund_qty": 0,
                            "refund_total": 0,
                            "reduced_stock": 2,
                            "extra_data": "a:10:{s:4:\"name\";s:11:\"Warehouse 2\";s:3:\"sku\";s:0:\"\";s:12:\"supplier_sku\";s:0:\"\";s:7:\"barcode\";s:0:\"\";s:8:\"bbe_date\";b:0;s:14:\"inventory_date\";s:16:\"2019-03-01 10:00\";s:3:\"lot\";s:0:\"\";s:6:\"region\";a:0:{}s:8:\"location\";a:0:{}s:16:\"expiry_threshold\";i:0;}"
                        }
                    ],
                    "bom_items": [
                        {
                            "bom_id": 183,
                            "bom_type": "raw_material",
                            "qty": 10
                        },
                        {
                            "bom_id": 184,
                            "bom_type": "product_part",
                            "qty": 5
                        }
                    ]
                },
                {
                    "id": 317,
                    "name": "Ship Your Idea 2 - Black",
                    "product_id": 22,
                    "variation_id": 23,
                    "quantity": 1,
                    "tax_class": "",
                    "subtotal": "20.00",
                    "subtotal_tax": "4.00",
                    "total": "20.00",
                    "total_tax": "4.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "4",
                            "subtotal": "4"
                        }
                    ],
                    "stock_changed": "yes",
                    "meta_data": [
                        {
                            "id": 2722,
                            "key": "pa_color",
                            "value": "black",
                            "display_key": "Color",
                            "display_value": "Black"
                        }
                    ],
                    "sku": "",
                    "global_unique_id": "",
                    "price": 20,
                    "image": {
                        "id": 0,
                        "src": ""
                    },
                    "parent_name": "Ship Your Idea 2",
                    "mi_inventories": [],
                    "bom_items": []
                }
            ],
            "tax_lines": [
                {
                    "id": 319,
                    "rate_code": "GB-VAT-1",
                    "rate_id": 1,
                    "label": "VAT",
                    "compound": false,
                    "tax_total": "4.00",
                    "shipping_tax_total": "2.00",
                    "meta_data": []
                }
            ],
            "shipping_lines": [
                {
                    "id": 318,
                    "method_title": "Flat Rate",
                    "method_id": "flat_rate",
                    "total": "10.00",
                    "total_tax": "2.00",
                    "taxes": [
                        {
                            "id": 1,
                            "total": "2",
                            "subtotal": ""
                        }
                    ],
                    "meta_data": []
                }
            ],
            "fee_lines": [],
            "description": "",
            "supplier": false,
            "multiple_suppliers": true,
            "date_expected": "2019-11-12T10:24:12",
            "date_created_gmt": "2019-10-24T08:16:12",
            "date_modified_gmt": "2019-11-12T10:15:56",
            "date_completed_gmt": "2019-11-12T09:24:12",
            "date_expected_gmt": "2019-11-12T09:24:12",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders/1927"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/purchase-orders"
                    }
                ]
            }
        }
    ]
}

On this page