Skip to main content

RetailOrder

Retail order provides access to the retail/web order resource. A retail order is an order placed for a retail customer in the i.Level system, These may typically come from a retail website or be manually keyed, following mail or telephone request. A retail order will require despatching to a customer.

By default the RetailOrder resource will return the related Retail Customer and the Retail Order Items

Example of a returned retail order object with items included

{
"response": {
"Page": 1,
"PageCount": 1,
"RecordsSent": 1,
"RecordsFound": 1,
"RetailOrder": [
{
"id": 1,
"Customer_id": 1,
"Warehouse_id": 0,
"Order_Number": "WO00001",
"Order_Ref": "U18",
"Order_Source": "OWNWEB01",
"Marketplace_Ref": "",
"Order_Date": "2014-09-09T23:00:00.000Z",
"Order_Status": "Done",
"Marketplace_Status": "Shipped",
"Despatch_Date": "2014-09-23T23:00:00.000Z",
"Name": "Mr TEST TEST",
"Address1": "TEST",
"Address2": "TEST",
"Town": "Tyne & Wear",
"County": "United Kingdom",
"Postcode": "NE11 0LE",
"Country_Code": "",
"Country": "",
"Address_Text": "TEST\rTEST\rTyne & Wear\rNE11 0LE\rUnited Kingdom",
"Cost_Centre": 0,
"Carrier": "",
"Tracking_Ref": "000000",
"Extended_Data": null,
"Gross": 57.98,
"VAT": 0,
"VAT_Code": "Z",
"Currency": "GBP",
"RetailCustomer": {
"id": 1,
"Customer_Ref": "OWNWEB01-6",
"Title": "",
"Forename": "",
"Surname": "",
"Family_Name": "Mr TEST TEST",
"Given_Name": "Mr TEST TEST",
"Company_Name": "",
"Address1": "TEST",
"Address2": "TEST",
"Town": "Tyne & Wear",
"County": "United Kingdom",
"Postcode": "NE11 0LE",
"Country": "",
"Telephone": "12345612345",
"Mobile": "",
"Fax": "",
"Email": "demo1@red-fern.co.uk",
"Comments": "",
"URL": "",
"Identifier1": "",
"Identifier2": "",
"Accounts_Ref": "",
"Rating": ""
},
"Items": [
{
"id": 1,
"Order_id": 1,
"Item_Ref": "",
"Host_Item_Ref": "",
"SKUSize": "A0000001010A",
"Barcode": "",
"Article": "FLORAL 1",
"Colour": "OFF WHITE",
"Size": "S",
"Marketplace_Status": "confirmed",
"Quantity": 2,
"Item_Price": 28.99,
"Line_Total": 57.98,
"VAT_Total": 0,
"RRP": 28.99,
"VAT_Status": true,
"VAT_Rate": 0,
"Despatch_Date": "0000-00-00T00:00:00.000Z",
"Details": null
},
{
"id": 2,
"Order_id": 1,
"Item_Ref": "SHIPPING",
"Host_Item_Ref": "",
"SKUSize": "",
"Barcode": "",
"Article": "Delivery",
"Colour": "",
"Size": "",
"Marketplace_Status": "",
"Quantity": 1,
"Item_Price": 0,
"Line_Total": 0,
"VAT_Total": 0,
"RRP": 0,
"VAT_Status": true,
"VAT_Rate": 0,
"Despatch_Date": "0000-00-00T00:00:00.000Z",
"Details": null
}
]
}
]
}
}

RetailOrder Properties​

