Skip to main content
POST
Create order action

Authorizations

Authorization
string
header
required

An InsightChain API key: ic_live_... for your organization, ic_test_... for its sandbox

Body

application/json
action
enum<string>
required
Available options:
get_policies,
propose,
edit_quantity,
cancel,
approve,
reject,
execute,
verify
recommendation_id
string<uuid>

The recommendation id. Required when action is propose

order_id
string<uuid>

The order id. Required when action is edit_quantity, approve, reject, cancel, execute or verify

action_request_id
string<uuid>
deprecated

Deprecated: use order_id

connection_id
string<uuid>

propose: the ERP connection to write to (GET /v1/connections)

idempotency_key
string

propose: your own key for this proposal. Proposing again with the same key returns the order made the first time; left out, a recommendation is proposed once

quantity
number

The planner's quantity, above 0, at most three decimals, within the recommendation's own constraints. Required when action is edit_quantity; optional with propose, and then quantity_reason is required

Required range: 0 <= x <= 10000000
quantity_reason
string

propose: why the quantity differs from the recommended one. Required when propose carries quantity

Required string length: 3 - 500
reason
string

Why the quantity changes. Required when action is edit_quantity

Required string length: 3 - 500

Response

OK

Depends on action. get_policies: policies, kinds, writable_kinds, connections, writeback_feature and compliance_gate. propose: order and decision, or order and idempotent for an order that already existed. edit_quantity, approve, reject, cancel, execute, verify: order

request_id
string
required

Quote this when asking about the request; also the X-Request-ID header

order
object

Every action but get_policies: the order, its status after the action, and what the action adds

decision
object

propose, for a new order: what the execution rule decided

idempotent
any

propose: the order already existed (same idempotency_key, by default one per recommendation) and is returned as it is

quantity_applied
any

propose, with idempotent: the quantity sent was not applied to the existing order; change it with edit_quantity

policies
object[]

get_policies: the rule in force per order kind; a kind without one waits for a person

kinds
enum<string>[]

get_policies: every order kind

Available options:
stock_transfer,
purchase_order,
expedite,
markdown
writable_kinds
enum<string>[]

get_policies: kinds at least one connection can write to the ERP

Available options:
stock_transfer,
purchase_order,
expedite,
markdown
connections
object[]

get_policies: connections that can write orders

writeback_feature
boolean

get_policies: whether ERP write-back is turned on for the organization

compliance_gate
object

get_policies: the product compliance check on orders