How-to Guide - Rest API - Baskets
Introduction
The purpose of this guide is to provide an understanding of the REST Basket 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 Basket API is deployed.
Following are Enactor REST Basket APIs areas covered in this document:
-
Basket
-
Basket Items
-
Basket Discount
-
Basket Tender
-
Basket Orders
Basket API
The Basket API is used to add/remove/update items in a basket. It also allows for promotion calculations to be performed against a basket.
Following is the list of Basket APIs covered in this section:
-
Create / Save a Basket.
-
Replace Basket.
-
Delete Basket.
-
Copy / Move All Items from one Basket to another Basket.
-
Remove all Items from a Basket.
-
Request a Promotion Calculation for a Basket.
-
List Customer Baskets.
-
Get Basket Details.
-
Associate Basket with a Customer.
-
Update a Basket Description.
-
Submit a Basket.
-
Get Transaction of a Basket.
Basket API General Notes
The Basket API allows for baskets to be named, and a single customer can have multiple active baskets; this is used to support 'wishlists'. In this scenario there is one 'PRIMARY' basket for the customer, and many 'WISHLIST' baskets - these are internally identified by the BasketType on the StoredCustomerBasket entity.
Baskets have a unique reference ID. This is generated from a Class 4 UUID encoded into Base32 as shown by the following code:
public String createReferenceId() {
// First create a UUID
UUID uuid = UUID.randomUUID();
// Convert to binary
ByteBuffer buffer = ByteBuffer.wrap(new byte[16]);
buffer.putLong(uuid.getMostSignificantBits());
buffer.putLong(uuid.getLeastSignificantBits());
byte[] bytes = buffer.array();
// Encode to Base32
String base32Id = Base32.encodeBytes(bytes);
// Strip (trailing) '=' symbols and return
return base32Id.replace("=","");
}
This should result in a 22-character string.
Baskets can be either associated with a customer or be anonymous. In the latter case, the anonymous customer can only access their stored baskets by retaining the basket reference (for example in a cookie) – if the basket reference is lost, an anonymous basket cannot be retrieved.
Baskets will be stored using the Enactor Basket Store (not the Stored Transaction Service)
Subject Header Handling
As the Basket API may be used directly by end-users (customers), it is important to protect the baskets of one customer from modification by another customer. Therefore, the Basket API normally requires that all calls against a Basket consistently use the same Subject header. This restriction can be removed by using configuring a User with sufficient permissions for cases where baskets are created by other systems (rather than directly by the Customers themselves).
The following scenarios are supported when using the Subject header:
-
A Customer creates a fully anonymous Basket. In this scenario, the Subject header should not be supplied. The Customer Details should also not be present in the "Create Basket" API call. All subsequent calls to the Basket API for this Basket must not include the Subject header.
-
A Customer creates a Basket with Customer Details, but without a Customer Number. In this scenario, the Subject header should not be supplied, but the Customer Details will be included in the "Create Basket" API call. All subsequent calls to the Basket API for this Basket must not include the Subject header.
-
A Customer creates a Basket with Customer Details and a Customer Number. In this scenario, the Subject header should contain the Customer Number, and the Customer Details will be included in the "Create Baskets" API call. All subsequent calls to the Basket API for this Basket should include the same Subject header.
-
A Customer creates a Basket with a Customer Number, but without Customer Details In this scenario, the Subject header should contain the Customer Number. The Customer Details will be loaded from the Enactor Customer database. All subsequent calls to the Basket API for this Basket should include the same Subject header.
Line Reference
Many Basket API methods allow you to update existing items in the basket. Existing items can be referenced in one of two ways:
-
Line Number Each line is associated with a line number that denotes its order in the basket. The line number for a specific line may change if items are deleted from the basket. Otherwise, each amendment to the basket will introduce new lines that appear at the end of the basket.
-
External Reference When a line is added to the basket you can optionally supply an external reference. This reference can then be used to later refer to the line. The external reference can contain any value but cannot begin with a number. The external reference does not need to be unique - if that is the case then any attempt to update a basket using the external reference will operate on the first item in the basket that has a matching reference.
Privileges
In order to carry out certain REST Basket API functions, make sure to enable the appropriate privileges as required for the user who will used for Authorisation.
Following is the list of all the privileges that are needed in order to run all the REST Basket API functions successfully:
Application Package | Process | Function ID | Function Name |
---|---|---|---|
Rest API - Rest Basket Service | Handle List Customer Basket Request | enactor.restApi.BasketApi.AllowListingOfAllBaskets | Allow Listing Of All Baskets. |
Rest API - Rest Basket Service | Load Basket | enactor.restApi.BasketApi.AllowUpdateAnyBasket | Allow Update Any Basket. |
Rest API - Rest Basket Service | Validate Create Basket Request | enactor.restApi.BasketApi.AllowCustomerNumberInCreateBasketRequest | Allow CustomerNumber In Create Basket Request. |
Enabling the above privileges as required would allow to run the Admin Functions in the POS successfully.
Create / Save a Basket
This creates a new empty basket with the given name. The reference for the new basket is returned in the response headers. If the accessToken contains customer details, the basket will be associated with the customer, otherwise the basket is anonymous.
The type determines what kind of basket to create, can be supplied as 'WISHLIST' or 'BASKET'.
If the type is 'BASKET' the basket can be recalled on the POS as a 'full' basket - if the basket type is 'WISHLIST' and the basket is recalled on the POS, only the items in the basket will be carried over. Note this does not restrict the capabilities of the Basket Rest API itself.
If the name is not supplied, the service will generate one, using a simple incrementing number for the number of wishlists the customer has, or if the customer is anonymous the name will be just set to ‘Wish List’.
If the ‘forOrder’ flag is not supplied, or is true, the basket will default to an ‘order’ – otherwise items in the basket will be regular ‘sale’ items.
The ‘deviceId’ property allows you to control which terminal in the Enactor estate is used to control which terminal/location specific behaviour Enactor will apply – for example this could be used to offer different pricing for different regions. If this is not supplied, it will default based on the Enactor configuration files.
Customer details may be supplied when the basket is created – if so, Enactor will not attempt to lookup customer details in its local database. The customers dateOfBirth must be specified as a Unix Epoch Time (with milliseconds).
Request
Request Service URL
POST /baskets
Request Body
ICreateBasketRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
basketName | Optional | String | The name for the new basket. Optional, generated if not supplied. Maximum length 20 characters. |
basketType | Optional | String | The type of basket to create. Optional, can be 'WISHLIST' or 'BASKET'. If not supplied it will default to 'WISHLIST'. |
basketReference | Optional | String | The unique identifier for this basket. Optional, generated if not supplied. If this is supplied, it must be unique. Maximum length 100 characters. |
forOrder | Optional | Boolean | Should the basket be used to create an order. Optional, defaults to true |
deviceId | Optional | String | The identifier of the Enactor Device that will represent the "terminal" the basket is being created for. If not supplied a default device will be used (specified using the Enactor configuration files). Maximum length 20 characters. |
promotionCalculationMode | Optional | String | This decides whether the promotion recalculation is triggered or not when updatePromotions query parameter is absent. This can be absent, ”AUTOMATIC” or ”MANUAL”. |
customerDetails | Optional | CustomerDetails | An object that describes the details of the customer - Optional. If not supplied customer details will be loaded from the local database. A full description of the available properties is included in the examples below. The following maximum lengths apply to the child properties of this object:
Other customerDetails child property fields are not limited in length. |
Response
Response Headers
Location: /baskets/{basketReference}
Response Body
There is no response body.
Request & Response Examples
Basic Example
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets
Content-Type: application/json
{ "basketType": "WISHLIST", "basketName": "Xmas Wishlist" }
Response:
Status: 201 created
Location: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MUCFJAIBTVDK3HHNC444ZALMV4
Full Example
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets
Content-Type: application/json
{
"basketName": "HeadlessExample",
"basketType": "BASKET",
"basketReference": "MyBasket",
"forOrder": false,
"deviceId": "pos1@0001.enactor",
"customerDetails": {
"name": {
"forename": "TestForename",
"surname": "TestSurname",
"dateOfBirth": 455702400000
},
"address": {
"street1": "TestStreet1",
"street2": "TestStreet2",
"street3": "TestStreet3",
"town": "Town",
"county": "County",
"province": "Province",
"country": "Country",
"countryCode": "CountryCode",
"postCode": "PostCode"
},
"emailAddress": {
"emailAddress": "test@email.com"
},
"phoneNumber": {
"number": "01992 100 200"
}
}
}
Response:
Status: 201 created
Location: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket
Replace Basket
Replaces the content of an existing basket with the supplied content. This is similar to POST /basket, but you cannot use it to create a new basket. i.e. the basketReference must already exist. If the basketReference is PRIMARY, the content of the PRIMARY basket is replaced.
Request
Request Service URL
PUT /baskets/{basketReference}
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
There are no request parameters.
Request Body
IReplaceBasketRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
IBasket | Required | String | The content of the new basket. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
PUT: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY
{
"basketName": "HeadlessExample",
"basketType": "BASKET",
"basketReference": "MyRef",
"forOrder": false,
"deviceId": "pos1@0003.enactor",
"customerDetails": {
"name": {
"forename": "TestForename",
"surname": "TestSurname",
"dateOfBirth": 455702400000
},
"address": {
"street1": "TestStreet1",
"street2": "TestStreet2",
"street3": "TestStreet3",
"town": "Town",
"county": "County",
"province": "Province",
"country": "Country",
"countryCode": "CountryCode",
"postCode": "PostCode"
},
"emailAddress": {
"emailAddress": "test@email.com"
},
"phoneNumber": {
"number": "01992 100 200"
}
}
}
Response:
Status: 200 OK
Delete Basket
Deletes a basket, identified by the basket reference. If the PRIMARY basket is specified, it is not deleted, but all items are removed from it.
Request
Request Service URL
DELETE /baskets/{basketReference}
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
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.
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MUCFJAIBTVDK3HHNC444ZALMV4
Response:
Status: 200 OK
Copy / Move All Items from one Basket to another Basket
Copies all Line Items from the source basket (BasketReference) to the Basket identified by the targetBasketReference. If the Copy operation is specified, the source basket is retained with all its items. If the Move operation is specified, all items of the source basket are deleted and, in all cases except the PRIMARY Basket, the source basket is also deleted.
Request
Request Service URL
Copy:
POST /baskets/manager/copy
Move:
POST /baskets/manager/move
Request Tokens
There are no request tokens.
Request Parameters
There are no request parameters.
Request Body
ModifyBasketItemsRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
sourceBasketReference | Required | String | The basket reference of the source basket to copy/move the items from. |
targetBasketReference | Required | String | The basketReference of the basket to copy/move the items to. |
Response
Response Headers
There are no response headers.
Response Body
IModifyBasketItemsResponse
Element | Type | Description |
---|---|---|
sourceLocation | String | Location of the URL for the source basket. |
destinationLocation | String | Location of the URL for the destination basket. |
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/manager/copy
{ "sourceBasketReference": "MyBasket", "targetBasketReference": "PRIMARY" }
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/manager/move
{ "sourceBasketReference": "MyBasket", "targetBasketReference": "PRIMARY" }
Response:
Status: 200 OK
{
"sourceBasketLocation": "http://[SWARM_LEADER_IP]/WebRestApi/rest/ baskets/MyBasket",
"destinationBasketLocation": "http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY"
}
Remove all Items from a Basket
The basket reference of the basket to remove all items from a basket.
Request
Request Service URL
DELETE /baskets/{basketReference}/items
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
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.
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items
Response:
Status: 200 OK
Request a Promotion Calculation for a Basket
Recalculate promotions on the associated basket. Typically, promotions will only be updated when items are added/removed/updated, this service can be called to force an update if required.
Request
Request Service URL
PATCH /baskets/{basketReference}/promotions
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
- returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
Element | Type | Description |
---|---|---|
basket | IBasket | Optional, defaults to PRODUCT. The type of the item to add to the basket. Currently, supported types are VOUCHER, PRODUCT and OPTION_PRODUCT. |
itemId | String | Required. The ID of the item to add to the basket. If the type is PRODUCT or empty, the item should be the ID of the product. When the type is VOUCHER, the item ID should be the voucher’s serial number. |
Request & Response Examples
Request:
PATCH http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY/promotions?returnBasket=true
id_token: <identity_token>
Response:
{
"basket": {
"items": [
{
"@type": "orderDetailsItem",
"description": "###.###",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 0,
"lineNumber": 1,
"netValue": 0,
"value": 0,
"dateTimeCreated": "2019-07-22T16:04:03.000+01:00",
"userId": "CUST_USER",
"type": "VALUE",
"orderReference": "17",
"customerOrderTypeId": "CUSTOMER_ORDER"
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"description": "Vans Canvas Shoes",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 5995,
"lineNumber": 2,
"netValue": 5995,
"value": 5995,
"dateTimeCreated": "2019-07-22T16:04:26.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "VV639JS-8",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 5995,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/VV639JS-1.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHOES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shoes",
"brandGroupId": "VANS",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "8",
"sizeRangeId": "MENS_SHOES"
}
}
],
"balance": 5995,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": true,
"taxSchemeId": "UK",
"itemCount": 2,
"saleItemQuantity": 1,
"returnItemQuantity": 0,
"saleItemNetValue": 5995,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 1,
"merchandiseItemValue": 5995,
"total": 5995,
"grossTotal": 5995,
"taxTotal": 0,
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 5995
},
"basketReference": "PRIMARY",
"basketType": "PRIMARY",
"basketDescription": "Primary",
"basketStatus": "IN_PROGRESS"
}
List Customer Baskets
List the baskets associated with the given customer, excluding the Primary basket. It is not possible to list baskets associated with an anonymous customer - if the customer loses their reference to an anonymous basket, the basket cannot be recalled.
Request
Request Service URL
GET /baskets
Request Tokens
There are no request tokens.
Request Parameters
-
pageSize: Integer. The maximum number of baskets to return in a single page - Optional, default to 10, limited to 100. Eg: pageSize=50
-
pageOffset: Integer. The offset, in rows, of the first basket to return - Optional, default to 0. Eg: pageOffset=2
-
extended: Boolean. If the flag is true, then a list of basket responses is returned. Otherwise, a list of basket summaries is returned. Defaults to false. Eg: extended=true
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
Element | Type | Description |
---|---|---|
basksetSummaries | String | A list of basket summaries, excluding the Primary basket, for the given customer. The basket summaries only include details about the basket's reference, type, and description. |
basketResponses | String | This response will only be obtained when the extended flag is set to true. This would provide a list of basket responses, excluding the Primary basket, for the given customer. The list will include the basketReferences to allow the details to be later retrieved. |
Request & Response Examples
Basic Example
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets
Response:
{
"basketSummaries": [
{
"reference": "4PYQCL2LQ5EQXM2TYE3PBTGO4A",
"type": "WISHLIST",
"description": "Monday"
},
{
"reference": "BK3TSNHJJZF23F7K7PJ4YDWK5M",
"type": "WISHLIST",
"description": "Christmas Wishlist"
},
{
"reference": "BRC7SUUIJ5CU3OKJ6K3ZJFVZR4",
"type": "WISHLIST",
"description": "Stored Basket"
},
{
"reference": "BTRGMY7JHBDHDOXRBJR5CZVFAA",
"type": "WISHLIST",
"description": "Postman2"
},
{
"reference": "CKKTFIP7FVAMDHHMPI27TZ6TD4",
"type": "WISHLIST",
"description": "Postman2"
},
{
"reference": "GYM5JXTEFFE4PNTQJZYF6M3HBM",
"type": "WISHLIST",
"description": "Postman2"
},
{
"reference": "H3TD3SGOIBHUROO63N7SI7HDQ4",
"type": "WISHLIST",
"description": "Xmas Wishlist"
},
{
"reference": "HLMC4D7VIVBUFI6NOFEB4APIFQ",
"type": "WISHLIST",
"description": "TEst 1"
},
{
"reference": "MUZ5LFOTGFDGJK7VNPERD5X65M",
"type": "WISHLIST",
"description": "Stored Basket"
},
{
"reference": "NDCRLG3TBFA5DGZBRESAGMZPMA",
"type": "WISHLIST",
"description": "BLANK"
},
{
"reference": "Q7J6EFEULFGD7BB7J6BKLVWVXE",
"type": "WISHLIST",
"description": "My Bag"
},
{
"reference": "R7WB2IJJURESPIRPQUOHPP46EU",
"type": "WISHLIST",
"description": "Dehan"
},
{
"reference": "RQVE6DPYSNHQLLM2SCEB5KO2ZE",
"type": "WISHLIST",
"description": "James"
},
{
"reference": "TXS7FJKNSFEZXNVKRNQ3JLUVSY",
"type": "WISHLIST",
"description": "Easter"
},
{
"reference": "YUEPHVMGLJFIBDIEWE42JVW2UM",
"type": "WISHLIST",
"description": "Stored Basket"
}
]
}
Example with the extended flag set to true
Request:
GET: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets
Response:
{
"basketResponses": [
{
"basket": {
"items": [
{
"@type": "orderDetailsItem",
"description": "###.###",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 0,
"lineNumber": 1,
"netValue": 0,
"value": 0,
"dateTimeCreated": "2019-02-11T13:23:18.000+00:00",
"userId": "CUST_USER",
"type": "VALUE",
"orderReference": "0002190211132318",
"performedOffline": true,
"customerOrderTypeId": "CUSTOMER_ORDER"
},
{
"@type": "orderDetailsItem",
"description": "###.###",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 0,
"lineNumber": 2,
"netValue": 0,
"value": 0,
"dateTimeCreated": "2019-01-22T14:39:26.000+00:00",
"userId": "CUST_USER",
"type": "VALUE",
"orderReference": "120",
"customerOrderTypeId": "CUSTOMER_ORDER"
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"description": "Vans Canvas Shoes",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 5590,
"lineNumber": 3,
"netValue": 5995,
"value": 5995,
"dateTimeCreated": "2019-01-22T14:39:28.000+00:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": -405,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "VV639JS-12",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 5995,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/VV639JS-1.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHOES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shoes",
"brandGroupId": "VANS",
"brandGroupHierarchyId": "FASHION",
"modifiers": [
{
"@type": "distributedPromotionSavingItem",
"lineNumber": 3,
"distributedSaving": 405,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -405
}
],
"sizeId": {
"id": "12",
"sizeRangeId": "MENS_SHOES"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"description": "Vans Canvas Shoes",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 5589,
"lineNumber": 4,
"netValue": 5995,
"value": 5995,
"dateTimeCreated": "2019-01-22T14:39:30.000+00:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": -406,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "VV639JS-12",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 5995,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/VV639JS-1.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHOES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shoes",
"brandGroupId": "VANS",
"brandGroupHierarchyId": "FASHION",
"modifiers": [
{
"@type": "distributedPromotionSavingItem",
"lineNumber": 4,
"distributedSaving": 406,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -406
}
],
"sizeId": {
"id": "12",
"sizeRangeId": "MENS_SHOES"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "BLUE",
"colourRangeId": "WOMENS_DRESSES"
},
"description": "Crinkle Day Dress",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 2609,
"lineNumber": 5,
"netValue": 2798,
"value": 2798,
"dateTimeCreated": "2019-01-28T11:41:35.000+00:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": -189,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "MB229XML-4",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 2798,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/MB229XM-3.jpg",
"type": "VALUE",
"mmGroupId": "WOMENS_DRESSES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Women's Dresses",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"modifiers": [
{
"@type": "distributedPromotionSavingItem",
"lineNumber": 5,
"distributedSaving": 189,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -189
}
],
"sizeId": {
"id": "16",
"sizeRangeId": "WOMENS_DRESSES"
}
},
{
"@type": "voucherRedemptionItem",
"voucherDetails": {
"voucherTypeId": {
"regionId": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
},
"voucherTypeId": "10_POUND"
}
},
"track": false,
"markItemsUsed": false,
"currencyId": "GBP",
"description": "£10 Pound off",
"deviceId": "pos2@0001.enactor",
"lineNumber": 6,
"dateTimeCreated": "2019-02-07T11:47:15.000+00:00",
"userId": "CUST_USER",
"type": "VALUE"
}
],
"balance": 13788,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": true,
"taxSchemeId": "UK",
"itemCount": 6,
"saleItemQuantity": 3,
"returnItemQuantity": 0,
"saleItemNetValue": 13788,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 3,
"merchandiseItemValue": 14788,
"total": 13788,
"grossTotal": 14788,
"taxTotal": 0,
"promotionCalculation": {
"totalSaving": 1000,
"totalPoints": 0,
"itemsArray": [
{
"promotionSavingItem": {
"saving": 1000,
"savingAdjustment": 0,
"distributedSavings": [
{
"distributedPromotionSavingItem": {
"lineNumber": 3,
"distributedSaving": 405,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -405
}
},
{
"distributedPromotionSavingItem": {
"lineNumber": 4,
"distributedSaving": 406,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -406
}
},
{
"distributedPromotionSavingItem": {
"lineNumber": 5,
"distributedSaving": 189,
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"modifierType": "PROMOTION",
"effectiveValue": -189
}
}
],
"adjustEmployeeBalance": false,
"promotionDescription": "£10 off when you spend £100",
"promotionQuantity": 1,
"operationWithDiscounts": "APPLIES_AFTER_ON_GROSS",
"promotionKey": {
"promotionId": "3",
"groupKey": {
"id": "All",
"groupTypeId": "region",
"groupHierarchyId": "All"
}
},
"triggers": [
{
"rewardValue": 1000,
"lineRewardValue": 405,
"distributeSaving": true,
"lineNumber": 3,
"quantity": 1,
"unitValue": 5995,
"triggerCount": 1
},
{
"rewardValue": 1000,
"lineRewardValue": 406,
"distributeSaving": true,
"lineNumber": 4,
"quantity": 1,
"unitValue": 5995,
"triggerCount": 1
},
{
"rewardValue": 1000,
"lineRewardValue": 189,
"distributeSaving": true,
"lineNumber": 5,
"quantity": 1,
"unitValue": 2798,
"triggerCount": 1
}
]
}
}
]
},
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 13788
},
"basketReference": "4PYQCL2LQ5EQXM2TYE3PBTGO4A",
"basketType": "WISHLIST",
"basketDescription": "Monday",
"basketStatus": "NEW"
}
]
}
Get Basket Details
Load an existing basket and return it, without making any changes. A user should only be able to load baskets which belong to them.
Request
Request Service URL
GET /baskets/{basketReference}
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
- basketType: String. The type of basket to query for. Eg: basketType=BASKET
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
BasketResponse
Element | Type | Description |
---|---|---|
basket | IBasket | The basket associated with the given reference. |
basketReference | String | The reference of the basket. |
basketType | String | The type of the basket. |
basketDescription | String | The description of the basket. |
basketResponseCode | String | A specific basket code to indicate if the basket was implicitly created by the server. |
basketStatus | String | The status of the basket.
|
Request & Response Examples
Request:
GET: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY
Response:
{
"basket": {
"items": [
{
"@type": "orderDetailsItem",
"description": "###.###",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 0,
"lineNumber": 1,
"netValue": 0,
"value": 0,
"dateTimeCreated": "2019-07-19T16:18:23.000+01:00",
"userId": "CUST_USER",
"type": "VALUE",
"orderReference": "15",
"customerOrderTypeId": "CUSTOMER_ORDER"
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"description": "Vans Canvas Shoes",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 5995,
"lineNumber": 2,
"netValue": 5995,
"value": 5995,
"dateTimeCreated": "2019-07-19T16:18:26.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "VV639JS-12",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 5995,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/VV639JS-1.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHOES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shoes",
"brandGroupId": "VANS",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "12",
"sizeRangeId": "MENS_SHOES"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"description": "Button Down Collar Red",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 2595,
"lineNumber": 3,
"netValue": 2595,
"value": 2595,
"dateTimeCreated": "2019-07-19T16:21:08.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "DF517XM-1",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 2595,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/DF517XM-2.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHIRTS",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shirts",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"description": "Button Down Collar Red",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 2595,
"lineNumber": 4,
"netValue": 2595,
"value": 2595,
"dateTimeCreated": "2019-07-19T16:21:10.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "DF517XM-1",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 2595,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/DF517XM-2.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHIRTS",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shirts",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"description": "Button Down Collar Red",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 2595,
"lineNumber": 5,
"netValue": 2595,
"value": 2595,
"dateTimeCreated": "2019-07-19T16:21:11.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "DF517XM-1",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 2595,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/DF517XM-2.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHIRTS",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shirts",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHIRTS"
},
"description": "Button Down Collar Red",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 2595,
"lineNumber": 6,
"netValue": 2595,
"value": 2595,
"dateTimeCreated": "2019-07-19T16:21:13.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "DF517XM-1",
"quantity": 1,
"netQuantity": 1,
"isReturn": false,
"unitPrice": 2595,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/DF517XM-2.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHIRTS",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shirts",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"sizeId": {
"id": "S",
"sizeRangeId": "MENS_SHIRTS"
}
}
],
"balance": 16375,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": true,
"taxSchemeId": "UK",
"itemCount": 6,
"saleItemQuantity": 5,
"returnItemQuantity": 0,
"saleItemNetValue": 16375,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 5,
"merchandiseItemValue": 16375,
"total": 16375,
"grossTotal": 16375,
"taxTotal": 0,
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 16375
},
"basketReference": "PRIMARY",
"basketType": "PRIMARY",
"basketDescription": "Primary",
"basketStatus": "IN_PROGRESS"
}
Associate Basket with a Customer
This updates the basket, so it is associated with the customer using the accessToken to determine the Customer ID. Note that this does not set the 'CustomerRetailDetails' on the basket.
When the basket is associated with the customer this may result in a conflict:
-
If the basket is a primary basket, but the customer already has a primary basket.
-
If the basket is a wishlist and the customer already has a wishlist with the same name.
In these cases, the following table determines how the system should behave, as controlled by the mergeRule parameter which is set in the request:
Merge Rule | Results |
---|---|
ERROR | Return an error and do not make any changes |
MERGE | Copy items from the incoming basket into the existing basket. Return the existing basket and its reference. Discard the incoming basket. |
OVERWRITE | Associate the incoming basket with the customer and overwrite any existing basket. Return the basket and its reference. |
DISCARD | Discard the incoming basket. Return the existing basket and its reference. |
The service checks for an existing wishlist basket by looking for a stored basket with a basket type of WISHLIST and matches the basket description of the incoming baskets.
The Merge Rule Scenarios are further explained in the Scenarios and Responses section of this Associate Basket with a Customer section.
Request
Request Service URL
PATCH /baskets/{basketReference}/customer
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
-
mergeRule: String. Determines how to behave if there is a merge conflict - Optional, defaults to ERROR. Eg: mergeRule=MERGE
-
returnBasket Boolean. If true the updated basket is returned - Optional, defaults to true. Eg: returnBasket=false
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
BasketResponse
Element | Type | Description |
---|---|---|
basket | IBasket | The basket associated with the given reference. |
basketReference | String | The reference of the basket. |
basketType | String | The type of the basket. |
basketDescription | String | The description of the basket. |
basketResponseCode | String | A specific basket code to indicate if the basket was implicitly created by the server. |
basketStatus | String | The status of the basket.
|
Following are some scenarios for each merge rule:
No Merge Rule
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
Basket manager service receives an associate basket customer request with no merge rule. | Fail | Return an error and do not make any changes. | 500 | ErrorMessage: Failed to associate basket with customer, outcome (500) |
Error
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
Basket manager service receives an associate basket customer request with the merge Rule of ERROR. | Fail | Return an error and do not make any changes. | 500 | ErrorMessage: Failed to associate basket with customer, outcome (500) |
Merge
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The customer wants to associate a Primary basket (Anonymous primary basket). | Success | Copy items from the incoming basket into the existing basket. Return the existing basket and its reference. Discard the incoming basket. | 200 | Return the existing basket (BasketResponse) |
The customer wants to associate a Wishlist basket. (Anonymous wishlist basket). The existing basket already exists. | Success | Copy items from the incoming basket into the existing basket. Return the existing basket and its reference. Discard the incoming basket. | 200 | Return the existing basket (BasketResponse) |
The customer wants to associate a Wishlist basket. (Anonymous wishlist basket). The existing basket does not exist. | Success | Stored the incoming basket as a new basket against the customer. Return the existing basket and its reference. Discard the incoming basket. | 200 | Return the existing basket (BasketResponse) |
The customer wants to associate a Wishlist basket which is already associated with a customer. | NotAllowed | Return a NotAllowed error and do not make any changes | 400: Bad Request | ErrorMessage: Failed to associate basket with customer. Basket already associated with customer, outcome (500) |
Overwrite
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The customer wants to associate a Primary basket (Anonymous primary basket). | Success | Associate the incoming basket with the customer and overwrite any existing basket. Return the basket and its reference. | 200 | Return the existing basket (BasketResponse) |
The customer wants to associate a Primary basket (Anonymous wishlist basket). | Success | Associate the incoming basket with the customer and overwrite any existing basket. Return the basket and its reference. | 200 | Return the existing basket (BasketResponse) |
Discard
All Scenarios start with: Basket manager service receives an associate basket customer request with the Merge Rule of DISCARD.
Scenario | Outcome | Expected Behaviour | Status Code | Response |
---|---|---|---|---|
The customer wants to discard the incoming wishlist basket. | Success | The incoming basket is discarded. Returns the customer’s existing wishlist basket and its reference. | 200 | IBasketResponse: basket, basketReference... |
The customer wants to discard the incoming primary basket. | Success | The incoming basket is discarded. Returns the customer’s existing primary basket and its reference. | 200 | IBasketResponse: basket, basketReference... |
Request & Response Examples
Request:
PATCH http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/customer?mergeRule=MERGE
Response:
Status: 200 OK
Update a Basket Description
Updates an existing baskets description. The basket must already exist, otherwise, the service will return a 404 not found. If the description is empty in the request, the service should return a 400 Bad Request. If the service call is successful, a 200 OK response is returned. However, if the returnBasket parameter is true, the basket is also returned in the response.
Request
Request Service URL
PATCH /baskets/{basketReference}/description
Request Tokens
There are no request tokens.
Request Parameters
- returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
**Request Body **UpdateBasketDescriptionRequest - extends BasketRetrievalRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
description | Required | String | The new description of the wishlist - Maximum length is 20. |
Response
Response Headers
There are no response headers.
Response Body
BasketResponse
Element | Type | Description |
---|---|---|
basket | IBasket | The basket associated with the given reference. |
basketReference | String | The reference of the basket. |
basketType | String | The type of the basket. |
basketDescription | String | The description of the basket. |
basketResponseCode | String | A specific basket code to indicate if the basket was implicitly created by the server. |
basketStatus | String | The status of the basket.
|
Request & Response Examples
Request:
PATCH http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY/description
Content-Type: application/json
{ "description": "New Description" }
Response:
Status: 200 OK
Submit a Basket
Submits a basket for transaction processing. Once submitted, a new transaction is created and stored. The new transaction is returned in the response. The ID of the order submitted is also returned.
Request
Request Service URL
POST /baskets/{basketReference}/submit
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
SubmitBasketResponse
Element | Type | Description |
---|---|---|
orderId | String | The ID of the order submitted. |
newBasketReference | String | The ID of the new basket. |
Request & Response Examples
Request:
http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY/submit
Response:
Status: 200 OK
{
"orderId": "00000033",
"newBasketReference": "A6U7KWLMYFCZ7CNFLAUE67HFKY"
}
Get Transaction of a Basket
Retrieves the current transaction which is holding the basket. Note that if a Basket is submitted for processing this Transaction may not be reused.
Request
Request Service URL
GET /baskets/{basketReference}/transaction
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
TransactionResponse
Element | Type | Description |
---|---|---|
transaction | ITransaction | Returns the transaction of the basket. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/PRIMARY/transaction
Host: localhost:8080
subject: 100
Response:
Status: 200 OK
{
"transaction": {
"source": "pos2@0001.enactor",
"sourceApplication": "POS",
"topic": "Transactions",
"sequenceNumber": 0,
"transactionId": "00010002000571907191549452",
"applicationId": "WEB_REST_API",
"transactionNumber": 57,
"originatedBy": {
"regionId": {
"id": "UK",
"groupTypeId": "region",
"groupHierarchyId": "All"
},
"branchNumber": 1,
"terminalNumber": 2,
"transactionNumber": 57,
"userId": {
"id": "CUST_USER"
},
"deviceId": {
"id": "pos2@0001.enactor"
},
"locationId": {
"id": "0001"
}
},
"dateTimeCreated": "2019-07-19T15:49:45.000+01:00",
"basket": {
"items": [
{
"@type": "styleColourSizeItem",
"colourId": {
"id": "RED",
"colourRangeId": "MENS_SHOES"
},
"description": "Vans Canvas Shoes",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 59950,
"lineNumber": 1,
"netValue": 59950,
"value": 59950,
"dateTimeCreated": "2019-07-19T15:35:52.000+01:00",
"userId": "CUST_USER",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0,
"modifiersQuantity": 0,
"notDiscountable": false,
"maxDiscount": 0,
"handKeyed": true,
"productID": "VV639JS-8",
"quantity": 10,
"netQuantity": 10,
"isReturn": false,
"unitPrice": 5995,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/VV639JS-1.jpg",
"type": "VALUE",
"mmGroupId": "MENS_SHOES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Mens Shoes",
"brandGroupId": "VANS",
"brandGroupHierarchyId": "FASHION",
"modifiers": [
{
"@type": "quantityModifier",
"modifierItemLine": 2,
"newQuantity": 6,
"originalQuantity": 1
},
{
"@type": "quantityModifier",
"modifierItemLine": 3,
"newQuantity": 4,
"originalQuantity": 6
},
{
"@type": "quantityModifier",
"modifierItemLine": 4,
"newQuantity": 10,
"originalQuantity": 4
},
{
"@type": "quantityModifier",
"modifierItemLine": 5,
"newQuantity": 10,
"originalQuantity": 10
}
],
"sizeId": {
"id": "8",
"sizeRangeId": "MENS_SHOES"
}
},
{
"@type": "quantityModifierItem",
"description": "Modify Quantity",
"deviceId": "pos2@0001.enactor",
"lineNumber": 2,
"dateTimeCreated": "2019-07-19T16:00:33.000+01:00",
"userId": "CUST_USER",
"type": "QUANTITY",
"newQuantity": 6
},
{
"@type": "quantityModifierItem",
"description": "Modify Quantity",
"deviceId": "pos2@0001.enactor",
"lineNumber": 3,
"dateTimeCreated": "2019-07-19T16:00:58.000+01:00",
"userId": "CUST_USER",
"type": "QUANTITY",
"newQuantity": 4
},
{
"@type": "quantityModifierItem",
"description": "Modify Quantity",
"deviceId": "pos2@0001.enactor",
"lineNumber": 4,
"dateTimeCreated": "2019-07-19T16:03:48.000+01:00",
"userId": "CUST_USER",
"type": "QUANTITY",
"newQuantity": 10
},
{
"@type": "quantityModifierItem",
"description": "Modify Quantity",
"deviceId": "pos2@0001.enactor",
"lineNumber": 5,
"dateTimeCreated": "2019-07-19T16:07:04.000+01:00",
"userId": "CUST_USER",
"type": "QUANTITY",
"newQuantity": 10
}
],
"balance": 59950,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": true,
"taxSchemeId": "UK",
"itemCount": 5,
"saleItemQuantity": 10,
"returnItemQuantity": 0,
"saleItemNetValue": 59950,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 10,
"merchandiseItemValue": 59950,
"total": 59950,
"grossTotal": 59950,
"taxTotal": 0,
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 59950
},
"loyaltyPointsDetails": {
"dayNumber": 0,
"loyaltyPointsBalance": 0,
"loyaltyPointsEarned": 0,
"promotionalLoyaltyPointsEarned": 0,
"loyaltyPointsMissed": 0,
"loyaltyPointsRate": 0,
"loyaltyAccountOffline": true,
"loyaltyPointsUsed": 0,
"totalSpend": 0,
"spendToNextTier": 0,
"externalProvider": false,
"noLoyaltyUpdate": false,
"rewardValue": 0,
"rewardValueRedeemed": 0
}
}
}
Basket Items API
This section covers the Basket Item APIs which are used to carry out the different operations to the Items of a Basket. Following is the list of Basket Items APIs covered in this section:
-
Add Basket Item.
-
Get Basket Item.
-
Remove Basket Item.
-
Update Quantity Basket Item.
-
Remove all Basket Items.
Add Basket Item
This adds a new item to a basket and the behaviour of this service is as follows:
-
If the PRIMARY basket is specified and it does not currently exist, it will be created.
-
However, if a wishlist basket does not exist, the service call will fail with a bad request. The lineNumber for the new item is returned in the response header.
-
If the returnBasket parameter is set to true, the updated basket and the line number of the new item is returned in the response body.
-
If updatePromotions is set to true, it triggers a promotion recalculation. Removes existing promotions if set to false.
-
The itemUnitPrice can be used to override the standard Enactor price lookup - if this field is not supplied, Enactor will search for and load a price in the standard manner.
Option Products
When you are adding an option product to the basket you can additionally configure the options associated with the product. This is done using the optionSets property. The property accepts a collection of option sets and the values to use for the options in that option set, for example:
"optionSets": [
{
"optionSetId": {
"optionSetId": "myoptionset",
"type": "productOptionOptionSet",
"groupId": {
"groupId": "All",
"groupHierarchyId": "All",
"groupTypeId":, "region"
}
},
"options": [
{
"optionPath": "MyProductOption",
"optionType": "PRODUCT_OPTION",
"value": {
"productId": "PRODUCT_1",
"quantity": 1,
"unitPrice": 1000
}
}
]
}
]
Here we are specifying the optionSet key (myoptionset) along with its associated region. We are then specfying that in this option set, we want to set the value of the MyProductOption option to PRODUCT_1. As this is a product option, we can also specify the quantity and unit price for the product to be sold as an option.
Currently only PRODUCT_OPTION options can be added through the Rest API. It is also not possible to currently add "recursive" options (i.e. options that have their own options).
Request
Request Service URL
POST /baskets/{basketReference}/items
Request Tokens
- basketReference: The basket reference of which basket to add the items to, or can be 'PRIMARY' to retrieve from the PRIMARY basket.
Request Parameters
-
returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
-
updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IAddBasketItemRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
itemType | Optional | String | The type of the item to add to the basket. Currently, supported
types are VOUCHER, PRODUCT and OPTION_PRODUCT. Optional, defaults to PRODUCT. |
itemId | Required | String | The ID of the item to add to the basket. If the type is PRODUCT or empty, the item should be the ID of the product. When the type is VOUCHER, the Item ID should be the voucher’s serial number. |
quantity | Optional | Integer | The quantity to add to the basket. Optional, defaults to 1. |
itemUnitPrice | Optional | Long | The unit price for this item. Optional, defaults to the "standard" price for this product. |
optionSets | Required if adding an item using the OPTION_PRODUCT itemType. | OptionSetDetails | This property will be used to specify the details of the options. This property is not supported for other values of itemType. |
externalReference | Optional | String | A string which can be associated with the item to refer to the item
later. Optional. |
Response
Response Headers
Location: /baskets/{basketReference}/items/{lineNumber}
Response Body
IBasketItemResponse
Element | Type | Description |
---|---|---|
basketItemLineNumber | String | The line number of the item added to the basket. |
basket | IBasket | The new or updated transaction containing the item being added, if the parameter returnBasket=true is set. |
basketReference | String | The reference of the basket. |
basketType | String | The type of the basket. |
basketDescription | String | The description of the basket. |
basketResponseCode | String | A specific basket code to indicate if the basket was implicitly created by the server. |
basketStatus | String | The status of the basket.
|
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/{basketReference}/items?returnBasket=true
Content-Type: application/json
{
"itemType": "PRODUCT",
"itemId": "500100",
"quantity": "1",
"itemUnitPrice": 29900,
"externalReference": "myItemExternalReference"
}
Response:
Status: 200 OK
{
"basketItemLineNumber": "1",
"basketType": "BASKET",
"basketDescription": "HeadlessExample",
"basket": {
"items": [
{
"@type": "merchandiseItem",
"mmGroupId": "TV",
"mmGroupHierarchyId": "RETAIL",
"localisedWarrantyInformation": {},
"mmGroupDescription": "Televisions",
"inventoryUnitOfMeasureId": "1",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"description": "JVC LT-40CA890 Android TV 40\" ",
"deviceId": "pos1@0001.enactor",
"effectiveNetValue": 29900,
"lineNumber": 1,
"netValue": 29900,
"value": 29900,
"dateTimeCreated": "2023-11-13T15:30:57.000+00:00",
"userId": "CUST_USER",
"externalReferenceNumber": "myItemExternalReference",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0.0,
"modifiersQuantity": 0.0,
"notDiscountable": false,
"maxDiscount": 0.0,
"handKeyed": true,
"productID": "500100",
"quantity": 1.0,
"netQuantity": 1.0,
"isReturn": false,
"unitPrice": 29900,
"sourceInventoryType": "AVA",
"orderable": true,
"roundedTaxAmount": 4983,
"productTypeId": "merchandiseProduct",
"productImageURL": "image://PRODUCT/l_500100_005.jpg",
"type": "VALUE",
"taxGroupId": {
"taxGroupId": "GENERAL",
"id": "GENERAL"
},
"tax": [
{
"@type": "taxAmount",
"taxRateId": "UK_1",
"taxRateKey": {
"taxRateId": "UK_1",
"effectiveDate": 1427155200000
},
"displayTaxCode": "UK VAT 20%",
"taxAmount": 49833332,
"scale": 4,
"taxRatePercentage": 0.2,
"taxableAmount": 29900
}
],
"giftReceiptItem": false,
"supplementaryValues": {}
}
],
"balance": 29900,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": true,
"taxSchemeId": "UK",
"itemCount": 1,
"saleItemQuantity": 1.0,
"returnItemQuantity": 0.0,
"returnMerchandiseItemQuantity": 0.0,
"returnMerchandiseItemNetValue": 0,
"saleItemNetValue": 29900,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 1.0,
"merchandiseItemValue": 29900,
"total": 29900,
"grossTotal": 29900,
"taxTotal": 4983,
"promotionCalculation": {
"totalSaving": 0,
"totalPoints": 0
},
"taxRateSummary": [
{
"taxRateId": "UK_1",
"displayTaxCode": "UK VAT 20%",
"netValue": 24917,
"taxValue": 4983,
"grossValue": 29900,
"taxRatePercentage": 0.2
}
],
"additionalData": {
"entityQName": "{http://www.enactor.com/retail}additionalData",
"dataMap": {
"RestAPI.ForOrderDefault": "false"
}
},
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 29900
},
"basketResponseCode": "BASKET_ITEM_ADDED"
}
Get Basket Item
This loads an existing basket and extracts the basket item based on the line number that is requested.
Request
Request Service URL
GET /baskets/{basketReference}/items/{lineReference}
Request Tokens
-
basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
-
lineReference: The lineReference of the item to return from the basket. For more information on this, refer to the section on “Line Reference” in this document.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IBasketItemRetrievalResponse
Element | Type | Description |
---|---|---|
basketItem | IBasketItem | The requested basket item. |
Request & Response Examples
Request:
GET: http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/1
Response:
Status: 200 OK
{
"basketItem": {
"mmGroupId": "TV",
"mmGroupHierarchyId": "RETAIL",
"localisedWarrantyInformation": {},
"mmGroupDescription": "Televisions",
"inventoryUnitOfMeasureId": "1",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"description": "JVC LT-40CA890 Android TV 40\" ",
"deviceId": "pos1@0001.enactor",
"effectiveNetValue": 29900,
"lineNumber": 1,
"netValue": 29900,
"value": 29900,
"dateTimeCreated": "2023-11-13T15:30:57.000+00:00",
"userId": "CUST_USER",
"externalReferenceNumber": "myItemExternalReference",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0.0,
"modifiersQuantity": 0.0,
"notDiscountable": false,
"maxDiscount": 0.0,
"handKeyed": true,
"productID": "500100",
"quantity": 1.0,
"netQuantity": 1.0,
"isReturn": false,
"unitPrice": 29900,
"sourceInventoryType": "AVA",
"orderable": true,
"roundedTaxAmount": 4983,
"productTypeId": "merchandiseProduct",
"productImageURL": "image://PRODUCT/l_500100_005.jpg",
"type": "VALUE",
"taxGroupId": {
"taxGroupId": "GENERAL",
"id": "GENERAL"
},
"tax": [
{
"@type": "taxAmount",
"taxRateId": "UK_1",
"taxRateKey": {
"taxRateId": "UK_1",
"effectiveDate": 1427155200000
},
"displayTaxCode": "UK VAT 20%",
"taxAmount": 49833332,
"scale": 4,
"taxRatePercentage": 0.2,
"taxableAmount": 29900
}
],
"giftReceiptItem": false,
"supplementaryValues": {}
}
}
Update Quantity Basket Item
This updates the quantity on an existing line in the basket. The line reference is used to identify which line to update. Setting the quantity to zero will result in the line being deleted.
Request
Request Service URL
PATCH /baskets/{basketReference}/items/{lineReference}/quantity[?returnBasket=true]
Request Tokens
-
basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
-
lineReference: The lineReference of the item to return from the basket. For more information on this, refer to the section on “Line Reference” in this document.
Request Parameters
-
returnBasket Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
-
updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IUpdateBasketItemQuantityRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
quantity | Required | Integer | The new quantity for the line. |
Response
Response Headers
There are no response headers.
Response Body
BasketResponse
Element | Type | Description |
---|---|---|
basket | IBasket | The basket associated with the given reference. |
basketReference | String | The reference of the basket. |
basketType | String | The type of the basket. |
basketDescription | String | The description of the basket. |
basketResponseCode | String | A specific basket code to indicate whether the basket was implicitly created by the server. |
basketStatus | String | The status of the basket.
Baskets will have been submitted to retail processing have the status SUBMITTED. |
Request & Response Examples
Request:
PATCH http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/1/quantity
Content-Type: application/json
{ "quantity": "1" }
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/2
Response:
Status: 200 OK
Remove Basket Item
This deletes an existing line item from a basket.
Request
Request Service URL
DELETE /baskets/{basketReference}/items/{lineReference}
Request Tokens
-
basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
-
lineReference: The lineReference of the item to return from the basket. For more information on this, refer to the section on “Line Reference” in this document.
Request Parameters
- updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/2
Response:
Status: 200 OK
Remove all Basket Items
This removes all items from the basket while all the existing basket information is kept.
Request
Request Service URL
DELETE /baskets/{basketReference}/items
Request Tokens
- basketReference: The basket reference of the basket to get the item from, or can be 'PRIMARY' to add to the PRIMARY basket.
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.
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket
Response:
Status: 200 OK
Basket Discount API
This section covers the Basket Discount APIs which are used to carry out transaction discount, item discount, price override and transaction discount void to the Basket. Following is the list of Basket Items APIs covered in this section:
-
Add an Item Discount.
-
Record a Price Override.
-
Record a Transaction Discount.
-
Void Transaction Discounts.
Add an Item Discount
Adds an item discount to the specified line in the basket.
The value will determine the discount amount - it may not be required, depending on the configuration of the reason selected. The value may be a fixed amount (in whole base units, i.e. 100 = £1.00) or a percentage (i.e. 100 = 100%), again depending on the configuration.
If the returnBasket flag is true, the updated basket will be returned.
Triggers a promotion recalculation if updatePromotions flag is set to true. Removes existing promotions if set to false.
Request
Request Service URL
POST /baskets/{basketReference}/items/{lineReference}/discount?returnBasket=true
Request Tokens
-
basketReference: The basket reference of the basket to record the discount against.
-
lineReference: The line reference of the item to apply the item discount to.
Request Parameters
- updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IDiscountBasketItemRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
reasonId | Required | String | The ID of the Item Discount Reason to apply. |
value | Optional (depending on the Voucher Configuration) | Double | The value of the Item Discount. |
externalReference | Optional | String | A string which can be associated with the item to refer to the item later. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/1/discount
Content-Type: application/json
{
"reasonId": "ID-UK-01"
}
Record a Price Override
Record a Price Override against an item in the basket.
The value will determine the new price for the line. If the line has a quantity greater than 1, this will be the new value for the entire line.
If the returnBasket flag is true, the updated basket will be returned.
Triggers a promotion recalculation if updatePromotions is set to true. Removes existing promotions if set to false.
Request
Request Service URL
POST /baskets/{basketReference}/items/{lineReference}/priceOverride?returnBasket=true
Request Tokens
-
basketReference:
The basket reference of the basket to record the price override against. -
lineReference:
The line reference of the item to apply the price override to.
Request Parameters
- updatePromotions
Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false.
Eg: updatePromotions=true
Request Body
IPriceOverrideRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
reasonId | Required | String | The ID of the Price Override Reason to apply. |
value | Required | Double | The new price for the line. |
externalReference | Optional | String | A string which can be associated with the price override to refer to it later. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/1/priceOverride
Content-Type: application/json
{
"reasonId": "PO-UK-01",
"value": 50000
}
Response:
Status: 200 OK
Record a Transaction Discount
This service adds a transaction discount to the basket.
The value will determine the discount amount to be given - it may not be required, depending on the configuration of the transaction discount reason selected.
The value may be a fixed amount (in whole base units, i.e. 100 = £1.00) or a percentage (i.e. 100 = 100%) and this would again depend on the configuration of the transaction discount reason.
If the returnBasket flag is true, the updated basket will be returned.
Triggers a promotion recalculation if updatePromotions flag is set to true. Removes existing promotions if set to false.
Request
Request Service URL
POST /baskets/{basketReference}/discount?returnBasket=true
Request Tokens
- basketReference: The basket reference of the basket to record the discount against.
Request Parameters
- updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IDiscountTransactionRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
reasonId | Required | String | The ID of the Transaction Discount Reason to apply. |
value | Optional (depending on the Voucher Configuration) | Double | The value of the Transaction Discount. |
externalReference | Optional | String | A string which can be associated with the item to refer to the item later. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/discount
Content-Type: application/json
{
"reasonId": "TD-UK-01",
"externalReference": "td"
}
Response:
Status: 200 OK
Void Transaction Discounts
Voids a transaction discount which is specified by a line in the basket.
If the returnBasket flag is true, the updated basket will be returned.
Request
Request Service URL
POST /baskets/{basketReference}/items/{externalReference}/void
Request Tokens
-
basketReference: The basket reference of the basket to void the transaction discount against.
-
externalReference: The external reference of the transaction discount which is to be voided (Line number can also be used to void instead of external reference).
Request Parameters
There are request parameters.
Request Body
Element | Required / Optional | Type | Description |
---|---|---|---|
reasonId | Required | String | The ID of the Item Void Reason to apply. Note: An Item Void Reason should be used here. |
externalReference | Optional | String | A string which can be associated with the discount void to refer to it later. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/items/td/void
Content-Type: application/json
{
"reasonId": "IV-01",
"externalReference": "tdvoid"
}
Response:
Status: 200 OK
Basket Tender API
This section covers the Tender API, a part of the Rest Basket API, that is used to record a tender on the basket. This API is not responsible for “taking payment” and will only be used for recording the effect of a payment in the basket. Following is the list of Basket Items APIs covered in this section:
-
Redeem a Voucher.
-
Record a Tender.
-
Update Allocations on a Tender.
-
Delete Allocations on a Tender.
-
Record Change.
-
Issue Change.
Redeem a Voucher
Redeems a voucher in the context of a basket. The exact behaviour of the redemption will depend on the configuration associated with the voucher type.
Currently this supports both vouchers which trigger promotions and the vouchers that are used as a tender.
If the voucher has sub-types configured, you must supply the sub-type when you attempt to redeem it (using the voucherSubType field). If there is no sub-type, then this field is not needed.
If the returnBasket flag is true, the updated basket will be returned.
Triggers a promotion recalculation if updatePromotions flag is set to true. Removes existing promotions if set to false.
Request
Request Service URL
POST /baskets/{basketReference}/tenders/redeemVoucher?returnBasket=true
Request Tokens
- basketReference: The basket reference of the basket to redeem the voucher against.
Request Parameters
- updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IRedeemVoucherRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
voucherTypeId | Required | String | The ID of the Voucher Type to apply. |
voucherSubType | Required if the voucher has subtypes configured | String | The ID of the Voucher Sub Type. |
voucherValue | Optional, depending on the voucher configuration | Long | The value of the voucher to redeem. |
serialNumber | Optional, depending on the voucher configuration | String | The serial number of the voucher to redeem. |
externalReference | Optional | String | A string which can be associated with the voucher line to refer to it later. |
itemAllocations | Optional | itemAllocations | List of item allocations as in below: "itemAllocations": [ { "lineReference": 1, "amount": 300 }, { "lineReference": 3, "amount": 400 } ] |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Basic Example
Request:
POST http://[[SWARM_LEADER_IP]]/WebRestApi/rest/baskets/MyBasket/tenders/redeemVoucher?returnBasket=true
Content-Type: application/json
{
"voucherTypeId": "UK-GV",
"serialNumber": 0103054230803095129013
}
Response:
Status: 200 OK
Example with Sub Type
POST http://[[SWARM_LEADER_IP]]/WebRestApi/rest/baskets/MyBasket/tenders/redeemVoucher?returnBasket=true
Content-Type: application/json
{
"voucherTypeId": "UK-GV",
"voucherSubType": "5"
}
Response:
Status: 200 OK
Record a Tender
Records a tender in the basket. Only CASH tenders are currently supported.
Tenders can also be allocated to specific items in the basket. To use this function the “Enable Item Allocation” flag should be set in the Restrictions 1 tab of the Tender Maintenance for your Tender.
If the returnBasket flag is true, the updated basket will be returned.
Triggers a promotion recalculation if updatePromotions flag is set to true. Removes existing promotions if set to false.
Request
Request Service URL
POST /baskets/{basketReference}/tenders?returnBasket=true
Request Tokens
- basketReference: The basket reference of the basket to record the tender against.
Request Parameters
- updatePromotions Boolean. If true, triggers a promotion recalculation - Removes existing promotions if set to false. Eg: updatePromotions=true
Request Body
IRecordTenderRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
tenderType | Required | String | The type of tender to record, currently only CASH is supported. |
tenderId | Required | String | The ID of the tender to record, this must map to the ID of a tender in the Enactor database. |
tenderAmount | Required, however Tender configuration can use a fixed value. | String | The amount of the tender to record. |
referenceNumber | Optional | String | The reference number of the tender. |
externalReference | Optional | String | A string which can be associated with the tender item to refer to it later. |
itemAllocations | Optional | itemAllocations | To use this, the “Enable Item Allocation” flag should be set in the Restrictions 1 tab of the Tender Maintenance for your Tender. Tender can be allocated for items as follows: "itemAllocations": [ { "lineReference": 1, "amount": 300 }, { "lineReference": 2, "amount": 400 } ] |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request (without tender allocations):
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/tenders
{
"tenderType": "CASH",
"tenderId": "CSH",
"tenderAmount": 1000,
"referenceNumber": "ABC"
}
Request (with tender allocations):
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/tenders
{
"tenderType": "CASH",
"tenderId": "CSH",
"tenderAmount": 7000,
"referenceNumber": "ABC",
"itemAllocations": [
{
"lineReference": 1,
"amount": 3000
},
{
"lineReference": 2,
"amount": 4000
}
]
}
Response:
Status: 200 OK
Update Allocations on a Tender
Once Tender has been allocated for items using the Record a Tender API, the update Allocations on a Tender API can be used to make changes to the Tender Allocations that were initially added.
Note: Make sure that the allocated amount that is to be updated is less than the total tender amount. Eg: If the total tender amount is £500, the new totals of the updated allocated tenders are less than or equal to £500. i.e., allocations of £250 and £250 for items 1 and 2 respectively will work. Allocations of £251 and £250 for items 1 and 2 will not work.
Request
Request Service URL
PATCH /baskets/{basketReference}/tenders/{lineReference}/allocations?returnBasket=true
Request Tokens
-
basketReference: The basket reference of the basket to record the update of tender allocation against.
-
lineReference: The line reference of the tender item or the voucher item.
Request Parameters
- returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
IRecordTenderRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
itemAllocations | Required | itemAllocations | List of item allocations as in below: "itemAllocations": [ { "lineReference": 1, "amount": 300 }, { "lineReference": 3, "amount": 400 } ] |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request (For a total tender value of 8000):
PATCH http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/tenders/ABC/allocations?returnBasket=true
{
"itemAllocations": [
{
"lineReference": 1,
"amount": 6000
},
{
"lineReference": 2,
"amount": 2000
}
]
}
Response:
Status: 200 OK
Delete Allocations on a Tender
Once Tender has been allocated for items using the Record a Tender API, the Delete Allocations on a Tender API can be used to make changes to the Tender Allocations that were added.
Request
Request Service URL
DELETE /baskets/{basketReference}/tenders/{lineReference}/allocationsreturnBasket=true
Request Tokens
-
basketReference: The basket reference of the basket to delete the tender allocation against.
-
lineReference: The line reference of the tender allocation item.
Request Parameters
- returnBasket: Boolen. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
DELETE http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyBasket/tenders/3/allocations?returnBasket=true
Response:
Status: 200 OK
Record Change
This would allow to record a change to a basket. Please note that for this to work, there should be a tender already recorded to the basket, that exceeds the total of the basket items’ values. Eg: Tender of £500 is recorded for a basket that has a total of £299. Only then will you be able to record a change value using this API.
Request
Request Service URL
POST /baskets/{basketReference}/tenders/recordChange?returnBasket=true
Request Tokens
- basketReference: The basket reference of the basket to record change against.
Request Parameters
- returnBasket: Boolen. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
IRecordChangeRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
tenderType | Required | String | Type of the change about to be recorded. |
tenderId | Required | String | Tender ID of the change about to be recorded. |
tenderAmount | Required | Long | Amount about to be recorded as the change. |
referenceNumber | Required | String | Reference number of the recording change. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST /baskets/MyBasket/tenders/recordChange?returnBasket=true
{
"tenderType": "CASH",
"tenderId": "CSH",
"tenderAmount": 1000,
"referenceNumber": "456"
}
Response:
Status: 200 OK
Issue Change
This would allow to record the full change to a basket.
Request
Request Service URL
POST /baskets/{basketReference}/tenders/issueChangereturnBasket=true
Request Tokens
- basketReference: The basket reference of the basket to issue the change against.
Request Parameters
- returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
IRecordChangeRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
tenderType | Required | String | Type of the change about to be recorded. |
tenderId | Required | String | Tender ID of the change about to be recorded. |
referenceNumber | Optional | String | Reference number of the recording change. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST /baskets/MyBasket/tenders/issueChange?returnBasket=true
{ "tenderType": "CASH", "tenderId": "CSH", "referenceNumber": "456" }
Response:
Status: 200 OK
Basket Orders API
Following is the list of Basket Orders APIs covered in this section:
-
List Delivery Options.
-
Update Delivery Details.
-
Update Collection Details.
-
List Collection Options.
-
List Collection Locations.
-
List Collection Delivery Options.
-
List Collection Deposit Options.
-
List Delivery Deposit Options.
-
Set Deposit Reason.
List Delivery Options
Lists the available delivery options for a delivery address. Each delivery options states what products (including quantity) the delivery options can fulfil.
Request
Request Service URL
POST /baskets/{basketReference}/orders/deliveryOptions
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
ListDeliveryOptionsResponse
Element | Type | Description |
---|---|---|
deliveryOptions | List<DeliveryOption> | The list of available delivery options for a request. |
deliverySlot | DeliverySlot | A list of the currency and fulfillment options of delivery slots. |
deliveryDescription | String | A description for this option in the specified locale. |
deliveryReference | String | A string that can be used as a reference for this delivery option. |
deliveryPromiseText | String | A text used to display the delivery promise for this option. |
products | List<ProductQuantity> | The list of products and the quantity available with this delivery option. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/deliveryOptions
{
"street1": "Enactor House",
"street2": "1 Bluecoats Avenue",
"town": "Hertford",
"county": "Hertfordshire",
"postCode": "SG14 1PB"
}
Response:
Status: 200 OK
{
"deliveryOptions": [
{
"@type": "addressDeliveryOption",
"address": {
"countryCodeId": {},
"typeId": {},
"postCode": "sg124 9tf",
"street1": "Great Amwell",
"isTemplate": false
},
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0003"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationReservationDeliveryOption",
"locationId": {
"id": "0001"
},
"deliveryDescription": "Enactor Store",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0001"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationCollectionDeliveryOption",
"locationId": {
"id": "0001"
},
"deliveryDescription": "Enactor Store",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationReservationDeliveryOption",
"locationId": {
"id": "0003"
},
"deliveryDescription": "Enactor (Demo Room)",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0003"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationCollectionDeliveryOption",
"locationId": {
"id": "0003"
},
"deliveryDescription": "Enactor (Demo Room)",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0001"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
}
]
}
Update Delivery Details
This service will update the basket’s order details with a delivery name, address, and option. Any existing delivery options will be removed and replaced.
Request
Request Service URL
POST /baskets/{basketReference}/orders/deliveryDetails
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
ISetDeliveryDetailsRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
address | Required | ICustomerOrderAddress | The address of the order. |
deliveryOption | Required | IDeliveryOption | The delivery option for the order. |
deliveryName | Required | IName | The name of delivery address. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/deliveryOptions
{
"address": {
"houseNumber": "44 Furlong Way, Great Amwellbb",
"street1": "Great Amwell",
"city": "Ware",
"postCode": "sg124 9tf",
"phoneNumber": "7565678900"
},
"deliveryOption": {
"@type": "addressDeliveryOption",
"address": {
"countryCodeId": {},
"typeId": {},
"postCode": "sg124 9tf",
"street1": "Great Amwell",
"isTemplate": false
},
"deliverySlot": {
"currencyId": {},
"deliveryCharge": 500,
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-12"
}
}
},
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
],
"deliveryTypeId": {
"deliveryTypeId": "Express"
}
},
"products": [
{
"productKey": {
"id": "VV639JS-12"
},
"quantity": 1
},
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
],
"index": 0
},
"deliveryName": {
"forename": "James",
"surname": "hanson"
}
}
Response:
Status: 200 OK
Update Collection Details
This service will update the collection details for a basket.
Request
Request Service URL
POST /baskets/{basketReference}/orders/collectionDetails
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
UpdateCollectionDetailsRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
locationId | Required | String | The ID of the location. |
deliveryOption | Required | IDeliveryOption | The (collection) delivery option to update the order with. |
deliveryName | Required | IName | The name of delivery option. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/collectionDetails
{
"locationId": "0001",
"deliveryOption": {
"@type": "locationCollectionDeliveryOption",
"locationId": {
"id": "0001"
},
"deliveryDescription": "Enactor Store",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-12"
}
}
},
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-12"
},
"quantity": 1
},
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
],
"index": 1
},
"deliveryName": {
"forename": "James",
"surname": "hanson"
}
}
Response:
Status: 200 OK
List Collection Options
This service will return a list of collection delivery options for a given location ID.
Request
Request Service URL
POST /baskets/{basketReference}/orders/collectionOptions/{locationId}
Request Tokens
-
basketReference: The reference of the basket.
-
locationId: The ID of the location to list the collection options of.
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.
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/collectionOptions/0001
Response:
Status: 200 OK
{
"deliveryOptions": [
{
"@type": "addressDeliveryOption",
"address": {
"countryCodeId": {},
"typeId": {},
"isTemplate": false
},
"deliverySlot": {
"currencyId": {},
"deliveryCharge": 500,
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-12"
}
}
},
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
],
"deliveryTypeId": {
"deliveryTypeId": "Express"
}
},
"products": [
{
"productKey": {
"id": "VV639JS-12"
},
"quantity": 1
},
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationCollectionDeliveryOption",
"locationId": {
"id": "0001"
},
"deliveryDescription": "Enactor Store",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-12"
}
}
},
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-12"
},
"quantity": 1
},
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
},
{
"@type": "locationCollectionDeliveryOption",
"locationId": {
"id": "0003"
},
"deliveryDescription": "Enactor (Demo Room)",
"deliverySlot": {
"currencyId": {},
"fulfilmentOptions": [
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-12"
}
}
},
{
"locationStockFulfilment": {
"locationId": {
"id": "0100"
},
"quantity": 1,
"productId": {
"id": "VV639JS-8"
}
}
}
]
},
"products": [
{
"productKey": {
"id": "VV639JS-12"
},
"quantity": 1
},
{
"productKey": {
"id": "VV639JS-8"
},
"quantity": 1
}
]
}
]
}
List Collection Locations
This service will return a list of summaries of all the possible collection locations available.
Request
Request Service URL
GET /baskets/{basketReference}/orders/collectionLocations
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListCollectionLocationsResponse
Element | Type | Description |
---|---|---|
collectionLocationSummaries | List<ICollectionLocationSummary> | The list of collection location summaries. |
locationId | String | The ID of the location for the collection location. |
description | String | The description of the collection location. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/collectionLocations
Response:
Status: 200 OK
{
"collectionLocationSummaries": [
{
"locationId": "1001",
"description": "US Atlanta"
},
{
"locationId": "1003",
"description": "US New York"
},
{
"locationId": "0003",
"description": "UK Oxford Street"
},
{
"locationId": "0001",
"description": "UK Hertford"
}
]
}
List Collection Delivery Options
This service will return a list of all the delivery options available for the collection of the customer order.
Request
Request Service URL
GET /baskets/{basketReference}/orders/collectionOptions
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListDeliveryOptionsResponse
Element | Type | Description |
---|---|---|
deliveryOptions | List<IDeliveryOptions> | The list of delivery options available for collection. |
deliverySlot | IDeliverySlot | The delivery slot. |
deliveryDescription | String | The description of the delivery. |
deliveryReference | String | The reference of the delivery. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/collectionOptions
Response:
TODO
List Collection Deposit Options
This service will return a list of all the deposit options available for the collection of the customer order.
Request
Request Service URL
GET /baskets/{basketReference}/orders/collectionDepositOptions
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListDepositOptionsResponse
Element | Type | Description |
---|---|---|
depositOptions | List<IDeliveryOptions> | The list of deposit options available. |
value | Long | The calculated value of the deposit. |
description | String | The description of the deposit reason. |
reasonKey | IReasonKey | The deposit reason. |
currencyId | String | The currency of the deposit. |
minValue | Long | The minimum possible value of the deposit. |
maxValue | Long | The maximum possible value of the deposit. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/collectionDepositOptions
Response:
Status: 200 OK
{
"depositOptions": [
{
"value": 0,
"description": "Pay on collection",
"reasonKey": {
"reasonId": "WOCD-UK-01",
"regionId": {
"groupTypeId": "region",
"groupHierarchyId": "All",
"groupId": "UK",
"id": "UK"
}
},
"currencyId": "GBP"
}
]
}
List Delivery Deposit Options
This service will return a list of all the deposit options available for the delivery of the customer order.
Request
Request Service URL
GET /baskets/{basketReference}/orders/deliveryDepositOptions
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
There are no request parameters.
Request Body
There is no request body.
Response
Response Headers
There are no response headers.
Response Body
IListDepositOptionsResponse
Element | Type | Description |
---|---|---|
depositOptions | List<IDeliveryOptions> | The list of deposit options available. |
value | Long | The calculated value of the deposit. |
description | String | The description of the deposit reason. |
reasonKey | IReasonKey | The deposit reason. |
currencyId | String | The currency of the deposit. |
minValue | Long | The minimum possible value of the deposit. |
maxValue | Long | The maximum possible value of the deposit. |
Request & Response Examples
Request:
GET http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/deliveryDepositOptions
Response:
Status: 200 OK
{
"depositOptions": [
{
"value": 29900,
"description": "100% Full Payment",
"reasonKey": {
"reasonId": "WODD-UK-01",
"regionId": {
"groupTypeId": "region",
"groupHierarchyId": "All",
"groupId": "UK",
"id": "UK"
}
},
"currencyId": "GBP"
}
]
}
Set Deposit Reason
This service will set a deposit reason to the order basket.
Request
Request Service URL
POST /baskets/{basketReference}/orders/deposit?returnBasket=true
Request Tokens
- basketReference: The reference of the basket.
Request Parameters
- returnBasket: Boolean. If true, the updated basket is returned - Defaults to false. Eg: returnBasket=true
Request Body
ISetDepositReasonRequest
Element | Required / Optional | Type | Description |
---|---|---|---|
reasonId | Required | String | The ID of the deposit reason. |
depositAmount | Required | Long | The deposit amount. |
referenceNumber | Optional | String | The reference number of the deposit. |
externalReference | Optional | String | The external reference of the customer deposit reason basket item. |
Response
Response Headers
There are no response headers.
Response Body
There is no response body.
Request & Response Examples
Request:
POST http://[SWARM_LEADER_IP]/WebRestApi/rest/baskets/MyOrderBasket/orders/deposit
{ "reasonId": "COD-UK-02", "depositAmount": 1000 }
Response:
{
"basket": {
"items": [
{
"@type": "orderDetailsItem",
"description": "Order",
"deviceId": "pos1@0001.enactor",
"effectiveNetValue": -4260,
"lineNumber": 1,
"netValue": -4260,
"value": -4260,
"dateTimeCreated": "2023-05-09T14:53:56.000+05:30",
"userId": "CUST_USER",
"type": "VALUE",
"orderReference": "890",
"sendCustomerDeliveryNotification": true,
"customerOrderTypeId": "CUSTOMER_ORDER",
"childLineNumbers": [3],
"supplementaryValues": {}
},
{
"@type": "styleColourSizeItem",
"colourId": {
"colourRangeId": "WOMENS_DRESSES",
"id": "NAVY_BLUE"
},
"description": "Rose Print Tea Dress",
"deviceId": "pos2@0001.enactor",
"effectiveNetValue": 4260,
"lineNumber": 2,
"netValue": 4260,
"value": 4260,
"dateTimeCreated": "2023-05-09T14:54:07.000+05:30",
"userId": "CUST_USER",
"externalReferenceNumber": "validItemExternalReference1",
"modifiersNetValue": 0,
"modifiersEffectiveNetValue": 0,
"modifiersVoidQuantity": 0.0,
"modifiersQuantity": 0.0,
"notDiscountable": false,
"maxDiscount": 0.0,
"handKeyed": true,
"productID": "MB709SN-1",
"quantity": 1.0,
"netQuantity": 1.0,
"isReturn": false,
"unitPrice": 4260,
"sourceInventoryType": "AVA",
"orderable": true,
"priceTypeId": "R",
"productTypeId": "skuProduct",
"productImageURL": "image://PRODUCT/MB709SN-2.jpg",
"type": "VALUE",
"localisedWarrantyInformation": {},
"mmGroupId": "WOMENS_DRESSES",
"mmGroupHierarchyId": "FASHION",
"mmGroupVariantGroupId": "All",
"mmGroupVariantHierarchyId": "All",
"mmGroupDescription": "Women's Dresses",
"brandGroupId": "INTERNAL",
"brandGroupHierarchyId": "FASHION",
"modifiers": [
{
"@type": "orderModifier",
"modifierItemLine": 1
}
],
"giftReceiptItem": false,
"sizeId": {
"sizeRangeId": "WOMENS_DRESSES",
"id": "8"
},
"supplementaryValues": {}
},
{
"@type": "customerOrderDepositBasketItem",
"deviceId": "pos1@0001.enactor",
"effectiveNetValue": 4000,
"lineNumber": 3,
"netValue": 4000,
"value": 4000,
"dateTimeCreated": "2023-05-09T14:54:15.000+05:30",
"userId": "CUST_USER",
"externalReferenceNumber": "ref1",
"allowVoidWhenChild": true,
"depositValue": 4000,
"depositReasonId": {
"reasonId": "ODR_DPST_3",
"regionId": {
"groupTypeId": "region",
"groupHierarchyId": "All",
"groupId": "UK",
"id": "UK"
}
},
"supplementaryValues": {}
}
],
"balance": 4000,
"currencyId": "GBP",
"currencyDescription": "Pounds Sterling",
"taxInclusive": false,
"taxSchemeId": "UK",
"itemCount": 3,
"saleItemQuantity": 1.0,
"returnItemQuantity": 0.0,
"returnMerchandiseItemQuantity": 0.0,
"returnMerchandiseItemNetValue": 0,
"saleItemNetValue": 4260,
"returnItemNetValue": 0,
"merchandiseItemQuantity": 1.0,
"merchandiseItemValue": 4260,
"total": 4000,
"grossTotal": 4000,
"taxTotal": 0,
"promotionCalculation": {
"totalSaving": 0,
"totalPoints": 0
},
"additionalData": {
"entityQName": "{http://www.enactor.com/retail}additionalData",
"dataMap": {
"RestAPI.ForOrderDefault": "true"
}
},
"currentModifierLineNumber": 1,
"totalTaxAdjustment": 0,
"preAuthBalance": 0,
"effectiveSaleValue": 4260
},
"basketReference": "MyBasket",
"basketType": "BASKET",
"basketDescription": "MyBasket",
"basketStatus": "IN_PROGRESS",
"basketCreatedDate": "2023-05-09T14:53:56.000+05:30"
}