orders

Create a channel order (synchronous)

Validates and synchronously materializes a channel order: checks the channel is active; optionally links an existing customer by customer_id (the order is left unidentified when omitted); validates every item SKU against an active product and every payment method against an active payment method; cross-checks the subtotal against the sum of item totals; then persists the order, its items, addresses, mirrored payments and bootstrap timeline event in a single transaction. A duplicate (same external_order_id + channel) is rejected with 409. Authenticated as a channel service account.

post/api/v1/orders

Request body

requested_strategy_codestring nullable
source_storestring nullable
shipping_methodstring nullable
currency'BRL' | 'USD'
customer_idstring uuid nullable
metadataobject nullable
external_order_idstring required
channel_codestring required

Response

Order created.

idstring required
external_order_idstring required
channel_idstring required
customer_idstring nullable required
requested_strategy_codestring nullable required
source_storestring nullable required
shipping_methodstring nullable required
statusstring required
state_machine_version_idstring required
state_machine_idstring required
currency'BRL' | 'USD' required
subtotalnumber required
shippingnumber required
discountnumber required
totalnumber required
item_countnumber required
created_atstring required
updated_atstring required

Changes

Changed in 2 of the 9 revisions of this API.3426

  • a3b4750a505f3425See the full diff
    • added the new required request property billing_address/allOf[OrderAddressCreate]/city

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/country

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/district

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/number

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/state

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/street

      new-required-request-property

    • added the new required request property billing_address/allOf[OrderAddressCreate]/zip_code

      new-required-request-property

    • added the new required request property channel_code

      new-required-request-property

    • added the new required request property external_order_id

      new-required-request-property

    • added the new required request property items/items/name

      new-required-request-property

    • added the new required request property items/items/quantity

      new-required-request-property

    • added the new required request property items/items/sku

      new-required-request-property

    • added the new required request property items/items/total_price

      new-required-request-property

    • added the new required request property items/items/unit_price

      new-required-request-property

    • added the new required request property payments/items/amount

      new-required-request-property

    • added the new required request property payments/items/method

      new-required-request-property

    • added the new required request property payments/items/status

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/city

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/country

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/district

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/number

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/state

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/street

      new-required-request-property

    • added the new required request property shipping_address/allOf[OrderAddressCreate]/zip_code

      new-required-request-property

    • added the new required request property totals/discount

      new-required-request-property

    • added the new required request property totals/shipping

      new-required-request-property

    • added the new required request property totals/subtotal

      new-required-request-property

    • added the new required request property totals/total

      new-required-request-property

    • the items request property's minItems was increased to 1

      request-property-min-items-increased

    • the payments request property's minItems was increased to 1

      request-property-min-items-increased

    • the customer_id request property type/format changed from object/uuid to string/uuid

      request-property-type-changed

    • the requested_strategy_code request property type/format changed from object/ to string/

      request-property-type-changed

    • the shipping_method request property type/format changed from object/ to string/

      request-property-type-changed

    • the source_store request property type/format changed from object/ to string/

      request-property-type-changed

    • added the new optional request property billing_address/allOf[OrderAddressCreate]/complement

      new-optional-request-property

    • added the new optional request property items/items/category

      new-optional-request-property

    • added the new optional request property items/items/discount

      new-optional-request-property

    • added the new optional request property items/items/metadata

      new-optional-request-property

    • added the new optional request property payments/items/gateway_payment_id

      new-optional-request-property

    • added the new optional request property payments/items/installments

      new-optional-request-property

    • added the new optional request property shipping_address/allOf[OrderAddressCreate]/complement

      new-optional-request-property

    • added the required property channel_id to the response with the 201 status

      response-required-property-added

    • added the required property created_at to the response with the 201 status

      response-required-property-added

    • added the required property currency to the response with the 201 status

      response-required-property-added

    • added the required property customer_id to the response with the 201 status

      response-required-property-added

    • added the required property discount to the response with the 201 status

      response-required-property-added

    • added the required property external_order_id to the response with the 201 status

      response-required-property-added

    • added the required property id to the response with the 201 status

      response-required-property-added

    • added the required property item_count to the response with the 201 status

      response-required-property-added

    • added the required property requested_strategy_code to the response with the 201 status

      response-required-property-added

    • added the required property shipping to the response with the 201 status

      response-required-property-added

    • added the required property shipping_method to the response with the 201 status

      response-required-property-added

    • added the required property source_store to the response with the 201 status

      response-required-property-added

    • added the required property state_machine_id to the response with the 201 status

      response-required-property-added

    • added the required property state_machine_version_id to the response with the 201 status

      response-required-property-added

    • added the required property status to the response with the 201 status

      response-required-property-added

    • added the required property subtotal to the response with the 201 status

      response-required-property-added

    • added the required property total to the response with the 201 status

      response-required-property-added

    • added the required property updated_at to the response with the 201 status

      response-required-property-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 36 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog