createOrder
Creates a new order with the specified attributes. You can create orders with customer details, shipping information, order items, and various fulfillment settings.
Requirements
- User must have
create_order
permission - Valid sales channel must be specified or default channel will be used
- All referenced entities (products, carriers, responsible persons) must exist
- Order number must be unique within the brand context (if provided)
Address Requirements
Shipping addresses should include:
address1
- Street addresscity
- City namecountry
- ISO 2-letter country codepostalCode
- Valid postal code for the country
Missing or invalid address fields will set order status to Pending
with appropriate alerts.
Order Items Behavior
- **Product Identification**: Items require either
productId
orsku
- **Quantity**: Positive quantity required (missing quantity creates alert)
- **Stock Management**: Inventory levels are automatically adjusted
- **Fulfillment Method**: Automatically determined based on item processability:
LOCAL
- All items processable locallyDROPSHIP
- All items require dropshippingMIXED
- Combination of local and dropship items
Financial Settings
financialStatus
: Defaults toPAID
if not specifiedshippingCost
andtotalTax
cannot be negativefulfillUnpaid
: Allows fulfillment of orders with non-paid status
Fulfillment Configuration
autoFulfill
: Automatically processes orders when conditions are metallocateToExternal
: Enables allocation to external/read-only facilitieslocalRouting
: Bypasses external integration routing rules- Fulfillment settings inherit from sales channel unless explicitly overridden
Order Identification
orderNumber
: Optional unique identifier within brand contextoriginOrderId
: External system reference (must be unique if provided)- System generates UUID for internal order tracking
Error Responses
ValidationError
: Business rule violations including:- Duplicate order numbers or origin IDs
- Invalid sales channel, responsible person, or integration references
- Negative financial amounts
- Missing required fields for non-local order sources
PermissionError
: Insufficient permissions for order creationNotFoundError
: Referenced entities (sales channels, products, etc.) not found
Order Status Alerts
Orders may be created with status alerts for:
- Missing shipping address (
missingShippingAddress
) - Invalid postal codes (
invalidShippingPostalCode
) - Missing order items (
noOrderItems
) - Auto-fulfill enabled (
autoFulfillEnabled
) - Payment pending (
paymentPending
)
Integration Considerations
For orders from external systems:
sourceIntegrationId
must match valid integration- Integration type must match
originOrderSource
- Additional validation rules may apply based on integration settings
createOrder(
input: CreateOrderInput!
): Order!
Arguments
createOrder.input
● CreateOrderInput!
non-null input
Parameters for CreateOrder
Type
Order
object
The order type. This type represents an order in the system.