Service URL: GET /baskets/{basketReference}
Tokens:
basketReference – The basket reference of the basket to add the items to, or can be ‘PRIMARY’ to add to the PRIMARY basket.
Parameters:
basketType – String – the type of basket to query for
Response Body:
BasketResponse
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 indict whether the basket was implicitly created by the server.
basketStatus – String – the status of the basket. Fresh baskets have the status NEW. Baskets in progress have the status of IN_PROGRESS. Baskets will have been submitted to retail processing have the status SUBMITTED.
Remarks:
Load an existing basket and return it, without making any changes. A user should only be able to load baskets which belong to them.
Scenarios:
Scenario | Outcome | Expected behavior | Status Code | Response | |
---|---|---|---|---|---|
1 | Get Basket service has been given a valid basket reference | Success | The basket is returned to the client | 200 | BaskerResponse |
2 | Get Basket service has been given a basket reference that doesn’t exist | NotFound | The basket is not returned. A NotFound outcome is returned with a 404 not found response. | 404 | Error Message: Failed to retrieve basket, outcome: NotFound |
3 | Get Basket service has been given a PRIMARY basket reference with a valid token. | Success | The primary basket for a customer is returned to the client | 200 | BaskerResponse |
4 | Get Basket service has been given a PRIMARY basket reference but no token is supplied | Fail | The basket is not returned. The service will fail because the customer’s information is missing | 500 | Error Message: Failed to retrieve basket, outcome: Fail |
Cucumber (Deprecated):
Number | Scenario | Outcome | Response |
---|---|---|---|
1 | Call GetBasket process for a wishlist basket given a valid basket key/reference | Success | BasketResponse |
2 | Call GetBasket process for a primary basket | Success | BasketResponse |
Rest Assured (Deprecated):
Number | Scenario | StatusCode | Response |
---|---|---|---|
1 | Call GetBasket service for a wishlist basket given a valid basket key/reference | 200 | BasketResponse |
2 | Call GetBasket service for a basket given a invalid basket key/reference | 500 | ErrorMessage: Failed to retrieve basket |
3 | Call GetBasket service for a primary basket | 200 | BasketResponse |
Example Request:
GET: http: //localhost:8080/WebRestApi/rest/baskets/PRIMARY |
Example 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"
}