Validates and calculates pricing for a terminal basket. Returns the basket with calculated prices, taxes, and discounts.
With draft: true the basket is stored as a draft (is_valid: false): per-product shipping may be omitted (shipping that is present is still validated in full) and stock reservations are not touched. Stock is only reserved on a full (non-draft) validate.
Requires process_offline_payments, process_card_payments, or process_test_orders permission
Setting stock_override: true additionally requires manage_account or manage_catalogue permission.
Body
Required
-
Store ENI (Entity Number Identifier)
-
Customer identifier
Maximum length is
191. -
Store the basket as a draft (
is_valid: false) — per-productshippingmay be omitted and stock reservations are not touched -
Bypass stock validation and allow overselling. Requires
manage_accountormanage_cataloguepermission
Responses
-
Validated basket with calculated prices
-
Forbidden - storefront users cannot access
-
Validation error. Basket limit errors additionally expose a stable
code(basket.max_products,basket.max_addons,basket.addon_max_allowed) and itsparamsso clients can interpolate the limits into their own copy.
curl \
--request POST 'https://api.asia.enjovia.app/terminal/basket/validate' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--header "Store-Subdomain: string" \
--data '{
"store_eni": "STORE-2024-001",
"customer_id": "customer-123456",
"data": {
"products": [
{
"id": "987e6543-e21b-12d3-a456-426614174000",
"eni": "PROD-2024-001",
"image_url": "https://example.com/product.jpg",
"message": "Happy Birthday!",
"recipient_name": "John Doe",
"from_name": "Jane Smith",
"monetary_value": 5000,
"shipping": {
"type": "email",
"email": "john.doe@example.com"
}
},
{
"id": "abc12345-e89b-12d3-a456-426614174001",
"eni": "PROD-2024-002",
"image_url": "https://example.com/product2.jpg",
"variant_id": "def45678-e89b-12d3-a456-426614174002",
"addons": [
{
"id": "789abcde-e89b-12d3-a456-426614174003",
"eni": "ADDON-001"
}
],
"shipping": {
"type": "post",
"packaging_option_id": "123e4567-e89b-12d3-a456-426614174004",
"delivery_method_id": "456e7890-e89b-12d3-a456-426614174005",
"delivery_address": {
"name": "John Doe",
"address_line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
}
}
],
"marketing_consent": true,
"promotion": {
"id": "bcd23456-e89b-12d3-a456-426614174006",
"eni": "PROMO-001",
"code": "SUMMER20"
}
}
}'
{
"store_eni": "STORE-2024-001",
"customer_id": "customer-123456",
"data": {
"products": [
{
"id": "987e6543-e21b-12d3-a456-426614174000",
"eni": "PROD-2024-001",
"image_url": "https://example.com/product.jpg",
"message": "Happy Birthday!",
"recipient_name": "John Doe",
"from_name": "Jane Smith",
"monetary_value": 5000,
"shipping": {
"type": "email",
"email": "john.doe@example.com"
}
},
{
"id": "abc12345-e89b-12d3-a456-426614174001",
"eni": "PROD-2024-002",
"image_url": "https://example.com/product2.jpg",
"variant_id": "def45678-e89b-12d3-a456-426614174002",
"addons": [
{
"id": "789abcde-e89b-12d3-a456-426614174003",
"eni": "ADDON-001"
}
],
"shipping": {
"type": "post",
"packaging_option_id": "123e4567-e89b-12d3-a456-426614174004",
"delivery_method_id": "456e7890-e89b-12d3-a456-426614174005",
"delivery_address": {
"name": "John Doe",
"address_line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
}
}
],
"marketing_consent": true,
"promotion": {
"id": "bcd23456-e89b-12d3-a456-426614174006",
"eni": "PROMO-001",
"code": "SUMMER20"
}
}
}
{
"basket": {
"id": "string",
"customer_id": "string",
"data": {}
}
}
{
"message": "A basket can have a maximum of 20 products",
"code": "basket.max_products",
"params": {
"limit": 20
},
"errors": {
"basket": [
"A basket can have a maximum of 20 products"
]
}
}