Contents
On this page

Receive Purchase Order - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/purchase-orders/{id}/receive

Record a delivery, in full or in part. Stock goes up in the order’s store; the order becomes partial or received.

Needs a user with the plugixa_pos_purchase capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Unlike the other capabilities, Pro gives this one to administrators and to the WooCommerce Shop manager role.

Request

POST https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/3/receive

Path parameters

Name Type Description
id integer The purchase order’s id

Request body

Content type: application/json

Field Type Required Description
lines object[] Yes 1 to 500: product_id and qty received now, and optionally the real unit_cost.
note string No Up to 500 characters.
{
  "lines": [
    {
      "product_id": 3745,
      "qty": 6
    }
  ],
  "note": "First half, rest next week"
}

Responses

200 OK. data is the order.

{
  "success": true,
  "data": {
    "id": 3,
    "number": "PO-000003",
    "supplier_id": 2,
    "supplier_name": "Atelier Grès & Terre",
    "outlet_id": 1,
    "outlet_name": "Maison Plugixa Marais",
    "status": "partial",
    "expected_at": "2026-11-21",
    "note": "",
    "created_at": "2026-11-05 09:00:00",
    "ordered_at": "2026-11-05 09:30:00",
    "closed_at": null,
    "total": "58.80",
    "items": [
      {
        "id": 11,
        "product_id": 3745,
        "name": "Ceramic bowl",
        "sku": "KIT-BOWL",
        "qty_ordered": 12,
        "qty_received": 6,
        "unit_cost": "4.9000",
        "total": "58.80"
      }
    ],
    "receipts": [
      {
        "id": 3,
        "received_at": "2026-11-19 16:10:00",
        "note": "First half, rest next week",
        "received_by": "admin"
      }
    ]
  }
}

Errors

Status Code When
404 plugixa_pos_not_found No purchase order with that id.
409 plugixa_pos_po_status The order cannot do that in its current state.
422 plugixa_pos_not_on_order A product is not on this order.
422 plugixa_pos_nothing_received No quantity above zero.
409 plugixa_pos_not_stocked A product does not track stock.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/3/receive" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"lines":[{"product_id":3745,"qty":6}],"note":"First half, rest next week"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/3/receive');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'lines' => [
            [
                'product_id' => 3745,
                'qty'        => 6,
            ],
        ],
        'note'  => 'First half, rest next week',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/3/receive', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ lines: [{ product_id: 3745, qty: 6 }], note: 'First half, rest next week' }),
});
const { data } = await response.json();

Quick Links

Share