Saltar al contenido principal

Order Cart Validation

Overview

Order Cart Validation (OCV) allows DoorDash to validate a customer’s cart with your system before the order is submitted.

OCV ensures that orders are only placed when they can be successfully fulfilled. Validation occurs during checkout and prevents invalid orders caused by:

  • Out-of-stock items
  • Price discrepancies
  • Invalid modifiers or incomplete selections
  • Store closure or capacity constraints
  • Promotion or tax mismatches

If validation succeeds, the customer will be able to checkout and DoorDash will submit the order. If validation fails, DoorDash will block submission and display a user-friendly error message on the checkout screen based on the error code(s) returned.

How It Works

OCV is triggered when a customer proceeds from cart to checkout.

Flow

  1. The customer arrives at the store page.
  2. The customer adds items to their cart.
  3. The customer views items in their cart.
  4. When the customer clicks “Continue” on the cart page, DoorDash invokes Order Cart Validation (OCV).
  5. The customer is allowed to proceed to the checkout page while validation processes.
  6. When the customer clicks “Place Order” on the checkout page:
    1. If validation succeeds, the order is submitted.
    2. If validation fails, the validation error is surfaced on the checkout page.

Why This Matters

Fewer Cancellations

Invalid orders are identified before submission, reducing proactive and POS-related cancellations.

Improved Checkout Experience

Customers receive real-time feedback and can resolve issues before paying — increasing successful checkouts.

Endpoint Requirements

Partners must expose the following endpoint:

POST /orderCartValidation

Request Schema

Trigger: Fired automatically by DoorDash when the customer moves to the checkout page.

Headers: Standard signed headers as configured in your developer webhook subscription.

URL Parameters: None (cart_id will be passed in the request body payload)

Example Request #1

POST /orderCartValidation

{  
"cart_id": "string", //Unique ID for tracking cart validation
"store": {
"merchant_supplied_id": "string", // Store ID
"provider_type": "string" //POS integration type being used
},

"fulfillment": { "dx_delivery", // Enum:"

"dx_delivery"|"pickup"|"mx_fleet_delivery"

// dx_delivery = DoorDash delivery

// pickup = Consumer pickup

// mx_fleet_delivery = merchant delivery

"asap": true, // ASAP or scheduled

"requested_time": "2025-12-05T18:30:00Z",

},

"subtotal": 0.00, // Pre-tax cart subtotal
"tax": 0.00, // Tax amount applied to the cart

"categories": [ // Structured list of menu categories included
{
"name": "string", // Category name (ex: "Burgers", "Sides")
"merchant_supplied_id": "string", // Category identifier
"items": [ // List of items under this category
{
"name": "string", // Item name
"merchant_supplied_id": "string", // Merchant/POS item ID
"price": 0.00, // Unit price
"quantity": 0, // Quantity requested by customer

"extras": [ // Add-ons, modifiers, or nested options
{
"name": "string",
"merchant_supplied_id": "string",
"options": [ // Available modifier options for the user
{
"name": "string",
"merchant_supplied_id": "string",
"price": 0.00, // Price adjustment for modifier
"quantity": 0, // Modifier quantity
"extras": [ null ], // Supports further nesting
"line_option_id": "string" // Unique identifier for this option
}
]
}
],

"special_instructions": "string", // Optional notes
"line_item_id": "string" // ID used to correlate this item
}
]
}
],

"experience": "DOORDASH" // Ordering channel
}

Response Schema

You must return one of the following:

Success Response

{  
"valid": true, // Order passed validation
"cart_id": "string", // Returned ID matching the request
"expires_at": "2025-11-05T16:00:00Z", // Time until validation expires
"earliest_pickup_time": "2025-11-05T16:15:00Z" // Earliest available pickup time slot
}

Failure Response

{  
"valid": false, // Order failed validation
"cart_id": "string",
"expires_at": "2025-11-05T16:00:00Z",

"errors": [ // Detailed list of issues found during validation
{
"code": "ITEM_OUT_OF_STOCK", // Menu item is unavailable
"merchant_supplied_id": "line_01", // Item ID
"message": "Burger is sold out" // Message to surface
}
]
}

Response Rules

  • The cart_id must match the request.
  • Use structured error codes (see below).
  • Errors must be item-level when applicable.
  • Do not return generic errors when a specific error applies.

Error Codes

Partners must return one of the following standardized error codes:

