Back

Search

Search

Methods

Inventory

Orders

ProcessedOrders /CreateExchange

Response: List<ReturnInfo>


Parameters

NameTypeDescription
pkOrderIdGuidThe order id
exchangeItemsList<RowQty>A list of items to be exchanged, including quantity, scrap, refund, etc.
despatchLocationGuidThe id of the location to despatch replacement items from
returnLocationGuidThe id of the location to return stock to
channelReasonStringChannel reason - required if a refund on the channel is required
channelSubReasonStringChannel subreason - required if a refund on the channel is required.
categoryStringThe refund category
reasonStringThe reason for the reason
isBookingBooleanTrue if it is a exchange booking, False if it is a new exchange
ignoredValidationBooleanTrue if failed validation has been ignored (see IsRefundValid). Otherwise, false. When set to true, refunds will not be automatically actioned on the channel. Ignored if creating a booking as a refund is not created at this stage.

HTTP Endpoint

Server /ProcessedOrders / CreateExchange

Permissions


Example Code

Example Request

The following request format is required for this method.

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

pkOrderId=18627970-d860-4dfe-982c-55d830b08568&exchangeItems=[
  {
    "OrderItemRowId": "f54e87c6-f471-4c09-a80e-ebba108205d4",
    "OrderItemBatchId": 1,
    "Refund": 2.1,
    "Qty": 3,
    "ScrapQty": 1,
    "AdditionalCost": 4.1,
    "NewStockItemId": "fc962fc9-b9b7-4e67-ad17-e93516bbc74d",
    "NewQty": 5
  },
  {
    "OrderItemRowId": "f54e87c6-f471-4c09-a80e-ebba108205d4",
    "OrderItemBatchId": 1,
    "Refund": 2.1,
    "Qty": 3,
    "ScrapQty": 1,
    "AdditionalCost": 4.1,
    "NewStockItemId": "fc962fc9-b9b7-4e67-ad17-e93516bbc74d",
    "NewQty": 5
  }
]&despatchLocation=f15298fb-e4bb-4eec-89dc-e1a9b48a5d98&returnLocation=c81ce1d0-2a26-45e2-a2d7-f142ef1f18e8&channelReason=sample string 1&channelSubReason=sample string 1&category=sample string 1&reason=sample string 1&isBooking=true&ignoredValidation=true

Response

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

[
  {
    "pkReturnId": 1,
    "RowType": 0,
    "ReturnReference": "sample string 2",
    "fkOrderId": "d0e88e99-8c62-4775-9beb-7a04909d99a9",
    "fkOrderItemRowId": "243e7762-6b98-401f-861a-1e341daee1b3",
    "OrderItemBatchId": 5,
    "nOrderId": 6,
    "SKU": "sample string 7",
    "ItemTitle": "sample string 8",
    "BatchNumber": "sample string 9",
    "Reason": "sample string 10",
    "ChannelReason": "sample string 11",
    "ChannelReasonSec": "sample string 12",
    "Category": "sample string 13",
    "ReturnQty": 14,
    "fkReturnLocationId": "49ddd2ea-b833-4b91-ab11-4db1b2563fad",
    "Scrapped": true,
    "ScrapQty": 1,
    "LastState": "sample string 16",
    "LastDate": "2018-02-19T16:57:07.9612673+00:00",
    "Completed": true,
    "fkNewOrderId": "c5924e34-e75e-48e3-afe8-e77e60cd8fb2",
    "fkNewOrderItemRowId": "b359d16f-1264-47c3-b256-35a573137eda",
    "fkNewStockItemId": "a371f0bf-fc3d-4b6e-9c02-4024b13d6767",
    "NewQty": 1,
    "NewOrderId": 1,
    "NewOrderCancelled": true,
    "NewSKU": "sample string 20",
    "NewItemTitle": "sample string 21",
    "NewOrderProcessedOn": "2018-02-19T16:57:07.9612673+00:00",
    "AdditionalCost": 1.1,
    "fkRefundRowId": "e9838cb8-c8ef-4e3f-b184-7637ebf622c6",
    "RefundedAmount": 1.1,
    "PendingRefund": 1.1,
    "ReturnDate": "2018-02-19T16:57:07.9612673+00:00"
  },
  {
    "pkReturnId": 1,
    "RowType": 0,
    "ReturnReference": "sample string 2",
    "fkOrderId": "d0e88e99-8c62-4775-9beb-7a04909d99a9",
    "fkOrderItemRowId": "243e7762-6b98-401f-861a-1e341daee1b3",
    "OrderItemBatchId": 5,
    "nOrderId": 6,
    "SKU": "sample string 7",
    "ItemTitle": "sample string 8",
    "BatchNumber": "sample string 9",
    "Reason": "sample string 10",
    "ChannelReason": "sample string 11",
    "ChannelReasonSec": "sample string 12",
    "Category": "sample string 13",
    "ReturnQty": 14,
    "fkReturnLocationId": "49ddd2ea-b833-4b91-ab11-4db1b2563fad",
    "Scrapped": true,
    "ScrapQty": 1,
    "LastState": "sample string 16",
    "LastDate": "2018-02-19T16:57:07.9612673+00:00",
    "Completed": true,
    "fkNewOrderId": "c5924e34-e75e-48e3-afe8-e77e60cd8fb2",
    "fkNewOrderItemRowId": "b359d16f-1264-47c3-b256-35a573137eda",
    "fkNewStockItemId": "a371f0bf-fc3d-4b6e-9c02-4024b13d6767",
    "NewQty": 1,
    "NewOrderId": 1,
    "NewOrderCancelled": true,
    "NewSKU": "sample string 20",
    "NewItemTitle": "sample string 21",
    "NewOrderProcessedOn": "2018-02-19T16:57:07.9612673+00:00",
    "AdditionalCost": 1.1,
    "fkRefundRowId": "e9838cb8-c8ef-4e3f-b184-7637ebf622c6",
    "RefundedAmount": 1.1,
    "PendingRefund": 1.1,
    "ReturnDate": "2018-02-19T16:57:07.9612673+00:00"
  }
]