# Create an order (with optional new customer)

Creates an order with its lines, optionally creating the customer in the same call (`newVendor*` fields).
Used by the Orderwerks mobile sales app; also available to integrators with an API key.
Before anything is written the request is validated: the customer must be active and accessible, and every
line's item must be active with enough inventory. Failures come back as `400` with a `ReconcileErrors` body.
Idempotent on `order.api_guid`: a retry with the same key returns the existing order (and the customer /
address / contact references) instead of creating a duplicate.

Endpoint: POST /v1/orderWithItems
Version: 1.19
Security: ApiKey, ApiSecret, UserGuid, UserToken, SupplierGuid

## Security:

  - `ApiKey` (unknown)
    apiKey in header x-apiKey

  - `ApiSecret` (unknown)
    apiKey in header x-apiSecret

  - `UserGuid` (unknown)
    apiKey in header userGuid

  - `UserToken` (unknown)
    apiKey in header userToken

  - `SupplierGuid` (unknown)
    apiKey in header supplierGuid

## Header parameters:

  - `vendorGuid` (string)
    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.

  - `userGuid` (string)
    With API key authentication only: run the request as this user instead of the supplier's master user (the order is attributed to them). Ignored when user session headers are used, where it is part of the credentials.

## Request fields (application/json):

  - `catalogGuid` (string, required)

  - `priceGroupGuid` (string, required)

  - `order` (object, required)
    Order header fields accepted on create.

  - `order.api_guid` (string)
    Your idempotency key for this order (unique per supplier). A retry with the same value returns the existing order instead of creating a duplicate. Honored by `POST /v1/orderWithItems`.
    Example: 4c0d3e2a-8f7b-4c1e-9a6d-0b1c2d3e4f5a

  - `order.name` (string)
    Override the generated order number. Leave unset to let Orderwerks assign one.

  - `order.po_no` (string)
    Customer purchase order number.
    Example: PO-77812

  - `order.note` (string)
    Note visible to the customer.

  - `order.internal_note` (string)
    Note visible to supplier users only.

  - `order.description` (string)

  - `order.is_quote` (boolean)

  - `order.is_sample` (boolean)

  - `order.shipping_instructions` (string)

  - `order.is_local_pickup` (boolean)

  - `order.is_local_delivery` (boolean)

  - `order.shipping` (number)
    Manual shipping charge.

  - `order.do_not_ship_before_date` (string)

  - `order.shipstation_carrierCode` (string)

  - `order.shipstation_serviceType` (string)

  - `order.shipstation_packageType` (string)

  - `orderItems` (array, required)

  - `orderItems.catalog_item_id` (integer)

  - `orderItems.catalog_item_guid` (string)

  - `orderItems.qty` (number, required)
    Example: 12

  - `orderItems.item_no` (integer)
    Line number. Assigned sequentially when omitted.

  - `orderItems.price_group_id` (integer)
    Price the line from this price group instead of the order's.

  - `orderItems.is_manual_price` (boolean)
    When true, `list_price_frozen` is used as the unit price instead of catalog pricing.

  - `orderItems.list_price_frozen` (number)
    Manual unit price. Only honored when `is_manual_price` is true.

  - `orderItems.note` (string)

  - `orderItems.description` (string)

  - `orderItems.name` (string)

  - `orderItems.width` (number)

  - `orderItems.height` (number)

  - `orderItems.depth` (number)

  - `orderItems.selected_options` (array)
    Chosen item options for configurable products.

  - `orderItems.itemOptionValues` (array)

  - `orderItems.itemOptionValues.item_option_id` (integer)

  - `orderItems.itemOptionValues.value` (any)
    Option value; type depends on the option.

  - `orderDetails` (object)
    Supplier-specific extra order fields.

  - `shipTo` (object)
    Address fields accepted when creating or updating an address.

  - `shipTo.name` (string)
    Contact name at this address.
    Example: Jane Doe

  - `shipTo.company_name` (string)
    Example: Acme, Inc.

  - `shipTo.address_line_one` (string)
    Example: 123 Any Street

  - `shipTo.address_line_two` (string)
    Example: Unit A

  - `shipTo.address_line_three` (string)

  - `shipTo.city` (string)
    Example: Anytown

  - `shipTo.state` (string)
    Example: CA

  - `shipTo.postal_code` (string)
    Example: 12345

  - `shipTo.country` (string)
    Example: US

  - `shipTo.phone` (string)

  - `shipTo.fax` (string)

  - `shipTo.email` (string)

  - `shipTo.note` (string)

  - `shipTo.address_internal_id` (string)
    Your own identifier for this address.

  - `source` (any)
    Order source, as a name (`OTHER`, `APP`, ...) or its numeric id.

  - `workflowGuid` (string)
    Workflow to run the order through, for suppliers with multiple workflows. Defaults to the supplier's default workflow.

  - `newVendor` (object)
    Customer fields accepted on create.

  - `newVendor.name` (string, required)
    Example: Acme, Inc.

  - `newVendor.email` (string)
    Example: orders@acme.example

  - `newVendor.customer_internal_id` (string)
    Your own identifier for this customer. Used for idempotent matching by some integrations.

  - `newVendor.phone` (string)

  - `newVendor.cell` (string)

  - `newVendor.fax` (string)

  - `newVendor.shipping_email` (string)

  - `newVendor.address_line_one` (string)

  - `newVendor.address_line_two` (string)

  - `newVendor.city` (string)

  - `newVendor.state` (string)

  - `newVendor.postal_code` (string)

  - `newVendor.country` (string)

  - `newVendor.active` (boolean)

  - `newVendor.tax_exempt` (boolean)

  - `newVendor.resale_tax_id` (string)

  - `newVendor.price_group_id` (integer)

  - `newVendor.lock_catalog_id` (integer)

  - `newVendor.payment_type_id` (integer)

  - `newVendor.payment_term_id` (integer)

  - `newVendor.require_payment` (boolean)

  - `newVendor.require_po` (boolean)

  - `newVendor.standing_po` (string)

  - `newVendor.hide_pricing` (boolean)

  - `newVendor.is_ecomm_user` (boolean)

  - `newVendor.notes` (string)

  - `newVendor.default_order_category_id` (integer)

  - `newVendor.route_id` (integer)

  - `newVendor.route_stop_order` (integer)
    Standing stop order of the customer on its route; null or omitted = unordered (sorts last, by name).

  - `newVendorContact` (object)

  - `newVendorContact.name` (string, required)
    Example: Jane Doe

  - `newVendorContact.email` (string)

  - `newVendorContact.phone` (string)

  - `newVendorContact.mobile` (string)

  - `newVendorNote` (string)

  - `remainInPreliminary` (boolean)
    When true the order stays in PRELIMINARY. When omitted, the supplier setting "remain in preliminary" decides; when false the order is submitted.

  - `override_min_order_total` (boolean)
    When the order is submitted, submit it even when the order is below the supplier's minimum order total. Honored only for supplier admins (and API keys, which act as the supplier's master user); ignored for other staff and customer users.

  - `utm` (object)
    UTM attribution captured by the client, stamped onto the order.

