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=9ff44fa9-82c2-471d-8f81-3c5030b0465d&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=8efb07bb-df1a-437c-b391-93d19ec20bbc

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": "7bacfbcc-c9da-465d-aeb4-a71933fc421b",
    "ProfitMargin": 7.1,
    "TotalDiscount": 8.1,
    "Currency": "sample string 9",
    "CountryTaxRate": 10.1,
    "ConversionRate": 11.1
  },
  "Item": {
    "ItemId": "6922f52a-d214-442c-9666-07e3923870ae",
    "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,
    "InOrderBook": 1,
    "Level": 11,
    "MinimumLevel": 1,
    "AvailableStock": 12,
    "PricePerUnit": 13.1,
    "UnitCost": 14.1,
    "Discount": 15.1,
    "Tax": 20.1,
    "TaxRate": 16.1,
    "Cost": 17.1,
    "CostIncTax": 18.1,
    "CompositeSubItems": [
      {
      },
      {
      }
    ],
    "IsService": true,
    "SalesTax": 20.1,
    "TaxCostInclusive": true,
    "PartShipped": true,
    "Weight": 23.1,
    "BarcodeNumber": "sample string 24",
    "Market": 25,
    "ChannelSKU": "sample string 26",
    "ChannelTitle": "sample string 27",
    "DiscountValue": 10.222739018087856,
    "HasImage": true,
    "ImageId": "0fdecb41-ae81-442a-b630-0ec59901008b",
    "AdditionalInfo": [
      {
        "pkOptionId": "32422387-5a21-420a-84d8-0e4137a29898",
        "Property": "sample string 2",
        "Value": "sample string 3"
      },
      {
      }
    ],
    "StockLevelIndicator": 28,
    "BatchNumberScanRequired": true,
    "SerialNumberScanRequired": true,
    "BinRack": "sample string 31",
    "BinRacks": [
      {
        "Quantity": 1,
        "BinRack": "sample string 2",
        "Location": "2168d907-9367-45e4-9981-2080b14d2fda",
        "BatchId": 1,
        "OrderItemBatchId": 1
      },
      {
      }
    ],
    "InventoryTrackingType": 32,
    "isBatchedStockItem": false,
    "HasPurchaseOrders": true,
    "CanPurchaseOrderFulfil": true,
    "IsUnlinked": false,
    "RowId": "da63b220-4a78-4ef5-ac78-0bbc9332ed3b",
    "OrderId": "654933ef-4f1a-49c1-9f9a-d4f008a18055",
    "StockItemId": "72715c42-e738-42eb-8ab8-af09d71c5e14"
  },
  "ItemWeight": 1.1,
  "TotalWeight": 2.1
}