{"openapi":"3.0.3","info":{"title":"FieldNova Business API","version":"1.0.0","description":"Book and track deliveries and rides for your business. Test keys (fn_test_...) use the sandbox: no real Partner, no money. Live keys (fn_live_...) book real orders."},"servers":[{"url":"https://fieldnova.in/api/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"Basics"},{"name":"Orders"},{"name":"Sandbox"},{"name":"Wallet"},{"name":"Company"}],"paths":{"/ping":{"get":{"tags":["Basics"],"summary":"Check your key","operationId":"getPing","description":"Returns the mode (test or live) of the key you sent.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"mode":{"type":"string","enum":["test","live"]},"company_id":{"type":"integer"}}},"example":{"ok":true,"mode":"test","company_id":12}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes":{"post":{"tags":["Orders"],"summary":"Get a price","operationId":"postQuotes","description":"Price for each drop before booking. Uses your company rate card when one is set. Sandbox prices are simulated.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderIn"},"example":{"service_id":1,"service_category_id":1,"vehicle_type_id":1,"pickup":{"address":"MG Road, Vijayawada","lat":16.5089,"lng":80.6717,"contact_name":"Front desk","contact_phone":"9876543210"},"drops":[{"address":"Benz Circle, Vijayawada","lat":16.4994,"lng":80.6566,"name":"Ravi Kumar","phone":"9123456780"}],"reference":"INV-1042","pay":"wallet"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"},"example":{"mode":"test","sandbox":true,"legs":[{"drop_index":0,"distance_km":2.4,"duration":"7 mins","amount":"69.00","rate_card":false}],"total":"69.00","rate_card":false,"available":"100000.00","shortfall":"0.00"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"post":{"tags":["Orders"],"summary":"Create an order","operationId":"postOrders","description":"Books one order per drop. Several drops = linked orders sharing route_id (one pickup, many drops). Live orders are paid from your wallet / credit (or cash if allowed) and dispatched to Partners. Test orders never reach a Partner and never move money.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Any unique string (e.g. a UUID). Retrying with the same key returns the first answer and never books twice. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderIn"},"example":{"service_id":1,"service_category_id":1,"vehicle_type_id":1,"pickup":{"address":"MG Road, Vijayawada","lat":16.5089,"lng":80.6717,"contact_name":"Front desk","contact_phone":"9876543210"},"drops":[{"address":"Benz Circle, Vijayawada","lat":16.4994,"lng":80.6566,"name":"Ravi Kumar","phone":"9123456780"}],"reference":"INV-1042","pay":"wallet"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResult"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Orders"],"summary":"List orders","operationId":"getOrders","description":"Newest first. A test key lists test orders, a live key live orders.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["active","searching","accepted","arrived","started","completed","cancelled"]}},{"name":"reference","in":"query","schema":{"type":"string"}},{"name":"batch_id","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/batch":{"post":{"tags":["Orders"],"summary":"Create many orders","operationId":"postOrdersBatch","description":"Up to 100 orders. Every order is checked first: any invalid order = nothing is booked (422 batch_invalid). Live: if the wallet cannot pay for the whole batch nothing is booked (422 business_wallet_low with the shortfall).","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Any unique string (e.g. a UUID). Retrying with the same key returns the first answer and never books twice. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/OrderIn"}}}},"example":{"orders":[{"service_id":1,"service_category_id":1,"vehicle_type_id":1,"pickup":{"address":"MG Road, Vijayawada","lat":16.5089,"lng":80.6717,"contact_name":"Front desk","contact_phone":"9876543210"},"drops":[{"address":"Benz Circle, Vijayawada","lat":16.4994,"lng":80.6566,"name":"Ravi Kumar","phone":"9123456780"}],"reference":"INV-1042","pay":"wallet"},{"service_id":1,"service_category_id":1,"vehicle_type_id":1,"pickup":{"address":"MG Road, Vijayawada","lat":16.5089,"lng":80.6717,"contact_name":"Front desk","contact_phone":"9876543210"},"drops":[{"address":"Benz Circle, Vijayawada","lat":16.4994,"lng":80.6566,"name":"Ravi Kumar","phone":"9123456780"}],"reference":"INV-1043","pay":"wallet"}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"batch_id":{"type":"string"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"failed":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"tags":["Orders"],"summary":"Order status","operationId":"getOrdersId","description":"Status, Partner, live Partner location and ETA.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ord_test_8fK2mQ9xLp3RtV7aB1cD"},"description":"Order id from create (ord_test_... or ord_live_...)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/tracking":{"get":{"tags":["Orders"],"summary":"Live Partner location + ETA","operationId":"getOrdersIdTracking","description":"Light-weight; poll every 10-15 seconds while the order is active.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ord_test_8fK2mQ9xLp3RtV7aB1cD"},"description":"Order id from create (ord_test_... or ord_live_...)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tracking"},"example":{"id":"ord_test_8fK2mQ9xLp3RtV7aB1cD","status":"accepted","partner":{"name":"Test Partner","phone":"9000000000","vehicle_no":"TEST 0000"},"partner_location":{"lat":16.5109,"lng":80.6737,"at":"2026-10-07T10:15:02.000Z"},"eta_minutes":4,"eta_to":"pickup"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/cancel":{"post":{"tags":["Orders"],"summary":"Cancel an order","operationId":"postOrdersIdCancel","description":"A cancellation fee may apply after the Partner has arrived (returned as fee).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ord_test_8fK2mQ9xLp3RtV7aB1cD"},"description":"Order id from create (ord_test_... or ord_live_...)"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Any unique string (e.g. a UUID). Retrying with the same key returns the first answer and never books twice. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":191}}},"example":{"reason":"Customer not available"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"fee":{"type":"string","example":"0.00"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/orders/{id}/advance":{"post":{"tags":["Sandbox"],"summary":"Move a test order one step","operationId":"postSandboxOrdersIdAdvance","description":"Test keys only. searching -> accepted -> arrived -> started -> completed (each step also sends its webhook). Test orders also move by themselves within about 2 minutes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ord_test_8fK2mQ9xLp3RtV7aB1cD"},"description":"Order id from create (ord_test_... or ord_live_...)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-test-only":true}},"/wallet":{"get":{"tags":["Wallet"],"summary":"Wallet balance","operationId":"getWallet","description":"available = balance - amounts held for orders in progress. Sandbox shows a fixed test balance.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"},"example":{"mode":"live","balance":"25000.00","held":"420.00","available":"24580.00","low_balance_alert":"5000.00","currency":"INR"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/wallet/statements":{"get":{"tags":["Wallet"],"summary":"Wallet statement","operationId":"getWalletStatements","description":"Every money step: top-ups, order charges, refunds, cancellation fees, adjustments.","parameters":[{"name":"month","in":"query","schema":{"type":"string","example":"2026-10"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerLine"}},"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices":{"get":{"tags":["Wallet"],"summary":"Monthly invoices","operationId":"getInvoices","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"orders":{"type":"integer"},"amount":{"type":"string"},"pdf":{"type":"string"}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{month}":{"get":{"tags":["Wallet"],"summary":"Download an invoice (PDF)","operationId":"getInvoicesMonth","parameters":[{"name":"month","in":"path","required":true,"schema":{"type":"string","example":"2026-09"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/employees":{"get":{"tags":["Company"],"summary":"Employees","operationId":"getEmployees","description":"People you can book for (for.type = \"employee\").","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string","nullable":true},"cost_centre_id":{"type":"integer","nullable":true},"status":{"type":"string"}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cost-centres":{"get":{"tags":["Company"],"summary":"Cost centres","operationId":"getCostCentres","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"},"status":{"type":"integer"}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"tags":["Basics"],"summary":"This specification","operationId":"getOpenapiJson","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer fn_test_... (sandbox) or fn_live_..."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"validation_failed"},"message":{"type":"string"},"details":{}}},"request_id":{"type":"string"}}},"OrderIn":{"type":"object","required":["service_id","vehicle_type_id","pickup","drops"],"properties":{"service_id":{"type":"integer","description":"Parcel / delivery, ride, rental or outstation service of the zone"},"service_category_id":{"type":"integer"},"vehicle_type_id":{"type":"integer"},"pickup":{"type":"object","required":["address","lat","lng"],"properties":{"address":{"type":"string","maxLength":500},"lat":{"type":"number"},"lng":{"type":"number"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"}}},"drops":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["address","lat","lng"],"properties":{"address":{"type":"string","maxLength":500},"lat":{"type":"number"},"lng":{"type":"number"},"name":{"type":"string","description":"Recipient name"},"phone":{"type":"string","description":"Recipient phone (gets the delivery PIN by SMS)"},"country_code":{"type":"string","example":"91"},"note":{"type":"string"}}}},"for":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["employee"]},"employee_id":{"type":"integer"}}},{"type":"object","properties":{"type":{"type":"string","enum":["anyone"]},"name":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"}}}],"description":"Who the order is for (as your company settings allow)"},"pay":{"type":"string","enum":["wallet","credit","cash"],"default":"wallet"},"start_time":{"type":"string","example":"2026-10-08 09:30","description":"Schedule for later (India time). Omit = now."},"hourly_package_id":{"type":"integer","description":"Rental (hourly) package"},"weight":{"type":"number","description":"kg"},"description":{"type":"string"},"cost_centre_id":{"type":"integer"},"branch_id":{"type":"integer"},"reference":{"type":"string","maxLength":60,"description":"Your own reference (searchable)"}}},"Quote":{"type":"object","properties":{"mode":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"drop_index":{"type":"integer"},"distance_km":{"type":"number"},"duration":{"type":"string"},"amount":{"type":"string"},"rate_card":{"type":"boolean"}}}},"total":{"type":"string"},"rate_card":{"type":"boolean"},"available":{"type":"string"},"shortfall":{"type":"string"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string","enum":["test","live"]},"reference":{"type":"string","nullable":true},"ride_number":{"type":"string","nullable":true},"status":{"type":"string","enum":["searching","scheduled","accepted","arrived","started","completed","cancelled"]},"route_id":{"type":"string","nullable":true},"batch_id":{"type":"string","nullable":true},"amount":{"type":"string","example":"69.00"},"pay_mode":{"type":"string"},"pickup":{},"drop":{},"recipient":{"type":"object","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"phone":{"type":"string"},"vehicle_no":{"type":"string"}}},"partner_location":{"$ref":"#/components/schemas/Location"},"eta_minutes":{"type":"integer","nullable":true},"eta_to":{"type":"string","enum":["pickup","drop"],"nullable":true},"created_at":{"type":"string"}}},"CreateResult":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"route_id":{"type":"string","nullable":true},"total":{"type":"string"}}},"Location":{"type":"object","nullable":true,"properties":{"lat":{"type":"number"},"lng":{"type":"number"},"at":{"type":"string"}}},"Tracking":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"partner":{"type":"object","nullable":true},"partner_location":{"$ref":"#/components/schemas/Location"},"eta_minutes":{"type":"integer","nullable":true},"eta_to":{"type":"string","nullable":true}}},"Wallet":{"type":"object","properties":{"mode":{"type":"string"},"balance":{"type":"string"},"held":{"type":"string"},"available":{"type":"string"},"low_balance_alert":{"type":"string","nullable":true},"currency":{"type":"string"}}},"LedgerLine":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["topup","order_charge","refund","cancel_fee","adjustment"]},"amount":{"type":"string"},"balance_after":{"type":"string"},"ride_number":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"at":{"type":"string"}}},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","example":"evt_..."},"type":{"type":"string","enum":["order.accepted","order.arrived","order.started","order.completed","order.cancelled","wallet.low_balance"]},"mode":{"type":"string"},"created_at":{"type":"string"},"data":{"type":"object"}}}}},"x-webhooks":{"events":["order.accepted","order.arrived","order.started","order.completed","order.cancelled","wallet.low_balance"],"signature":"FieldNova-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>","retries_seconds":[30,120,600,1800,3600,10800,21600,43200]}}