Delivery in sandbox
A sandbox cart sent for delivery is delivered by a simulated driver, at a test restaurant or at a real restaurant whose menu Layout holds. The driver is booked, reaches the restaurant, collects the food and arrives, and your webhooks hear each step as they will in production. Nothing is charged.
What changed
simulatein a deliveryfulfillment. Sandbox keys only:delivered(the default),left_at_door,running_late,courier_canceled,no_courier,lostorreturned. A live key that sends it is refused with400 invalid_request. Test restaurants ignore the cart's ownsimulate, never the delivery's.- Timing. With
latency: "realistic", the default, a delivery takes about 85 seconds todelivered. Withlatency: "instant", any ending runs end to end in under about 15 seconds. - What it reads as. The simulated delivery fee is $4.99,
amounts.charged_minorstaysnullbecause nothing is charged, and nothing is saved to the test person's account. A sandbox address with a digit in it resolves near the test restaurants with no lookup; one without isaddress_not_found.test_place_delivery_farisout_of_range, withtest_place_placedas thealternative. - Not counted. Sandbox quotes and address lookups never count toward the delivery limits.
- MCP and the CLI. A sandbox delivery over MCP ends
delivered. From CLI 0.5.4,layout test-order --deliver-to "500 Howard St" --courier <ending>runs a whole delivery and exits 0 only when it ends that way.
{
"placeId": "test_place_placed",
"request": "a latte",
"fulfillment": { "type": "delivery", "address": "500 Howard St, San Francisco, CA", "simulate": "running_late" },
"latency": "instant"
}
What to do
Send each ending once and check your integration handles it: a delivery that arrives, one that becomes a pickup, and one that fails. What each ending does to the order, its events and the charge is in Test every ending.
Breaking changes
None.