## Response 200:

  - `200` (unknown)
    The created (or matched) order.

## Response 200 fields (application/json):

  - `order` (object, 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.

  - `order.id` (integer)

  - `order.guid` (string)

  - `order.name` (string)
    Order number as displayed, e.g. `ABC-10000`.

  - `order.api_guid` (string)
    Client-supplied idempotency key, when the order was created through the API.

  - `order.supplier_id` (integer)

  - `order.vendor_id` (integer)

  - `order.user_id` (integer)

  - `order.catalog_id` (integer)

  - `order.price_group_id` (integer)

  - `order.category_id` (integer)

  - `order.parent_order_id` (integer)

  - `order.client_id` (integer)

  - `order.project_id` (integer)

  - `order.sales_rep_id` (integer)

  - `order.ship_to_id` (integer)

  - `order.order_state_id` (integer)
    Current workflow state id (1 = PRELIMINARY, 2 = SUBMITTED, 8 = SHIPPED, 9 = COMPLETED, 23 = CANCELLED, ...).

  - `order.order_source_id` (integer)
    Origin of the order (1 = ORDERWERKS, 20 = OTHER, 21 = APP, ...).

  - `order.po_no` (string)

  - `order.invoice_no` (string)

  - `order.description` (string)

  - `order.note` (string)

  - `order.internal_note` (string)

  - `order.shipping_instructions` (string)

  - `order.is_quote` (boolean)

  - `order.is_sample` (boolean)

  - `order.is_local_pickup` (boolean)

  - `order.is_local_delivery` (boolean)

  - `order.is_shipped` (boolean)

  - `order.partially_shipped` (boolean)

  - `order.is_on_hold` (boolean)

  - `order.is_cancelled` (boolean)

  - `order.sub_total` (number)

  - `order.tax` (number)

  - `order.shipping` (number)

  - `order.labor` (number)

  - `order.discount` (number)

  - `order.discount_total` (number)

  - `order.other` (number)

  - `order.grand_total` (number)

  - `order.delivery_date` (string)

  - `order.ship_date` (string)

  - `order.do_not_ship_before_date` (string)

  - `order.created_at` (string)

  - `order.updated_at` (string)

  - `order.Order_Items` (array)

  - `order.Order_Items.id` (integer)

  - `order.Order_Items.guid` (string)

  - `order.Order_Items.order_id` (integer)

  - `order.Order_Items.catalog_item_id` (integer)

  - `order.Order_Items.catalog_item_guid` (string)

  - `order.Order_Items.parent_order_item_id` (integer)

  - `order.Order_Items.item_no` (integer)
    Line number within the order.

  - `order.Order_Items.sku` (string)

  - `order.Order_Items.name` (string)

  - `order.Order_Items.description` (string)

  - `order.Order_Items.qty` (number)
    Quantity ordered. Never reduced by shipments.

  - `order.Order_Items.qty_shipped` (number)

  - `order.Order_Items.qty_backordered` (number)

  - `order.Order_Items.qty_pending` (number)

  - `order.Order_Items.qty_reserved` (number)

  - `order.Order_Items.is_manual_price` (boolean)

  - `order.Order_Items.list_price_frozen` (number)
    Unit price captured when the line was created.

  - `order.Order_Items.net_price` (number)

  - `order.Order_Items.discount` (number)

  - `order.Order_Items.discount_total` (number)

  - `order.Order_Items.tax` (number)

  - `order.Order_Items.total` (number)

  - `order.Order_Items.is_credit` (boolean)

  - `order.Order_Items.is_backordered` (boolean)

  - `order.Order_Items.note` (string)

  - `order.Order_Items.width` (number)

  - `order.Order_Items.height` (number)

  - `order.Order_Items.depth` (number)

  - `order.Order_Items.selected_options` (array)

  - `order.Order_Items.Catalog_Item` (object)
    A product. With API key authentication the paged list endpoint returns exactly the fields below; other endpoints (and user session calls) return the full model, which has many more optional fields.

  - `order.Order_Items.Catalog_Item.id` (integer)

  - `order.Order_Items.Catalog_Item.guid` (string)

  - `order.Order_Items.Catalog_Item.catalog_id` (integer)

  - `order.Order_Items.Catalog_Item.category_id` (integer)

  - `order.Order_Items.Catalog_Item.sku` (string)

  - `order.Order_Items.Catalog_Item.upc` (string)

  - `order.Order_Items.Catalog_Item.name` (string)

  - `order.Order_Items.Catalog_Item.description` (string)

  - `order.Order_Items.Catalog_Item.manufacturer` (string)

  - `order.Order_Items.Catalog_Item.color` (string)

  - `order.Order_Items.Catalog_Item.style` (string)

  - `order.Order_Items.Catalog_Item.active` (boolean)

  - `order.Order_Items.Catalog_Item.is_taxable` (boolean)

  - `order.Order_Items.Catalog_Item.msrp` (number)

  - `order.Order_Items.Catalog_Item.cost_per_uom` (number)
    Supplier cost. Omitted for customer (vendor) users.

  - `order.Order_Items.Catalog_Item.pricing` (object)
    Price per price group, keyed by price group name. `"N/A"` means not offered to that group.
    Example: {"Retail":99.99,"Wholesale":79.99,"Distributor":"N/A"}

  - `order.Order_Items.Catalog_Item.has_inventory` (boolean)
    Whether stock is tracked for this item.

  - `order.Order_Items.Catalog_Item.qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.qty_incoming` (number)

  - `order.Order_Items.Catalog_Item.reserved_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.qty_backordered` (number)

  - `order.Order_Items.Catalog_Item.qty_held_for_backorders` (number)

  - `order.Order_Items.Catalog_Item.min_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.max_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.min_order_qty` (number)

  - `order.Order_Items.Catalog_Item.allow_backorder` (boolean)

  - `order.Order_Items.Catalog_Item.qty_break` (number)
    Quantity at which `qty_break_price` applies.

  - `order.Order_Items.Catalog_Item.qty_break_price` (number)

  - `order.Order_Items.Catalog_Item.has_serials` (boolean)

  - `order.Order_Items.Catalog_Item.has_lots` (boolean)

  - `order.Order_Items.Catalog_Item.has_exp_date` (boolean)

  - `order.Order_Items.Catalog_Item.width` (number)

  - `order.Order_Items.Catalog_Item.height` (number)

  - `order.Order_Items.Catalog_Item.depth` (number)

  - `order.Order_Items.Catalog_Item.item_weight` (number)

  - `order.Order_Items.Catalog_Item.shipping_weight` (number)

  - `order.Order_Items.Catalog_Item.is_product_group` (boolean)

  - `order.Order_Items.Catalog_Item.product_group_type` (string)
    Enum: "flat", "multi", "null"

  - `order.Order_Items.Catalog_Item.product_group_display_style` (string)

  - `order.Order_Items.Catalog_Item.group_parent_catalog_item_id` (integer)

  - `order.Order_Items.Catalog_Item.group_sequence` (integer)

  - `order.Order_Items.Catalog_Item.group_title` (string)

  - `order.Order_Items.Catalog_Item.subsection_id` (integer)

  - `order.Order_Items.Catalog_Item.third_party_sku` (string)

  - `order.Order_Items.Catalog_Item.third_party_pricing` (string)

  - `order.Order_Items.Catalog_Item.third_party_size` (string)

  - `order.Order_Items.Catalog_Item.Category` (object)

  - `order.Order_Items.Catalog_Item.Category.id` (integer)

  - `order.Order_Items.Catalog_Item.Category.guid` (string)

  - `order.Order_Items.Catalog_Item.Category.catalog_id` (integer)

  - `order.Order_Items.Catalog_Item.Category.parent_category_id` (integer)

  - `order.Order_Items.Catalog_Item.Category.name` (string)

  - `order.Order_Items.Catalog_Item.Category.sequence` (integer)

  - `order.Order_Items.Catalog_Item.Category.hide_category` (boolean)

  - `order.Order_Items.Catalog_Item.Category.created_at` (string)

  - `order.Order_Items.Catalog_Item.Category.updated_at` (string)

  - `order.Order_Items.Catalog_Item.CategoryHierarchy` (array)
    Root-to-leaf category path, when category retrieval is not skipped.

  - `order.Order_Items.Catalog_Item.created_at` (string)

  - `order.Order_Items.Catalog_Item.updated_at` (string)

  - `order.Order_Items.Catalog_Item.deleted_at` (string)
    Present only in delta-sync responses for soft-deleted items.

  - `order.Order_Items.created_at` (string)

  - `order.Order_Items.updated_at` (string)

  - `order.Ship_To` (object)
    A billing or shipping address. Additional internal fields may be present.

  - `order.Ship_To.id` (integer)

  - `order.Ship_To.guid` (string)

  - `order.Ship_To.vendor_id` (integer)

  - `order.Ship_To.order_id` (integer)

  - `order.Ship_To.name` (string)
    Contact name at this address.

  - `order.Ship_To.company_name` (string)

  - `order.Ship_To.address_line_one` (string)

  - `order.Ship_To.address_line_two` (string)

  - `order.Ship_To.address_line_three` (string)

  - `order.Ship_To.city` (string)

  - `order.Ship_To.state` (string)

  - `order.Ship_To.postal_code` (string)

  - `order.Ship_To.country` (string)

  - `order.Ship_To.phone` (string)

  - `order.Ship_To.fax` (string)

  - `order.Ship_To.email` (string)

  - `order.Ship_To.note` (string)

  - `order.Ship_To.address_internal_id` (string)
    Your own identifier for this address, if one was supplied.

  - `order.Ship_To.is_vendor_main_ship_to` (boolean)

  - `order.Ship_To.verified` (boolean)
    True when the address was verified against a postal database.

  - `order.Ship_To.lat` (number)

  - `order.Ship_To.lng` (number)

  - `order.Ship_To.created_at` (string)

  - `order.Ship_To.updated_at` (string)

  - `order.Vendor` (object)
    A customer of the supplier. The full model includes many integration-specific fields (QuickBooks, Stripe, FastBound, routing); only the commonly used ones are listed here.

  - `order.Vendor.id` (integer)

  - `order.Vendor.guid` (string)

  - `order.Vendor.supplier_id` (integer)

  - `order.Vendor.parent_vendor_id` (integer)

  - `order.Vendor.customer_internal_id` (string)
    Your own identifier for this customer.

  - `order.Vendor.name` (string)

  - `order.Vendor.email` (string)

  - `order.Vendor.shipping_email` (string)

  - `order.Vendor.phone` (string)

  - `order.Vendor.cell` (string)

  - `order.Vendor.fax` (string)

  - `order.Vendor.address_line_one` (string)

  - `order.Vendor.address_line_two` (string)

  - `order.Vendor.city` (string)

  - `order.Vendor.state` (string)

  - `order.Vendor.postal_code` (string)

  - `order.Vendor.country` (string)

  - `order.Vendor.active` (boolean)

  - `order.Vendor.tax_exempt` (boolean)

  - `order.Vendor.resale_tax_id` (string)

  - `order.Vendor.lock_catalog_id` (integer)
    When set, the customer can only order from this catalog.

  - `order.Vendor.price_group_id` (integer)
    Price group used for this customer's pricing.

  - `order.Vendor.payment_type_id` (integer)

  - `order.Vendor.payment_term_id` (integer)

  - `order.Vendor.require_payment` (boolean)

  - `order.Vendor.credit_limit` (number)

  - `order.Vendor.open_balance` (number)

  - `order.Vendor.is_ecomm_user` (boolean)
    True for Orderwerks Online (e-commerce) customers.

  - `order.Vendor.net_term_ecomm_user` (boolean)

  - `order.Vendor.require_po` (boolean)

  - `order.Vendor.standing_po` (string)

  - `order.Vendor.hide_pricing` (boolean)

  - `order.Vendor.currency_id` (integer)

  - `order.Vendor.notes` (string)

  - `order.Vendor.default_order_category_id` (integer)

  - `order.Vendor.route_id` (integer)

  - `order.Vendor.route_stop_order` (integer)
    Standing stop order of the customer on its route; null = unordered (sorts last, by name).

  - `order.Vendor.timezone` (string)

  - `order.Vendor.bill_to_id` (integer)

  - `order.Vendor.ship_to_id` (integer)

  - `order.Vendor.created_at` (string)

  - `order.Vendor.updated_at` (string)

  - `order.Vendor.deleted_at` (string)
    Present only in delta-sync responses for soft-deleted customers.

  - `order.Catalog` (object)

  - `order.Catalog.id` (integer)

  - `order.Catalog.guid` (string)

  - `order.Catalog.supplier_id` (integer)

  - `order.Catalog.name` (string)
    Example: Main Catalog

  - `order.Catalog.email` (string)

  - `order.Catalog.version` (string)

  - `order.Catalog.active` (boolean)

  - `order.Catalog.order_item_type_id` (integer)

  - `order.Catalog.currency_id` (integer)

  - `order.Catalog.order_prefix_override` (string)
    Prefix used for order numbers created from this catalog, if overridden.

  - `order.Catalog.last_inventory_update` (string)

  - `order.Catalog.Price_Groups` (array)

  - `order.Catalog.Price_Groups.id` (integer)

  - `order.Catalog.Price_Groups.guid` (string)

  - `order.Catalog.Price_Groups.catalog_id` (integer)

  - `order.Catalog.Price_Groups.value` (string)
    Price group name. This is the key used in a catalog item's `pricing` object.
    Example: Wholesale

  - `order.Catalog.Price_Groups.is_main` (boolean)

  - `order.Catalog.Price_Groups.percentage` (number)

  - `order.Catalog.Price_Groups.price_upcharge_type_id` (integer)

  - `order.Catalog.Price_Groups.created_at` (string)

  - `order.Catalog.Price_Groups.updated_at` (string)

  - `order.Catalog.Price_Groups.deleted_at` (string)

  - `order.Catalog.created_at` (string)

  - `order.Catalog.updated_at` (string)

  - `order.Order_State` (object)

  - `order.Order_State.id` (integer)

  - `order.Order_State.guid` (string)

  - `order.Order_State.name` (string)

  - `order.User` (object)
    User who created the order.

  - `order.User.id` (integer)

  - `order.User.guid` (string)

  - `order.User.name` (string)

  - `order.User.email` (string)

  - `order.Supplier` (object)

  - `order.Supplier.id` (integer)

  - `order.Supplier.guid` (string)

  - `order.Supplier.name` (string)

  - `order.Supplier.email` (string)

  - `order.Client` (object)
    End client on behalf of whom the customer placed the order, if any.

  - `order.Client.id` (integer)

  - `order.Client.guid` (string)

  - `order.Client.name` (string)

  - `order.Parent_Order` (object)

  - `order.Parent_Order.id` (integer)

  - `order.Parent_Order.guid` (string)

  - `order.Parent_Order.name` (string)

  - `order.Order_Detail` (object)
    Supplier-specific extra fields.

  - `order.Order_State_Logs` (array)
    State transition history.

  - `order.Order_State_Logs.created_at` (string)

  - `order.Order_State_Logs.User` (object)

  - `order.Order_State_Logs.User.name` (string)

  - `order.Order_State_Logs.User.email` (string)

  - `order.Order_State_Logs.Order_State` (object)

  - `order.Order_State_Logs.Order_State.name` (string)

  - `order.Assigned_Users` (array)

  - `order.Assigned_Users.id` (integer)

  - `order.Assigned_Users.guid` (string)

  - `order.Assigned_Users.name` (string)

  - `order.Assigned_Users.email` (string)

  - `billTo` (object)
    Minimal reference to a created record, so a client can back-fill its local rows.

  - `billTo.id` (integer, required)
    Example: 4821

  - `billTo.guid` (string, required)

## Response 400:

  - `400` (unknown)
    Validation failed.

## Response 400 fields (application/json):

  - `isValid` (boolean, required)
    Example: false

  - `inactiveAccount` (boolean)
    The customer account is inactive.

  - `noAccountAccess` (boolean)
    The caller may not order for this customer.

  - `message` (string)

  - `errors` (array, required)
    One entry per line that failed validation.

  - `errors.sku` (string)

  - `errors.name` (string)

  - `errors.active` (boolean)

  - `errors.inventoryAvailable` (number)

## Response 401:

  - `401` (unknown)
    Missing credentials or no access to the customer.

## Response 401 fields (application/json):

  - `message` (string)

  - `isValid` (boolean)
    Example: false

## Response 422:

  - `422` (unknown)
    The order was created but is below the supplier's minimum order total, so it was left in PRELIMINARY. The body is the normal response (order, and any new customer records) plus the minimum details.

## Response 422 fields (application/json):

  - `order` (object, 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.

  - `order.id` (integer)

  - `order.guid` (string)

  - `order.name` (string)
    Order number as displayed, e.g. `ABC-10000`.

  - `order.api_guid` (string)
    Client-supplied idempotency key, when the order was created through the API.

  - `order.supplier_id` (integer)

  - `order.vendor_id` (integer)

  - `order.user_id` (integer)

  - `order.catalog_id` (integer)

  - `order.price_group_id` (integer)

  - `order.category_id` (integer)

  - `order.parent_order_id` (integer)

  - `order.client_id` (integer)

  - `order.project_id` (integer)

  - `order.sales_rep_id` (integer)

  - `order.ship_to_id` (integer)

  - `order.order_state_id` (integer)
    Current workflow state id (1 = PRELIMINARY, 2 = SUBMITTED, 8 = SHIPPED, 9 = COMPLETED, 23 = CANCELLED, ...).

  - `order.order_source_id` (integer)
    Origin of the order (1 = ORDERWERKS, 20 = OTHER, 21 = APP, ...).

  - `order.po_no` (string)

  - `order.invoice_no` (string)

  - `order.description` (string)

  - `order.note` (string)

  - `order.internal_note` (string)

  - `order.shipping_instructions` (string)

  - `order.is_quote` (boolean)

  - `order.is_sample` (boolean)

  - `order.is_local_pickup` (boolean)

  - `order.is_local_delivery` (boolean)

  - `order.is_shipped` (boolean)

  - `order.partially_shipped` (boolean)

  - `order.is_on_hold` (boolean)

  - `order.is_cancelled` (boolean)

  - `order.sub_total` (number)

  - `order.tax` (number)

  - `order.shipping` (number)

  - `order.labor` (number)

  - `order.discount` (number)

  - `order.discount_total` (number)

  - `order.other` (number)

  - `order.grand_total` (number)

  - `order.delivery_date` (string)

  - `order.ship_date` (string)

  - `order.do_not_ship_before_date` (string)

  - `order.created_at` (string)

  - `order.updated_at` (string)

  - `order.Order_Items` (array)

  - `order.Order_Items.id` (integer)

  - `order.Order_Items.guid` (string)

  - `order.Order_Items.order_id` (integer)

  - `order.Order_Items.catalog_item_id` (integer)

  - `order.Order_Items.catalog_item_guid` (string)

  - `order.Order_Items.parent_order_item_id` (integer)

  - `order.Order_Items.item_no` (integer)
    Line number within the order.

  - `order.Order_Items.sku` (string)

  - `order.Order_Items.name` (string)

  - `order.Order_Items.description` (string)

  - `order.Order_Items.qty` (number)
    Quantity ordered. Never reduced by shipments.

  - `order.Order_Items.qty_shipped` (number)

  - `order.Order_Items.qty_backordered` (number)

  - `order.Order_Items.qty_pending` (number)

  - `order.Order_Items.qty_reserved` (number)

  - `order.Order_Items.is_manual_price` (boolean)

  - `order.Order_Items.list_price_frozen` (number)
    Unit price captured when the line was created.

  - `order.Order_Items.net_price` (number)

  - `order.Order_Items.discount` (number)

  - `order.Order_Items.discount_total` (number)

  - `order.Order_Items.tax` (number)

  - `order.Order_Items.total` (number)

  - `order.Order_Items.is_credit` (boolean)

  - `order.Order_Items.is_backordered` (boolean)

  - `order.Order_Items.note` (string)

  - `order.Order_Items.width` (number)

  - `order.Order_Items.height` (number)

  - `order.Order_Items.depth` (number)

  - `order.Order_Items.selected_options` (array)

  - `order.Order_Items.Catalog_Item` (object)
    A product. With API key authentication the paged list endpoint returns exactly the fields below; other endpoints (and user session calls) return the full model, which has many more optional fields.

  - `order.Order_Items.Catalog_Item.id` (integer)

  - `order.Order_Items.Catalog_Item.guid` (string)

  - `order.Order_Items.Catalog_Item.catalog_id` (integer)

  - `order.Order_Items.Catalog_Item.category_id` (integer)

  - `order.Order_Items.Catalog_Item.sku` (string)

  - `order.Order_Items.Catalog_Item.upc` (string)

  - `order.Order_Items.Catalog_Item.name` (string)

  - `order.Order_Items.Catalog_Item.description` (string)

  - `order.Order_Items.Catalog_Item.manufacturer` (string)

  - `order.Order_Items.Catalog_Item.color` (string)

  - `order.Order_Items.Catalog_Item.style` (string)

  - `order.Order_Items.Catalog_Item.active` (boolean)

  - `order.Order_Items.Catalog_Item.is_taxable` (boolean)

  - `order.Order_Items.Catalog_Item.msrp` (number)

  - `order.Order_Items.Catalog_Item.cost_per_uom` (number)
    Supplier cost. Omitted for customer (vendor) users.

  - `order.Order_Items.Catalog_Item.pricing` (object)
    Price per price group, keyed by price group name. `"N/A"` means not offered to that group.
    Example: {"Retail":99.99,"Wholesale":79.99,"Distributor":"N/A"}

  - `order.Order_Items.Catalog_Item.has_inventory` (boolean)
    Whether stock is tracked for this item.

  - `order.Order_Items.Catalog_Item.qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.qty_incoming` (number)

  - `order.Order_Items.Catalog_Item.reserved_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.qty_backordered` (number)

  - `order.Order_Items.Catalog_Item.qty_held_for_backorders` (number)

  - `order.Order_Items.Catalog_Item.min_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.max_qty_on_hand` (number)

  - `order.Order_Items.Catalog_Item.min_order_qty` (number)

  - `order.Order_Items.Catalog_Item.allow_backorder` (boolean)

  - `order.Order_Items.Catalog_Item.qty_break` (number)
    Quantity at which `qty_break_price` applies.

  - `order.Order_Items.Catalog_Item.qty_break_price` (number)

  - `order.Order_Items.Catalog_Item.has_serials` (boolean)

  - `order.Order_Items.Catalog_Item.has_lots` (boolean)

  - `order.Order_Items.Catalog_Item.has_exp_date` (boolean)

  - `order.Order_Items.Catalog_Item.width` (number)

  - `order.Order_Items.Catalog_Item.height` (number)

  - `order.Order_Items.Catalog_Item.depth` (number)

  - `order.Order_Items.Catalog_Item.item_weight` (number)

  - `order.Order_Items.Catalog_Item.shipping_weight` (number)

  - `order.Order_Items.Catalog_Item.is_product_group` (boolean)

  - `order.Order_Items.Catalog_Item.product_group_type` (string)
    Enum: "flat", "multi", "null"

  - `order.Order_Items.Catalog_Item.product_group_display_style` (string)

  - `order.Order_Items.Catalog_Item.group_parent_catalog_item_id` (integer)

  - `order.Order_Items.Catalog_Item.group_sequence` (integer)

  - `order.Order_Items.Catalog_Item.group_title` (string)

  - `order.Order_Items.Catalog_Item.subsection_id` (integer)

  - `order.Order_Items.Catalog_Item.third_party_sku` (string)

  - `order.Order_Items.Catalog_Item.third_party_pricing` (string)

  - `order.Order_Items.Catalog_Item.third_party_size` (string)

  - `order.Order_Items.Catalog_Item.Category` (object)

  - `order.Order_Items.Catalog_Item.Category.id` (integer)

  - `order.Order_Items.Catalog_Item.Category.guid` (string)

  - `order.Order_Items.Catalog_Item.Category.catalog_id` (integer)

  - `order.Order_Items.Catalog_Item.Category.parent_category_id` (integer)

  - `order.Order_Items.Catalog_Item.Category.name` (string)

  - `order.Order_Items.Catalog_Item.Category.sequence` (integer)

  - `order.Order_Items.Catalog_Item.Category.hide_category` (boolean)

  - `order.Order_Items.Catalog_Item.Category.created_at` (string)

  - `order.Order_Items.Catalog_Item.Category.updated_at` (string)

  - `order.Order_Items.Catalog_Item.CategoryHierarchy` (array)
    Root-to-leaf category path, when category retrieval is not skipped.

  - `order.Order_Items.Catalog_Item.created_at` (string)

  - `order.Order_Items.Catalog_Item.updated_at` (string)

  - `order.Order_Items.Catalog_Item.deleted_at` (string)
    Present only in delta-sync responses for soft-deleted items.

  - `order.Order_Items.created_at` (string)

  - `order.Order_Items.updated_at` (string)

  - `order.Ship_To` (object)
    A billing or shipping address. Additional internal fields may be present.

  - `order.Ship_To.id` (integer)

  - `order.Ship_To.guid` (string)

  - `order.Ship_To.vendor_id` (integer)

  - `order.Ship_To.order_id` (integer)

  - `order.Ship_To.name` (string)
    Contact name at this address.

  - `order.Ship_To.company_name` (string)

  - `order.Ship_To.address_line_one` (string)

  - `order.Ship_To.address_line_two` (string)

  - `order.Ship_To.address_line_three` (string)

  - `order.Ship_To.city` (string)

  - `order.Ship_To.state` (string)

  - `order.Ship_To.postal_code` (string)

  - `order.Ship_To.country` (string)

  - `order.Ship_To.phone` (string)

  - `order.Ship_To.fax` (string)

  - `order.Ship_To.email` (string)

  - `order.Ship_To.note` (string)

  - `order.Ship_To.address_internal_id` (string)
    Your own identifier for this address, if one was supplied.

  - `order.Ship_To.is_vendor_main_ship_to` (boolean)

  - `order.Ship_To.verified` (boolean)
    True when the address was verified against a postal database.

  - `order.Ship_To.lat` (number)

  - `order.Ship_To.lng` (number)

  - `order.Ship_To.created_at` (string)

  - `order.Ship_To.updated_at` (string)

  - `order.Vendor` (object)
    A customer of the supplier. The full model includes many integration-specific fields (QuickBooks, Stripe, FastBound, routing); only the commonly used ones are listed here.

  - `order.Vendor.id` (integer)

  - `order.Vendor.guid` (string)

  - `order.Vendor.supplier_id` (integer)

  - `order.Vendor.parent_vendor_id` (integer)

  - `order.Vendor.customer_internal_id` (string)
    Your own identifier for this customer.

  - `order.Vendor.name` (string)

  - `order.Vendor.email` (string)

  - `order.Vendor.shipping_email` (string)

  - `order.Vendor.phone` (string)

  - `order.Vendor.cell` (string)

  - `order.Vendor.fax` (string)

  - `order.Vendor.address_line_one` (string)

  - `order.Vendor.address_line_two` (string)

  - `order.Vendor.city` (string)

  - `order.Vendor.state` (string)

  - `order.Vendor.postal_code` (string)

  - `order.Vendor.country` (string)

  - `order.Vendor.active` (boolean)

  - `order.Vendor.tax_exempt` (boolean)

  - `order.Vendor.resale_tax_id` (string)

  - `order.Vendor.lock_catalog_id` (integer)
    When set, the customer can only order from this catalog.

  - `order.Vendor.price_group_id` (integer)
    Price group used for this customer's pricing.

  - `order.Vendor.payment_type_id` (integer)

  - `order.Vendor.payment_term_id` (integer)

  - `order.Vendor.require_payment` (boolean)

  - `order.Vendor.credit_limit` (number)

  - `order.Vendor.open_balance` (number)

  - `order.Vendor.is_ecomm_user` (boolean)
    True for Orderwerks Online (e-commerce) customers.

  - `order.Vendor.net_term_ecomm_user` (boolean)

  - `order.Vendor.require_po` (boolean)

  - `order.Vendor.standing_po` (string)

  - `order.Vendor.hide_pricing` (boolean)

  - `order.Vendor.currency_id` (integer)

  - `order.Vendor.notes` (string)

  - `order.Vendor.default_order_category_id` (integer)

  - `order.Vendor.route_id` (integer)

  - `order.Vendor.route_stop_order` (integer)
    Standing stop order of the customer on its route; null = unordered (sorts last, by name).

  - `order.Vendor.timezone` (string)

  - `order.Vendor.bill_to_id` (integer)

  - `order.Vendor.ship_to_id` (integer)

  - `order.Vendor.created_at` (string)

  - `order.Vendor.updated_at` (string)

  - `order.Vendor.deleted_at` (string)
    Present only in delta-sync responses for soft-deleted customers.

  - `order.Catalog` (object)

  - `order.Catalog.id` (integer)

  - `order.Catalog.guid` (string)

  - `order.Catalog.supplier_id` (integer)

  - `order.Catalog.name` (string)
    Example: Main Catalog

  - `order.Catalog.email` (string)

  - `order.Catalog.version` (string)

  - `order.Catalog.active` (boolean)

  - `order.Catalog.order_item_type_id` (integer)

  - `order.Catalog.currency_id` (integer)

  - `order.Catalog.order_prefix_override` (string)
    Prefix used for order numbers created from this catalog, if overridden.

  - `order.Catalog.last_inventory_update` (string)

  - `order.Catalog.Price_Groups` (array)

  - `order.Catalog.Price_Groups.id` (integer)

  - `order.Catalog.Price_Groups.guid` (string)

  - `order.Catalog.Price_Groups.catalog_id` (integer)

  - `order.Catalog.Price_Groups.value` (string)
    Price group name. This is the key used in a catalog item's `pricing` object.
    Example: Wholesale

  - `order.Catalog.Price_Groups.is_main` (boolean)

  - `order.Catalog.Price_Groups.percentage` (number)

  - `order.Catalog.Price_Groups.price_upcharge_type_id` (integer)

  - `order.Catalog.Price_Groups.created_at` (string)

  - `order.Catalog.Price_Groups.updated_at` (string)

  - `order.Catalog.Price_Groups.deleted_at` (string)

  - `order.Catalog.created_at` (string)

  - `order.Catalog.updated_at` (string)

  - `order.Order_State` (object)

  - `order.Order_State.id` (integer)

  - `order.Order_State.guid` (string)

  - `order.Order_State.name` (string)

  - `order.User` (object)
    User who created the order.

  - `order.User.id` (integer)

  - `order.User.guid` (string)

  - `order.User.name` (string)

  - `order.User.email` (string)

  - `order.Supplier` (object)

  - `order.Supplier.id` (integer)

  - `order.Supplier.guid` (string)

  - `order.Supplier.name` (string)

  - `order.Supplier.email` (string)

  - `order.Client` (object)
    End client on behalf of whom the customer placed the order, if any.

  - `order.Client.id` (integer)

  - `order.Client.guid` (string)

  - `order.Client.name` (string)

  - `order.Parent_Order` (object)

  - `order.Parent_Order.id` (integer)

  - `order.Parent_Order.guid` (string)

  - `order.Parent_Order.name` (string)

  - `order.Order_Detail` (object)
    Supplier-specific extra fields.

  - `order.Order_State_Logs` (array)
    State transition history.

  - `order.Order_State_Logs.created_at` (string)

  - `order.Order_State_Logs.User` (object)

  - `order.Order_State_Logs.User.name` (string)

  - `order.Order_State_Logs.User.email` (string)

  - `order.Order_State_Logs.Order_State` (object)

  - `order.Order_State_Logs.Order_State.name` (string)

  - `order.Assigned_Users` (array)

  - `order.Assigned_Users.id` (integer)

  - `order.Assigned_Users.guid` (string)

  - `order.Assigned_Users.name` (string)

  - `order.Assigned_Users.email` (string)

  - `billTo` (object)
    Minimal reference to a created record, so a client can back-fill its local rows.

  - `billTo.id` (integer, required)
    Example: 4821

  - `billTo.guid` (string, required)

  - `success` (boolean, required)
    Example: false

  - `errorType` (string, required)
    Enum: "MinOrderTotalNotMet"

  - `errorCode` (string, required)
    Enum: "MIN_ORDER_TOTAL_NOT_MET"

  - `message` (string, required)

  - `basis` (string)
    Which subtotal was compared. `after_discounts` subtracts the order discount and the promo code discount; `before_discounts` does not. Tax and shipping never count.
    Enum: "before_discounts", "after_discounts"

  - `minimum` (number, required)
    Example: 500

  - `subtotal` (number, required)
    The subtotal that was compared.
    Example: 420

  - `shortfall` (number, required)
    Example: 80

  - `currency` (string, required)
    Example: USD

  - `vendorCurrency` (string)
    Example: CAD

  - `convertedMinimum` (number)

  - `convertedSubtotal` (number)

  - `convertedShortfall` (number)

  - `isValid` (boolean)
    Always false, so app clients that read the reconcile-error shape can show `message`.
    Example: false

## Response 500:

  - `500` (unknown)
    Unexpected error. `noAccountAccess` / `inactiveAccount` are set when that was the cause.

## Response 500 fields (application/json):

  - `message` (string)

  - `errMessage` (string)

  - `noAccountAccess` (boolean)

  - `inactiveAccount` (boolean)

  - `isValid` (boolean)
    Example: false

