How-to Guide - Rest API - Orders
Introduction
The purpose of this guide is to provide an understanding of the REST Orders APIs provided by Enactor for use with external Web Sites and for Customer integration. It is separated out into functional areas, with each section related to a specific service. Note that the final URL used to access the service will be determined based on how the Enactor REST Orders API is deployed.
Following are Enactor REST Orders APIs areas covered in this document:
-
Orders API
-
Orders Task API
Orders API
The Order API is used to get details about an order. It can also be used to request cancellation and return an order or an item within an order. It cannot be used to submit an order - that must be done by creating a basket and submitting it through the checkout flow. Following is the list of Orders APIs covered in this section:
-
Search Orders
-
List Order Headers
-
Create an Order
-
Get an Order's Details
-
Cancel an Order
-
Cancel an Order Item
-
Request Return of an Order
-
Request Return of an Order Item
-
Update Order?
Search Orders
This service can be used to list orders associated with the customer.
Request
Request Service URL
GET /orders
Request Tokens
There are no request tokens.
Request Parameters
-
typeId: String. The ID of the customer order type – Required. Eg: typeId=CUSTOMER_ORDER
-
earliestDate: Date. List orders created after, or on, this date - Optional, defaults to 60 days ago.
-
latestDate: Date. List orders created before, or on, this date - Optional, defaults to now.
-
pageSize: Integer. The maximum number of orders to return on a single page - Optional, defaults to 10, limited to 100.
-
pageSize: Integer. The offset, in rows, of the first order to return - Optional defaults to 0.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListOrdersResponse
Element | Type | Description |
---|---|---|
orderList | List<ICustomerOrder> | A list of order details, including the orderId. |
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Search Orders service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service recieves no query params. | Success | The service should return the customer orders, limited to 10 and within the date range of today and 60 days ago. | 200 | IListOrdersResponse: OrderList: List of customer orders. |
The orders service recieves a value for the earliestDate param. | Success | The service should return the customer orders, limited to 10 and within the date range of today and <EarliestDateParam> days ago. | 200 | IListOrdersResponse: OrderList: List of customer orders. |
The orders service recieves a value for the latestDate param. | Success | The service should return the customer orders, limited to 10 and within the date range of <LatestDateParam>and 60 days ago. | 200 | IListOrdersResponse: OrderList: List of customer orders. |
The orders service recieves a value for the pageSize param. | Success | The service should return the customer orders, limited to <PageSizeParam> and within the date range of today and 60 days ago. | 200 | IListOrdersResponse: OrderList: List of customer orders. |
The orders service recieves a value for the pageOffset param. | Success | The service should return the customer orders, limited to 10, with an offset of <PageOffsetParam> and within the date range of today and 60 days ago. | 200 | IListOrdersResponse: OrderList: List of customer orders. |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
GET:
http://[SWARM_LEADER_IP]/WebRestApi/rest/orders?typeId=CUSTOMER_ORDER
Response:
Status: 200 OK
{
"orderList": [
{
"products": [
{
"productId": "VV639JS-12",
"type": "skuProduct",
"productDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Vans Canvas Shoes"
}
]
},
"productLongDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "From Vans"
}
]
},
"productInfo": "Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.",
"imageURL": "image://PRODUCT/VV639JS-1.jpg",
"posDetails": {
"productOptionSetDetails": {
"isTemplate": false
},
"isTemplate": false
},
"isTemplate": false,
"status": "LIVE",
"lastUpdated": 1544090247382,
"taxExemptProhibited": false,
"exportDetails": {
"notForExport": false,
"isTemplate": false
},
"inventoryDetails": {
"allowForLoan": false,
"allowCustomerOrder": true,
"allowPurchaseOrder": true,
"customerOrderOnly": false,
"directToStoreDelivery": false,
"isStocked": true,
"isTemplate": false
},
"productDimensions": {
"isTemplate": false
},
"warrantyDetails": {
"isTemplate": false
},
"standardCostPrice": 0,
"standardMargin": 0,
"styleId": "VV639JS",
"fasciaId": {},
"imageFilenameId": {
"id": "VV639JS-1",
"category": "PRODUCT",
"type": "jpg"
},
"taxGroupId": {
"id": "A"
},
"mmGroupId": {
"id": "MENS_SHOES",
"groupTypeId": "mmGroup",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"brandId": {
"id": "VANS",
"groupTypeId": "brand",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"rangeId": {},
"seasonId": {
"id": "ALL"
},
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"sizeId": {
"id": "12",
"sizeRangeId": "MENS_SHOES"
}
}
],
"customerOrderItems": [
{
"item": {
"sourceLineNumber": 1,
"parentLineNumber": 0,
"fulfilmentId": 1,
"transactionId": "00010001000011811291048036",
"userId": {
"id": "1"
},
"locationId": {
"id": "0001"
},
"productId": {
"id": "VV639JS-12"
},
"createdDate": "2018-11-29T10:48:03.000+00:00",
"customerOrderId": "19",
"lastUpdated": 1543488556000,
"lineNumber": 1,
"netPrice": 5995,
"orderedQty": 1,
"reservedQty": 0,
"shippedQty": 0,
"status": "SUBMITTED",
"taxAmount": 0,
"unitPrice": 5995,
"voided": false,
"effectiveNetValue": 5995,
"destinationLocationId": {},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
}
}
],
"customerOrderPayments": [
{
"customerOrderCashPayment": {
"transactionId": "00010001000011811291048036",
"customerOrderId": "19",
"paymentNumber": 1,
"paymentType": "customerOrderCashPayment",
"voided": false,
"amount": 5995,
"status": "COMMITTED",
"createdDate": "2018-11-29T10:49:01.000+00:00",
"exchangeRate": 0,
"foreignValue": 0,
"lastUpdated": 1543488541000,
"isRefund": false,
"refundAvailable": 5995,
"tenderId": {
"tenderId": "CASH_UK",
"groupId": {
"id": "UK",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"currencyId": {
"id": "GBP"
},
"userId": {
"id": "1"
}
}
}
],
"customerOrderHeader": {
"transactionId": "00010001000011811291048036",
"customerOrderId": "19",
"customerOrderTypeId": "CUSTOMER_ORDER",
"referenceId": "19",
"internalReferenceId": "b91e7311-3b85-4c95-8c59-e02006dafac8",
"locationId": {
"id": "0001"
},
"userId": {
"id": "1"
},
"createdDate": "2018-11-29T10:48:37.000+00:00",
"authorisedByUserKey": {},
"authorisedDate": "2018-11-29T10:48:37.000+00:00",
"preferredContactTypeKey": {
"id": "CX_ORD_CONTACT"
},
"notificationContactTypeKey": {
"id": "CX_ORD_NOTIFICATION"
},
"customerNumber": "1",
"customerTitle": "Mr",
"customerFirstName": "Mark",
"customerSurname": "Harrison",
"customerPostcode": "SG141PB",
"currencyId": {
"id": "GBP"
},
"orderValue": 5995,
"balanceOwed": -5995,
"taxAmount": 0,
"taxInclusive": false,
"totalPayments": 5995,
"totalsLastCalculated": 1543488561000,
"voided": false,
"status": "SUBMITTED",
"lastUpdatedByUserKey": {},
"lastUpdated": 1543488561000,
"address": [
{
"county": "Hertfordshire",
"email": "demo@enactor.co.uk",
"phone1": "01295768256",
"postCode": "SG141PB",
"street1": "1 Enactor House",
"street2": "Bluecoats Avenue",
"town": "Hertford",
"organisation": "Enactor",
"isTemplate": false,
"lastUpdated": 1543488541000,
"countryCodeId": {},
"typeId": {
"id": "CX_ORD_CONTACT"
}
}
],
"deviceId": {
"id": "pos1@0001.enactor"
},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
},
"customerOrderFulfilments": [
{
"customerOrderId": "19",
"fulfilmentId": 1,
"sourceType": "locationStockFulfilment",
"sourceId": "0100",
"destinationType": "COLLECTION",
"destinationLocationId": {
"id": "0001"
},
"destinationAddress": {
"isTemplate": false,
"countryCodeId": {},
"typeId": {}
},
"destinationName": {},
"deliveryCharge": 0,
"deliveryChargeForeignCurrencyId": {},
"deliveryChargeForeignAmount": 0,
"lastUpdated": 1543488572000,
"deliveryTypeId": {},
"trackingDetails": {}
}
]
},
{
"products": [
{
"productId": "DF517XM-1",
"type": "skuProduct",
"productDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Button Down Collar Red"
}
]
},
"productLongDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Check Button Down Collar Western Shirt"
}
]
},
"productInfo": "Machine washable. Cotton.",
"imageURL": "image://PRODUCT/DF517XM-2.jpg",
"posDetails": {
"operatorMessage": {},
"customerMessage": {},
"cashierAgeRestrict": 0,
"numberCopyReceipts": 0,
"maxDiscount": 0,
"maxEmployeeDiscount": 0,
"returnsTimeLimit": 0,
"maxQtyPerTransaction": 0,
"customerAgeRestriction": 0,
"receiptMessage": {},
"productOptionSetDetails": {
"isTemplate": false
},
"isTemplate": false
},
"isTemplate": false,
"status": "LIVE",
"lastUpdated": 1436467475060,
"taxExemptProhibited": false,
"exportDetails": {
"notForExport": false,
"isTemplate": false
},
"inventoryDetails": {
"allowForLoan": false,
"allowCustomerOrder": true,
"allowPurchaseOrder": true,
"customerOrderOnly": false,
"directToStoreDelivery": false,
"warehouseUnitOfMeasureId": "1",
"isStocked": true,
"isTemplate": false
},
"productDimensions": {
"isTemplate": false
},
"warrantyDetails": {
"isTemplate": false
},
"salesUnitOfMeasureId": "1",
"inventoryUnitOfMeasureId": "1",
"standardCostPrice": 0,
"standardMargin": 0,
"styleId": "DF517XM",
"fasciaId": {},
"imageFilenameId": {
"id": "DF517XM-2",
"category": "PRODUCT",
"type": "jpg"
},
"taxGroupId": {
"id": "A"
},
"mmGroupId": {
"id": "MENS_SHIRTS",
"groupTypeId": "mmGroup",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"brandId": {
"id": "INTERNAL",
"groupTypeId": "brand",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"rangeId": {},
"measureSystemId": {
"id": "CASE_PACK"
},
"seasonId": {
"id": "ALL"
},
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
},
{
"productId": "MB709SN-4",
"type": "skuProduct",
"productDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Rose Print Tea Dress"
}
]
},
"productLongDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Lightweight cotton tea dress. Back shirring for improved fit."
}
]
},
"productInfo": "Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.",
"imageURL": "image://PRODUCT/MB709SN-2.jpg",
"posDetails": {
"productOptionSetDetails": {
"isTemplate": false
},
"isTemplate": false
},
"isTemplate": false,
"status": "LIVE",
"lastUpdated": 1557908691938,
"taxExemptProhibited": false,
"exportDetails": {
"notForExport": false,
"isTemplate": false
},
"inventoryDetails": {
"allowForLoan": false,
"allowCustomerOrder": true,
"allowPurchaseOrder": true,
"customerOrderOnly": false,
"directToStoreDelivery": false,
"isStocked": true,
"isTemplate": false
},
"productDimensions": {
"isTemplate": false
},
"warrantyDetails": {
"isTemplate": false
},
"standardCostPrice": 0,
"standardMargin": 0,
"styleId": "MB709SN",
"fasciaId": {},
"imageFilenameId": {
"id": "MB709SN-2",
"category": "PRODUCT",
"type": "jpg"
},
"taxGroupId": {
"id": "A"
},
"mmGroupId": {
"id": "WOMENS_DRESSES",
"groupTypeId": "mmGroup",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"brandId": {
"id": "INTERNAL",
"groupTypeId": "brand",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"rangeId": {},
"seasonId": {
"id": "SUMMER"
},
"colourId": {
"id": "NAVY_BLUE",
"colourRangeId": "WOMENS_DRESSES"
},
"sizeId": {
"id": "14",
"sizeRangeId": "WOMENS_DRESSES"
}
}
],
"customerOrderItems": [
{
"item": {
"sourceLineNumber": 1,
"parentLineNumber": 0,
"fulfilmentId": 1,
"userId": {},
"locationId": {
"id": "0001"
},
"productId": {
"id": "MB709SN-4"
},
"createdDate": "2018-11-26T09:34:52.000+00:00",
"customerOrderId": "75YA7IQ7LVCDJJOMTBT2SIS2MI",
"lastUpdated": 1543224947000,
"lineNumber": 1,
"netPrice": 1000,
"orderedQty": 2,
"reservedQty": 0,
"shippedQty": 0,
"status": "NEW",
"taxAmount": 0,
"unitPrice": 0,
"voided": false,
"effectiveNetValue": 1000,
"destinationLocationId": {},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
}
},
{
"item": {
"sourceLineNumber": 0,
"parentLineNumber": 0,
"fulfilmentId": 1,
"userId": {},
"locationId": {
"id": "0001"
},
"productId": {
"id": "DF517XM-1"
},
"createdDate": "2018-11-26T09:34:52.000+00:00",
"customerOrderId": "75YA7IQ7LVCDJJOMTBT2SIS2MI",
"lastUpdated": 1543224947000,
"lineNumber": 2,
"netPrice": 1000,
"orderedQty": 5,
"reservedQty": 0,
"shippedQty": 0,
"status": "NEW",
"taxAmount": 0,
"unitPrice": 0,
"voided": false,
"effectiveNetValue": 1000,
"destinationLocationId": {},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
}
}
],
"customerOrderPayments": [
{
"customerOrderCardPayment": {
"cardDetails": {
"cardDescription": "Mastercard",
"panToken": "476173B0000H0119",
"panIIN": "530125",
"mangledPAN": "*********0192",
"hashedPan": "i0PLbox7WJ7iPWJbzNbGBSbn3O5nn2K0MzrYv5+k81Q="
},
"isPreAuth": false,
"hostAuthorised": false,
"hostDeclined": false,
"isManuallyRecorded": false,
"billingAddressContactTypeId": {},
"customerOrderId": "75YA7IQ7LVCDJJOMTBT2SIS2MI",
"paymentNumber": 1,
"paymentType": "customerOrderCardPayment",
"voided": false,
"amount": 2000,
"status": "COMMITTED",
"createdDate": "2018-11-26T09:35:47.000+00:00",
"exchangeRate": 0,
"foreignValue": 0,
"lastUpdated": 1543224947000,
"isRefund": false,
"refundAvailable": 2000,
"tenderId": {
"groupId": {
"id": "ALL",
"groupTypeId": "region",
"groupHierarchyId": "ALL"
}
},
"currencyId": {
"id": "GBP"
},
"userId": {
"id": "1"
}
}
}
],
"customerOrderHeader": {
"customerOrderId": "75YA7IQ7LVCDJJOMTBT2SIS2MI",
"customerOrderTypeId": "CUSTOMER_ORDER",
"referenceId": "75YA7IQ7",
"internalReferenceId": "3b8f6789-5f94-48af-9b9d-01df06d0e5aa",
"locationId": {
"id": "estatemanager"
},
"userId": {},
"createdDate": "2018-11-26T09:34:52.000+00:00",
"authorisedByUserKey": {},
"preferredContactTypeKey": {
"id": "CX_ORD_CONTACT"
},
"notificationContactTypeKey": {
"id": "CX_ORD_NOTIFICATION"
},
"customerNumber": "1",
"customerTitle": "MR",
"customerFirstName": "James Hanson",
"customerSurname": "Hanson",
"customerPostcode": "SG12 9TE",
"currencyId": {},
"orderValue": 3000,
"balanceOwed": -1000,
"taxAmount": 0,
"taxInclusive": false,
"adjustments": [
{
"adjustmentNumber": 1,
"fulfilmentId": 1,
"description": "£10.00 off",
"voided": false,
"amount": 1000,
"percentage": 0,
"taxAmount": 0,
"canCancel": false,
"lastUpdated": 1543224947000
}
],
"totalPayments": 2000,
"totalsLastCalculated": 1543224949000,
"voided": false,
"status": "IN_PROGRESS",
"lastUpdatedByUserKey": {},
"lastUpdated": 1543224949000,
"address": [
{
"country": "Britain",
"email": "james.hanson@enactor.co.uk",
"mobilePhone": "07777 9999999",
"postCode": "SG14 9TG",
"street1": "Bluecoats",
"street2": "Avenue",
"town": "Hertford",
"isTemplate": false,
"lastUpdated": 1543224947000,
"countryCodeId": {},
"typeId": {
"id": "CX_ORD_CONTACT"
}
},
{
"isTemplate": false,
"lastUpdated": 1543224947000,
"countryCodeId": {},
"typeId": {
"id": "CX_ORD_NOTIFICATION"
}
}
],
"deviceId": {
"id": "estateManager.enactor"
},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
},
"customerOrderNotes": [
{
"customerOrderId": "75YA7IQ7LVCDJJOMTBT2SIS2MI",
"lineNumber": 1,
"messageNumber": 1,
"type": "GENERAL",
"note": "This is a test note",
"locationId": {
"id": "0001"
},
"userId": {
"id": "1"
},
"lastUpdated": 1543224947000
},
List Order Headers
This service can be used to list all order headers.
Request
Request Service URL
GET /orders/headers
Request Tokens
There are no request tokens.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
ListOrderHeaderResponse
Element | Type | Description |
---|---|---|
list | List<CustomerOrderHeaderListElementList> | The list of customer order headers. |
Scenarios and Responses
This sub-section covers the Primary Basket Scenarios, Wishlist Basket
Scenarios and Response Codes related to Add Basket Item service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
GET: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders/headers
Response:
Status 200 OK
{
"list": [
{
"customerOrderHeaderKey": {
"id": "2"
},
"status": "SUBMITTED",
"transactionId": "00030106000022312221314100",
"referenceId": "2",
"customerNumber": "100",
"currencyKey": {
"id": "GBP"
},
"voided": false,
"balanceOwed": -29900,
"totalsLastCalculated": 1703251022000,
"orderValue": 29900,
"createdDate": "2023-12-22T13:15:29.000+00:00",
"customerTitle": "Mrs",
"customerFirstName": "Amelia",
"customerSurname": "Baldwin",
"customerPostcode": "SG14 3AG",
"customerDateOfBirth": 539308800000,
"entityQName": "{http://www.enactor.com/orders}customerOrderHeaderListElement"
},
{
"customerOrderHeaderKey": {
"id": "1"
},
"status": "SUBMITTED",
"transactionId": "00030002000032312221308352",
"referenceId": "1",
"customerNumber": "100",
"currencyKey": {
"id": "GBP"
},
"voided": false,
"balanceOwed": -29900,
"totalsLastCalculated": 1703250732000,
"orderValue": 29900,
"createdDate": "2023-12-22T13:10:15.000+00:00",
"customerTitle": "Mrs",
"customerFirstName": "Amelia",
"customerSurname": "Baldwin",
"customerPostcode": "SG14 3AG",
"customerDateOfBirth": 539308800000,
"entityQName": "{http://www.enactor.com/orders}customerOrderHeaderListElement"
}
]
}
Create an Order
This service creates an order for a given transaction. The transaction must have a user and customer order ID associated with it.
Request
Request Service URL
POST /orders
Request Tokens
There are no request tokens.
Request Parameters
There are no request parameters.
Request Body
Element | Required / Optional | Type | Description |
---|---|---|---|
request | Required | ICreateOrderTransaction | The details of the order to create. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Scenarios and Responses
This sub-section covers the Primary Basket Scenarios, Wishlist Basket Scenarios and Response Codes related to Add Basket Item service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders
{
"customerOrderCreateHeaderMessage": {
"transactionId": "00010002000081811201312526",
"customerOrderId": "10",
"customerOrderTypeId": "CUSTOMER_ORDER",
"referenceId": "10",
"deviceId": {
"id": "pos2@0001.enactor"
},
"locationId": {
"id": "0001"
},
"userId": {
"id": "CUST_USER"
},
"createdDate": "2018-11-20T15:10:44.000+00:00",
"authorisedByUserKey": {},
"authorisedDate": "2018-11-20T15:10:44.000+00:00",
"preferredContactTypeKey": {},
"customerNumber": "1",
"customerPostcode": "SG141PB",
"contactAddress": {
"county": "Hertfordshire",
"email": "demo@enactor.co.uk",
"phone1": "01295768256",
"postCode": "SG141PB",
"street1": "1 Enactor House",
"street2": "Bluecoats Avenue",
"town": "Hertford",
"organisation": "Enactor",
"isTemplate": false,
"countryCodeId": {},
"typeId": {}
},
"currencyId": {
"id": "GBP"
},
"status": "STARTING",
"notificationEmailAddress": "demo@enactor.co.uk"
},
"customerOrderItems": [
{
"transactionId": "00010002000081811201312526",
"customerOrderId": "10",
"sourceLineNumber": 2,
"fulfilmentId": 1,
"locationId": {
"id": "0001"
},
"userId": {
"id": "CUST_USER"
},
"createdDate": "2018-11-20T13:12:52.000+00:00",
"productId": {
"id": "MB709SN"
},
"orderedQty": 1,
"unitPrice": 4260,
"netPrice": 4260,
"effectiveNetValue": 4260
}
],
"customerOrderPayments": [
{
"cardPayment": {
"cardDetails": {},
"isPreAuth": false,
"hostAuthorised": false,
"hostDeclined": false,
"isManuallyRecorded": false,
"billingAddressContactTypeId": {},
"transactionId": "00010002000081811201312526",
"customerOrderId": "10",
"paymentType": "customerOrderCardPayment",
"amount": 4260,
"exchangeRate": 0.0,
"foreignValue": 0,
"isRefund": false,
"isTransfer": false,
"currencyId": {
"id": "GBP"
},
"tenderId": {
"tenderId": "CARD",
"groupId": {
"id": "UK",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"userId": {
"id": "CUST_USER"
}
}
}
],
"fulfilmentOptions": [
{
"customerOrderId": "10",
"fulfilmentId": 1,
"sourceType": "locationStockFulfilment",
"sourceId": "0003",
"destinationType": "ADDRESS",
"destinationLocationId": {},
"destinationAddress": {
"county": "Hertfordshire",
"postCode": "sg124 9tf",
"street1": "44 Furlong Way",
"street2": "Great Amwell",
"isTemplate": false,
"lastUpdated": 1542726677852,
"countryCodeId": {},
"typeId": {}
},
"destinationName": {},
"deliveryCharge": 0,
"deliveryChargeForeignCurrencyId": {},
"deliveryTypeId": {}
}
],
"transactionId": "estateManager.enactor_16731acdc59",
"sequenceNumber": 1,
"source": "estateManager.enactor",
"sourceApplication": "Retail Transaction Processing",
"topic": "Transactions",
"userId": "CUST_USER"
}
Response:
Status: 200 OK
Get an Order’s Details
This service allows to retrieve details about a particular order.
Request
Request Service URL
GET /orders/{orderId}
Request Tokens
- orderId: The ID of the order to retrieve.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
Element | Type | Description |
---|---|---|
order | ICustomerOrder | The details of the specified order. |
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Get an Order’s Details service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service receives a valid order ID and the order belongs to the customer. | Success | The customer order is returned. | 200 | IGetOrderResponse: order <ICustomerOrder> |
The orders service receives a valid order ID and the order does not belong to the customer. | NotAllowed | The customer order is not returned. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to retrieve order, outcome: NotAllowed. |
The orders service receives an invalid order ID. | Fail | The customer order is not returned. An internal server error message is returned. | 500 | ErrorMessage: 500, Failed to retrieve order, outcome: Fail |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
GET: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders/1
Response:
Status: 200 OK
{
"order": {
"products": [
{
"productId": "DF517XM-1",
"type": "skuProduct",
"productDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Button Down Collar Red"
}
]
},
"productLongDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Check Button Down Collar Western Shirt"
}
]
},
"productInfo": "Machine washable. Cotton.",
"imageURL": "image://PRODUCT/DF517XM-2.jpg",
"posDetails": {
"operatorMessage": {},
"customerMessage": {},
"cashierAgeRestrict": 0,
"numberCopyReceipts": 0,
"maxDiscount": 0,
"maxEmployeeDiscount": 0,
"returnsTimeLimit": 0,
"maxQtyPerTransaction": 0,
"customerAgeRestriction": 0,
"receiptMessage": {},
"productOptionSetDetails": {
"isTemplate": false
},
"isTemplate": false
},
"isTemplate": false,
"status": "LIVE",
"lastUpdated": 1436467475060,
"taxExemptProhibited": false,
"exportDetails": {
"notForExport": false,
"isTemplate": false
},
"inventoryDetails": {
"allowForLoan": false,
"allowCustomerOrder": true,
"allowPurchaseOrder": true,
"customerOrderOnly": false,
"directToStoreDelivery": false,
"warehouseUnitOfMeasureId": "1",
"isStocked": true,
"isTemplate": false
},
"productDimensions": {
"isTemplate": false
},
"warrantyDetails": {
"isTemplate": false
},
"salesUnitOfMeasureId": "1",
"inventoryUnitOfMeasureId": "1",
"standardCostPrice": 0,
"standardMargin": 0,
"styleId": "DF517XM",
"fasciaId": {},
"imageFilenameId": {
"id": "DF517XM-2",
"category": "PRODUCT",
"type": "jpg"
},
"taxGroupId": {
"id": "A"
},
"mmGroupId": {
"id": "MENS_SHIRTS",
"groupTypeId": "mmGroup",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"brandId": {
"id": "INTERNAL",
"groupTypeId": "brand",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"rangeId": {},
"measureSystemId": {
"id": "CASE_PACK"
},
"seasonId": {
"id": "ALL"
},
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
},
{
"productId": "MB709SN-4",
"type": "skuProduct",
"productDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Rose Print Tea Dress"
}
]
},
"productLongDescription": {
"string": [
{
"country": "GB",
"language": "en",
"string": "Lightweight cotton tea dress. Back shirring for improved fit."
}
]
},
"productInfo": "Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.",
"imageURL": "image://PRODUCT/MB709SN-2.jpg",
"posDetails": {
"productOptionSetDetails": {
"isTemplate": false
},
"isTemplate": false
},
"isTemplate": false,
"status": "LIVE",
"lastUpdated": 1557908691938,
"taxExemptProhibited": false,
"exportDetails": {
"notForExport": false,
"isTemplate": false
},
"inventoryDetails": {
"allowForLoan": false,
"allowCustomerOrder": true,
"allowPurchaseOrder": true,
"customerOrderOnly": false,
"directToStoreDelivery": false,
"isStocked": true,
"isTemplate": false
},
"productDimensions": {
"isTemplate": false
},
"warrantyDetails": {
"isTemplate": false
},
"standardCostPrice": 0,
"standardMargin": 0,
"styleId": "MB709SN",
"fasciaId": {},
"imageFilenameId": {
"id": "MB709SN-2",
"category": "PRODUCT",
"type": "jpg"
},
"taxGroupId": {
"id": "A"
},
"mmGroupId": {
"id": "WOMENS_DRESSES",
"groupTypeId": "mmGroup",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"brandId": {
"id": "INTERNAL",
"groupTypeId": "brand",
"groupHierarchyId": "FASHION",
"variantGroupTypeId": "region",
"variantGroupId": "All",
"variantGroupHierarchyId": "All"
},
"rangeId": {},
"seasonId": {
"id": "SUMMER"
},
"colourId": {
"id": "NAVY_BLUE",
"colourRangeId": "WOMENS_DRESSES"
},
"sizeId": {
"id": "14",
"sizeRangeId": "WOMENS_DRESSES"
}
}
],
"customerOrderItems": [
{
"item": {
"sourceLineNumber": 1,
"parentLineNumber": 0,
"fulfilmentId": 1,
"userId": {},
"locationId": {
"id": "0001"
},
"productId": {
"id": "MB709SN-4"
},
"createdDate": "2018-11-26T09:44:51.000+00:00",
"customerOrderId": "3WQG6LAV6FHDTIXNP4WPWE2TQE",
"lastUpdated": 1543225531000,
"lineNumber": 1,
"netPrice": 1000,
"orderedQty": 2,
"reservedQty": 0,
"shippedQty": 0,
"status": "NEW",
"taxAmount": 0,
"unitPrice": 0,
"voided": false,
"effectiveNetValue": 1000,
"destinationLocationId": {},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
}
},
{
"item": {
"sourceLineNumber": 0,
"parentLineNumber": 0,
"fulfilmentId": 1,
"userId": {},
"locationId": {
"id": "0001"
},
"productId": {
"id": "DF517XM-1"
},
"createdDate": "2018-11-26T09:44:51.000+00:00",
"customerOrderId": "3WQG6LAV6FHDTIXNP4WPWE2TQE",
"lastUpdated": 1543225531000,
"lineNumber": 2,
"netPrice": 1000,
"orderedQty": 5,
"reservedQty": 0,
"shippedQty": 0,
"status": "NEW",
"taxAmount": 0,
"unitPrice": 0,
"voided": false,
"effectiveNetValue": 1000,
"destinationLocationId": {},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
}
}
],
"customerOrderPayments": [
{
"customerOrderCardPayment": {
"cardDetails": {
"cardDescription": "Mastercard",
"panToken": "476173B0000H0119",
"panIIN": "530125",
"mangledPAN": "*********0192",
"hashedPan": "i0PLbox7WJ7iPWJbzNbGBSbn3O5nn2K0MzrYv5+k81Q="
},
"isPreAuth": false,
"hostAuthorised": false,
"hostDeclined": false,
"isManuallyRecorded": false,
"billingAddressContactTypeId": {},
"customerOrderId": "3WQG6LAV6FHDTIXNP4WPWE2TQE",
"paymentNumber": 1,
"paymentType": "customerOrderCardPayment",
"voided": false,
"amount": 2000,
"status": "COMMITTED",
"createdDate": "2018-11-26T09:45:31.000+00:00",
"exchangeRate": 0,
"foreignValue": 0,
"lastUpdated": 1543225531000,
"isRefund": false,
"refundAvailable": 2000,
"tenderId": {
"groupId": {
"id": "ALL",
"groupTypeId": "region",
"groupHierarchyId": "ALL"
}
},
"currencyId": {
"id": "GBP"
},
"userId": {
"id": "1"
}
}
}
],
"customerOrderHeader": {
"customerOrderId": "3WQG6LAV6FHDTIXNP4WPWE2TQE",
"customerOrderTypeId": "CUSTOMER_ORDER",
"referenceId": "3WQG6LAV",
"internalReferenceId": "2afd8598-88a0-4ab5-904c-1d737c613574",
"locationId": {
"id": "estatemanager"
},
"userId": {},
"createdDate": "2018-11-26T09:44:51.000+00:00",
"authorisedByUserKey": {},
"preferredContactTypeKey": {
"id": "CX_ORD_CONTACT"
},
"notificationContactTypeKey": {
"id": "CX_ORD_NOTIFICATION"
},
"customerNumber": "1",
"customerTitle": "MR",
"customerFirstName": "James Hanson",
"customerSurname": "Hanson",
"customerPostcode": "SG12 9TE",
"currencyId": {},
"orderValue": 3000,
"balanceOwed": -1000,
"taxAmount": 0,
"taxInclusive": false,
"adjustments": [
{
"adjustmentNumber": 1,
"fulfilmentId": 1,
"description": "£10.00 off",
"voided": false,
"amount": 1000,
"percentage": 0,
"taxAmount": 0,
"canCancel": false,
"lastUpdated": 1543225531000
}
],
"totalPayments": 2000,
"totalsLastCalculated": 1543225534000,
"voided": false,
"status": "IN_PROGRESS",
"lastUpdatedByUserKey": {},
"lastUpdated": 1543225534000,
"address": [
{
"country": "Britain",
"email": "james.hanson@enactor.co.uk",
"mobilePhone": "07777 9999999",
"postCode": "SG14 9TG",
"street1": "Bluecoats",
"street2": "Avenue",
"town": "Hertford",
"isTemplate": false,
"lastUpdated": 1543225531000,
"countryCodeId": {},
"typeId": {
"id": "CX_ORD_CONTACT"
}
},
{
"isTemplate": false,
"lastUpdated": 1543225531000,
"countryCodeId": {},
"typeId": {
"id": "CX_ORD_NOTIFICATION"
}
}
],
"deviceId": {
"id": "estateManager.enactor"
},
"reasonId": {
"regionId": {
"groupTypeId": "region"
}
}
},
"customerOrderNotes": [
{
"customerOrderId": "3WQG6LAV6FHDTIXNP4WPWE2TQE",
"lineNumber": 1,
"messageNumber": 1,
"type": "GENERAL",
"note": "This is a test note",
"locationId": {
"id": "0001"
},
"userId": {
"id": "1"
},
"lastUpdated": 1543225531000
}
]
}
}
Cancel an Order
This service allows to request cancellation of an order.
If the order cannot be cancelled at this time, the service would respond with a 405 (Method Not Allowed) status code. Otherwise, the cancellation request will be recorded and processed late where the service should respond with a 202 (Accepted) status code – this does not guarantee that cancellation will be possible.
Note: The Order Status, returned on the Get an Order’s Details service, will provide a hint to the client if a cancellation is possible.
Request
Request Service URL
DELETE /orders/{orderId}
Request Tokens
- orderId: The ID of the order to request cancellation for.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Cancel an Order service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service receives a valid order ID and the order belongs to the customer. | Success | The customer’s order has been requested to be cancelled by the order manager. | 202 | Response: 202 Accepted. |
The orders service receives a valid order ID and the order does not belong to the customer. | NotAllowed | The customer order is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order, outcome: NotAllowed. |
The orders service receives an invalid order ID. | Fail | The customer order is not cancelled. An Internal server error message is returned. | 500 | ErrorMessage: 500, Failed to cancel order, outcome: Fail. |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
DELETE: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders/1
Response:
Status: 202 Accepted
Cancel an Order Item
This service allows to request cancellation of an order item.
If the order cannot be cancelled at this time, the service would respond with a 405 (Method Not Allowed) status code. Otherwise, the cancellation request will be recorded and processed late where the service should respond with a 202 (Accepted) status code – this does not guarantee that cancellation will be possible.
Note: The Order Item Status and Order Status, returned on the Get an Order’s Details service, will provide a hint to the client if a cancellation is possible.
Request
Request Service URL
DELETE /orders/{orderId}/items/{lineNumber}
Request Tokens
-
orderId: The ID of the order that holds the line to be cancelled.
-
lineNumber: The line number of the item to be cancelled.
Request Parameters
There are no request parameters.
Request Body
Element | Required / Optional | Type | Description |
---|---|---|---|
quantity | Optional | The number of items to be cancelled (optional). Defaults to the ordered quantity. | |
reasonKey | The reason key for the customer order cancel reason. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Cancel an Order Item service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service receives a valid order ID, a valid line number and the order belongs to the customer. | Success | The customers order item has been requested to be cancelled by the order manager. | 202 | Response: 202 Accepted. |
The orders service receives a valid order ID, a valid line number and but the order does not belong to the customer. | NotAllowed | The customers order item is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order item, outcome: NotAllowed. |
The orders service receives a valid order ID, an invalid line number and but the order does not belong to the customer. | NotAllowed | The customers order item is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order item, outcome: NotAllowed. |
The orders service receives an invalid order ID. | Fail | The customer order is not cancelled. An Internal server error message is returned. | 500 | ErrorMessage: 500, Failed to cancel order item, outcome: Fail. |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders/1/items/1
Response:
Status: 202 Accepted
Request Return of an Order
This service allows to request return of an order.
If the order cannot be cancelled at this time, the service would respond with a 405 (Method Not Allowed) status code. Otherwise, the cancellation request will be recorded and processed late where the service should respond with a 202 (Accepted) status code – this does not guarantee that cancellation will be possible.
Note: The Order Status, returned on the Get an Order’s Details service, will provide a hint to the client if a cancellation is possible.
Request
Request Service URL
PATCH /orders/{orderId}/return
Request Tokens
- orderId: The ID of the order to be returned.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Request Return of an Order service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service receives a valid order ID and the order belongs to the customer. | Success | The customer’s order has been requested to be cancelled by the order manager. | 202 | Response: 202 Accepted. |
The orders service receives a valid order ID and the order does not belong to the customer. | NotAllowed | The customer order is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order, outcome: NotAllowed. |
The orders service receives an invalid order ID. | Fail | The customer order is not cancelled. An Internal server error message is returned. | 500 | ErrorMessage: 500, Failed to cancel order, outcome: Fail. |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
PATCH: http://[SWARM_LEADER_IP]/WebRestApi/rest/orders/1/return
Response:
Status: 202 Accepted
Request Return of an Order Item
This service allows to request return of an order item.
If the order cannot be cancelled at this time, the service would respond with a 405 (Method Not Allowed) status code. Otherwise, the cancellation request will be recorded and processed late where the service should respond with a 202 (Accepted) status code – this does not guarantee that cancellation will be possible.
Note: The Order Item Status and Order Status, returned on the Get an Order’s Details service, will provide a hint to the client if a cancellation is possible.
Request
Request Service URL
PATCH /orders/{orderId}/items/{lineNumber}/return
Request Tokens
-
orderId: The ID of the order that holds the line to be returned.
-
lineNumber: The line number of the item to be returned.
Request Parameters
There are no request parameters.
Request Body
Element | Required / Optional | Type | Description |
---|---|---|---|
quantity | Optional | The number of items to be cancelled (optional). Defaults to the ordered quantity. | |
reasonKey | The reason key for the customer order cancel reason. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to Request Return of an Order Item service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The orders service receives a valid order ID, a valid line number and the order belongs to the customer. | Success | The customers order item has been requested to be cancelled by the order manager. | 202 | Response: 202 Accepted. |
The orders service receives a valid order ID, a valid line number and but the order does not belong to the customer. | NotAllowed | The customers order item is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order item, outcome: NotAllowed. |
The orders service receives a valid order ID, an invalid line number and but the order does not belong to the customer. | NotAllowed | The customers order item is not cancelled. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to cancel order item, outcome: NotAllowed. |
The orders service receives an invalid order ID. | Fail | The customer order is not cancelled. An Internal server error message is returned. | 500 | ErrorMessage: 500, Failed to cancel order item, outcome: Fail. |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
PATCH:
http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/orders/1/items/1/return
Response:
Status: 202 Accepted
Update Order?
PUT /orders/{orderId}
PATCH /orders/{orderId}
Remarks:
Not sure we need/want this?
Orders Task API
The Orders Task API is used to provide a clean view of task information relevant to the order system. It will typically use other services to provide a response but will combine and augment their responses as required. Following is the list of Orders Task APIs covered in this section:
- List Available Picks
List Available Picks
This service requires authentication and will return a list of Picks that can be performed by the authenticated user.
Request
Request Service URL
GET /tasks/orders/availablePicks
Request Tokens
There are no request tokens.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListAvailablePicksResponse
Element | Type | Description |
---|---|---|
availablePicksList | List<IAvailablePick> | A list of the available picks. |
Scenarios and Responses
This sub-section covers the Scenarios and Response Codes related to List Available Picks service.
Scenarios
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The service is not supplied any Authorisation header | Error | The service will fail to perform any query | 401 | No response body |
The service is supplied an invalid Authorisation header | Error | The service will fail to perform any query | 401 | No response body |
The service is supplied a valid Authorisation header | Success | The service should return a list of available picks that can be performed by the authenticated user. | 200 | IListAvailablePicksResponse |
Response Codes
HTTP Status Code / Phrase | Detail Message ID | Description / Potential Causes |
---|---|---|
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/tasks/orders/availablePicks
Response:
Status: 200 OK
{
"availablePicksList": [
{
"orderId": "1",
"fulfilmentId": "1",
"taskId": "a39c48a9-0b1e-471c-b0b5-050a18bbc4d0",
"customerTitle": "Miss",
"customerFistName": "Amelia",
"customerSurname": "Baldwin",
"orderTotal": 995,
"orderCurrency": "GBP",
"dateCreated": 1604662300000
}
]
}