Back

Search

Search

Methods

Inventory

Orders

PurchaseOrder /Modify_AdditionalCost

Response: Modify_AdditionalCostResponse



Modify purchase order additional costs. You can add new lines, update and delete existing. The method will return modified list back to you with each record identified by unique identifier.
Purchase Order header will also be returned with new total recalculated

Parameters

NameTypeDescription
requestModify_AdditionalCostRequest

HTTP Endpoint

Server /PurchaseOrder / Modify_AdditionalCost

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_AdditionalCost 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={
  "itemsToAdd": [
    {
      "Id": "8cc8edfb-be95-47d0-acf4-96cb94cc87a2",
      "AdditionalCostTypeId": 2,
      "Reference": "sample string 3",
      "SubTotalLineCost": 4.0,
      "TaxRate": 5.0,
      "Currency": "sample string 6",
      "ConversionRate": 7.0,
      "AllocationLocked": true,
      "Print": true,
      "AllocationMethod": 0
    },
    {
      "Id": "8cc8edfb-be95-47d0-acf4-96cb94cc87a2",
      "AdditionalCostTypeId": 2,
      "Reference": "sample string 3",
      "SubTotalLineCost": 4.0,
      "TaxRate": 5.0,
      "Currency": "sample string 6",
      "ConversionRate": 7.0,
      "AllocationLocked": true,
      "Print": true,
      "AllocationMethod": 0
    }
  ],
  "itemsToUpdate": [
    {
      "PurchaseAdditionalCostItemId": 1,
      "Id": "661121c0-4619-4e52-a034-2688f35b8676",
      "AdditionalCostTypeId": 3,
      "Reference": "sample string 4",
      "SubTotalLineCost": 5.0,
      "TaxRate": 6.0,
      "Currency": "sample string 7",
      "ConversionRate": 8.0,
      "AllocationLocked": true,
      "Print": true,
      "AllocationMethod": 0
    },
    {
      "PurchaseAdditionalCostItemId": 1,
      "Id": "661121c0-4619-4e52-a034-2688f35b8676",
      "AdditionalCostTypeId": 3,
      "Reference": "sample string 4",
      "SubTotalLineCost": 5.0,
      "TaxRate": 6.0,
      "Currency": "sample string 7",
      "ConversionRate": 8.0,
      "AllocationLocked": true,
      "Print": true,
      "AllocationMethod": 0
    }
  ],
  "itemsToDelete": [
    1,
    2
  ],
  "PurchaseId": "49391d1f-6886-4d6d-8d01-8593a306a125"
}

Response

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

{
  "ModifiedItems": [
    {
      "Id": "8ab55bfb-8bc1-49a7-8f42-8b7f6ea73e99",
      "PurchaseAdditionalCostItemId": 2,
      "AdditionalCostTypeId": 3,
      "Reference": "sample string 4",
      "SubTotalLineCost": 5.0,
      "TaxRate": 6.0,
      "Tax": 7.0,
      "Currency": "sample string 8",
      "ConversionRate": 9.0,
      "TotalLineCost": 10.0,
      "CostAllocation": [
        {
          "CostAllocationId": 1,
          "PurchaseAdditionalCostItemId": 2,
          "PurchaseItemId": "928abb59-bd65-4d5b-8c43-60d071fd690e",
          "AllocationPercentage": 4.0
        },
        {
          "CostAllocationId": 1,
          "PurchaseAdditionalCostItemId": 2,
          "PurchaseItemId": "928abb59-bd65-4d5b-8c43-60d071fd690e",
          "AllocationPercentage": 4.0
        }
      ],
      "AllocationLocked": true,
      "AdditionalCostTypeName": "sample string 12",
      "AdditionalCostTypeIsShippingType": true,
      "AdditionalCostTypeIsPartialAllocation": true,
      "Print": true,
      "AllocationMethod": 0
    },
    {
      "Id": "8ab55bfb-8bc1-49a7-8f42-8b7f6ea73e99",
      "PurchaseAdditionalCostItemId": 2,
      "AdditionalCostTypeId": 3,
      "Reference": "sample string 4",
      "SubTotalLineCost": 5.0,
      "TaxRate": 6.0,
      "Tax": 7.0,
      "Currency": "sample string 8",
      "ConversionRate": 9.0,
      "TotalLineCost": 10.0,
      "CostAllocation": [
        {
          "CostAllocationId": 1,
          "PurchaseAdditionalCostItemId": 2,
          "PurchaseItemId": "928abb59-bd65-4d5b-8c43-60d071fd690e",
          "AllocationPercentage": 4.0
        },
        {
          "CostAllocationId": 1,
          "PurchaseAdditionalCostItemId": 2,
          "PurchaseItemId": "928abb59-bd65-4d5b-8c43-60d071fd690e",
          "AllocationPercentage": 4.0
        }
      ],
      "AllocationLocked": true,
      "AdditionalCostTypeName": "sample string 12",
      "AdditionalCostTypeIsShippingType": true,
      "AdditionalCostTypeIsPartialAllocation": true,
      "Print": true,
      "AllocationMethod": 0
    }
  ],
  "PurchaseOrderHeader": {
    "pkPurchaseID": "ff2d878d-df64-4470-beea-cec827c16e5d",
    "fkSupplierId": "4e5bdf98-360f-4c37-a6a2-16073bcf856c",
    "fkLocationId": "8b34965f-ed77-4d72-a35d-ae486f14eb0d",
    "ExternalInvoiceNumber": "sample string 4",
    "Status": 0,
    "Currency": "sample string 5",
    "SupplierReferenceNumber": "sample string 6",
    "Locked": true,
    "LineCount": 8,
    "DeliveredLinesCount": 9,
    "UnitAmountTaxIncludedType": 10,
    "DateOfPurchase": "2018-10-03T11:12:35.4201578Z",
    "DateOfDelivery": "2018-10-03T11:12:35.4201578Z",
    "QuotedDeliveryDate": "2018-10-03T11:12:35.4201578Z",
    "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
  }
}