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=b5976a76-07f3-465d-b35f-4ec0920f9149&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=6964e287-380e-44d9-a0a1-91ffb7f36152

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": "e3b14f64-13c5-4c05-be23-79a1fe7ad2a8",
    "ProfitMargin": 7.1,
    "TotalDiscount": 8.1,
    "Currency": "sample string 9",
    "CountryTaxRate": 10.1,
    "ConversionRate": 11.1
  },
  "Item": {
    "OrderId": "83911258-b400-4fce-bb8d-589a430afc8e",
    "ItemId": "896af402-4b8d-47fd-a7e7-d896eb817029",
    "StockItemId": "01ff3ffc-a54f-40b7-a9ce-79b3bedae653",
    "ItemNumber": "sample string 4",
    "SKU": "sample string 5",
    "ItemSource": "sample string 6",
    "Title": "sample string 7",
    "Quantity": 8,
    "CategoryName": "sample string 9",
    "CompositeAvailablity": 1,
    "RowId": "e1e11598-9d28-4dd7-bff6-7365577a0d6b",
    "StockLevelsSpecified": true,
    "OnOrder": 12,
    "InOrderBook": 1,
    "Level": 13,
    "MinimumLevel": 1,
    "AvailableStock": 14,
    "PricePerUnit": 15.1,
    "UnitCost": 16.1,
    "Discount": 17.1,
    "Tax": 22.1,
    "TaxRate": 18.1,
    "Cost": 19.1,
    "CostIncTax": 20.1,
    "CompositeSubItems": [
      {
      },
      {
      }
    ],
    "IsService": true,
    "SalesTax": 22.1,
    "TaxCostInclusive": true,
    "PartShipped": true,
    "Weight": 25.1,
    "BarcodeNumber": "sample string 26",
    "Market": 27,
    "ChannelSKU": "sample string 28",
    "ChannelTitle": "sample string 29",
    "DiscountValue": 17.490939881456391,
    "HasImage": true,
    "ImageId": "dcee44f5-9bf7-479c-b1ad-2664a1c47c38",
    "AdditionalInfo": [
      {
        "pkOptionId": "608eb4c6-a1f9-4d65-813d-a71b92bd5084",
        "Property": "sample string 2",
        "Value": "sample string 3"
      },
      {
      }
    ],
    "StockLevelIndicator": 30,
    "BatchNumberScanRequired": true,
    "SerialNumberScanRequired": true,
    "BinRack": "sample string 33",
    "BinRacks": [
      {
        "Quantity": 1,
        "BinRack": "sample string 2",
        "Location": "5e745606-4325-4c30-86fe-25b560e3a27b"
      },
      {
      }
    ],
    "InventoryTrackingType": 34,
    "isBatchedStockItem": false
  },
  "ItemWeight": 1.1,
  "TotalWeight": 2.1
}