Back

Search

Search

Methods

Inventory

Orders

Orders /AddCoupon

Response: UpdateOrderItemResult



Add a coupon to a specific order

Parameters

NameTypeDescription
orderIdGuidOrder id
barcodeStringCoupon barcode
couponDataCouponValidationResultCoupon data
fulfilmentCenterGuidCurrent fulfilment center

HTTP Endpoint

Server /Orders / AddCoupon

Permissions


Example Code

Example Request

The following request format is required for this method.

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

orderId=4d052130-70e7-447d-8839-58e66e5d9ec3&barcode=sample string 1&couponData={
  "ValidationText": "sample string 1",
  "DeductVisible": true,
  "DeductText": "sample string 3",
  "BalanceVisible": true,
  "BalanceText": "sample string 5",
  "ValueText": "sample string 6",
  "DiscountType": "sample string 7"
}&fulfilmentCenter=0769c531-9554-4411-95f4-83da8869ea85

Response

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

{
  "TotalsInfo": {
    "Subtotal": 1.1,
    "PostageCost": 2.1,
    "Tax": 3.1,
    "TotalCharge": 4.1,
    "PaymentMethod": "sample string 5",
    "PaymentMethodId": "b5869a83-31cf-499b-951b-e084f42138ec",
    "ProfitMargin": 7.1,
    "TotalDiscount": 8.1,
    "Currency": "sample string 9",
    "CountryTaxRate": 10.1,
    "ConversionRate": 11.1
  },
  "Item": {
    "ItemId": "acaa8daf-e6e1-4063-8da9-a70b6e31e11e",
    "ItemNumber": "sample string 2",
    "SKU": "sample string 3",
    "ItemSource": "sample string 4",
    "Title": "sample string 5",
    "Quantity": 6,
    "CategoryName": "sample string 8",
    "CompositeAvailablity": 1,
    "StockLevelsSpecified": true,
    "OnOrder": 10,
    "OnPurchaseOrder": {
      "pkPurchaseItemId": "2657da93-1164-4af1-b75a-4e97ee941700",
      "Rowid": "42345f0a-d436-4653-8a2f-93eb0268e6a9",
      "pkPurchaseId": "f3033e37-8bdc-4eda-a43d-8c7dfac452a3",
      "ExternalInvoiceNumber": "sample string 4",
      "fkSupplierId": "df164512-e103-45ca-8f9d-168fc2348247",
      "DateOfDelivery": "2019-10-09T15:11:44.8557709+01:00",
      "QuotedDeliveryDate": "2019-10-09T15:11:44.8557709+01:00",
      "SupplierName": "sample string 8",
      "fkLocationId": "b6b3fefc-497d-42e6-b081-e8f9f3f2719f"
    },
    "InOrderBook": 1,
    "Level": 11,
    "MinimumLevel": 1,
    "AvailableStock": 12,
    "PricePerUnit": 13.1,
    "UnitCost": 14.1,
    "DespatchStockUnitCost": 15.1,
    "Discount": 16.1,
    "Tax": 21.1,
    "TaxRate": 17.1,
    "Cost": 18.1,
    "CostIncTax": 19.1,
    "CompositeSubItems": [
      {
      },
      {
      }
    ],
    "IsService": true,
    "SalesTax": 21.1,
    "TaxCostInclusive": true,
    "PartShipped": true,
    "Weight": 24.1,
    "BarcodeNumber": "sample string 25",
    "Market": 26,
    "ChannelSKU": "sample string 27",
    "ChannelTitle": "sample string 28",
    "DiscountValue": 10.806660973526899,
    "HasImage": true,
    "ImageId": "496f09fd-1489-4db0-9a07-3203261b0259",
    "AdditionalInfo": [
      {
        "pkOptionId": "8fd72d74-8b21-48c4-92d9-1fc546f90b4a",
        "Property": "sample string 2",
        "Value": "sample string 3"
      },
      {
      }
    ],
    "StockLevelIndicator": 29,
    "BatchNumberScanRequired": true,
    "SerialNumberScanRequired": true,
    "BinRack": "sample string 32",
    "BinRacks": [
      {
        "Quantity": 1,
        "BinRack": "sample string 2",
        "Location": "d8162cce-ae37-4500-85dc-a95ac0c35107",
        "BatchId": 1,
        "OrderItemBatchId": 1
      },
      {
      }
    ],
    "InventoryTrackingType": 33,
    "isBatchedStockItem": false,
    "IsWarehouseManaged": true,
    "HasPurchaseOrders": true,
    "CanPurchaseOrderFulfil": true,
    "IsUnlinked": false,
    "RowId": "dea7075b-f18b-4862-a27d-19c9057f73ef",
    "OrderId": "d8ff1158-8e7c-4057-90a6-8be5fc158c9d",
    "StockItemId": "c47b1db4-b370-470b-bf5b-0ccb4b3642b1"
  },
  "ItemWeight": 1.1,
  "TotalWeight": 2.1
}