PropertyExampleDescription
id1300Unique id of the order
Customer_id1092Customer id
Warehouse_id0Warehouse id indicates the warehouse from which the stock for the order should be taken. Default 0 for main warehouse. Use multiplewarehouse resource (if active on your system) for details of available warehouses.
Order_Number"01298"Order number created by i.Level (Read Only)
Order_Ref"4703122564"Order reference can be passed in. If passed it will be used with the Order_Source to check uniqueness
Order_Source"SHOPIFY"Order source
Marketplace_Ref"4703122564"Marketplace reference.
Order_Date"2017-01-12T00:00:00.000Z"Creation date of the order
Order_Status"Pending_Scan"Primary status for the order
Marketplace_Status"paid"Web/marketplace order status
Delivery_Date"2017-01-17T00:00:00.000Z"Required delivery date
Delivery_Date_Est"0000-00-00T00:00:00.000Z"Estimated delivery date
Name"Ameer Jones"Delivery customer name
Address1"24 Bradford Road"Delivery address line 1
Address2"Hackney "Delivery address line 2
Town"Hackney"Delivery address line 3
County"London"Delivery address line 4
Postcode"HA453PQ"Delivery postcode
Country_Code"GB"Delivery address country code
Country"United Kingdom"Delivery address country name
Address_Text"24 Bradford Road\rHackney \rHackney\rLondon\rHA453PQ\rUnited Kingdom"Full delivery address. You do not need to pass this if the address fields have been filled in. This is deemed a legacy field.
Cost_Centre0Cost centre/trade name code
Carrier""Despatch carrier service
Tracking_Ref""Despatch reference
Gross240Total order value including Taxes and delivery
VAT40Total VAT value for the order
VAT_Code"S"VAT code
Currency"GBP"Order currency code
Extended_DatanullObject containing additional order details (where applicable)
RetailCustomer{}Object containing the retail customer details see retailcustomer resource
Items[]Array of retail order items see retailorderitem resource

Example JSON request content to create a new Retail Order

{
"Warehouse_id": 0,
"Order_Number": "TEST2",
"Order_Ref": "DOUGTESTREF",
"Order_Source": "DOUGTEST",
"Marketplace_Ref": "MKPREF",
"Order_Date": "2017-07-03",
"Name": "Mr J Douglas Cryer",
"Address1": "12 Park Road North",
"Town": "Bedford",
"County": "Bedfordshire",
"Postcode": "MK41 7RH",
"Gross": 240,
"VAT": 40,
"Currency": "GBP",
"RetailCustomer": {
"Customer_Ref": "TESTCUST",
"Company_Name": "Telekinetix Limited",
"Title": "Mr",
"Forename": "J Douglas",
"Surname": "Cryer",
"Address1": "4-6 The Braodway",
"Town": "Bedford",
"County": "Bedfordshire",
"Postcode": "MK40 2TE",
"Country": "United Kingdom",
"Telephone": "08433 676 271",
"Email": "jdcryer@me.com",
"Comments": "Regular customer."
},
"Items": [
{
"Item_Ref": "1234",
"SKUSize": "A0000001010E",
"Barcode": "5060395910051",
"Quantity": 3,
"Item_Price": 30
},
{
"Item_Ref": "456",
"SKUSize": "16427005 B",
"Barcode": "5060409819004",
"Quantity": 2,
"Item_Price": 75
}
]
}

RetailOrder Methods​

GET /api/retailorder​

Returns all stock in the system with all published fields.

POST /api/retailorder​

Parses the request object and creates a retail order (if validated). The retail customer and items are all passed as part of the request object. The total value of the items will be validated against the Gross value passed in the order header. If the RetailCustomer Customer_Ref is passed and exists the customer will be found and updated with any changes.

All exposed properties of the RetailOrder can be inserted with the exception of id and Order_Number. The eample given shows the recommended fields to be used. Please see the RetailOrderItems documentation for item fields which are allowable in a post.

The response will return the entire retailorder and in addition a response_status property. Possible values for the response_status property are shown below.

It is the responsibility of the developer to ensure that fields are filled to the customers requirement. This may vary based on shipping and processing requirements.

Response Status Description Accepted The order has been created without any issues. Back Order The order has items on it that are out of stock and has therefore been given a status of Pending_Stock. Held - Invalid Pay Amount The gross order value does not match the total of the order items.