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": "f253b0e9-968d-4c38-a1a6-ff6c5965a175",
  "ItemsToAdd": [
    {
      "Id": "4b8d76d8-544c-467f-a988-574634ad7775",
      "StockItemId": "9b1f41ad-7875-4c00-a512-b9ac1dd39f2f",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "4b8d76d8-544c-467f-a988-574634ad7775",
      "StockItemId": "9b1f41ad-7875-4c00-a512-b9ac1dd39f2f",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToUpdate": [
    {
      "Id": "b4db6310-b742-43a9-8cf6-338741e194e2",
      "PurchaseItemId": "2d0fe9cb-d3c1-4f1f-976b-d9a2b35ae547",
      "StockItemId": "e53ae0eb-b9be-4f42-b61b-c42b20475a62",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "b4db6310-b742-43a9-8cf6-338741e194e2",
      "PurchaseItemId": "2d0fe9cb-d3c1-4f1f-976b-d9a2b35ae547",
      "StockItemId": "e53ae0eb-b9be-4f42-b61b-c42b20475a62",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToDelete": [
    "66ff331f-37a3-4d41-bb19-813f01990178",
    "e5e074b2-4993-4da0-93b4-4553cb98baf5"
  ]
}

Response

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

{
  "ModifiedItems": [
    {
      "Id": "3904d3bb-41df-40e5-a1ac-5360d685633d",
      "PurchaseItemId": "255b415f-0d46-4f72-811c-7c75c5611322",
      "StockItemId": "70ddc0cd-f620-425b-ac5a-aedceeb25e88",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    },
    {
      "Id": "3904d3bb-41df-40e5-a1ac-5360d685633d",
      "PurchaseItemId": "255b415f-0d46-4f72-811c-7c75c5611322",
      "StockItemId": "70ddc0cd-f620-425b-ac5a-aedceeb25e88",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    }
  ],
  "PurchaseOrderHeader": {
    "pkPurchaseID": "b106d6d9-8b10-4a91-90cd-5240ad6c92f1",
    "fkSupplierId": "6d8d2fc3-9bf5-4094-80cc-6cd200de756f",
    "fkLocationId": "938a135b-8621-412a-9088-2132cb6e9a9b",
    "ExternalInvoiceNumber": "sample string 4",
    "Status": 0,
    "Currency": "sample string 5",
    "SupplierReferenceNumber": "sample string 6",
    "Locked": true,
    "LineCount": 8,
    "DeliveredLinesCount": 9,
    "UnitAmountTaxIncludedType": 10,
    "DateOfPurchase": "2019-10-09T15:11:43.7534521Z",
    "DateOfDelivery": "2019-10-09T15:11:43.7534521Z",
    "QuotedDeliveryDate": "2019-10-09T15:11:43.7534521Z",
    "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
  }
}