Order Management
Overview
Sales Orders in the SynthesQ CRM/ERP system represent customer purchase requests and form the foundation of the order-to-cash workflow. Orders track all aspects of a sale from creation through completion, including line items, pricing, customer information, and fulfillment status.
Breaking change - money fields are now structured objects
As of the fix/77 release, all monetary fields across Orders, Invoices, and Payments are returned as structured objects instead of plain numbers. Update any code that reads these fields.
// Before
"total_amount": 347.47
// After
"total_amount": {
"amount": 347.47,
"cents": 34747,
"currency": "USD",
"formatted": "347.47 USD"
}Fields affected on orders: subtotal_amount, tax_amount, shipping_amount, discount_amount, total_amount
Fields affected on order items: unit_price, discount_amount, tax_amount, line_total
Use amount for arithmetic, cents for exact integer comparisons, and formatted for display.
Order Structure
Core Order Fields
Each order contains the following essential information:
Order Identity:
order_number- Unique identifier (e.g., "ORD-A3X7K9M2")id- Internal database IDorder_date- Date order was placeddue_date- Expected completion/delivery date
Customer Information:
customer_id- Reference to customer recordbilling_address- Customer billing address detailsshipping_info- Shipping address and delivery instructions
Financial Details:
subtotal_amount- Sum of all line items before taxes/feestax_amount- Total tax chargedshipping_amount- Shipping and handling chargesdiscount_amount- Any discounts appliedtotal_amount- Final order total (calculated automatically)currency- ISO 4217 currency code for this order. Defaults to the tenant's configured currency (set at account level). All monetary fields on the order use this currency.
Per-tenant currency
All monetary amounts on an order use the currency of that order. When no explicit currency is provided at order creation, the API defaults to the currency configured for your account. To use a different currency for a specific order, pass "currency": "EUR" (or any supported ISO 4217 code) in the request body.
Business Context:
sales_rep_id- Assigned sales representativesource- Order origin (direct_sale, online_store, phone_order, email_order, opportunity_conversion, quote_conversion, repeat_customer, partner_referral, api_integration, and others)priority- Order priority level (low, standard, high, expedited, rush, critical)quote_id- Reference to related quote (if applicable)opportunity_id- Reference to CRM opportunity (if applicable)
Status Tracking:
status- Current order statusconfirmed_at- When order was confirmed (ISO 8601)shipped_at- When order was shipped (ISO 8601)delivered_at- When order was delivered (ISO 8601)cancelled_at- When order was cancelled, if applicable (ISO 8601)
Status timestamps on creation
When you create an order directly in a non-draft status (e.g. "status": "confirmed" for an API integration or automated import), the corresponding timestamp is set immediately at creation time - you do not need to perform a separate status-transition call. For example, creating an order with "status": "confirmed" returns a non-null confirmed_at in the response.
Computed Integer Fields:
days_since_created- Number of whole days since the order was created (integer, 0 on the day of creation)days_until_due- Number of whole days until the due date (integer; negative when past due, null when no due date is set)fulfillment_days- Number of days from confirmation to shipment or completion (integer; null until the order is confirmed)
Additional Fields:
payment_terms- Payment terms and conditionsnotes- Internal notes about the ordercustom_fields- Extensible JSON field for custom datatags- Array of tags for organization
Order Line Items
Each order contains one or more line items representing products/services:
{
"id": "01hwxyz123abc456def789ghi0",
"order_id": "01hwxyz123abc456def789ghi1",
"product_id": "01hwxyz123abc456def789ghi2",
"sku": "WIDGET-001",
"name": "Premium Widget",
"description": "High-quality widget with advanced features",
"quantity": 5,
"unit_price": { "amount": 89.99, "cents": 8999, "currency": "USD", "formatted": "89.99 USD" },
"catalog_price": { "amount": 99.99, "cents": 9999, "currency": "USD", "formatted": "99.99 USD" },
"is_price_override": true,
"tax_amount": { "amount": 12.50, "cents": 1250, "currency": "USD", "formatted": "12.50 USD" },
"discount_amount": { "amount": 10.00, "cents": 1000, "currency": "USD", "formatted": "10.00 USD" },
"line_total": { "amount": 452.45, "cents": 45245, "currency": "USD", "formatted": "452.45 USD" }
}Each order line item includes two price fields:
unit_price- the price actually charged for this item on this order.catalog_price- the product's listed price at the time the order was created. Always present when the item references a product. Always returned in the order's currency - if the product catalog uses a different currency than the order, the API converts the snapshot to the order currency so all monetary fields on an item are in the same currency.is_price_override-truewhenunit_pricediffers fromcatalog_price. Use this to flag custom-priced orders in your UI.
Server resolves price automatically
unit_price is optional when creating an order. If omitted, the API uses the product's current catalog price and no special permission is required. Only pass unit_price when you intend to charge a different amount.
Price override requires permission
If you submit a unit_price that differs from the catalog price, the authenticating user must hold the sales:override-pricing ability, or the API token must include sales:override-pricing (or sales:*) as a token scope. Without this, the request returns a 422 error on the affected item:
{
"success": false,
"errors": {
"items.0.unit_price": [
"You are not authorized to override the catalog price. Catalog price is 99.99 USD."
]
}
}Order Status Lifecycle
Orders progress through a defined set of statuses:
Draft
Description: Initial state when order is created but not yet submitted
Characteristics:
- Can be freely edited
- Not visible to customer
- No inventory reservations made
- Can be deleted without audit trail
Transitions: → Pending, Pending Approval, Confirmed, Cancelled
Pending
Description: Order submitted and awaiting confirmation
Characteristics:
- Customer notified
- Awaiting payment or approval
- Limited editing allowed
- Inventory may be reserved
Transitions: → Pending Approval, Confirmed, Cancelled, On Hold
Pending Approval
Description: Order submitted but requires manager approval before confirmation
Characteristics:
- Awaiting internal sign-off
- Typically for high-value or custom-priced orders
- Cannot proceed to fulfillment until approved
Transitions: → Confirmed, Cancelled, On Hold
Confirmed
Description: Order approved and ready for fulfillment
Characteristics:
- Payment authorized or received
- Inventory reserved
- Fulfillment team notified
- Cannot be easily modified
Transitions: → Processing, Cancelled, On Hold
Processing
Description: Order being prepared for shipment
Characteristics:
- Items being picked/packed
- Inventory actively allocated
- Shipping label may be generated
- Customer notified of progress
Transitions: → Partially Shipped, Shipped, Cancelled, On Hold
Partially Shipped
Description: Some items have shipped; others are pending
Characteristics:
- At least one shipment dispatched
- Remaining items awaiting fulfillment
- Customer notified of partial delivery
Transitions: → Shipped, Delivered, Cancelled
Shipped
Description: Order dispatched to customer
Characteristics:
- All items shipped
- Tracking number assigned
- Customer notified with tracking info
Transitions: → Delivered, Cancelled
Delivered
Description: Order received by customer
Characteristics:
- Delivery confirmed
- Customer signature obtained (if required)
- Ready for completion
- Return period begins
Transitions: → Completed, Refunded
Completed
Description: Order fully fulfilled and closed
Characteristics:
- All items delivered and accepted
- Payment received
- Invoice generated and sent
- No further action required
Transitions: Terminal state
Cancelled
Description: Order cancelled before completion
Characteristics:
cancellation_reasonrequired- Inventory reservations released
- Customer notified
- Cannot be reactivated
Transitions: Terminal state
Refunded
Description: Payment returned to customer after delivery
Characteristics:
- Full refund issued
- Product return may be required
- Revenue reversed
Transitions: Terminal state
On Hold
Description: Order temporarily paused
Characteristics:
- Used for payment issues, stock problems, or customer requests
- Can be resumed to previous status
- Inventory reservations maintained
- Customer notified of hold status
Transitions: → Confirmed, Processing, Cancelled
Creating Orders
Basic Order Creation
Endpoint: POST /api/v1/sales/orders
Authentication: Required (Bearer token)
Request Body:
{
"customer_id": "01hwxyz123abc456def789ghi3",
"order_date": "2025-12-17",
"due_date": "2025-12-24",
"source": "online_store",
"priority": "standard",
"currency": "USD",
"billing_address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"shipping_info": {
"method": "standard",
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US",
"instructions": "Leave at front door"
},
"payment_terms": {
"method": "credit_card",
"terms": "Net 30",
"due_days": 30
},
"items": [
{
"product_id": "01hwxyz123abc456def789ghi4",
"quantity": 2,
"unit_price": 99.99,
"tax_amount": 5.00,
"discount_amount": 0
},
{
"product_id": "01hwxyz123abc456def789ghi5",
"quantity": 1,
"unit_price": 149.99,
"tax_amount": 7.50,
"discount_amount": 15.00
}
],
"notes": "Customer is VIP - prioritize fulfillment"
}Response (201 Created):
{
"success": true,
"message": "Order created successfully",
"data": {
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"status": "draft",
"customer": {
"id": "01hwxyz123abc456def789ghi3",
"customer_number": "CUST-00042",
"company_name": "Acme Corporation",
"email": "orders@acme.com"
},
"sales_rep": null,
"order_date": "2025-12-17",
"due_date": "2025-12-24",
"source": "online_store",
"priority": "standard",
"subtotal_amount": { "amount": 349.97, "cents": 34997, "currency": "USD", "formatted": "349.97 USD" },
"tax_amount": { "amount": 12.50, "cents": 1250, "currency": "USD", "formatted": "12.50 USD" },
"shipping_amount": { "amount": 0.00, "cents": 0, "currency": "USD", "formatted": "0.00 USD" },
"discount_amount": { "amount": 15.00, "cents": 1500, "currency": "USD", "formatted": "15.00 USD" },
"total_amount": { "amount": 347.47, "cents": 34747, "currency": "USD", "formatted": "347.47 USD" },
"currency": "USD",
"items": [
{
"id": "01hwxyz123abc456def789ghi7",
"product_id": "01hwxyz123abc456def789ghi4",
"sku": "WIDGET-001",
"name": "Premium Widget",
"quantity": 2,
"unit_price": { "amount": 99.99, "cents": 9999, "currency": "USD", "formatted": "99.99 USD" },
"tax_amount": { "amount": 5.00, "cents": 500, "currency": "USD", "formatted": "5.00 USD" },
"discount_amount": { "amount": 0.00, "cents": 0, "currency": "USD", "formatted": "0.00 USD" },
"line_total": { "amount": 204.98, "cents": 20498, "currency": "USD", "formatted": "204.98 USD" }
},
{
"id": "01hwxyz123abc456def789ghi8",
"product_id": "01hwxyz123abc456def789ghi5",
"sku": "GADGET-002",
"name": "Smart Gadget",
"quantity": 1,
"unit_price": { "amount": 149.99, "cents": 14999, "currency": "USD", "formatted": "149.99 USD" },
"tax_amount": { "amount": 7.50, "cents": 750, "currency": "USD", "formatted": "7.50 USD" },
"discount_amount": { "amount": 15.00, "cents": 1500, "currency": "USD", "formatted": "15.00 USD" },
"line_total": { "amount": 142.49, "cents": 14249, "currency": "USD", "formatted": "142.49 USD" }
}
],
"billing_address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"shipping_info": {
"method": "standard",
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US",
"instructions": "Leave at front door"
},
"confirmed_at": null,
"shipped_at": null,
"delivered_at": null,
"cancelled_at": null,
"created_at": "2025-12-17T10:30:00Z",
"updated_at": "2025-12-17T10:30:00Z"
}
}Order Validation
The system validates orders during creation:
Required Fields:
customer_id- Must reference valid customeritems- At least one line item required- Each item must have:
product_id,quantity, andline_total
Optional Fields:
unit_priceper item - when omitted, the server uses the product's catalog price
Automatic Calculations:
subtotal_amount- Sum of all line itemline_totalvalues (auto-calculated when omitted)total_amount- Subtotal + tax + shipping − discount (always server-calculated)- Line item
line_total- Provided by caller; must equalunit_price × quantity − discount
Business Rules:
quantitymust be a positive integerunit_pricemust be non-negativedue_datemust be on or afterorder_date- If
subtotal_amountis provided, it must equal the sum of all itemline_totalvalues (within ±0.01 tolerance); otherwise the request is rejected with a422error identifying the expected value - Product inventory checked if
track_inventoryis enabled on the product
Listing Orders
Get All Orders
Endpoint: GET /api/v1/sales/orders
Authentication: Required (Bearer token)
Query Parameters:
status(string) - Filter by status (draft, pending, confirmed, etc.)customer_id(string) - Filter by customersales_rep_id(string) - Filter by sales representativesource(string) - Filter by source (direct_sale, online_store, phone_order, email_order, opportunity_conversion, etc.)priority(string) - Filter by priority (low, standard, high, expedited, rush, critical)from_date(date) - Filter by order_date >= this dateto_date(date) - Filter by order_date <= this datemin_total(number) - Filter by total_amount >= this valuemax_total(number) - Filter by total_amount <= this valuesearch(string) - Search order number, customer name/emailsort_by(string) - Sort field (order_date, total_amount, status, due_date)sort_direction(string) - Sort direction (asc, desc)page(integer) - Page number for paginationper_page(integer) - Items per page (default: 25, max: 100)
Example Request:
GET /api/v1/sales/orders?status=confirmed&from_date=2025-12-01&sort_by=order_date&sort_direction=desc&per_page=50Response (200 OK):
{
"success": true,
"message": null,
"data": [
{
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"status": "confirmed",
"customer": {
"id": "01hwxyz123abc456def789ghi3",
"customer_number": "CUST-00042",
"company_name": "Acme Corporation"
},
"order_date": "2025-12-17",
"due_date": "2025-12-24",
"total_amount": { "amount": 347.47, "cents": 34747, "currency": "USD", "formatted": "347.47 USD" },
"currency": "USD",
"confirmed_at": "2025-12-17T11:00:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 50,
"total": 1,
"last_page": 1,
"from": 1,
"to": 1
},
"links": {
"first": "/api/v1/sales/orders?page=1",
"last": "/api/v1/sales/orders?page=1",
"prev": null,
"next": null
}
}Retrieving Order Details
Endpoint: GET /api/v1/sales/orders/{order}
Authentication: Required (Bearer token)
Response (200 OK):
{
"success": true,
"message": null,
"data": {
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"status": "confirmed",
"customer": {
"id": "01hwxyz123abc456def789ghi3",
"customer_number": "CUST-00042",
"company_name": "Acme Corporation",
"email": "orders@acme.com",
"phone": "+1-555-0100"
},
"sales_rep": {
"id": "01hwxyz123abc456def789ghi9",
"name": "Jane Smith",
"email": "jane.smith@company.com"
},
"order_date": "2025-12-17",
"due_date": "2025-12-24",
"source": "online_store",
"priority": "standard",
"subtotal_amount": { "amount": 349.97, "cents": 34997, "currency": "USD", "formatted": "349.97 USD" },
"tax_amount": { "amount": 12.50, "cents": 1250, "currency": "USD", "formatted": "12.50 USD" },
"shipping_amount": { "amount": 0.00, "cents": 0, "currency": "USD", "formatted": "0.00 USD" },
"discount_amount": { "amount": 15.00, "cents": 1500, "currency": "USD", "formatted": "15.00 USD" },
"total_amount": { "amount": 347.47, "cents": 34747, "currency": "USD", "formatted": "347.47 USD" },
"currency": "USD",
"items": [
{
"id": "01hwxyz123abc456def789ghi7",
"product_id": "01hwxyz123abc456def789ghi4",
"sku": "WIDGET-001",
"name": "Premium Widget",
"description": "High-quality widget",
"quantity": 2,
"unit_price": { "amount": 99.99, "cents": 9999, "currency": "USD", "formatted": "99.99 USD" },
"tax_amount": { "amount": 5.00, "cents": 500, "currency": "USD", "formatted": "5.00 USD" },
"discount_amount": { "amount": 0.00, "cents": 0, "currency": "USD", "formatted": "0.00 USD" },
"line_total": { "amount": 204.98, "cents": 20498, "currency": "USD", "formatted": "204.98 USD" }
},
{
"id": "01hwxyz123abc456def789ghi8",
"product_id": "01hwxyz123abc456def789ghi5",
"sku": "GADGET-002",
"name": "Smart Gadget",
"description": "Advanced smart gadget",
"quantity": 1,
"unit_price": { "amount": 149.99, "cents": 14999, "currency": "USD", "formatted": "149.99 USD" },
"tax_amount": { "amount": 7.50, "cents": 750, "currency": "USD", "formatted": "7.50 USD" },
"discount_amount": { "amount": 15.00, "cents": 1500, "currency": "USD", "formatted": "15.00 USD" },
"line_total": { "amount": 142.49, "cents": 14249, "currency": "USD", "formatted": "142.49 USD" }
}
],
"billing_address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"shipping_info": {
"method": "standard",
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US",
"instructions": "Leave at front door"
},
"payment_terms": {
"method": "credit_card",
"terms": "Net 30",
"due_days": 30
},
"confirmed_at": "2025-12-17T11:00:00Z",
"shipped_at": null,
"delivered_at": null,
"cancelled_at": null,
"notes": "Customer is VIP - prioritize fulfillment",
"created_at": "2025-12-17T10:30:00Z",
"updated_at": "2025-12-17T11:00:00Z"
}
}Updating Orders
Endpoint: PUT /api/v1/sales/orders/{order}
Authentication: Required (Bearer token)
Update Constraints:
- Draft orders: Full editing allowed
- Pending/Confirmed orders: Limited fields can be updated
- Processing/Shipped/Delivered orders: Very limited updates
- Completed/Cancelled orders: No updates allowed
Request Body (partial updates supported):
{
"priority": "rush",
"due_date": "2025-12-22",
"shipping_info": {
"method": "express",
"instructions": "Call customer upon arrival"
},
"notes": "Customer called - needs urgent delivery"
}Response (200 OK):
{
"success": true,
"message": "Order updated successfully",
"data": {
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"priority": "rush",
"due_date": "2025-12-22",
"updated_at": "2025-12-17T14:30:00Z"
}
}Searching Orders
Endpoint: GET /api/v1/sales/orders/search
Authentication: Required (Bearer token)
Query Parameters:
q(string, required) - Search querystatus(string) - Filter by statusdate_from(date) - Filter orders from this datedate_to(date) - Filter orders until this dateper_page(integer) - Results per page
Search Fields:
- Order number
- Customer name
- Customer email
- Customer company name
- Customer number
- Order notes
Example Request:
GET /api/v1/sales/orders/search?q=acme&status=confirmedResponse (200 OK):
{
"success": true,
"message": null,
"data": [
{
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"status": "confirmed",
"customer": {
"id": "01hwxyz123abc456def789ghi3",
"customer_number": "CUST-00042",
"company_name": "Acme Corporation"
},
"total_amount": 347.47,
"order_date": "2025-12-17"
}
],
"meta": {
"total": 1,
"per_page": 25,
"current_page": 1
}
}Orders Requiring Attention
Endpoint: GET /api/v1/sales/orders/requires-attention
Authentication: Required (Bearer token)
Returns: Orders that need immediate action:
- Orders overdue (past due_date)
- Orders due within 1 day
- Orders in pending_approval status
- Orders on_hold status
Response (200 OK):
{
"success": true,
"message": null,
"data": [
{
"id": "01hwxyz123abc456def789ghi6",
"order_number": "ORD-A3X7K9M2",
"status": "pending",
"customer": {
"id": "01hwxyz123abc456def789ghi3",
"company_name": "Acme Corporation"
},
"total_amount": 347.47,
"due_date": "2025-12-18",
"days_until_due": 1,
"is_overdue": false,
"is_urgent": true,
"reason": "Due within 1 day"
}
],
"meta": {
"total_attention_required": 1,
"overdue_count": 0,
"urgent_count": 1
}
}High-Value Orders
Endpoint: GET /api/v1/sales/orders/high-value
Authentication: Required (Bearer token)
Query Parameters:
minimum_amount(number) - Minimum order total (default: 10000)status(string) - Filter by statusfrom_date(date) - Filter from dateto_date(date) - Filter to date
Example Request:
GET /api/v1/sales/orders/high-value?minimum_amount=5000&status=confirmedResponse (200 OK):
{
"success": true,
"message": null,
"data": [
{
"id": "01hwxyz123abc456def789ghj0",
"order_number": "ORD-B7Y9L2K5",
"status": "confirmed",
"customer": {
"id": "01hwxyz123abc456def789ghj1",
"company_name": "Enterprise Corp"
},
"total_amount": { "amount": 12450.00, "cents": 1245000, "currency": "USD", "formatted": "12450.00 USD" },
"currency": "USD",
"order_date": "2025-12-17",
"is_high_value": true
}
],
"meta": {
"total": 1,
"total_value": 12450.00,
"average_value": 12450.00
}
}Business Scenarios
Scenario 1: Creating Order from Quote
When a customer accepts a quote, convert it to an order:
- Retrieve quote details:
GET /api/v1/sales/quotes/{quote_id} - Create order with quote reference:
{
"customer_id": "01hwxyz123abc456def789ghi3",
"quote_id": "01hwxyz123abc456def789ghj2",
"items": [/* items from quote */],
"billing_address": {/* from quote */},
"notes": "Converted from Quote Q-789"
}- Update quote status to "converted"
Scenario 2: Bulk Order Creation
For wholesale customers or recurring orders:
- Prepare order template with common items
- Submit orders via API with customer-specific details
- Use
source: "api"to track automated orders - Set
priority: "standard"unless specified otherwise
Scenario 3: Order with Custom Pricing
When special pricing is negotiated:
- Create order with custom
unit_pricefor items - Add
discount_amountat line item or order level - Include reason in
notesfield - Require approval if discount exceeds threshold
Scenario 4: International Orders
For orders shipping internationally:
- Set appropriate
currency(e.g., "EUR", "GBP") - Include customs information in
shipping_info - Calculate appropriate
tax_amountbased on destination - Allow longer
due_datefor international shipping
Integration Points
With CRM Module
- Orders linked to customers via
customer_id - Can reference opportunities (
opportunity_id) for sales tracking - Customer activities tracked with order events
With Operations Module
- Product inventory reserved when order confirmed
- Stock allocated during order processing
- Inventory decremented when order shipped
- Product availability checked during order creation
With Finance Module
- Orders generate accounts receivable
- Revenue recognition triggered on order completion
- Tax calculations integrated with tax engine
- Payment tracking linked to invoices
Best Practices
Always Validate Customer Data: Ensure customer exists and has complete contact information before creating orders
Set Realistic Due Dates: Consider product availability, shipping method, and customer location
Use Order Source Tracking: Tag orders with appropriate
sourceto analyze channel performanceLeverage Priority Levels: Use priority flags to help fulfillment teams prioritize work
Include Detailed Notes: Document special instructions, customer requests, or unusual circumstances
Monitor Orders Requiring Attention: Check this endpoint daily to prevent missed deadlines
Track High-Value Orders: Give special attention to large orders to ensure customer satisfaction
Use Search Effectively: Utilize search endpoint to quickly locate orders by customer or order number
Related Guides
- Order Workflow - Order confirmation, fulfillment, and completion processes
- Invoice Generation - Creating invoices from orders
- Payment Processing - Processing payments for orders
- Order-to-Cash Workflow - Complete order-to-cash process