curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/sales-orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 1,
"order_number": "ORD-2024-001",
"order_date": "2024-01-15",
"order_status": "pending",
"bill_to": {
"name": "John Doe"
},
"ship_to": {
"name": "Jane Smith"
},
"items": [
{
"product_id": 123,
"quantity": 2,
"unit_price": 49.99
}
]
}
'{
"data": {
"id": 12345,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"status": "Active",
"order_id": "12345",
"order_number": "ORD-2024-001",
"order_date": "2024-01-15",
"order_status": "pending",
"customer_email": "customer@example.com",
"customer_username": "johndoe123",
"customer_po_number": "PO-2024-5678",
"company_id": 123,
"company": {
"id": 123,
"name": "Acme Corporation",
"status": "active",
"address": "123 Main Street",
"city": "Anytown",
"state": "CA",
"postal_code": "90210",
"country": "US"
},
"bill_to": {
"name": "John Doe",
"company": "Acme Corporation",
"street1": "123 Main Street",
"street2": "Suite 100",
"city": "Anytown",
"state": "CA",
"postal_code": "90210",
"country": "US",
"phone": "555-1234"
},
"ship_to": {
"name": "Jane Smith",
"company": "Delivery Corp",
"street1": "456 Oak Avenue",
"city": "Somewhere",
"state": "NY",
"postal_code": "10001",
"country": "US",
"phone": "555-5678"
},
"total": 128.23,
"total_paid": 0,
"total_tax": 15.75,
"total_shipping": 12.5,
"product_total": 99.98,
"requested_shipping_service": "FedEx Ground",
"customer_notes": "Please handle with care - fragile items",
"internal_notes": "Rush order - expedite processing",
"ship_date": "2024-01-20",
"hold_until_date": "2024-01-18",
"ship_by_date": "2024-01-25",
"earliest_ship_date": "2024-01-18",
"externally_fulfilled": false,
"is_posted": false,
"source": "external_api",
"total_order_quantity": 3,
"items": [
{
"id": 67890,
"line_number": 1,
"sku": "WIDGET-001",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99,
"upc": "123456789012",
"product_id": 123,
"tags": [],
"custom_fields": {}
},
{
"id": 67891,
"line_number": 2,
"sku": "WIDGET-002",
"name": "Standard Widget",
"quantity": 1,
"unit_price": 25,
"upc": "123456789013",
"product_id": 124,
"tags": [],
"custom_fields": {}
}
],
"tags": [
{
"id": 1,
"name": "urgent"
},
{
"id": 2,
"name": "vip-customer"
},
{
"id": 3,
"name": "rush-order"
}
],
"custom_fields": {
"Customer PO": "PO-98765",
"Priority Level": "High",
"Package Count": 3
}
}
}Create a new sales order
Create a new sales order with items, addresses, and optional metadata.
Key Features
- Create orders with multiple line items
- Support for both product ID and SKU lookup for items
- Automatic product name and details population
- Flexible address handling (only name required)
- Optional company association - when
company_idis provided, addresses are auto-populated - Optional custom fields and tags at both order and order item level
- Automatic total calculation from line items plus tax/shipping
Product Identification
For each line item, you must provide either:
product_id: The internal product IDsku: The product SKU (supports both internal SKU and alternate SKUs)
Order Status Values
Valid order statuses include: pending, shipped, fulfilled, cancelled,
awaiting_shipment, partially_shipped, on_hold, backorder,
partially_refunded, committed, processing, completed
Total Calculation
The order total is automatically calculated as:
(sum of item quantities × unit prices) + total_tax + total_shipping
Custom Fields and Tags
- Custom fields must be predefined in the system before use
- Both order-level and item-level custom fields/tags are supported
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/sales-orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 1,
"order_number": "ORD-2024-001",
"order_date": "2024-01-15",
"order_status": "pending",
"bill_to": {
"name": "John Doe"
},
"ship_to": {
"name": "Jane Smith"
},
"items": [
{
"product_id": 123,
"quantity": 2,
"unit_price": 49.99
}
]
}
'{
"data": {
"id": 12345,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"status": "Active",
"order_id": "12345",
"order_number": "ORD-2024-001",
"order_date": "2024-01-15",
"order_status": "pending",
"customer_email": "customer@example.com",
"customer_username": "johndoe123",
"customer_po_number": "PO-2024-5678",
"company_id": 123,
"company": {
"id": 123,
"name": "Acme Corporation",
"status": "active",
"address": "123 Main Street",
"city": "Anytown",
"state": "CA",
"postal_code": "90210",
"country": "US"
},
"bill_to": {
"name": "John Doe",
"company": "Acme Corporation",
"street1": "123 Main Street",
"street2": "Suite 100",
"city": "Anytown",
"state": "CA",
"postal_code": "90210",
"country": "US",
"phone": "555-1234"
},
"ship_to": {
"name": "Jane Smith",
"company": "Delivery Corp",
"street1": "456 Oak Avenue",
"city": "Somewhere",
"state": "NY",
"postal_code": "10001",
"country": "US",
"phone": "555-5678"
},
"total": 128.23,
"total_paid": 0,
"total_tax": 15.75,
"total_shipping": 12.5,
"product_total": 99.98,
"requested_shipping_service": "FedEx Ground",
"customer_notes": "Please handle with care - fragile items",
"internal_notes": "Rush order - expedite processing",
"ship_date": "2024-01-20",
"hold_until_date": "2024-01-18",
"ship_by_date": "2024-01-25",
"earliest_ship_date": "2024-01-18",
"externally_fulfilled": false,
"is_posted": false,
"source": "external_api",
"total_order_quantity": 3,
"items": [
{
"id": 67890,
"line_number": 1,
"sku": "WIDGET-001",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99,
"upc": "123456789012",
"product_id": 123,
"tags": [],
"custom_fields": {}
},
{
"id": 67891,
"line_number": 2,
"sku": "WIDGET-002",
"name": "Standard Widget",
"quantity": 1,
"unit_price": 25,
"upc": "123456789013",
"product_id": 124,
"tags": [],
"custom_fields": {}
}
],
"tags": [
{
"id": 1,
"name": "urgent"
},
{
"id": 2,
"name": "vip-customer"
},
{
"id": 3,
"name": "rush-order"
}
],
"custom_fields": {
"Customer PO": "PO-98765",
"Priority Level": "High",
"Package Count": 3
}
}
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Body
ID of the channel this order belongs to
1
Unique order number identifier
255"ORD-2024-001"
Date when the order was placed (YYYY-MM-DD)
"2024-01-15"
Current status of the order
pending, shipped, fulfilled, cancelled, awaiting_shipment, partially_shipped, on_hold, backorder, partially_refunded, committed, processing, completed 255"pending"
Array of line items for the order
1Show child attributes
Show child attributes
Customer's email address
255"customer@example.com"
Customer's username
255"customer123"
Customer's purchase order number
255"PO-2024-5678"
ID of the company (business account) to associate with this sales order.
When provided, the system will automatically populate the bill_to and ship_to
addresses from the company's information. If company_id is provided, the
bill_to and ship_to fields become optional.
123
Billing address information. Required when company_id is not provided.
When company_id is provided, this field is optional and will be populated
from the company's billing address if not specified.
Show child attributes
Show child attributes
Shipping address information. Required when company_id is not provided.
When company_id is provided, this field is optional and will be populated
from the company's default shipping address if not specified.
Show child attributes
Show child attributes
Date when the order was or will be shipped (YYYY-MM-DD)
"2024-01-20"
Date to hold the order until (YYYY-MM-DD)
"2024-01-18"
Required ship by date (YYYY-MM-DD)
"2024-01-25"
Earliest date the order can be shipped (YYYY-MM-DD)
"2024-01-18"
Total tax amount for the order
x >= 015.75
Total shipping cost for the order
x >= 012.5
Total discount amount applied to the order. If omitted, any header trade discount configured on the linked company (see header_discount_enabled, header_discount_type, and header_discount_value on the company) is computed and applied automatically. Provide an explicit value to override.
x >= 010
Requested shipping service or carrier
255"FedEx Ground"
Notes from the customer
"Please handle with care - fragile items"
Internal notes for order processing
"Rush order - expedite processing"
Custom field values for the sales order
Show child attributes
Show child attributes
{
"Customer PO": "PO-98765",
"Priority Level": "High",
"Package Count": 3
}
Tags to associate with the sales order
255["urgent", "vip-customer", "rush-order"]
Response
Sales order created successfully
Show child attributes
Show child attributes