> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chift.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an order

> Create a new order



## OpenAPI

````yaml post /consumers/{consumer_id}/commerce/orders
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/commerce/orders:
    post:
      tags:
        - eCommerce
        - Orders
      summary: Create an order
      description: Create a new order
      operationId: ecommerce_create_order
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderItemIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderItemOut'
        '400':
          content:
            application/json:
              examples:
                No lines:
                  value:
                    message: The order must contain at least one line.
                    status: error
                Invalid currency:
                  value:
                    message: >-
                      The currency format is not correct. Please use the ISO
                      4217 codes.
                    status: error
                Invalid country:
                  value:
                    message: >-
                      The country format is not correct. Please use the ISO
                      3166-1 codes.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '422':
          content:
            application/json:
              examples:
                Invalid phone number:
                  value:
                    message: >-
                      The phone number doesnt seem to be valid. The number must
                      begin with the country code.
                    status: error
                Phone number used:
                  value:
                    message: The phone number is already used by another client.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Unprocessable Entity
      security:
        - mcp_auth:
            - commerce
            - commerce.orders
components:
  schemas:
    OrderItemIn:
      properties:
        customer:
          $ref: '#/components/schemas/OrderCustomerItem'
        billing_address:
          $ref: '#/components/schemas/CommerceAddressItemIn'
        shipping_address:
          $ref: '#/components/schemas/CommerceAddressItemIn'
        currency:
          type: string
          title: Currency
          description: Indicates the currency of the order (e.g. EUR).
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        lines:
          items:
            $ref: '#/components/schemas/OrderLineItemIn'
          type: array
          minItems: 1
          title: Lines
        payment_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Method
          description: >-
            If filled in the order will be marked as paid and processed by this
            payment method.
      type: object
      required:
        - customer
        - billing_address
        - shipping_address
        - currency
        - lines
      title: OrderItemIn
    OrderItemOut:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        order_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Order Number
        customer:
          anyOf:
            - $ref: '#/components/schemas/OrderCustomerItemOut'
            - type: 'null'
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/CommerceAddressItemOut'
            - type: 'null'
        shipping_address:
          anyOf:
            - $ref: '#/components/schemas/CommerceAddressItemOut'
            - type: 'null'
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        last_updated_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Updated On
        confirmed_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Confirmed On
        delivery_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Delivery Date
        cancelled_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Cancelled On
        status:
          $ref: '#/components/schemas/OrderStatus'
        fulfillment:
          anyOf:
            - $ref: '#/components/schemas/EcommerceFulfillmentObject'
            - type: 'null'
        discount_amount:
          type: number
          title: Discount Amount
        untaxed_amount_without_fees:
          type: number
          title: Untaxed Amount Without Fees
          description: >-
            Untaxed amount without fees (e.g. shipping) but with discout.
            Refunds and returns are not included.
        tax_amount_without_fees:
          type: number
          title: Tax Amount Without Fees
          description: >-
            Total taxes applied to the order without taxes linked to fees (e.g.
            shipping).
        total_without_fees:
          type: number
          title: Total Without Fees
          description: >-
            Total of the order without fees (e.g. shipping) but with discount.
            Refunds and returns are not included.
        current_untaxed_amount:
          type: number
          title: Current Untaxed Amount
          description: >-
            Untaxed amount with discout and any kind of fee (e.g. shipping).
            After returns, removes and returns.
        current_tax_amount:
          type: number
          title: Current Tax Amount
          description: >-
            Total taxes applied to the order. After returns, removes and
            returns.
        current_total:
          type: number
          title: Current Total
          description: >-
            Current total of the order with discount. After returns, removes and
            returns.
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: >-
            Untaxed amount with discout and any kind of fee (e.g. shipping).
            Refunds and returns are not included.
        tax_amount:
          type: number
          title: Tax Amount
          description: >-
            Total taxes applied to the order. Refunds and returns are not
            included.
        total:
          type: number
          title: Total
          description: >-
            Total of the order with discount. Refunds and returns are not
            included.
        refunded_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Refunded Amount
          default: 0
        currency:
          type: string
          title: Currency
          description: Indicates the currency of the order (e.g. EUR).
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          default: []
        lines:
          items:
            $ref: '#/components/schemas/OrderLineItemOut'
          type: array
          title: Lines
        other_fees:
          anyOf:
            - items:
                $ref: '#/components/schemas/FeesItem'
              type: array
            - type: 'null'
          title: Other Fees
          default: []
        payment_method_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Method Id
          description: Technical id of the payment method in the eCommerce
        transactions:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrderTransactions'
              type: array
            - type: 'null'
          title: Transactions
          default: []
        payment_methods:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrderPaymentMethods'
              type: array
            - type: 'null'
          title: Payment Methods
          default: []
        detailed_refunds:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrderRefundItem'
              type: array
            - type: 'null'
          title: Detailed Refunds
        returns:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrderReturnItem'
              type: array
            - type: 'null'
          title: Returns
          default: []
      type: object
      required:
        - id
        - source_ref
        - status
        - discount_amount
        - untaxed_amount_without_fees
        - tax_amount_without_fees
        - total_without_fees
        - current_untaxed_amount
        - current_tax_amount
        - current_total
        - untaxed_amount
        - tax_amount
        - total
        - currency
        - lines
      title: OrderItemOut
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
      type: object
      required:
        - message
      title: ChiftError
    OrderCustomerItem:
      properties:
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        internal_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internal Notes
        email:
          type: string
          title: Email
      type: object
      required:
        - email
      title: OrderCustomerItem
    CommerceAddressItemIn:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        street:
          type: string
          title: Street
        number:
          type: string
          title: Number
        box:
          anyOf:
            - type: string
            - type: 'null'
          title: Box
        city:
          type: string
          title: City
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
        country:
          type: string
          title: Country
          description: 'Format: ISO 3166-1 codes.'
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
      type: object
      required:
        - first_name
        - last_name
        - street
        - number
        - city
        - country
      title: CommerceAddressItemIn
    OrderLineItemIn:
      properties:
        variant_id:
          type: string
          title: Variant Id
          description: Technical id of the product variant in Chift
        quantity:
          type: integer
          title: Quantity
        tax_rate:
          type: number
          title: Tax Rate
          description: Indicates the tax rate used for the line (e.g. 21.0).
        unit_price:
          type: number
          title: Unit Price
          description: Unit price of the product without taxes.
      type: object
      required:
        - variant_id
        - quantity
        - tax_rate
        - unit_price
      title: OrderLineItemIn
    Ref:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Technical id in the target software
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Name of the model/entity in the target software
      type: object
      title: Ref
    OrderCustomerItemOut:
      properties:
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        internal_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internal Notes
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        id:
          type: string
          title: Id
          description: Technical id of the customer in Chift
      type: object
      required:
        - id
      title: OrderCustomerItemOut
    CommerceAddressItemOut:
      properties:
        address_type:
          $ref: '#/components/schemas/AddressType'
        company_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Company Name
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        street:
          anyOf:
            - type: string
            - type: 'null'
          title: Street
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
        box:
          anyOf:
            - type: string
            - type: 'null'
          title: Box
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: 'Format: ISO 3166-1 codes.'
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        vat:
          anyOf:
            - type: string
            - type: 'null'
          title: Vat
      type: object
      required:
        - address_type
      title: CommerceAddressItemOut
    OrderStatus:
      type: string
      enum:
        - cancelled_unpaid
        - cancelled
        - draft
        - confirmed
        - shipped
        - refunded
      title: OrderStatus
    EcommerceFulfillmentObject:
      properties:
        fulfillment_type:
          $ref: '#/components/schemas/EcommerceFulfillmentType'
        shipping_from_address:
          anyOf:
            - $ref: '#/components/schemas/AddressItemOut'
            - type: 'null'
      type: object
      required:
        - fulfillment_type
      title: EcommerceFulfillmentObject
    OrderLineItemOut:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        variant:
          anyOf:
            - $ref: '#/components/schemas/OrderLineProductVariantItem'
            - type: 'null'
          description: Product variant
        quantity:
          type: integer
          title: Quantity
        current_quantity:
          type: integer
          title: Current Quantity
          description: Quantity without refunds and returns.
        unit_price:
          type: number
          title: Unit Price
          description: Unit price of the product without taxes.
        description:
          type: string
          title: Description
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: Technical id of the tax rate in Chift
        tax_rate:
          type: number
          title: Tax Rate
          description: Indicates the tax rate used for the line (e.g. 21.0).
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount of the order line with discount.
        tax_amount:
          type: number
          title: Tax Amount
          description: Total taxes applied to the order line.
        total:
          type: number
          title: Total
          description: Total of the order line with discount.
        discounts:
          anyOf:
            - items:
                $ref: '#/components/schemas/CommerceDiscountItem'
              type: array
            - type: 'null'
          title: Discounts
          default: []
        gift_card:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Gift Card
          default: false
        is_gift:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Gift
          default: false
      type: object
      required:
        - id
        - source_ref
        - quantity
        - current_quantity
        - unit_price
        - description
        - tax_rate
        - untaxed_amount
        - tax_amount
        - total
      title: OrderLineItemOut
    FeesItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        type:
          $ref: '#/components/schemas/FeesType'
        removed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Removed
          description: Indicates if the fee has been removed from the order
          default: false
        tax_rate:
          type: number
          title: Tax Rate
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: Technical id of the tax rate in Chift
        discounts:
          anyOf:
            - items:
                $ref: '#/components/schemas/CommerceDiscountItem'
              type: array
            - type: 'null'
          title: Discounts
          default: []
        untaxed_amount:
          type: number
          title: Untaxed Amount
        tax_amount:
          type: number
          title: Tax Amount
        total:
          type: number
          title: Total
      type: object
      required:
        - id
        - source_ref
        - type
        - tax_rate
        - untaxed_amount
        - tax_amount
        - total
      title: FeesItem
    OrderTransactions:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the transaction in the eCommerce
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        payment_method_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Method Id
          description: Technical id of the payment method in the eCommerce
        payment_method_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Method Name
          description: Name of the payment method
        amount:
          type: number
          title: Amount
        status:
          $ref: '#/components/schemas/CommerceTransactionStatus'
      type: object
      required:
        - id
        - amount
        - status
      title: OrderTransactions
    OrderPaymentMethods:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the payment method in the eCommerce
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the payment method
      type: object
      required:
        - id
      title: OrderPaymentMethods
    OrderRefundItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        total:
          type: number
          title: Total
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        order_lines:
          anyOf:
            - items:
                $ref: '#/components/schemas/RefundOrderLineItem'
              type: array
            - type: 'null'
          title: Order Lines
          default: []
        other:
          anyOf:
            - type: number
            - type: 'null'
          title: Other
          default: 0
        shipping_refunds:
          anyOf:
            - items:
                $ref: '#/components/schemas/ShippingRefund'
              type: array
            - type: 'null'
          title: Shipping Refunds
          default: []
        other_fees:
          anyOf:
            - items:
                $ref: '#/components/schemas/RefundFeesItem'
              type: array
            - type: 'null'
          title: Other Fees
          default: []
        transactions:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrderTransactions'
              type: array
            - type: 'null'
          title: Transactions
          default: []
      type: object
      required:
        - id
        - source_ref
        - total
      title: OrderRefundItem
    OrderReturnItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the return in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        created_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created On
        order_lines:
          anyOf:
            - items:
                $ref: '#/components/schemas/ReturnOrderLineItem'
              type: array
            - type: 'null'
          title: Order Lines
          default: []
        new_lines:
          anyOf:
            - items:
                $ref: '#/components/schemas/ReturnOrderLineItem'
              type: array
            - type: 'null'
          title: New Lines
          default: []
        linked_fees:
          anyOf:
            - items:
                $ref: '#/components/schemas/ReturnFeesItem'
              type: array
            - type: 'null'
          title: Linked Fees
          default: []
      type: object
      required:
        - id
        - source_ref
      title: OrderReturnItem
    AddressType:
      type: string
      enum:
        - main
        - delivery
        - invoice
      title: AddressType
    EcommerceFulfillmentType:
      type: string
      enum:
        - FBA
        - FBM
      title: EcommerceFulfillmentType
    AddressItemOut:
      properties:
        address_type:
          $ref: '#/components/schemas/AddressType'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
        box:
          anyOf:
            - type: string
            - type: 'null'
          title: Box
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        mobile:
          anyOf:
            - type: string
            - type: 'null'
          title: Mobile
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        street:
          anyOf:
            - type: string
            - type: 'null'
          title: Street
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: 'Format: ISO 3166-1 codes.'
      type: object
      required:
        - address_type
      title: AddressItemOut
    OrderLineProductVariantItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the product variant in Chift
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        name:
          type: string
          title: Name
        categories:
          anyOf:
            - items:
                $ref: '#/components/schemas/CommerceProductCategoryItem'
              type: array
            - type: 'null'
          title: Categories
          default: []
      type: object
      required:
        - id
        - name
      title: OrderLineProductVariantItem
    CommerceDiscountItem:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        amount:
          type: number
          title: Amount
      type: object
      required:
        - name
        - description
        - amount
      title: CommerceDiscountItem
    FeesType:
      type: string
      enum:
        - shipping
        - other
      title: FeesType
    CommerceTransactionStatus:
      type: string
      enum:
        - failed
        - pending
        - success
      title: CommerceTransactionStatus
    RefundOrderLineItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the order line in Chift
        variant:
          anyOf:
            - $ref: '#/components/schemas/OrderLineProductVariantItem'
            - type: 'null'
          description: Product variant
        quantity:
          type: integer
          title: Quantity
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount refunded (after discount).
        tax_amount:
          type: number
          title: Tax Amount
          description: Total taxes refunded (after discount).
        total:
          type: number
          title: Total
          description: Total refunded (after discount).
      type: object
      required:
        - id
        - quantity
        - untaxed_amount
        - tax_amount
        - total
      title: RefundOrderLineItem
    ShippingRefund:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount refunded (after discount).
        tax_amount:
          type: number
          title: Tax Amount
          description: Total taxes refunded (after discount).
        total:
          type: number
          title: Total
          description: Total refunded (after discount).
      type: object
      required:
        - id
        - source_ref
        - untaxed_amount
        - tax_amount
        - total
      title: ShippingRefund
    RefundFeesItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the fee in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        type:
          $ref: '#/components/schemas/FeesType'
        untaxed_amount:
          type: number
          title: Untaxed Amount
        tax_amount:
          type: number
          title: Tax Amount
        total:
          type: number
          title: Total
      type: object
      required:
        - id
        - source_ref
        - type
        - untaxed_amount
        - tax_amount
        - total
      title: RefundFeesItem
    ReturnOrderLineItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the order line in Chift
        variant:
          anyOf:
            - $ref: '#/components/schemas/OrderLineProductVariantItem'
            - type: 'null'
          description: Product variant
        quantity:
          type: integer
          title: Quantity
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount refunded (after discount).
        tax_amount:
          type: number
          title: Tax Amount
          description: Total taxes refunded (after discount).
        total:
          type: number
          title: Total
          description: Total refunded (after discount).
      type: object
      required:
        - id
        - quantity
        - untaxed_amount
        - tax_amount
        - total
      title: ReturnOrderLineItem
    ReturnFeesItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the fee in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        type:
          $ref: '#/components/schemas/FeesType'
        untaxed_amount:
          type: number
          title: Untaxed Amount
        tax_amount:
          type: number
          title: Tax Amount
        total:
          type: number
          title: Total
      type: object
      required:
        - id
        - source_ref
        - type
        - untaxed_amount
        - tax_amount
        - total
      title: ReturnFeesItem
    CommerceProductCategoryItem:
      properties:
        id:
          type: string
          title: Id
          description: Technical id of the category in Chift
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: CommerceProductCategoryItem
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````