Back

Search

Search

Methods

Inventory

Orders

PurchaseOrder /Add_PurchaseOrderItem

Response: Update_PurchaseOrderItemResponse



Method adds purchase order item to an existing PENDING order. Items can only be added to PENDING purchase orders. Returns class that represents modified/recalculated purchase order header and modified purchase order item line

Parameters

NameTypeDescription
addItemParameterAdd_PurchaseOrderItemParameterAdd purchase item parameter class

HTTP Endpoint

Server /PurchaseOrder / Add_PurchaseOrderItem

Permissions

GlobalPermissions.PurchaseOrder.EditPurchaseOrder.EditPurchaseOrderNode

Example Code

Example Request

The following request format is required for this method.

POST https://eu-ext.linnworks.net//api/PurchaseOrder/Add_PurchaseOrderItem 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

addItemParameter={
  "pkPurchaseId": "27a769e6-aa7b-4aa1-b80f-9777359c6e28",
  "fkStockItemId": "05676681-4728-4e28-9395-424d8e4ef4b0",
  "Qty": 3,
  "PackQuantity": 4,
  "PackSize": 5,
  "Cost": 1.0,
  "TaxRate": 2.0
}

Response

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

{
  "NewPurchaseOrderItem": {
    "pkPurchaseItemId": "b7498a7b-11cf-48a5-8dae-7972cca92e29",
    "fkStockItemId": "88947a6f-2eb7-4e3d-b80f-6fe2ea83753f",
    "Quantity": 3,
    "Cost": 4.0,
    "Delivered": 5,
    "TaxRate": 6.0,
    "Tax": 7.0,
    "PackQuantity": 8,
    "PackSize": 9,
    "SKU": "sample string 10",
    "ItemTitle": "sample string 11",
    "InventoryTrackingType": 12,
    "IsDeleted": true
  },
  "PurchaseOrderHeader": {
    "pkPurchaseID": "56e3f075-653a-4a12-afdd-aa557ec6eb17",
    "fkSupplierId": "f3dfa7a0-cbab-4b6a-8867-2e01faa35b7c",
    "fkLocationId": "b0e9cc0c-47d5-40b2-a5c9-a1bc2f3b01f2",
    "ExternalInvoiceNumber": "sample string 4",
    "Status": 0,
    "Currency": "sample string 5",
    "SupplierReferenceNumber": "sample string 6",
    "Locked": true,
    "LineCount": 8,
    "DeliveredLinesCount": 9,
    "DateOfPurchase": "2018-02-19T16:57:07.6885216Z",
    "DateOfDelivery": "2018-02-19T16:57:07.6885216Z",
    "QuotedDeliveryDate": "2018-02-19T16:57:07.6890231Z",
    "PostagePaid": 4.0,
    "TotalCost": 5.0,
    "taxPaid": 6.0,
    "ShippingTaxRate": 7.0,
    "ConversionRate": 8.0
  }
}