Skip to content

Submit an order / advance its state

Request

Moves an order to the next step of its workflow (or to order_state_id when given), reserving inventory and sending the step's notifications. Orders created through POST /v2/order are submitted automatically; use this for orders created with remainInPreliminary: true or by POST /v1/order.

Accepts user session headers only.

Security
UserGuid and UserToken and SupplierGuid
Headers
vendorGuidstring, (uuid)

GUID of the customer (vendor) to act for. With API key authentication this selects the customer context; with user session headers it is the vendor the user is acting on behalf of.

Bodyapplication/jsonrequired
orderGuidstring, (uuid)required
order_state_idinteger

Target workflow state. Defaults to the next step in the order's workflow.

stateChangeNotestring

Note shown to the customer with the state change.

stateChangeInternalNotestring
skipInventoryCheckboolean
allowPartialFulfillmentboolean

When true, reserve what is available and auto-create a backorder for the rest. When false, backorder the whole order if anything is short. When omitted, allocate what is available without creating a backorder.

useHeldInventoryboolean

Draw from inventory held for backorders before on-hand stock.

skipPendingItemsCheckboolean
pendingItemsActionstring

What to do with pending backorder lines when moving into a release state.

Enum:"backorder""remove""zero_out"
customMessagestring

Custom text merged into the outbound email for steps that allow it.

curl -i -X POST \
  https://docs.orderwerks.com/_mock/openapi/v1/order/submit \
  -H 'Content-Type: application/json' \
  -H 'supplierGuid: YOUR_API_KEY_HERE' \
  -H 'userGuid: YOUR_API_KEY_HERE' \
  -H 'userToken: YOUR_API_KEY_HERE' \
  -H 'vendorGuid: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -d '{
    "orderGuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
    "allowPartialFulfillment": true
  }'

Responses

The order after the transition.

Bodyapplication/json
orderobject(Order)required

A sales order. GET /v1/orders returns a reduced projection (the header fields plus id/guid/name of each related record); the single-order and create endpoints return the full model with all relations.

autoFulfilledItemsArray of objects

Pending backorder lines that were fulfilled from stock during a release transition.

Response
{ "order": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string", "api_guid": "string", "supplier_id": 0, "vendor_id": 0, "user_id": 0, "catalog_id": 0, "price_group_id": 0, "category_id": 0, "parent_order_id": 0, "client_id": 0, "project_id": 0, "sales_rep_id": 0, "ship_to_id": 0, "order_state_id": 0, "order_source_id": 0, "po_no": "string", "invoice_no": "string", "description": "string", "note": "string", "internal_note": "string", "shipping_instructions": "string", "is_quote": true, "is_sample": true, "is_local_pickup": true, "is_local_delivery": true, "is_shipped": true, "partially_shipped": true, "is_on_hold": true, "is_cancelled": true, "sub_total": 0, "tax": 0, "shipping": 0, "labor": 0, "discount": 0, "discount_total": 0, "other": 0, "grand_total": 0, "delivery_date": "string", "ship_date": "string", "do_not_ship_before_date": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "Order_Items": [ {} ], "Ship_To": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "vendor_id": 0, "order_id": 0, "name": "string", "company_name": "string", "address_line_one": "string", "address_line_two": "string", "address_line_three": "string", "city": "string", "state": "string", "postal_code": "string", "country": "string", "phone": "string", "fax": "string", "email": "string", "note": "string", "address_internal_id": "string", "is_vendor_main_ship_to": true, "verified": true, "lat": 0, "lng": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "Vendor": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "supplier_id": 0, "parent_vendor_id": 0, "customer_internal_id": "string", "name": "string", "email": "string", "shipping_email": "string", "phone": "string", "cell": "string", "fax": "string", "address_line_one": "string", "address_line_two": "string", "city": "string", "state": "string", "postal_code": "string", "country": "string", "active": true, "tax_exempt": true, "resale_tax_id": "string", "lock_catalog_id": 0, "price_group_id": 0, "payment_type_id": 0, "payment_term_id": 0, "require_payment": true, "credit_limit": 0, "open_balance": 0, "is_ecomm_user": true, "net_term_ecomm_user": true, "require_po": true, "standing_po": "string", "hide_pricing": true, "currency_id": 0, "notes": "string", "default_order_category_id": 0, "route_id": 0, "timezone": "string", "bill_to_id": 0, "ship_to_id": 0, "Bill_To": {}, "Ship_To": {}, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z" }, "Catalog": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "supplier_id": 0, "name": "Main Catalog", "email": "string", "version": "string", "active": true, "order_item_type_id": 0, "currency_id": 0, "order_prefix_override": "string", "last_inventory_update": "2019-08-24T14:15:22Z", "Price_Groups": [], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "Price_Group": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "catalog_id": 0, "value": "Wholesale", "is_main": true, "percentage": 0, "price_upcharge_type_id": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z" }, "Category": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "catalog_id": 0, "parent_category_id": 0, "name": "string", "sequence": 0, "hide_category": true, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "Order_State": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string" }, "User": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string", "email": "string" }, "Supplier": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string", "email": "string" }, "Client": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string" }, "Parent_Order": { "id": 0, "guid": "ee6a7af7-650d-499b-8e32-58a52ffdb7bc", "name": "string" }, "Order_Detail": {}, "Order_State_Logs": [ {} ], "Assigned_Users": [ {} ] }, "autoFulfilledItems": [ { "orderItemId": 0, "catalogItemName": "string", "catalogItemSku": "string", "qtyFulfilled": 0, "qtyFromHeld": 0, "qtyFromOnHand": 0 } ] }