Basket
The Basket API allows users to create and manage their shopping baskets within the Let’sTrade system. Users can add products, view basket details, and perform other actions related to their shopping experience.
API Base URL
The base URL for all API endpoints is:
https://lets-trade-basket-prod.letstrade.globalAttributes of a Basket
User ID (
user_id): The ID of the user who owns the basket.User (
user): Detailed information about the user.User ID (
_id): User’s unique identifier.User Name (
name): User’s first name.User Surname (
surname): User’s last name.User Email (
email): User’s email address.User Country Code (
cell_country_code): Country code for the user’s cell number.User Cell Number (
cell_number): User’s cell number.User Birthday (
birthday): User’s date of birth.
Client ID (
client_id): The client’s unique identifier.Delivery Fees (
delivery_fee): Fee for delivery.Total (
total): Total amount for the basket.Product Handling Fees (
product_handling_fees): Fees for handling the products.V AT (
vat): Value-added tax for the basket.Sub Total (
sub_total): Subtotal amount for the basket.Branch Information (
branch): Information about the branch where the basket is created.Branch ID (
_id): Branch’s unique identifier.Branch Extra Data (
extra_data): Additional data related to the branch.Branch Display Name (
display_name): Display name of the branch.Branch Email (
email): Email address of the branch.Branch Number (
branch_number): Branch’s number.Branch Address (
address): Address information of the branch.Full Address (
full_address): Full address.Longitude (
longitude): Longitude coordinate.Latitude (
latitude): Latitude coordinate.Line One (
line_one): Address line one.Line Two (
line_two): Address line two.Town (
town): Town name.City (
city): City name.Province (
province): Province name.Country (
country): Country name.Postal Code (
postal_code): Postal code.
Franchise (
franchise): Indicates if the branch is a franchise.Registered Name (
registered_name): Registered name of the branch.VAT Registered (
vat_registered): Indicates if the branch is VAT registered.VAT Number (
vat_number): VAT number of the branch.Contact Number (
contact_number): Contact number of the branch.Registration Number (
registration_number): Registration number of the branch.Delivery Information (
delivery): Delivery information.Delivery (
delivery): Indicates if delivery is available.Delivery Fee (
delivery_fee): Fee for delivery.Max Delivery Radius (
max_delivery_radius): Maximum delivery radius.Delivery Fee per KM (
delivery_fee_per_km): Delivery fee per kilometer.Base Delivery Radius (
base_delivery_radius): Base delivery radius.Last Collection Time (
last_collection_time): Last collection time.Last Delivery Time (
last_delivery_time): Last delivery time.Delivery Radii (
delivery_radii): Delivery radii information.Delivery Hours (
delivery_hours): Delivery hours.Delivery Fee type (
delivery_fee_type): Type of delivery fee.
Offline (
offline): Indicates if the branch is offline.Working Hours (
working_hours): Working hours of the branch.Exclusion Areas (
exclusion_areas): Exclusion areas for delivery.Coordinates (
coordinates): Coordinates of the branch.Country Code (
country_code): Country code.Country Code Extension (
country_code_extension): Country code extension
Status (
status): Status of the basket.Channel (
channel): Channel through which the basket was created.Provider (
provider): Provider of the basket.Straw (
straw): Indicates if straw is required.Cutlery (
cutlery): Indicates if cutlery is required.Serviettes (
serviettes): Indicates if serviettes are required.Type (
type): Type of the basket (e.g., collection, delivery).Address (
address): Address information for delivery.Outstanding Amount (
outstanding_amount): Outstanding amount for the basket.Paid Amount (
paid_amount): Paid amount for the basket.Deal (
deals): List of deals applied to the basket.Vouchers (
vouchers): List of vouchers applied to the basket.
Create Basket
POST /v2/create
This endpoint allows the creation of a new basket for a user, specifying whether it’s for collection or delivery and which branch it belongs to.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
user_id*
string
The ID of the user who owns the basket.
branch_id*
string
The ID of the branch where the basket is created.
type*
string
The type of the basket, either collection or delivery.
Sample Request
{
"user_id": "1234567890abcdef12345678",
"branch_id": "1234567890abcdef12345678",
"type": "collection"
}Response
{
"success": true,
"message": "Basket successfully created!",
"content": {
"user_id": "1234567890abcdef12345678",
"user": {
"_id": "1234567890abcdef12345678",
"name": "John",
"surname": "Doe",
"email": "[email protected]",
"cell_country_code": "+1",
"cell_number": "1234567890",
"birthday": "1990-01-01T00:00:00.000Z",
"client_id": "abcdef1234567890abcdef12"
},
"client_id": "abcdef1234567890abcdef12",
"delivery_fee": "5.00",
"total": "50.00",
"product_handling_fees": "2.00",
"vat": "3.00",
"sub_total": "45.00",
"products": [
{
"_id": "668cec84b9f8a87a0a490d3e",
"quantity": 1,
"price": "25.00",
"total_price": "25.00",
"name": "Sample Product",
"description": "This is a sample product.",
"image_url": "https://example.com/product.jpg",
"variations": [
{
"_id": "668cecb5b9f8a87a0a490d68",
"ref": "FE0NVVzs0m"
}
],
"condiments": [
{
"_id": "668edb57a21298abfb4ff32c",
"product_list": [
{
"_id": "666d53f54f228d1eeb14582a",
"name": "Condiment 1"
},
{
"_id": "666d53f54f228d1eeb14582e",
"name": "Condiment 2"
}
]
},
{
"_id": "668edde61eb3ab17469bf065",
"product_list": [
{
"_id": "666d53f44f228d1eeb14563e",
"name": "Condiment 3"
},
{
"_id": "666d53f54f228d1eeb145892",
"name": "Condiment 4"
},
{
"_id": "666d53f44f228d1eeb145641",
"name": "Condiment 5"
}
]
}
]
}
],
"branch": {
"_id": "abcdef1234567890abcdef34",
"extra_data": [
{
"name": "property_id",
"value": "1001"
},
{
"name": "store_id",
"value": "101"
}
],
"display_name": "Main Street Branch",
"email": "[email protected]",
"branch_number": "BR001",
"address": {
"full_address": "123 Main Street, Springfield, USA",
"longitude": "-93.0000",
"latitude": "37.0000",
"line_one": "123 Main Street",
"line_two": "",
"town": "Springfield",
"city": "Springfield",
"province": "Illinois",
"country": "USA",
"postal_code": "62701"
},
"franchise": false,
"registered_name": "Main Street Branch LLC",
"vat_registered": true,
"vat_number": "123456789",
"contact_number": "555-1234",
"registration_number": "987654321",
"delivery": {
"delivery": true,
"delivery_fee": "5.00",
"max_delivery_radius": "10",
"delivery_fee_per_km": "0.50",
"base_delivery_radius": "5",
"last_collection_time": "20:00",
"last_delivery_time": "22:00",
"delivery_radii": null,
"delivery_hours": [
{
"day": "Monday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Tuesday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Wednesday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Thursday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Friday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Saturday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Sunday",
"from": "08:00",
"to": "22:00"
}
],
"delivery_fee_type": "FLAT-FEE"
},
"offline": false,
"working_hours": [
{
"day": "Monday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Tuesday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Wednesday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Thursday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Friday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Saturday",
"from": "08:00",
"to": "22:00"
},
{
"day": "Sunday",
"from": "08:00",
"to": "22:00"
}
],
"exclusion_areas": [
{
"name": "Restricted Area",
"coordinates": [
{
"lat": "37.0001",
"lng": "-93.0001"
},
{
"lat": "37.0002",
"lng": "-93.0002"
},
{
"lat": "37.0003",
"lng": "-93.0003"
},
{
"lat": "37.0004",
"lng": "-93.0004"
},
{
"lat": "37.0005",
"lng": "-93.0005"
}
]
}
],
"coordinates": [
-93.0000,
37.0000
],
"country_code": "+1",
"country_code_extension": "US"
},
"status": "ACTIVE",
"channel": "LETS-TRADE",
"provider": "BRANCH",
"straw": false,
"cutlery": false,
"serviettes": false,
"type": "collection",
"address": null,
"outstanding_amount": "0.00",
"paid_amount": "0.00",
"deals": [],
"vouchers": []
}
}Get Basket
GET /v2/basket
This endpoint retrieves the current basket for a specified user.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Query Parameters
user_id
The ID of the user whose basket is to be retrieved.
Sample Request
curl --location '{base_ur}/v2/basket?user_id=622228a98268abc18c9e87eee' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'Response: Full basket is always returned. See response here.
Add Product to Basket
POST /v2/add/product
This endpoint allows adding a product to an existing basket by specifying the basket ID and product details.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
_id*
string
The ID of the basket
product*
object
Details of the product to add to the basket.
Product
_id*
string
The ID of the product
quantity*
string
The quantity of the product.
variations
array
List of variations for the product
{
"_id": "12345",
"ref": "FE0NVVzs0m"
}condiments
array
List of condiments for the product.
Sample Request
{
"_id": "66978b2b6ff5ed54ea5bed07",
"product": {
"_id": "668cec84b9f8a87a0a490d3e",
"quantity": "1",
"variations": [
{
"_id": "668cecb5b9f8a87a0a490d68",
"ref": "FE0NVVzs0m"
}
],
"condiments": [
{
"_id": "668edb57a21298abfb4ff32c",
"product_list": [
{
"_id": "666d53f54f228d1eeb14582a"
},
{
"_id": "666d53f54f228d1eeb14582e"
}
]
},
{
"_id": "668edde61eb3ab17469bf065",
"product_list": [
{
"_id": "666d53f44f228d1eeb14563e"
},
{
"_id": "666d53f54f228d1eeb145892"
},
{
"_id": "666d53f44f228d1eeb145641"
}
]
}
]
}
}or
{
"_id": "66978b2b6ff5ed54ea5bed07",
"product": {
"_id": "668cec84b9f8a87a0a490d3e",
"quantity": "1",
}
}Response: Full basket is always returned. See response here.
Remove Products from Basket
PUT /v2/remove/products
This endpoint allows removing specified products from an existing basket.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
_id*
string
The ID of the basket.
product_id_list*
array
List of product IDs to be removed from the basket.
Sample Request
{
"_id": "64cba5316c6fc2d61cd66e33",
"product_id_list": [
"64cbb3ade5d471c79f1af3dd"
]
}Response: Full basket is always returned. See response here.
Cancel Basket
PUT /v2/cancel
This endpoint allows canceling an existing basket.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
_id*
string
The ID of the basket.
Sample Request
{
"_id": "64cba5316c6fc2d61cd66e33"
}Response: Full basket is always returned. See response here.
Last updated