{"openapi":"3.1.0","info":{"title":"RentADriver API","version":"1.0.0","summary":"Physical delivery for AI agents and apps, fulfilled by vetted RentADriver drivers.","description":"Quote → create → fund → track → prove → pay. Quotes and coverage are free without auth. Everything else needs an API key (x-api-key). MCP server: `npx -y rentadriver-mcp`. Money is in integer minor units (cents).","contact":{"email":"support@rentadriver.ai","url":"https://rentadriver.ai"},"x-logo":{"url":"https://rentadriver.ai/brand/icon.svg"}},"servers":[{"url":"https://api.rentadriver.ai"}],"tags":[{"name":"Discovery"},{"name":"Quotes"},{"name":"Deliveries"},{"name":"Tracking"},{"name":"Account"},{"name":"Wallet"},{"name":"Webhooks"},{"name":"Support"},{"name":"Shopify","description":"The RentADriver app for Shopify (rentadriver.ai/integrations/shopify). Merchants install it from Shopify admin; these endpoints let the account that owns the shop list and book Shopify orders. Shopify-facing endpoints (install, session, webhooks, carrier-service rates) are documented at rentadriver.ai/integrations/shopify."},{"name":"Store connectors","description":"WooCommerce, BigCommerce, Wix Stores and Squarespace connectors (rentadriver.ai/integrations/<platform>). Merchants connect the store once; these endpoints let the account that owns it list and book its orders. Platform-facing endpoints (install, OAuth callbacks, webhooks, checkout rates) are documented per platform in the integration pages."}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Stop":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"Item":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}},"QuoteRequest":{"type":"object","required":["pickup","dropoffs"],"properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"pickup":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"dropoffs":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}}},"service":{"type":"string","enum":["auto","local","intercity"],"default":"auto","description":"auto picks intercity when the drop-off is in a neighbouring launch city: same-day, one dedicated driver, up to 160 km by road. Longer trips are refused (too_far)."},"speed":{"type":"string","enum":["same_day","express","standard","shared"],"default":"same_day","description":"Intercity only. Intercity is always same_day; express, standard and shared are accepted from older integrations and mean same_day."},"items":{"type":"array","items":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}}},"urgency":{"type":"string","enum":["asap","today","scheduled"],"default":"asap"},"scheduled_at":{"type":"string","format":"date-time"},"vehicle_class":{"type":"string","enum":["bike","scooter","car","suv","van","truck"],"description":"Requested minimum vehicle. The API upgrades unsuitable vehicles using total weight/volume, per-package weight, package count and all three dimensions. Quote vehicle_selection returns selected_vehicle, requested_vehicle, adjusted, reasons and limits. Display the selected vehicle and quoted price before booking."}}},"CreateDeliveryRequest":{"anyOf":[{"required":["quote_id"]},{"required":["pickup","dropoffs"]}],"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"pickup":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"dropoffs":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}}},"service":{"type":"string","enum":["auto","local","intercity"],"default":"auto","description":"auto picks intercity when the drop-off is in a neighbouring launch city: same-day, one dedicated driver, up to 160 km by road. Longer trips are refused (too_far)."},"speed":{"type":"string","enum":["same_day","express","standard","shared"],"default":"same_day","description":"Intercity only. Intercity is always same_day; express, standard and shared are accepted from older integrations and mean same_day."},"items":{"type":"array","items":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}}},"urgency":{"type":"string","enum":["asap","today","scheduled"],"default":"asap"},"scheduled_at":{"type":"string","format":"date-time"},"vehicle_class":{"type":"string","enum":["bike","scooter","car","suv","van","truck"],"description":"Requested minimum vehicle. The API upgrades unsuitable vehicles using total weight/volume, per-package weight, package count and all three dimensions. Quote vehicle_selection returns selected_vehicle, requested_vehicle, adjusted, reasons and limits. Display the selected vehicle and quoted price before booking."},"dispatch_timeout_hours":{"type":"number","minimum":0.25,"maximum":72,"description":"Automatic driver search duration. Default ASAP 24 hours; otherwise 72 hours, capped by today or explicit pickup-window end. Funds remain held once until assignment, cancellation or expiry."},"quote_id":{"type":"string","format":"uuid","description":"Use a quote from POST /v1/quotes instead of re-sending stops"},"instructions":{"type":"string"},"contingency":{"type":"object","properties":{"if_no_answer":{"type":"string","enum":["wait_then_leave_safe","wait_then_return","call_client","leave_with_neighbour"]},"if_closed":{"type":"string","enum":["return_to_pickup","hold_and_retry","call_client"]},"max_wait_minutes":{"type":"integer"},"return_to":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string"},"idempotency_key":{"type":"string"},"webhook_url":{"type":"string","format":"uri"},"metadata":{"type":"object"},"fund":{"type":"boolean","default":true,"description":"Hold funds from the wallet and start dispatch immediately"},"dryRun":{"type":"boolean","default":false,"description":"Validate + price only"}}},"Delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"Deposit":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["open","paid","credited","expired","failed","refunded"]},"amount_cents":{"type":"integer"},"currency":{"type":"string"},"workspace_id":{"type":"string"},"created_at":{"type":"string"},"paid_at":{"type":"string","nullable":true},"credited_at":{"type":"string","nullable":true},"payment_method":{"type":"string","nullable":true},"invoice_number":{"type":"string","nullable":true},"invoice_url":{"type":"string","nullable":true},"invoice_pdf":{"type":"string","nullable":true},"receipt_url":{"type":"string","nullable":true},"checkout_url":{"type":"string","nullable":true}}}}},"paths":{"/v1/support/tickets":{"get":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"listSupportTickets","summary":"This account's support tickets, newest activity first","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["active","all","open","in_progress","resolved","closed"]}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"createSupportTicket","summary":"Open a support ticket with RentADriver ops (optionally about one delivery)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject","body"],"properties":{"category":{"type":"string","enum":["payment","delivery","account","app","safety","other"]},"subject":{"type":"string","minLength":3,"maxLength":200},"body":{"type":"string","minLength":3,"maxLength":5000},"delivery_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/support/tickets/{id}":{"get":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"getSupportTicket","summary":"One ticket with its conversation (ops private notes excluded)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/support/tickets/{id}/messages":{"post":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"replySupportTicket","summary":"Reply on a ticket","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","minLength":1,"maxLength":5000},"request_id":{"type":"string","format":"uuid","description":"Idempotency: reuse after a timeout"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/support/assistant":{"get":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"getSupportAssistant","summary":"Whether the account-aware AI assistant is available, plus the guest chat link and support email","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"identified":{"type":"boolean"},"hosted_url":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"}}}}}}}}},"/v1/support/identity":{"post":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"createSupportIdentity","summary":"One-time ES256 assertion that signs the embedded AI assistant in as this organization (subject org:<organization id>, 120 s, verify with /.well-known/driver-support-jwks.json). Allowed for viewer keys; 30/min per key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["nonce"],"properties":{"nonce":{"type":"string","pattern":"^[A-Za-z0-9_-]{32,200}$","description":"Fresh per request"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nonce":{"type":"string"},"expiresIn":{"type":"integer","const":120}}}}}},"400":{"description":"Missing or malformed nonce, or URL parameters sent"},"503":{"description":"Account-aware assistant switched off; tickets still work"}}}},"/v1/support/context":{"get":{"tags":["Support"],"security":[{"ApiKeyAuth":[]}],"operationId":"getSupportContext","summary":"Read-only support snapshot for this organization: status, one wallet balance per country workspace (never summed across currencies), 5 recent deliveries (city only) and 10 ticket summaries. No arguments; sandbox keys see sandbox deliveries only","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object"},"wallets":{"type":"array","items":{"type":"object"}},"recent_deliveries":{"type":"array","items":{"type":"object"}},"tickets":{"type":"array","items":{"type":"object"}},"limits":{"type":"string"},"observed_at":{"type":"string","format":"date-time"}}}}}}}}},"/v1/account/overview":{"get":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"operationId":"getAccountOverview","summary":"30-day delivery and spending overview in the selected workspace currency","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/wallet/ledger":{"get":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"operationId":"getWalletLedger","summary":"Selected workspace ledger; every row includes currency and workspace_id","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/workspaces":{"get":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"operationId":"listCountryWorkspaces","summary":"List country workspaces, separate local-currency balances, and supported markets","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"currency":{"type":"string"},"wallet_balance_cents":{"type":"integer"},"is_default":{"type":"boolean"},"spending_cap_per_delivery_cents":{"type":["integer","null"]},"daily_cap_cents":{"type":["integer","null"]}}}},"markets":{"type":"array","items":{"type":"object"}},"conversion_supported":{"type":"boolean","const":false}}}}}}}},"post":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"operationId":"enableCountryWorkspace","summary":"Enable a zero-balance country workspace (admin role). Existing balances are never converted","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["country_code"],"properties":{"country_code":{"type":"string","enum":["US","GB","AU","CA"]},"name":{"type":"string"},"spending_cap_per_delivery_cents":{"type":["integer","null"],"minimum":0},"daily_cap_cents":{"type":["integer","null"],"minimum":0}}}}}},"responses":{"200":{"description":"Workspace already enabled"},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"currency":{"type":"string"},"wallet_balance_cents":{"type":"integer"},"is_default":{"type":"boolean"},"spending_cap_per_delivery_cents":{"type":["integer","null"]},"daily_cap_cents":{"type":["integer","null"]}}}}}}}},"403":{"description":"Admin role required"},"422":{"description":"Unsupported market"}}}},"/v1/routes/preview":{"get":{"tags":["Routing"],"summary":"Road geometry between 2–9 points (lat,lng;lat,lng) for maps","operationId":"routePreview","security":[],"parameters":[{"name":"points","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ success, route: GeoJSON LineString, distance_m, duration_s, source }"}}}},"/v1/track/{code}/route":{"get":{"tags":["Tracking"],"summary":"Planned + remaining route and live driver position for a tracking code","operationId":"trackRoute","security":[],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ success, status, live, planned, remaining, driver, stops }"}}}},"/v1/deliveries/{id}/route":{"get":{"tags":["Deliveries"],"summary":"Planned + remaining route and live driver position (console maps)","operationId":"deliveryRoute","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ success, status, live, planned, remaining, driver, stops }"}}}},"/v1/sandbox/keys":{"post":{"tags":["Sandbox"],"summary":"Mint a 24-hour sandbox (test-mode) API key — no account needed","operationId":"createSandboxKey","security":[],"responses":{"201":{"description":"{ success, key, mode: \"test\", expires_at, console_url }"},"429":{"description":"Three keys per hour per network"}}}},"/v1/status/history":{"get":{"tags":["Status"],"summary":"90 daily buckets of API traffic: requests, error_rate, p95_ms","operationId":"statusHistory","security":[],"responses":{"200":{"description":"{ success, days: [{ date, requests, error_rate, p95_ms }] }"}}}},"/v1/intercity/lanes":{"get":{"tags":["Discovery"],"summary":"Same-day city-to-city routes: each launch city's neighbouring cities within 160 km by road, with distance, drive time and a sample price","operationId":"listIntercityLanes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/service-areas":{"get":{"tags":["Discovery"],"summary":"List launch cities","operationId":"listServiceAreas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/coverage":{"get":{"tags":["Discovery"],"summary":"Is an address/point covered?","operationId":"checkCoverage","parameters":[{"name":"address","in":"query","schema":{"type":"string"}},{"name":"lat","in":"query","schema":{"type":"number"}},{"name":"lng","in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"covered":{"type":"boolean"},"area":{"type":"object"},"nearest_area":{"type":"object"}}}}}}}}},"/v1/quotes":{"post":{"tags":["Quotes"],"summary":"Price in the pickup country currency; returns required country workspace (no auth needed)","operationId":"getQuote","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pickup","dropoffs"],"properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"pickup":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"dropoffs":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}}},"service":{"type":"string","enum":["auto","local","intercity"],"default":"auto","description":"auto picks intercity when the drop-off is in a neighbouring launch city: same-day, one dedicated driver, up to 160 km by road. Longer trips are refused (too_far)."},"speed":{"type":"string","enum":["same_day","express","standard","shared"],"default":"same_day","description":"Intercity only. Intercity is always same_day; express, standard and shared are accepted from older integrations and mean same_day."},"items":{"type":"array","items":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}}},"urgency":{"type":"string","enum":["asap","today","scheduled"],"default":"asap"},"scheduled_at":{"type":"string","format":"date-time"},"vehicle_class":{"type":"string","enum":["bike","scooter","car","suv","van","truck"],"description":"Requested minimum vehicle. The API upgrades unsuitable vehicles using total weight/volume, per-package weight, package count and all three dimensions. Quote vehicle_selection returns selected_vehicle, requested_vehicle, adjusted, reasons and limits. Display the selected vehicle and quoted price before booking."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":["string","null"]},"country_code":{"type":"string"},"currency":{"type":"string"},"enabled":{"type":"boolean"},"balance_cents":{"type":["integer","null"]}}},"id":{"type":"string"},"client_price_cents":{"type":"integer"},"currency":{"type":"string"},"eta_pickup_min":{"type":["integer","null"],"description":"Unconfirmed when no live drivers are available; estimates do not guarantee acceptance."},"eta_dropoff_min":{"type":["integer","null"]},"eta_status":{"type":"string","enum":["awaiting_driver_availability","estimate_not_guaranteed"]},"expires_at":{"type":"string"},"breakdown":{"type":"object"}}}}}}}},"422":{"description":"outside_coverage / prohibited_item"}}}},"/v1/stats":{"get":{"tags":["Discovery"],"summary":"Live platform stats","operationId":"getStats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/signup/verify":{"get":{"tags":["Account"],"summary":"Verify email from the link sent at signup; unlocks wallet funding","operationId":"verifySignup","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/signup":{"post":{"tags":["Account"],"summary":"Create an account + API key (shown once); email verification unlocks funding. Rehearse with a sandbox (rd_test_) key first","operationId":"signup","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","email"],"properties":{"country_code":{"type":"string","enum":["US","GB","AU","CA"],"default":"US"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"kind":{"type":"string","enum":["agent","app","business"]},"agent_framework":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string"},"organization_id":{"type":"string"},"wallet_balance_cents":{"type":"integer"}}}}}}}}},"/v1/deliveries":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Create (and fund) a delivery","operationId":"createDelivery","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"required":["quote_id"]},{"required":["pickup","dropoffs"]}],"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"pickup":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"dropoffs":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}}},"service":{"type":"string","enum":["auto","local","intercity"],"default":"auto","description":"auto picks intercity when the drop-off is in a neighbouring launch city: same-day, one dedicated driver, up to 160 km by road. Longer trips are refused (too_far)."},"speed":{"type":"string","enum":["same_day","express","standard","shared"],"default":"same_day","description":"Intercity only. Intercity is always same_day; express, standard and shared are accepted from older integrations and mean same_day."},"items":{"type":"array","items":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}}},"urgency":{"type":"string","enum":["asap","today","scheduled"],"default":"asap"},"scheduled_at":{"type":"string","format":"date-time"},"vehicle_class":{"type":"string","enum":["bike","scooter","car","suv","van","truck"],"description":"Requested minimum vehicle. The API upgrades unsuitable vehicles using total weight/volume, per-package weight, package count and all three dimensions. Quote vehicle_selection returns selected_vehicle, requested_vehicle, adjusted, reasons and limits. Display the selected vehicle and quoted price before booking."},"dispatch_timeout_hours":{"type":"number","minimum":0.25,"maximum":72,"description":"Automatic driver search duration. Default ASAP 24 hours; otherwise 72 hours, capped by today or explicit pickup-window end. Funds remain held once until assignment, cancellation or expiry."},"quote_id":{"type":"string","format":"uuid","description":"Use a quote from POST /v1/quotes instead of re-sending stops"},"instructions":{"type":"string"},"contingency":{"type":"object","properties":{"if_no_answer":{"type":"string","enum":["wait_then_leave_safe","wait_then_return","call_client","leave_with_neighbour"]},"if_closed":{"type":"string","enum":["return_to_pickup","hold_and_retry","call_client"]},"max_wait_minutes":{"type":"integer"},"return_to":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string"},"idempotency_key":{"type":"string"},"webhook_url":{"type":"string","format":"uri"},"metadata":{"type":"object"},"fund":{"type":"boolean","default":true,"description":"Hold funds from the wallet and start dispatch immediately"},"dryRun":{"type":"boolean","default":false,"description":"Validate + price only"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}},"402":{"description":"insufficient_funds — deposit first"},"403":{"description":"spending_cap"},"422":{"description":"outside_coverage / prohibited_item"}}},"get":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"List deliveries","operationId":"listDeliveries","parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"'active' or comma list"},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","default":25}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"}}}}}}}}},"/v1/deliveries/batch":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Create up to 25 deliveries","operationId":"createBatch","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"anyOf":[{"required":["quote_id"]},{"required":["pickup","dropoffs"]}],"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"pickup":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}},"dropoffs":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":[],"properties":{"address":{"type":"string","description":"Street address; geocoded server-side if lat/lng omitted"},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"},"window_start":{"type":"string","format":"date-time"},"window_end":{"type":"string","format":"date-time"},"proof_required":{"type":"array","items":{"type":"string","enum":["photo","signature","recipient_name","otp"]}}}}},"service":{"type":"string","enum":["auto","local","intercity"],"default":"auto","description":"auto picks intercity when the drop-off is in a neighbouring launch city: same-day, one dedicated driver, up to 160 km by road. Longer trips are refused (too_far)."},"speed":{"type":"string","enum":["same_day","express","standard","shared"],"default":"same_day","description":"Intercity only. Intercity is always same_day; express, standard and shared are accepted from older integrations and mean same_day."},"items":{"type":"array","items":{"type":"object","required":["description"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","default":1},"size_class":{"type":"string","enum":["S","M","L","XL"],"default":"M","description":"S envelope/bag · M shoebox–backpack · L suitcase · XL bulky parcel (courier weight limits still apply)"},"weight_kg":{"type":"number","exclusiveMinimum":0,"maximum":20,"description":"Weight per package; 200 kg total courier limit"},"length_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"width_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"height_cm":{"type":"number","exclusiveMinimum":0,"maximum":1000},"value_cents":{"type":"integer"},"category":{"type":"string","enum":["parcel","document","retail","food","grocery","flowers","pharmacy","keys","electronics","other"]},"fragile":{"type":"boolean"}}}},"urgency":{"type":"string","enum":["asap","today","scheduled"],"default":"asap"},"scheduled_at":{"type":"string","format":"date-time"},"vehicle_class":{"type":"string","enum":["bike","scooter","car","suv","van","truck"],"description":"Requested minimum vehicle. The API upgrades unsuitable vehicles using total weight/volume, per-package weight, package count and all three dimensions. Quote vehicle_selection returns selected_vehicle, requested_vehicle, adjusted, reasons and limits. Display the selected vehicle and quoted price before booking."},"dispatch_timeout_hours":{"type":"number","minimum":0.25,"maximum":72,"description":"Automatic driver search duration. Default ASAP 24 hours; otherwise 72 hours, capped by today or explicit pickup-window end. Funds remain held once until assignment, cancellation or expiry."},"quote_id":{"type":"string","format":"uuid","description":"Use a quote from POST /v1/quotes instead of re-sending stops"},"instructions":{"type":"string"},"contingency":{"type":"object","properties":{"if_no_answer":{"type":"string","enum":["wait_then_leave_safe","wait_then_return","call_client","leave_with_neighbour"]},"if_closed":{"type":"string","enum":["return_to_pickup","hold_and_retry","call_client"]},"max_wait_minutes":{"type":"integer"},"return_to":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string"},"idempotency_key":{"type":"string"},"webhook_url":{"type":"string","format":"uri"},"metadata":{"type":"object"},"fund":{"type":"boolean","default":true,"description":"Hold funds from the wallet and start dispatch immediately"},"dryRun":{"type":"boolean","default":false,"description":"Validate + price only"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}":{"get":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Get a delivery (id or short code)","operationId":"getDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}},"patch":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Update instructions / contingency / drop-off contact","operationId":"updateDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"instructions":{"type":"string"},"contingency":{"type":"object"},"dropoff_contact":{"type":"object"},"window_end":{"type":"string"},"metadata":{"type":"object"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/fund":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Fund from wallet and start dispatch","operationId":"fundDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"insufficient_funds"}}}},"/v1/deliveries/{id}/cancel":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Cancel (free before a driver is assigned; a cancellation fee after)","operationId":"cancelDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"409":{"description":"invalid_state (already picked up)"}}}},"/v1/deliveries/{id}/retry":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Retry dispatch after no_driver_found (funds re-held at the same price; starts a fresh search and makes previously declining drivers eligible again). GET the delivery first: dispatch_summary explains why the search failed.","operationId":"retryDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["dispatching","funded"]},"delivery":{"type":"object"}}}}}},"409":{"description":"invalid_state (not no_driver_found) or retry_state_changed"}}}},"/v1/deliveries/{id}/confirm":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Confirm a delivered job and release payment (auto after 24h)","operationId":"confirmDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/tip":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Tip the driver; reuse idempotency_key for retries","operationId":"tipDriver","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount_cents","idempotency_key"],"properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"amount_cents":{"type":"integer"},"idempotency_key":{"type":"string","minLength":8,"maxLength":100}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/rate":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Rate the driver 1–5","operationId":"rateDriver","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stars"],"properties":{"stars":{"type":"integer"},"comment":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/dispute":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Open a dispute (funds stay held)","operationId":"openDispute","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"},"evidence":{"type":"array","items":{"type":"string","format":"uri"}}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/return":{"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Create the reverse leg (return to pickup)","operationId":"createReturn","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/track":{"get":{"tags":["Tracking"],"security":[{"ApiKeyAuth":[]}],"summary":"Live status, ETA, driver position","operationId":"trackDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/events":{"get":{"tags":["Tracking"],"security":[{"ApiKeyAuth":[]}],"summary":"Event timeline; add ?stream=1 for SSE","operationId":"deliveryEvents","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stream","in":"query","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/stops/{stop}/code":{"post":{"tags":["Tracking"],"security":[{"ApiKeyAuth":[]}],"summary":"Generate or replace a private six-digit recipient code for an OTP-required stop","operationId":"createRecipientCode","description":"Share the returned code privately with the recipient. Expires after seven days, locks after five attempts, and is consumed once at handover. Never send it to the driver. The response must not be cached.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"stop","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"expires_in_hours":{"type":"integer"}}}}}},"422":{"description":"Stop does not require a code"}}}},"/v1/deliveries/{id}/proof":{"get":{"tags":["Tracking"],"security":[{"ApiKeyAuth":[]}],"summary":"Proof of delivery (signed photo URLs, signature, recipient)","operationId":"getProof","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/deliveries/{id}/messages":{"get":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Messages with the driver","operationId":"getMessages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Deliveries"],"security":[{"ApiKeyAuth":[]}],"summary":"Message the driver","operationId":"sendMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/account":{"get":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"summary":"Account, balance, capabilities","operationId":"getAccount","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/account/controls":{"patch":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"summary":"Spending caps","operationId":"setSpendingControls","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"spending_cap_per_delivery_cents":{"type":"integer","nullable":true},"daily_cap_cents":{"type":"integer","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/wallet":{"get":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Balance + recent ledger","operationId":"getWallet","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/wallet/bridge":{"get":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Bridge funding methods, verification and settlement history for the selected workspace (live admin key)","operationId":"bridgeFundingStatus","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Administrator key and verified email required"},"409":{"description":"Sandbox funding is not allowed"}}}},"/v1/wallet/bridge/verify":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Start identity or business verification for bank and crypto funding","operationId":"bridgeFundingVerify","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","legal_name"],"properties":{"type":{"type":"string","enum":["individual","business"]},"legal_name":{"type":"string","minLength":2,"maxLength":150}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"409":{"description":"Complete verification already started in another workspace"},"503":{"description":"Provider unavailable"}}}},"/v1/wallet/bridge/refresh":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Refresh Bridge verification and currency-specific banking eligibility","operationId":"bridgeFundingRefresh","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/wallet/bridge/deposits":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Prepare bank or crypto deposit instructions; balance credits only after verified settlement","operationId":"bridgeCreateFunding","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["request_id","amount_cents","method"],"properties":{"from_address":{"type":"string","description":"Required for crypto: wallet you control on Base (USDC) or Ethereum (USDT); also the return destination"},"request_id":{"type":"string","format":"uuid","description":"Retain on retries; never reuse with changed details"},"amount_cents":{"type":"integer","minimum":2000,"maximum":500000},"method":{"type":"string","enum":["bank","usdc","usdt"],"description":"Bank in workspace currency (GBP/USD); USDC Base and USDT Ethereum only for USD workspaces"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Request saved; poll GET /v1/wallet/bridge for instructions and credited_at"},"409":{"description":"Verification required, idempotency mismatch or request in progress"},"422":{"description":"Unsupported country/currency or invalid payment input"},"503":{"description":"Live funding unavailable"}}}},"/v1/wallet/bridge/deposits/{id}/cancel":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"operationId":"bridgeCancelFunding","summary":"Cancel unused deposit instructions before funds arrive","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"409":{"description":"Payment is already processing or instructions are not ready"}}}},"/v1/wallet/deposit":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Card deposit via Stripe Checkout (returns a URL for a human to pay)","operationId":"createDeposit","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount_cents"],"properties":{"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"amount_cents":{"type":"integer","minimum":500,"maximum":1000000},"success_url":{"type":"string","description":"https; {CHECKOUT_SESSION_ID} is appended as session_id when absent"},"cancel_url":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deposit_id":{"type":"string"},"checkout_url":{"type":"string"},"expires_at":{"type":"string"}}}}}},"501":{"description":"deposits_not_configured"}}}},"/v1/wallet/deposits":{"get":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Card top-ups for the selected workspace with status, invoice and receipt links","operationId":"listDeposits","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"card_deposits":{"type":"boolean"},"deposits":{"type":"array","items":{"$ref":"#/components/schemas/Deposit"}}}}}}}}}},"/v1/wallet/deposits/{id}":{"get":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"One card top-up (open | paid | credited | expired | failed | refunded); settles it from Stripe if the webhook has not arrived yet","operationId":"getDeposit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deposit":{"$ref":"#/components/schemas/Deposit"},"wallet":{"type":"object"}}}}}},"404":{"description":"not_found"}}}},"/v1/x402/wallet/deposit":{"post":{"tags":["Wallet"],"security":[{"ApiKeyAuth":[]}],"summary":"Fund a USD country workspace via USDC on Base; other currencies rejected","operationId":"x402Deposit","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amountCents":{"type":"integer"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment requirements (x402 v2)"},"404":{"description":"x402_not_enrolled"}}}},"/oauth/register":{"post":{"tags":["OAuth"],"summary":"Register an OAuth client (RFC 7591, no auth)","operationId":"oauthRegister","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["redirect_uris"],"properties":{"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_post"]}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/oauth/token":{"post":{"tags":["OAuth"],"summary":"Exchange an authorization code (PKCE S256) or rotate a refresh token","operationId":"oauthToken","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token"]},"code":{"type":"string"},"code_verifier":{"type":"string"},"redirect_uri":{"type":"string"},"refresh_token":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"refresh_token":{"type":"string"},"scope":{"type":"string"}}}}}}}}},"/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke an access or refresh token (RFC 7009)","operationId":"oauthRevoke","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/oauth/connections":{"get":{"tags":["OAuth"],"security":[{"ApiKeyAuth":[]}],"summary":"Apps connected to this account via OAuth","operationId":"listOAuthConnections","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/oauth/connections/{id}":{"delete":{"tags":["OAuth"],"security":[{"ApiKeyAuth":[]}],"summary":"Disconnect an app (revokes its tokens)","operationId":"revokeOAuthConnection","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/api-keys":{"get":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"summary":"List keys","operationId":"listApiKeys","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"summary":"Create key (max 10)","operationId":"createApiKey","responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/api-keys/{id}":{"delete":{"tags":["Account"],"security":[{"ApiKeyAuth":[]}],"summary":"Revoke key","operationId":"revokeApiKey","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"summary":"List webhooks","operationId":"listWebhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"summary":"Register a webhook (HMAC-signed)","operationId":"createWebhook","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"summary":"Remove webhook","operationId":"deleteWebhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/events/stream":{"get":{"tags":["Tracking"],"security":[{"ApiKeyAuth":[]}],"summary":"SSE feed of every event on your account","operationId":"accountStream","responses":{"200":{"description":"text/event-stream"}}}},"/v1/shopify/shops":{"get":{"tags":["Shopify"],"security":[{"ApiKeyAuth":[]}],"summary":"Shopify shops connected to this account","operationId":"listShopifyShops","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"shops":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shopify/orders":{"get":{"tags":["Shopify"],"security":[{"ApiKeyAuth":[]}],"summary":"Shopify orders seen by the app with their delivery status","operationId":"listShopifyOrders","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","skipped","booked","needs_funds","failed","cancelled"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/shopify/orders/{ref}/book":{"post":{"tags":["Shopify"],"security":[{"ApiKeyAuth":[]}],"summary":"Book a delivery for a Shopify order (by order name like #1001, order id, or our row id); fetches the order from Shopify if needed","operationId":"bookShopifyOrder","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Ignore the shop's radius / size limits"},"shop":{"type":"string","description":"myshopify domain when several shops are connected"}}}}}},"responses":{"200":{"description":"Not booked — see order.status (skipped / needs_funds / failed) and order.last_error"},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object"},"delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}},"/v1/{platform}/stores":{"get":{"tags":["Store connectors"],"security":[{"ApiKeyAuth":[]}],"summary":"WooCommerce / BigCommerce / Wix / Squarespace stores connected to this account","operationId":"listStores","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","enum":["woocommerce","bigcommerce","wix","squarespace"]},"description":"Store platform of the connector"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"stores":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/{platform}/orders":{"get":{"tags":["Store connectors"],"security":[{"ApiKeyAuth":[]}],"summary":"Orders the connector has seen on the platform, with their delivery status","operationId":"listStoreOrders","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","enum":["woocommerce","bigcommerce","wix","squarespace"]},"description":"Store platform of the connector"},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","skipped","booked","needs_funds","failed","cancelled"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/{platform}/orders/{ref}/book":{"post":{"tags":["Store connectors"],"security":[{"ApiKeyAuth":[]}],"summary":"Book a delivery for a store order (by order number like #1001, the platform's order id, or our row id); fetches the order from the platform if needed","operationId":"bookStoreOrder","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","enum":["woocommerce","bigcommerce","wix","squarespace"]},"description":"Store platform of the connector"},{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Ignore the store's radius / size limits"},"store":{"type":"string","description":"Store id, URL or key when several stores of that platform are connected"}}}}}},"responses":{"200":{"description":"Not booked — see order.status (skipped / needs_funds / failed) and order.last_error"},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object"},"delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}},"/v1/{platform}/orders/{ref}/return":{"post":{"tags":["Store connectors"],"security":[{"ApiKeyAuth":[]}],"summary":"Book the return leg (drop-off back to the store) for a delivered store order","operationId":"returnStoreOrder","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","enum":["woocommerce","bigcommerce","wix","squarespace"]},"description":"Store platform of the connector"},{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object"},"delivery":{"type":"object","properties":{"route_planned":{"type":["object","null"],"description":"Route used for pricing, reused at booking. Traffic-aware routing where available, with planned-route or estimated fallback. Source, departure time and traffic metadata distinguish predictions from live observations. Accepted price stays fixed; ETA fields refresh separately. Legacy deliveries may be null.","properties":{"coordinates":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"description":"GeoJSON [longitude, latitude] pairs in stop order"},"distance_m":{"type":"integer"},"duration_s":{"type":"integer"},"source":{"type":"string","enum":["tomtom","osrm","estimate"]},"computed_at":{"type":"string","format":"date-time"}}},"workspace_id":{"type":"string","format":"uuid","description":"Country workspace owned by this account. Quotes/bookings infer it from pickup when omitted; money endpoints default to the original workspace. Never converts currency."},"country_code":{"type":"string"},"id":{"type":"string"},"short_code":{"type":"string","example":"RD-7K2P9QX"},"status":{"type":"string","enum":["quoted","pending_funding","funded","dispatching","assigned","en_route_pickup","at_pickup","picked_up","en_route_dropoff","at_dropoff","delivered","confirmed","paid","no_driver_found","cancelled","failed","returned","disputed"]},"next_action":{"type":"string"},"currency":{"type":"string"},"price_cents":{"type":"integer"},"tip_cents":{"type":"integer"},"eta_pickup_at":{"type":"string","format":"date-time","nullable":true},"eta_dropoff_at":{"type":"string","format":"date-time","nullable":true},"stops":{"type":"array","items":{"type":"object"}},"driver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"first_name":{"type":"string"},"rating":{"type":"number"},"jobs_completed":{"type":"integer"},"vehicle_class":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"proof":{"type":"object"},"tracking_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}},"/v1/track/{code}":{"get":{"tags":["Tracking"],"summary":"Public recipient tracking by short code","operationId":"publicTrack","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}