Back

Search

Search

Methods

Inventory

Orders

PurchaseOrder /Modify_PurchaseOrderItems_Bulk

Response: Modify_PurchaseOrderItems_BulkResponse



Delete, add and update purchase order items and cause purchase order totals recalculation

Parameters

NameTypeDescription
requestModify_PurchaseOrderItems_BulkRequest

HTTP Endpoint

Server /PurchaseOrder / Modify_PurchaseOrderItems_Bulk

Permissions

GlobalPermissions.PurchaseOrder.EditPurchaseOrderNode

Example Code

Example Request

The following request format is required for this method.

POST https://eu-ext.linnworks.net//api/PurchaseOrder/Modify_PurchaseOrderItems_Bulk HTTP/1.1
Host: eu-ext.linnworks.net
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
Origin: https://www.linnworks.net
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://www.linnworks.net/
Accept-Encoding: gzip, deflate
Authorization: INSERT_YOUR_TOKEN_HERE

request={
  "PurchaseId": "2e6086d0-8d3a-48a8-87d6-805db90bb364",
  "ItemsToAdd": [
    {
      "Id": "e8463870-eba5-48a7-bd44-82babac131dc",
      "StockItemId": "eaf983fb-35d3-426a-8f68-86f9fed1e4bc",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "e8463870-eba5-48a7-bd44-82babac131dc",
      "StockItemId": "eaf983fb-35d3-426a-8f68-86f9fed1e4bc",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToUpdate": [
    {
      "Id": "9843a444-0abc-4f1a-bfa3-ecaf213b5c0b",
      "PurchaseItemId": "826cc45a-5cf8-4f14-9444-d1fd89484b9b",
      "StockItemId": "ba44ce4c-f92a-4b86-8a9f-59336f1612e1",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "9843a444-0abc-4f1a-bfa3-ecaf213b5c0b",
      "PurchaseItemId": "826cc45a-5cf8-4f14-9444-d1fd89484b9b",
      "StockItemId": "ba44ce4c-f92a-4b86-8a9f-59336f1612e1",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToDelete": [
    "048719f7-65e0-4d4a-9ec3-cbab207a67c1",
    "256e39e8-5c14-4f26-a523-c8d9a7e176e4"
  ]
}

Response

This is an example response. Results may vary depending on your data.

{
  "ModifiedItems": [
    {
      "Id": "5e974bd9-ea0c-4361-8872-0dbe20d13b2f",
      "PurchaseItemId": "143e98ca-da0b-450b-a512-ad77867e9ca0",
      "StockItemId": "6699f73e-773c-4ae6-b508-4513f567e409",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    },
    {
      "Id": "5e974bd9-ea0c-4361-8872-0dbe20d13b2f",
      "PurchaseItemId": "143e98ca-da0b-450b-a512-ad77867e9ca0",
      "StockItemId": "6699f73e-773c-4ae6-b508-4513f567e409",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    }
  ],
  "PurchaseOrderHeader": {
    "pkPurchaseID": "f6df0d1c-6849-4034-9428-0e420f39a39f",
    "fkSupplierId": "40dd18bc-91e0-42b5-8b3f-93cdb67bbcd2",
    "fkLocationId": "ee434a83-1dd4-4a08-b123-ce9370755dd0",
    "ExternalInvoiceNumber": "sample string 4",
    "Status": 0,
    "Currency": "sample string 5",
    "SupplierReferenceNumber": "sample string 6",
    "Locked": true,
    "LineCount": 8,
    "DeliveredLinesCount": 9,
    "UnitAmountTaxIncludedType": 10,
    "DateOfPurchase": "2019-06-12T09:27:52.0806667Z",
    "DateOfDelivery": "2019-06-12T09:27:52.0806667Z",
    "QuotedDeliveryDate": "2019-06-12T09:27:52.0806667Z",
    "PostagePaid": 4.0,
    "TotalCost": 5.0,
    "taxPaid": 6.0,
    "ShippingTaxRate": 7.0,
    "ConversionRate": 8.0,
    "ConvertedShippingCost": 9.0,
    "ConvertedShippingTax": 10.0,
    "ConvertedOtherCost": 11.0,
    "ConvertedOtherTax": 12.0,
    "ConvertedGrandTotal": 13.0
  }
}