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=54d99347-fe96-413c-a987-a205830f3175&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=8c6e2e41-2394-4802-a2a1-eaccc432232b

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": "9a4b41d7-afe4-45c4-a8fb-310e6c737878",
    "ProfitMargin": 7.1,
    "TotalDiscount": 8.1,
    "Currency": "sample string 9",
    "CountryTaxRate": 10.1,
    "ConversionRate": 11.1
  },
  "Item": {
    "ItemId": "5b9026fe-47be-41a4-b8fc-b9af1929ffb8",
    "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": "7c53cd72-da8f-4e28-b010-b9f011dc772a",
      "Rowid": "91ec93ee-f328-4c5b-8575-f35eb1520012",
      "pkPurchaseId": "1e0d8147-fd8e-45b4-93ca-93f588cf5afa",
      "ExternalInvoiceNumber": "sample string 4",
      "fkSupplierId": "651f4e9f-7f37-4abf-84d2-c381509e08e5",
      "DateOfDelivery": "2019-11-28T09:46:01.2708194+00:00",
      "QuotedDeliveryDate": "2019-11-28T09:46:01.2708194+00:00",
      "SupplierName": "sample string 8",
      "fkLocationId": "b2c821fe-915f-4454-a1b9-494bb0e8d095"
    },
    "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": "9df97d2d-ad54-4a28-9065-4f5eff162fb8",
    "AdditionalInfo": [
      {
        "pkOptionId": "79e2c5d3-b9fb-4cd2-941a-227d2da7c0b5",
        "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": "a1d017ca-f7c4-41f7-999b-8391995300d2",
        "BatchId": 1,
        "OrderItemBatchId": 1
      },
      {
      }
    ],
    "InventoryTrackingType": 33,
    "isBatchedStockItem": false,
    "IsWarehouseManaged": true,
    "HasPurchaseOrders": true,
    "CanPurchaseOrderFulfil": true,
    "IsUnlinked": false,
    "RowId": "95e2dbd9-bbfc-49de-a7d9-4aa19b8f1cee",
    "OrderId": "ee7a1abe-20d8-479d-b729-29cab3120e41",
    "StockItemId": "7157407c-f73b-438c-a9e9-c9b5ac102d7c"
  },
  "ItemWeight": 1.1,
  "TotalWeight": 2.1
}