{"openapi":"3.1.0","info":{"title":"Connections Orders plane","version":"0.1.0","description":"Every order a seller has, from the store (Pay) and the connected marketplaces (Ship), read with the member's own AEGIS bearer. Holds no order data."},"servers":[{"url":"https://orders.connectionsapi.com"}],"components":{"securitySchemes":{"memberSession":{"type":"http","scheme":"bearer","description":"The member's Connections session access token, exactly as this product's app sends it. Only operations that declare this scheme accept one.","x-connections-credential":"member-session"},"cnxKey":{"type":"http","scheme":"bearer","description":"A cnx_live_ key minted in Studio. It acts as the member who minted it, within its scopes.","x-connections-credential":"connections-key"}}},"paths":{"/health":{"get":{"summary":"Liveness.","responses":{"200":{"description":"{ ok: true }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orders":{"get":{"operationId":"orders.by_owner","summary":"The seller's orders (store plus enabled marketplaces), with which homes answered, the to-ship numbers and the next steps. Pay failing is a 502; Ship failing leaves the store's orders with ship ok:false.","x-required-scope":"pay:read","security":[{"cnxKey":[]},{"memberSession":[]}],"parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string"},"description":"The workspace the orders were sold under."},{"name":"account","in":"query","required":false,"schema":{"type":"string"},"description":"The connected store account; used when no company is named."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unfulfilled"]}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["only"]}},{"name":"fulfillment","in":"query","required":false,"schema":{"type":"string","enum":["shipped"]}},{"name":"product","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["store","amazon","etsy"]}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ orders, complete (false: Pay had more orders than were read), homes: [{ home: 'pay' | 'ship', ok }], summary: { toShip, overdue, dueToday, bySource }, nextSteps }","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"{ error: 'owner_required' | 'invalid_source' | 'invalid_date', field? }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"{ error: 'unauthorized' }","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"{ error: 'forbidden', homes }","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"{ error: 'pay_unavailable', homes }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orders/tools/list":{"get":{"operationId":"orders_list","x-connections-principals":["assistant"],"summary":"List my orders and what still needs shipping, from every place I sell","description":"List a seller's orders across every sales channel: the store's own orders (Pay) and the Amazon and Etsy orders (Ship), in the same order the Orders screen shows. Each row says where it came from, whether it still needs shipping, and possibleDuplicate (the other order of the same buyer and basket placed minutes apart among the orders read, or null). Filter to shipped orders, one product, one place (store, amazon or etsy), a date window (since, until), or one order by id (its Connections id or the Amazon/Etsy order number the seller reads off the marketplace). Answers the orders, complete (false means the seller has more orders than were read, so a count or a filtered answer is partial), a per-home ok flag (a home that is down does not blank the list), a summary (to ship, overdue, due today, by source) and the next steps. Call it when the member asks what orders they have, what needs shipping, or what is late.","x-required-scope":"pay:read","security":[{"cnxKey":[]},{"memberSession":[]}],"x-agent-tool":"orders__orders_list","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string","description":"The workspace's id, exactly as returned by list_my_companies. Omit it when the member has one workspace; with several, the tool answers company_required with the choices."}},{"name":"account","in":"query","required":false,"schema":{"type":"string","description":"A Stripe account id (acct_...) the store sells on. Normally omit it and use company_id; with neither, the member's only workspace is read."}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unfulfilled"],"description":"unfulfilled: only orders that still need shipping."}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["only"],"description":"only: the archived orders instead of the live ones."}},{"name":"fulfillment","in":"query","required":false,"schema":{"type":"string","enum":["shipped"],"description":"shipped: only orders already shipped."}},{"name":"product","in":"query","required":false,"schema":{"type":"string","description":"Only orders that sold this product: its product key, Stripe price id or Stripe product id, as an order line shows it."}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["store","amazon","etsy"],"description":"Only orders from this place."}},{"name":"since","in":"query","required":false,"schema":{"type":"string","description":"Only orders placed at or after this ISO time."}},{"name":"until","in":"query","required":false,"schema":{"type":"string","description":"Only orders placed before this ISO time."}},{"name":"id","in":"query","required":false,"schema":{"type":"string","description":"One order: its Connections id (po_..., amazon:..., etsy:...) or the Amazon or Etsy order number."}}],"responses":{"200":{"description":"{ data: the tool's answer, with homes: [{ home: 'pay' | 'ship', ok }] }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"{ error: 'unauthorized' }","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"{ error: 'forbidden', homes }","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"{ error: 'pay_unavailable', homes }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orders/tools/next-steps":{"get":{"operationId":"orders_next_steps","x-connections-principals":["assistant"],"summary":"What to do next about my orders: what to ship first and what is late","description":"What the seller should do about their orders next, in order: the summary (to ship, overdue, due today, by source) and the next steps the Orders screen leads with, each with its worth. Call it when the member asks what to do next, or what is urgent about their orders.","x-required-scope":"pay:read","security":[{"cnxKey":[]},{"memberSession":[]}],"x-agent-tool":"orders__orders_next_steps","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string","description":"The workspace's id, exactly as returned by list_my_companies. Omit it when the member has one workspace; with several, the tool answers company_required with the choices."}},{"name":"account","in":"query","required":false,"schema":{"type":"string","description":"A Stripe account id (acct_...) the store sells on. Normally omit it and use company_id; with neither, the member's only workspace is read."}}],"responses":{"200":{"description":"{ data: the tool's answer, with homes: [{ home: 'pay' | 'ship', ok }] }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"{ error: 'unauthorized' }","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"{ error: 'forbidden', homes }","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"{ error: 'pay_unavailable', homes }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orders/tools/sales":{"get":{"operationId":"orders_sales","x-connections-principals":["assistant"],"summary":"What sold today, this week, last week or this month: orders and sales dollars, as figures","description":"What SOLD in a period, as figures: the store's orders and sales dollars, refunds and cancellations (the Amazon and Etsy orders as counts), with the period before it. Call it when the member asks what sold, how much they sold or made, their sales, revenue or order count for today, this week, last week or this month. It answers a figure even when nothing sold ($0.00, 0 orders). Needs no dates and no workspace id for a member with one workspace.","x-required-scope":"pay:read","security":[{"cnxKey":[]},{"memberSession":[]}],"x-agent-tool":"orders__orders_sales","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string","description":"The workspace's id, exactly as returned by list_my_companies. Omit it when the member has one workspace; with several, the tool answers company_required with the choices."}},{"name":"account","in":"query","required":false,"schema":{"type":"string","description":"A Stripe account id (acct_...) the store sells on. Normally omit it and use company_id; with neither, the member's only workspace is read."}},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["today","this_week","last_week","this_month"],"description":"The period to total (default this_week). Weeks start on Monday, UTC."}}],"responses":{"200":{"description":"{ data: the tool's answer, with homes: [{ home: 'pay' | 'ship', ok }] }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"{ error: 'unauthorized' }","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"{ error: 'forbidden', homes }","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"{ error: 'pay_unavailable', homes }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orders/summary":{"get":{"operationId":"orders.summary","summary":"Orders, sales, refunds and cancellations for a period and the one before it, by source. Marketplaces give order and cancellation counts only.","x-required-scope":"pay:read","security":[{"cnxKey":[]},{"memberSession":[]}],"parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string"},"description":"The workspace the orders were sold under."},{"name":"account","in":"query","required":false,"schema":{"type":"string"},"description":"The connected store account; used when no company is named."},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"prevFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"prevTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"{ period: { store, marketplaces }, previous: { store, marketplaces }, homes }","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"{ error: 'owner_required' | 'invalid_period' }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"{ error: 'unauthorized' }","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"{ error: 'insufficient_scope' | 'not_a_member' | 'forbidden' }","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"{ error: 'pay_unavailable', homes }","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}