Orders > Orders > ordersCreate
Commerce APIOrdersOrdersordersCreate
ordersCreate
POST:orders.json

Description

Create an order.

You can clone an existing order by providing "clone_from_id". Customers can only clone their own orders. When this field is provided all other fields are ignored.

While this API follows "multiple objects" convention, operations only on one order are allowed at a time.

Permission bit: "orders.create"

Topic: Orders

Arguments

data: [OrderCreate!]!

Main argument for mutations.


shop_id: String!

Unique shop identifier. See also: Unique Identifiers

Example: "sh_EQzGqWoY"


updated_at: String


uuid: String


Data Argument Fields

billing_address: AddressCreate

Billing address of an order


billing_address_short_id: String

Billing address of an order (short)

Example: "ar_EQzGqWoY"

Valid when: billing_address_short_id matches regexp pattern: ^ar_


clone_from_id: String

Valid order id to clone from, if used all other parameters are ignored

Example: "or_EQzGqWoY"

Valid when: clone_from_id matches regexp pattern: ^or_


currency: String

Currency to calculate the order in

Example: "USD"


custom_items: [OrderCustomItemCreate!]


customer_email: String

Customer email, used in no auth order flows

Example: "Customer email, used in no auth order flows"


customer_id: String

Customer id order belongs to, if customer creates an order this parameter is ignored

Example: "cu_EQzGqWoY"

Valid when: customer_id matches regexp pattern: ^cu_


discount_code: String

A discount code that can be entered by a customer on checkout

Example: "AD1241251"


gateway_id: String

Gateway used

Example: "gw_EQzGqWoY"

Valid when: gateway_id matches regexp pattern: ^gw_


line_items: [OrderLineItemCreate!]

Order line items


mobile: String

The mobile phone number of the customer (used for notifications)

Example: "45634634562"


mobile_notifications: Boolean

Whether to notify customer via mobile phone or not

Example: false


sales_channel_id: String

Sales channel associated with this order

Example: "sc_EQzGqWoY"

Valid when: sales_channel_id matches regexp pattern: ^sc_


send_fulfillment_notifications: Boolean

Should customer receive fulfillment-related notifications or not

Example: false


send_order_notifications: Boolean

Should customer receive order-related notifications or not

Example: false


shipping_address: AddressCreate

Shipping address of an order


shipping_address_short_id: String

Shipping address of an order (short)

Example: "ar_EQzGqWoY"

Valid when: shipping_address_short_id matches regexp pattern: ^ar_


shipping_rate_ids: [String!]


subscription_id: String

Subscription associated with this order

Example: "ss_EQzGqWoY"

Valid when: subscription_id matches regexp pattern: ^ss_


tags: [String!]

Order tags (can be used for organization)


Result

[Order!]

Preview (typescript)

Loading module