Error CodeDescription
INVALID_ORDERCart structure is invalid or incomplete.
ITEM_OUT_OF_STOCKItem is unavailable (86’d) at the restaurant.
STORE_HOURS_ISSUEOrder placed outside of configured POS store hours.
INTERNAL_ERRORUnexpected system failure.
OTHERUnclassified error.
CONNECTIVITY_ISSUENetwork/POS transmission issue.
TIME_OUTValidation timed out.
STORE_CLOSEDThe store is closed or not accepting orders.
STORE_CLOSED_EARLYRestaurant closed or not accepting orders.
POS_OFFLINEThe restaurant cannot be reached due to the POS being offline or otherwise unavailable.
CAPACITY_THROTTLINGKitchen capacity limit reached.
STALE_PICKUP_TIMEThe selected time is no longer valid.
ORDER_ONLINE_DISABLEDThe store has online ordering disabled.
INVALID_ADDRESSAddress is invalid.
STORE_RENOVATIONThe store is unavailable due to renovation.
STORE_TEMP_CLOSEDThe store is temporarily closed.
WEATHER_ISSUESOrders paused due to external conditions.

Field details

Top-Level Fields

FieldDescription
cart_id (Required)Unique identifier for tracking this cart validation session.
store.merchant_supplied_id (Required)Your internal store/location identifier.
store.provider_typePOS integration type being used.
fulfillment (Required)Fulfillment method. Enum: dx_delivery, pickup, mx_fleet_delivery.
asap (Required)Boolean. true for ASAP orders; false for scheduled orders.
requested_timeTimestamp of requested fulfillment time.
subtotalPre-tax cart subtotal (decimal).
taxTax amount applied to the cart (decimal).
categories (Required)Structured array of menu categories containing ordered items.
experienceOrdering channel. Value: DOORDASH.

categories[] — Category Object

FieldDescription
nameCategory display name (e.g., "Burgers", "Sides").
merchant_supplied_idYour internal identifier for this menu category.
items (Required)Array of item objects ordered within this category.

categories[].items[] — Item Object

FieldDescription
nameDisplay name of the menu item.
merchant_supplied_id (Required)Your internal POS identifier for this item.
priceUnit price of the item (decimal).
quantity (Required)Quantity of this item requested by the customer.
extrasArray of modifier/add-on group objects.
special_instructionsOptional free-text notes from the customer for this item.
line_item_id (Required)Unique identifier for this line item, used to correlate validation errors back to the item.

items[].extras[] — Modifier Group Object

FieldDescription
nameDisplay name of the modifier group.
merchant_supplied_idYour internal identifier for this modifier group.
optionsArray of the modifier options selected by the customer.

extras[].options[] — Modifier Option Object

FieldDescription
nameDisplay name of the modifier option.
merchant_supplied_idYour internal identifier for this modifier option.
pricePrice adjustment for this modifier option (decimal).
quantityQuantity of this modifier option selected.
extrasSupports further nesting for complex modifiers.
line_option_idUnique identifier for this specific modifier option selection.

Field Summary — Response

Your endpoint must return one of the following response structures. All responses must include cart_id matching the request.

Success Response Fields

FieldDescription
valid (Required)Boolean. Must be true to indicate the cart passed validation.
cart_id (Required)Must match the cart_id from the request exactly.
expires_at (Required)Timestamp indicating when this validation result expires.
earliest_pickup_time_minutesEarliest available pickup time slot.

Failure Response Fields

FieldDescription
valid (Required)Boolean. Must be false to indicate validation failed.
cart_id (Required)Must match the cart_id from the request exactly.
expires_at (Required)Timestamp indicating when this validation result expires.
errors (Required)Array of error objects detailing all issues found.

errors[] — Error Object Fields

FieldDescription
code (Required)Standardized error code string. Must be one of the defined error codes.
merchant_supplied_id (Required)The ID of the specific item or entity associated with this error.
message (Required)A human-readable message describing the issue. Will be surfaced to the customer.

Latency & Timeout Behavior

  • DoorDash expects a validation response returned within 2-3 seconds.
  • If no response is received by the time the customer attempts to place an order, the validation will be bypassed and the order will be submitted.
  • Excessive timeouts may result in OCV being disabled for affected stores.

Testing & Certification

Before production launch:

  1. Implement the endpoint in the sandbox environment and simulate OCV requests.
  2. Test the valid and invalid cart scenarios along with the expected responses.
  3. Validate that latency requirements are met.

Contact support to begin certification.