Skip to main content

updateOrder

Updates an existing order with new attributes. You can update order information, customer details, shipping preferences, order items, and fulfillment settings.

Requirements

  • The order must exist and be in an editable status (Ordered, Draft, or Error)
  • User must have update_order permission
  • All referenced entities (sales channels, carriers, products) must exist

Order Status Restrictions

Orders can only be updated when in specific statuses:

  • Ordered - Standard editable state
  • Draft - Pre-submission state
  • Error - Orders with validation issues

Address Validation

Both shipping and billing addresses require:

  • address1 - Street address (required)
  • city - City name (required)
  • country - ISO 2-letter country code (required)
  • postal_code - Valid postal code for the country (required)

Order Items Behavior

  • **New Items**: Require valid product_id or sku and positive quantity
  • **Existing Items**: Use id field to update; set delete: true to remove
  • **Stock Impact**: Quantity changes automatically adjust inventory levels
  • **Integration Sync**: Items are validated through source integration if applicable

Fulfillment Settings

  • fulfill_unpaid: Allows fulfillment of unpaid orders
  • allocate_to_external: Enables allocation to external/read-only facilities
  • auto_fulfill: Automatically fulfills orders when conditions are met
  • local_routing: Bypasses external integration routing rules

Financial Validation

  • shipping_cost and total_tax cannot be negative
  • Financial amounts use decimal precision

Error Responses

  • OrderNotFoundError: Order ID does not exist
  • ValidationError: Business rule violations (see specific error messages)
  • PermissionError: Insufficient permissions for the operation

Integration Considerations

Orders from external integrations undergo additional validation:

  • New items are processed through the source integration
  • Items marked as non-processable may affect fulfillment method
  • Local routing bypasses external validation requirements
updateOrder(
input: UpdateOrderInput!
): Order!

Arguments

updateOrder.input ● UpdateOrderInput! non-null input

Parameters for UpdateOrder

Type

Order object

The order type. This type represents an order in the system.