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=49da8866-afaa-4c05-93b9-1d57be60ab29&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=69d6c925-a731-4d48-80ed-3930f15abb2e

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": "ec64d566-a70c-4e45-9974-2d02afb8831b",
    "ProfitMargin": 7.1,
    "TotalDiscount": 8.1,
    "Currency": "sample string 9",
    "CountryTaxRate": 10.1,
    "ConversionRate": 11.1
  },
  "Item": {
    "ItemId": "6c770ac3-b0ee-4d42-bd9c-81fd2dc9821f",
    "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": "6cb2a3ac-3871-41d7-b407-a8ef3e3be494",
      "Rowid": "b9313d78-3a44-4c37-88ec-ba07465bd079",
      "pkPurchaseId": "9eff0644-dafc-4a2b-b7df-f72f5134ac8b",
      "ExternalInvoiceNumber": "sample string 4",
      "fkSupplierId": "56c8017f-f586-44d5-aa14-ae360da9644a",
      "DateOfDelivery": "2019-06-12T09:27:52.6280483+01:00",
      "QuotedDeliveryDate": "2019-06-12T09:27:52.6280483+01:00",
      "SupplierName": "sample string 8",
      "fkLocationId": "1d02ae89-49d6-40a3-a6c2-195190e54f69"
    },
    "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": "4cb5b541-11c8-43c0-bac1-91d52a871726",
    "AdditionalInfo": [
      {
        "pkOptionId": "d048e7ad-df5f-44af-a53f-a5cae96d583c",
        "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": "dc27a20d-5d63-4bfb-9050-ebf296822fa3",
        "BatchId": 1,
        "OrderItemBatchId": 1
      },
      {
      }
    ],
    "InventoryTrackingType": 33,
    "isBatchedStockItem": false,
    "IsWarehouseManaged": true,
    "HasPurchaseOrders": true,
    "CanPurchaseOrderFulfil": true,
    "IsUnlinked": false,
    "RowId": "07405230-ab8d-46ce-98f9-7d840c7ffe4c",
    "OrderId": "9cfbe930-3776-44ec-b425-c464ebd9354b",
    "StockItemId": "64a27ae9-fce1-4567-8e67-3a55189b047c"
  },
  "ItemWeight": 1.1,
  "TotalWeight": 2.1
}