API reference
Orders
Buying and booking: flight search, quotes and bookings, orders finished on a store site, and delivery progress.
- Operations
- 13
- Base path
https://os.one.ml/api/v1/orders- Scopes
orders:readorders:write- API keys
- —
- SDK
genesis.call('orders_listOrders', …)· helpers undergenesis.orders- MCP
- 10 tools; the other 3 through
genesis_call
Operations
| Operation | Endpoint | API key |
|---|---|---|
| List orders, newest first | GET | — |
| Show one order and its card | GET/{order_id} | — |
| The site page a ready-to-buy order finishes on | GET/{order_id}/handoff | — |
| Record that the person placed the order, matched to the site's confirmation | POST/{order_id}/placed | — |
| Record a delivery's progress (on the way, delivered) | POST/{order_id}/progress | — |
| Record an order the person finishes on a site (dinner, tickets, groceries) | POST/external | — |
| Search flights (no hold, no charge) | POST/flights/search | — |
| Price one offer fresh and open its purchase (the approval card's sentence, lines and limit) | POST/quotes | — |
| Show a quote as it stands | GET/quotes/{quote_id} | — |
| Book the quoted offer (charges the person's card once, then books) | POST/quotes/{quote_id}/book | — |
| Where the person said they live | GET/trips/residence | — |
| Set where the person lives | PUT/trips/residence | — |
| Remove where the person lives | DELETE/trips/residence | — |
Orders
List orders, newest first
GET/v1/orders
Scope orders:read. A person sees their own orders; an org key sees the organization's.
Parameters
limitquery · integerbeforequery · stringstatequery · "booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"
Responses
- 200Orders
Response fields
ordersobject[]requiredorders[].[].idstringrequiredorders[].[].quote_idstring | nullorders[].[].kind"flight" | "delivery" | "tickets" | "groceries"requiredorders[].[].state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorders[].[].titlestringorders[].[].whenstringorders[].[].sitestringorders[].[].confirmationstringorders[].[].total_minorintegerorders[].[].currencystringorders[].[].booked_atstring (date-time)orders[].[].created_atstring (date-time)orders[].[].changestringorders[].[].placedobjectorders[].[].placed.by"person"orders[].[].placed.matched"boxes_email" | "order_page"orders[].[].cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).orders[].[].card.idstringrequiredorders[].[].card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorders[].[].card.titlestringrequiredorders[].[].card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorders[].[].card.whenstringorders[].[].card.statusstringrequiredorders[].[].card.changestringorders[].[].card.linesobject[]requiredorders[].[].card.lines[].[].termstringrequiredmax length 20
orders[].[].card.lines[].[].valuestringrequiredmax length 80
orders[].[].card.stepsobject[]orders[].[].card.steps[].[].titlestringrequiredmax length 24
orders[].[].card.steps[].[].donebooleanrequiredorders[].[].card.actions"change" | "cancel" | "buy-on-site"[]requiredorders[].[].card.sitestringnextstring | nullrequired
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/orders" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_listOrders'){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_listOrders",
"arguments": {}
}
}{order id}
Show one order and its card
GET/v1/orders/{order_id}
Scope orders:read.
Parameters
order_idpath · stringrequired
Responses
- 200The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/orders/$ORDER_ID" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_getOrder', {
order_id: '<order_id>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_getOrder",
"arguments": {
"order_id": "<order_id>"
}
}
}The site page a ready-to-buy order finishes on
GET/v1/orders/{order_id}/handoff
Scope orders:read. 409 no_handoff when the order has none (every flight).
Parameters
order_idpath · stringrequired
Responses
- 200The signed site page
Response fields
urlstring (uri)requiredsitestringrequiredexpires_atstring (date-time)required
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/orders/$ORDER_ID/handoff" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_getHandoff', {
order_id: '<order_id>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_getHandoff",
"arguments": {
"order_id": "<order_id>"
}
}
}Record that the person placed the order, matched to the site's confirmation
POST/v1/orders/{order_id}/placed
Scope orders:write. Needs Idempotency-Key. by is always the person (One never places an order); the event carries placed: {by: "person", matched}.
Parameters
order_idpath · stringrequiredIdempotency-Keyheader · stringrequired
Request body application/json
matched"boxes_email" | "order_page"requiredstatusstringmax length 60
whenstringmax length 80
total_minorintegermin 0
Responses
- 200The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/$ORDER_ID/placed" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"matched": "boxes_email"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('orders_markPlaced', {
order_id: '<order_id>',
body: {
matched: 'boxes_email',
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_markPlaced",
"arguments": {
"order_id": "<order_id>",
"body": {
"matched": "boxes_email"
},
"idempotency_key": "<a stable key per change>"
}
}
}Record a delivery's progress (on the way, delivered)
POST/v1/orders/{order_id}/progress
Scope orders:write. Needs Idempotency-Key. status carries the time, never the words "On the way" again.
Parameters
order_idpath · stringrequiredIdempotency-Keyheader · stringrequired
Request body application/json
state"on-the-way" | "delivered"requiredstatusstringrequiredmax length 60
stepsobject[]steps[].[].titlestringrequiredmax length 24
steps[].[].donebooleanrequired
Responses
- 200The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/$ORDER_ID/progress" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "on-the-way",
"status": "string"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('orders_recordProgress', {
order_id: '<order_id>',
body: {
state: 'on-the-way',
status: 'string',
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_recordProgress",
"arguments": {
"order_id": "<order_id>",
"body": {
"state": "on-the-way",
"status": "string"
},
"idempotency_key": "<a stable key per change>"
}
}
}External
Record an order the person finishes on a site (dinner, tickets, groceries)
POST/v1/orders/external
Scope orders:write. Needs Idempotency-Key. No charge: the person pays on the site. The hand-off URL must be https on the site's own domain and is never shown, logged or sent in an event; GET …/handoff serves it.
Parameters
Idempotency-Keyheader · stringrequired
Request body application/json
kind"delivery" | "tickets" | "groceries"requiredsite"Uber Eats" | "Ticketmaster" | "Instacart" | "StubHub" | "SeatGeek"requiredtitlestringrequiredmax length 60
whenstringmax length 80
linesobject[]lines[].[].termstringrequiredmax length 20
lines[].[].valuestringrequiredmax length 80
total_minorintegerrequiredmin 0
currency"usd"requiredhandoff_urlstring (uri)requiredhandoff_expires_atstring (date-time)
Responses
- 200The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 201The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/external" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "delivery",
"site": "Uber Eats",
"title": "string",
"total_minor": 0,
"currency": "usd",
"handoff_url": "https://example.com"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('orders_createExternalOrder', {
body: {
kind: 'delivery',
site: 'Uber Eats',
title: 'string',
total_minor: 0,
currency: 'usd',
handoff_url: 'https://example.com',
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_createExternalOrder",
"arguments": {
"body": {
"kind": "delivery",
"site": "Uber Eats",
"title": "string",
"total_minor": 0,
"currency": "usd",
"handoff_url": "https://example.com"
},
"idempotency_key": "<a stable key per change>"
}
}
}Flights
Search flights (no hold, no charge)
POST/v1/orders/flights/search
Scope orders:read. Up to 10 offers, cheapest first, each with its total, expiry, conditions and the card's words.
Request body application/json
slicesobject[]requiredslices[].[].originstringrequiredpattern
^[A-Z]{3}$slices[].[].destinationstringrequiredpattern
^[A-Z]{3}$slices[].[].departure_datestring (date)requiredpassengersobject[]requiredpassengers[].[].type"adult" | "child" | "infant_without_seat"requiredpassengers[].[].ageintegermin 0 · max 17
cabin_class"economy" | "premium_economy" | "business" | "first"max_connections0 | 1 | 2limitintegermin 1 · max 10
Responses
- 200Offers
Response fields
offersobject[]requiredoffers[].[].offer_idstringrequiredoffers[].[].total_minorintegerrequiredoffers[].[].currencystringrequiredoffers[].[].expires_atstring (date-time)requiredoffers[].[].ownerobjectoffers[].[].owner.namestringoffers[].[].owner.iatastringoffers[].[].titlestringrequiredoffers[].[].whenstringrequiredoffers[].[].slicesobject[]offers[].[].conditionsobjectoffers[].[].conditions.refundablebooleanoffers[].[].conditions.refund_penalty_minorinteger | nulloffers[].[].conditions.changeablebooleanoffers[].[].conditions.change_penalty_minorinteger | nulloffers[].[].bagsstringoffers[].[].passenger_idsstring[]required
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 503Duffel or Pay didn't answer
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/flights/search" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slices": [
{
"origin": "string",
"destination": "string",
"departure_date": "string"
}
],
"passengers": [
{
"type": "adult"
}
]
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_searchFlights', {
body: {
slices: [
{
origin: 'string',
destination: 'string',
departure_date: 'string',
},
],
passengers: [
{
type: 'adult',
},
],
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_searchFlights",
"arguments": {
"body": {
"slices": [
{
"origin": "string",
"destination": "string",
"departure_date": "string"
}
],
"passengers": [
{
"type": "adult"
}
]
}
}
}
}Quotes
Price one offer fresh and open its purchase (the approval card's sentence, lines and limit)
POST/v1/orders/quotes
Scope orders:write. Needs Idempotency-Key. Re-reads the offer from the airline and opens a Pay purchase for exactly that total (it counts against the person's caps until it expires, at most 15 minutes). The answer carries the card in state quote under the id the order will have.
Parameters
Idempotency-Keyheader · stringrequired
Request body application/json
offer_idstringrequiredpattern
^off_[A-Za-z0-9]{8,64}$
Responses
- 200The quote
Response fields
quoteobjectrequiredquote.idstringrequiredquote.offer_idstringrequiredquote.kindstringquote.state"quoted" | "booking" | "booked" | "withdrawn" | "expired" | "failed"requiredquote.titlestringquote.whenstringquote.total_minorintegerrequiredquote.currencystringrequiredquote.total_displaystringquote.expires_atstring (date-time)requiredquote.sentencestringrequiredquote.linesobject[]requiredquote.lines[].[].termstringrequiredmax length 20
quote.lines[].[].valuestringrequiredmax length 80
quote.passenger_idsstring[]quote.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).quote.card.idstringrequiredquote.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredquote.card.titlestringrequiredquote.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredquote.card.whenstringquote.card.statusstringrequiredquote.card.changestringquote.card.linesobject[]requiredquote.card.lines[].[].termstringrequiredmax length 20
quote.card.lines[].[].valuestringrequiredmax length 80
quote.card.stepsobject[]quote.card.steps[].[].titlestringrequiredmax length 24
quote.card.steps[].[].donebooleanrequiredquote.card.actions"change" | "cancel" | "buy-on-site"[]requiredquote.card.sitestringquote.approvalobjectrequiredquote.approval.class"money"quote.approval.limit_minorintegerquote.approval.passkey_requiredbooleanquote.approval.passkey_linestring
- 201The quote
Response fields
quoteobjectrequiredquote.idstringrequiredquote.offer_idstringrequiredquote.kindstringquote.state"quoted" | "booking" | "booked" | "withdrawn" | "expired" | "failed"requiredquote.titlestringquote.whenstringquote.total_minorintegerrequiredquote.currencystringrequiredquote.total_displaystringquote.expires_atstring (date-time)requiredquote.sentencestringrequiredquote.linesobject[]requiredquote.lines[].[].termstringrequiredmax length 20
quote.lines[].[].valuestringrequiredmax length 80
quote.passenger_idsstring[]quote.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).quote.card.idstringrequiredquote.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredquote.card.titlestringrequiredquote.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredquote.card.whenstringquote.card.statusstringrequiredquote.card.changestringquote.card.linesobject[]requiredquote.card.lines[].[].termstringrequiredmax length 20
quote.card.lines[].[].valuestringrequiredmax length 80
quote.card.stepsobject[]quote.card.steps[].[].titlestringrequiredmax length 24
quote.card.steps[].[].donebooleanrequiredquote.card.actions"change" | "cancel" | "buy-on-site"[]requiredquote.card.sitestringquote.approvalobjectrequiredquote.approval.class"money"quote.approval.limit_minorintegerquote.approval.passkey_requiredbooleanquote.approval.passkey_linestring
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 503Duffel or Pay didn't answer
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/quotes" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"offer_id": "string"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('orders_createQuote', {
body: {
offer_id: 'string',
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_createQuote",
"arguments": {
"body": {
"offer_id": "string"
},
"idempotency_key": "<a stable key per change>"
}
}
}Show a quote as it stands
GET/v1/orders/quotes/{quote_id}
Scope orders:read.
Parameters
quote_idpath · stringrequired
Responses
- 200The quote
Response fields
quoteobjectrequiredquote.idstringrequiredquote.offer_idstringrequiredquote.kindstringquote.state"quoted" | "booking" | "booked" | "withdrawn" | "expired" | "failed"requiredquote.titlestringquote.whenstringquote.total_minorintegerrequiredquote.currencystringrequiredquote.total_displaystringquote.expires_atstring (date-time)requiredquote.sentencestringrequiredquote.linesobject[]requiredquote.lines[].[].termstringrequiredmax length 20
quote.lines[].[].valuestringrequiredmax length 80
quote.passenger_idsstring[]quote.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).quote.card.idstringrequiredquote.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredquote.card.titlestringrequiredquote.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredquote.card.whenstringquote.card.statusstringrequiredquote.card.changestringquote.card.linesobject[]requiredquote.card.lines[].[].termstringrequiredmax length 20
quote.card.lines[].[].valuestringrequiredmax length 80
quote.card.stepsobject[]quote.card.steps[].[].titlestringrequiredmax length 24
quote.card.steps[].[].donebooleanrequiredquote.card.actions"change" | "cancel" | "buy-on-site"[]requiredquote.card.sitestringquote.approvalobjectrequiredquote.approval.class"money"quote.approval.limit_minorintegerquote.approval.passkey_requiredbooleanquote.approval.passkey_linestring
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/orders/quotes/$QUOTE_ID" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_getQuote', {
quote_id: '<quote_id>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_getQuote",
"arguments": {
"quote_id": "<quote_id>"
}
}
}Book
Book the quoted offer (charges the person's card once, then books)
POST/v1/orders/quotes/{quote_id}/book
Scope orders:write. Needs Idempotency-Key. The body names the quoted offer and total exactly (else offer_mismatch, nothing charged) and every traveller on the offer. A moved price withdraws the quote (price_changed, with new_total_minor). A refused booking or a total that differs from the charge is refunded in the same request (booking_failed / total_mismatch, refunded: true). Traveller details go to the airline only; Orders stores none of them.
Parameters
quote_idpath · stringrequiredIdempotency-Keyheader · stringrequired
Request body application/json
offer_idstringrequiredtotal_minorintegerrequiredcurrency"usd"requiredpassengersobject[]requiredpassengers[].[].idstringrequiredpassengers[].[].title"mr" | "ms" | "mrs" | "miss" | "dr"requiredpassengers[].[].given_namestringrequiredpassengers[].[].family_namestringrequiredpassengers[].[].born_onstring (date)requiredpassengers[].[].gender"m" | "f"requiredpassengers[].[].emailstringrequiredpassengers[].[].phone_numberstringrequired
Responses
- 200The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 201The order
Response fields
orderobjectrequiredorder.idstringrequiredorder.quote_idstring | nullorder.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.state"booked" | "changed" | "cancelled" | "needs_you" | "ready_to_buy" | "placed" | "on_the_way" | "delivered"requiredorder.titlestringorder.whenstringorder.sitestringorder.confirmationstringorder.total_minorintegerorder.currencystringorder.booked_atstring (date-time)order.created_atstring (date-time)order.changestringorder.placedobjectorder.placed.by"person"order.placed.matched"boxes_email" | "order_page"order.cardobjectrequiredThe
data-orderpart One draws (one/src/lib/buys/shared.ts orderOf).order.card.idstringrequiredorder.card.kind"flight" | "delivery" | "tickets" | "groceries"requiredorder.card.titlestringrequiredorder.card.state"quote" | "booked" | "changed" | "cancelled" | "needs-you" | "ready-to-buy" | "on-the-way" | "delivered"requiredorder.card.whenstringorder.card.statusstringrequiredorder.card.changestringorder.card.linesobject[]requiredorder.card.lines[].[].termstringrequiredmax length 20
order.card.lines[].[].valuestringrequiredmax length 80
order.card.stepsobject[]order.card.steps[].[].titlestringrequiredmax length 24
order.card.steps[].[].donebooleanrequiredorder.card.actions"change" | "cancel" | "buy-on-site"[]requiredorder.card.sitestring
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 402The card was declined, needs the person, isn't saved, or didn't confirm (released)
- 403Missing scope, approval or passkey
- 404Unknown or another organization's
- 409quote_expired, quote_not_open, offer_mismatch, price_changed, offer_unavailable, spend caps, booking_failed, total_mismatch, no_handoff, idempotency_conflict, environment_not_available
- 502The refund didn't go through; the order needs a person
- 503Duffel or Pay didn't answer
- 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/orders/quotes/$QUOTE_ID/book" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"offer_id": "string",
"total_minor": 1,
"currency": "usd",
"passengers": []
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('orders_bookQuote', {
quote_id: '<quote_id>',
body: {
offer_id: 'string',
total_minor: 1,
currency: 'usd',
passengers: [],
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "orders_bookQuote",
"arguments": {
"quote_id": "<quote_id>",
"body": {
"offer_id": "string",
"total_minor": 1,
"currency": "usd",
"passengers": []
},
"idempotency_key": "<a stable key per change>"
}
}
}Trips
Where the person said they live
GET/v1/orders/trips/residence
Scope orders:read. The person of the session; residence is null until they have said. Sandbox and Live each keep their own.
Responses
- 200What is stored for the person
Response fields
residenceobject | nullrequiredupdated_atstring | null (date-time)required
- 403Missing scope, approval or passkey
- 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/orders/trips/residence" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_getResidence'){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "genesis_call",
"arguments": {
"operation": "orders_getResidence",
"arguments": {}
}
}
}Set where the person lives
PUT/v1/orders/trips/residence
Scope orders:write. The person's own session only (an API key, an agent or a job is a 403). The answer is the stored value read back. A price for a flight needs it first (409 residence_required); in a US state where travel isn't sold yet a price stays a 409 travel_unavailable_in_state. Sets and removals together are capped per person per day: past the cap a 429 residence_change_limit with retry_after_s.
Request body application/json
countrystringrequiredISO 3166 two-letter code, e.g. US pattern
^[A-Z]{2}$statestring | nullUSPS code, e.g. TX. Required when country is US; otherwise absent or null. pattern
^[A-Z]{2}$
Responses
- 200What is stored for the person
Response fields
residenceobject | nullrequiredupdated_atstring | null (date-time)required
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 429residence_change_limit, with
retry_after_s - 4xx 5xxThe error envelope.
curl -X PUT "https://os.one.ml/api/v1/orders/trips/residence" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "string"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_setResidence', {
body: {
country: 'string',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "genesis_call",
"arguments": {
"operation": "orders_setResidence",
"arguments": {
"body": {
"country": "string"
}
}
}
}
}Remove where the person lives
DELETE/v1/orders/trips/residence
Scope orders:write. The person's own session only; no body. Answers residence null whether or not one was stored. Counts toward the same daily cap as a set.
Responses
- 200What is stored for the person
Response fields
residenceobject | nullrequiredupdated_atstring | null (date-time)required
- 400A field is wrong (named, never echoed), or the Idempotency-Key is missing
- 403Missing scope, approval or passkey
- 429residence_change_limit, with
retry_after_s - 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/orders/trips/residence" \
-H "Authorization: Bearer $GENESIS_API_KEY"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('orders_removeResidence'){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "genesis_call",
"arguments": {
"operation": "orders_removeResidence",
"arguments": {}
}
}
}L1fe AI Inc. · Built from Genesis 0.3.1 and the live gateway on 2026-10-25. Support