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": "248430bb-f35b-41fc-91fa-7bec53601bcf",
  "ItemsToAdd": [
    {
      "Id": "d32c411a-8819-46f8-9363-f19251be50a7",
      "StockItemId": "9f1f6760-ac5c-4ed0-8f95-35138506068c",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "d32c411a-8819-46f8-9363-f19251be50a7",
      "StockItemId": "9f1f6760-ac5c-4ed0-8f95-35138506068c",
      "Qty": 3,
      "PackQuantity": 4,
      "PackSize": 5,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToUpdate": [
    {
      "Id": "d2ce1fcc-33cd-487d-af97-775a9736b9e1",
      "PurchaseItemId": "90b3e88b-02cb-42c9-b3c2-70206d12c42d",
      "StockItemId": "3efaa247-7d43-4240-b788-0d83d2bbb65a",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    },
    {
      "Id": "d2ce1fcc-33cd-487d-af97-775a9736b9e1",
      "PurchaseItemId": "90b3e88b-02cb-42c9-b3c2-70206d12c42d",
      "StockItemId": "3efaa247-7d43-4240-b788-0d83d2bbb65a",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "Cost": 1.0,
      "TaxRate": 2.0
    }
  ],
  "ItemsToDelete": [
    "224877ad-c7fc-4d85-9a83-d5054cb958c2",
    "d7a0bb07-4538-484e-9435-01baa5e57f0f"
  ]
}

Response

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

{
  "ModifiedItems": [
    {
      "Id": "fbe7c984-1efb-4c57-b9be-fd18999561d5",
      "PurchaseItemId": "3d05f16c-fc9f-4707-8fd6-591214e12f65",
      "StockItemId": "bf520887-df35-4e36-a463-900467932ab8",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    },
    {
      "Id": "fbe7c984-1efb-4c57-b9be-fd18999561d5",
      "PurchaseItemId": "3d05f16c-fc9f-4707-8fd6-591214e12f65",
      "StockItemId": "bf520887-df35-4e36-a463-900467932ab8",
      "Qty": 4,
      "PackQuantity": 5,
      "PackSize": 6,
      "BoundToOpenOrdersItems": 1,
      "QuantityBoundToOpenOrdersItems": 2,
      "Cost": 3.0,
      "TaxRate": 4.0
    }
  ],
  "PurchaseOrderHeader": {
    "pkPurchaseID": "aa9a5449-2b6c-43b2-b2ca-458ea946e940",
    "fkSupplierId": "4c0e0e48-85cb-4d29-aed8-5f571eae66f5",
    "fkLocationId": "6bbd7014-177b-405d-9f0e-76293b642273",
    "ExternalInvoiceNumber": "sample string 4",
    "Status": 0,
    "Currency": "sample string 5",
    "SupplierReferenceNumber": "sample string 6",
    "Locked": true,
    "LineCount": 8,
    "DeliveredLinesCount": 9,
    "UnitAmountTaxIncludedType": 10,
    "DateOfPurchase": "2019-07-23T15:31:56.0362502Z",
    "DateOfDelivery": "2019-07-23T15:31:56.0362502Z",
    "QuotedDeliveryDate": "2019-07-23T15:31:56.0362502Z",
    "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
  }
}