Skip to content

Create an order

Request

Creates an order with its lines for an existing customer and, unless remainInPreliminary is true, submits it into the supplier's workflow. This is the recommended endpoint for integrations.

API key and secret only. The order is attributed to the supplier's master user. Requests without x-apiKey / x-apiSecret are rejected with a plain-text 400.

Security
ApiKey and ApiSecret
Bodyapplication/jsonrequired
vendorGuidstring, (uuid)required

Customer placing the order.

catalogGuidstring, (uuid)required
priceGroupGuidstring, (uuid)required
orderobject(OrderInput)required

Order header fields accepted on create.

orderItemsArray of objects, non-empty(OrderItemInput)required
orderDetailsobject

Supplier-specific extra order fields.

shipToobject(AddressInput)

Address fields accepted when creating or updating an address.

clientobject

End client the customer is ordering for. Creates a client record linked to the order.

sourcestring or integer
Example:"OTHER"
One of:

Order source, as a name (OTHER, APP, SHOPIFY, ...) or its numeric id.

string
remainInPreliminaryboolean

When true the order stays in PRELIMINARY instead of being submitted into the workflow.

Default:false
curl -i -X POST \
  https://docs.orderwerks.com/_mock/openapi/v2/order \
  -H 'Content-Type: application/json' \
  -H 'x-apiKey: YOUR_API_KEY_HERE' \
  -H 'x-apiSecret: YOUR_API_KEY_HERE' \
  -d '{
    "vendorGuid": "2b7c1d9e-3f4a-4b5c-8d6e-7f8091a2b3c4",
    "catalogGuid": "0f5a4b1e-1c9c-4d1a-9b8e-6f4a2a3c1d10",
    "priceGroupGuid": "9c8b7a6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
    "order": {
      "po_no": "PO-77812",
      "note": "Deliver to the rear dock.",
      "shipping_instructions": "Call on arrival"
    },
    "orderItems": [
      {
        "catalog_item_guid": "7a1d2e3f-4b5c-4d6e-8f90-a1b2c3d4e5f6",
        "qty": 12
      },
      {
        "catalog_item_guid": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b",
        "qty": 2,
        "note": "Gift wrap"
      }
    ],
    "shipTo": {
      "name": "Receiving",
      "company_name": "Acme, Inc.",
      "address_line_one": "400 Warehouse Road",
      "city": "Anytown",
      "state": "CA",
      "postal_code": "12345",
      "country": "US"
    },
    "source": "OTHER"
  }'

Responses

The created order.

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.

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": [ {} ] } }