# SalesChannelCreateOrder

## Create a new order

> Creates a new order in the system for the specified channel

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"channel_path":{"name":"channel_id","in":"path","description":"The channel ID of the resource.","required":true,"schema":{"type":"integer"}}},"schemas":{"OrderCreate":{"type":"object","required":["order","order_item"],"properties":{"order":{"allOf":[{"$ref":"#/components/schemas/CreateOrder"},{"type":"object","description":"Order data containing all necessary information"}]},"order_item":{"type":"array","description":"List of items in the order","items":{"type":"object","required":["product","quantity","unit_price","total_price"],"properties":{"order":{"type":"integer","description":"ID of the order (optional, can be null)"},"product":{"type":"integer","description":"ID of the product"},"status":{"$ref":"#/components/schemas/OrderStatus"},"price_currency":{"$ref":"#/components/schemas/CurrencyEnum"},"price":{"type":"number","format":"decimal","description":"Price of the product"},"quantity":{"type":"integer","description":"Quantity of the product"},"unit_price":{"type":"number","format":"decimal","description":"Price per unit"},"total_price":{"type":"number","format":"decimal","description":"Total price for this item"},"tax_rate":{"type":"number","format":"decimal","description":"Tax rate applied to this item"},"tax_amount":{"type":"number","format":"decimal","description":"Total tax amount for this item"},"extra_field":{"type":"object","description":"Additional information as JSON"},"price_list":{"type":"integer","description":"ID of the price list"},"stock_list":{"type":"integer","description":"ID of the stock list"},"shipping_company":{"$ref":"#/components/schemas/ShippingCompany"},"shipment_code":{"type":"string","description":"Shipment tracking code"},"attributes":{"type":"object","description":"Additional attributes as JSON"},"cancel_status":{"$ref":"#/components/schemas/CancelStatusEnum"},"installment_interest_amount":{"type":"number","format":"decimal","description":"Interest amount for installment"},"is_tradable":{"type":"boolean","description":"Whether the item is tradable"},"datasource":{"type":"integer","description":"ID of the data source"},"localized_attributes":{"type":"object","description":"Localized attributes"},"localized_attributes_kwargs":{"type":"object","description":"Additional arguments for localized attributes"},"cancellation_reconciliation":{"type":"integer","description":"Cancellation reconciliation ID"},"reconciliation":{"type":"integer","description":"Reconciliation ID"},"forced_refund":{"type":"boolean","description":"Whether refund was forced"},"original_stock":{"type":"integer","description":"Original stock ID"},"shipping_option_group":{"type":"integer","description":"Shipping option group ID"},"e_archive_url":{"type":"string","format":"uri","description":"URL to the electronic archive","readOnly":true},"tracking_number":{"type":"string","description":"Shipment tracking number","readOnly":true},"carrier_shipping_code":{"type":"string","description":"Shipping code from the carrier","readOnly":true},"external_status":{"type":"integer","description":"External status reference ID","readOnly":true},"discount_amount":{"type":"number","format":"decimal","description":"Discount amount applied to this item"},"retail_price":{"type":"number","format":"decimal","description":"Retail price of the item"},"image":{"type":"string","format":"binary","description":"Image file upload"},"parent":{"type":"integer","description":"ID of the parent order item"},"estimated_delivery_date":{"type":"string","format":"date","description":"Estimated delivery date"},"defined_tracking_url":{"type":"string","format":"uri","description":"Custom tracking URL"},"defined_shipping_company":{"type":"string","description":"Custom shipping company name"}}}}}},"CreateOrder":{"type":"object","required":["number","channel","customer","date_placed","amount","status"],"properties":{"number":{"type":"string","description":"Order number, unique within the context of a channel"},"channel":{"type":"integer","description":"ID of the channel through which the order was placed"},"status":{"$ref":"#/components/schemas/OrderStatus"},"date_placed":{"type":"string","format":"date-time","description":"Timestamp when the order was placed"},"customer":{"type":"integer","description":"ID of the customer who placed the order"},"shipping_address":{"type":"integer","description":"ID of the shipping address"},"billing_address":{"type":"integer","description":"ID of the billing address"},"currency":{"$ref":"#/components/schemas/CurrencyEnum"},"amount":{"type":"number","format":"decimal","description":"Total amount for the order"},"shipping_amount":{"type":"number","format":"decimal","description":"Shipping charge for the order"},"shipping_tax_rate":{"type":"number","format":"decimal","description":"Tax rate applied to the shipping charge"},"extra_field":{"type":"object","description":"Additional information about the order"},"payment_option":{"type":"integer","description":"ID of the payment option used"},"payment_option_slug":{"type":"string","description":"Slug of the payment option"},"bin_number":{"type":"string","description":"First 6 digits of the customer's card"},"installment":{"type":"integer","description":"ID of the installment option selected"},"installment_count":{"type":"integer","description":"Number of installments for the payment"},"delivery_type":{"type":"string","enum":["same_day","next_day","standard","in_store"],"description":"Type of delivery selected"},"installment_interest_amount":{"type":"number","format":"decimal","description":"Interest charged on installment payments"},"cargo_company":{"type":"integer","description":"ID of the company responsible for shipping"},"invoice_number":{"type":"string","description":"Invoice number for the order"},"invoice_date":{"type":"string","format":"date-time","description":"Invoice date for the order"},"e_archive_url":{"type":"string","format":"uri","description":"URL for the e-archive of the invoice"},"refund_amount":{"type":"number","format":"decimal","description":"Total refund amount for the order"},"discount_refund_amount":{"type":"number","format":"decimal","description":"Refund amount for the discount"},"shipping_refund_amount":{"type":"number","format":"decimal","description":"Refund amount for the shipping"},"discount_amount":{"type":"number","format":"decimal","description":"Discount applied to the order"},"is_send":{"type":"boolean","description":"Indicates whether the order has been sent"},"net_shipping_amount":{"type":"number","format":"decimal","description":"Net shipping amount","readOnly":true},"shipping_interest_amount":{"type":"number","format":"decimal","description":"Interest applied to the shipping cost"},"tracking_number":{"type":"string","description":"Tracking number for the order"},"carrier_shipping_code":{"type":"string","description":"Shipping code from the carrier"},"remote_addr":{"type":"string","description":"IP address from where the order was placed"},"fundstransfertransaction_set":{"type":"array","items":{"type":"integer"},"description":"Set of funds transfer transaction IDs"},"has_gift_box":{"type":"boolean","description":"Indicates whether the order has a gift box"},"gift_box_note":{"type":"string","description":"Message for the gift box"},"external_status":{"type":"integer","description":"ID of the external status"},"client_type":{"type":"string","enum":["default","android","ios","instore","b2b"],"description":"Type of client placing the order"},"language_code":{"type":"string","description":"Language code for the order"},"notes":{"type":"string","description":"Customer instructions for the order"},"delivery_range":{"type":"object","description":"Date range for delivery","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}}},"shipping_option_slug":{"type":"string","description":"Slug for the shipping option"},"segment":{"type":"string","description":"Customer segment for the order"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date of the order"},"checkout_provider_id":{"type":"integer","description":"ID of the provider used for checkout"},"created_date":{"type":"string","format":"date-time","description":"Creation date of the order"},"cancellation_info":{"type":"object","description":"Details regarding the cancellation of the order"},"shipping_company":{"$ref":"#/components/schemas/ShippingCompany","readOnly":true},"cancel_status":{"$ref":"#/components/schemas/CancelStatusEnum","readOnly":true},"defined_tracking_url":{"type":"string","format":"uri","description":"Custom tracking URL"},"installment_free":{"type":"boolean","description":"Whether installment is free","readOnly":true},"first_refund_strategy":{"type":"string","description":"First refund strategy","readOnly":true}}},"OrderStatus":{"type":"string","enum":["cancellation_waiting","cancelled","waiting","payment_waiting","confirmation_waiting","approved","preparing","shipped","shipped_and_informed","ready_for_pickup","attempted_delivery","review_started","review_waiting","waiting_for_payment","paid","delivered","refunded"],"description":"Status of the order item"},"CurrencyEnum":{"type":"string","description":"Currency type for the price list.","enum":["tr","eu","usd","egp","gbp","mad","pln","sar","ron","uah","czk","huf","rub","bgn","iqd","kwd","bhd","omr","qar","aed","ngn","inr","lei","kzt","jod","rsd"]},"ShippingCompany":{"type":"string","description":"Shipping company options","enum":["aras","ups","asil","yurtici","mng","hbexpress","aramex","other","ismail","gls","hoopkapida","fancourier","tmmexpress","ptt","horoz","novaposhta","droplight","surat","ups_intl","b2c_direct","jetizz","tyexpress","ay_cargo","cainiao","acs","packupp","k_gelsin","birgunde","kargo_ist","giz","mylerz","mylerzsdd","r2s","boomex","chrono","scotty","netkargo","murat_lgc","fast_cargo","dpd","in_post","k_sende","rupost","cdek","loomis","carrtell","speeta","bringo","dhlexpress","bovo","gelal","arvato","bpost_athome","bpost_24_7","cathedis","dincer","sameday","gkn","svuum","hjetxl","aramex_express","tnt_cargo","ceva_cargo","bringo_express","sendeo","cargus","pinkpost","speedy","deliverigo","jetizz_v7","evdemo_lojistik","extension","apiship","octovan_express","clickpost","iMile","jetlogi","bolt","pony_express","boxaty","monist","city_express","fero_ai","carriyo","pakettaxi","falcon_flex","porter_express","sky_express","pts_express","bpost_pickup"]},"CancelStatusEnum":{"type":"string","description":"Cancellation status of the order item","enum":["waiting","confirmation_waiting","confirmed","approved","rejected","waiting_for_payment","manuel_refund_need","completed"]},"OrderResponse":{"$ref":"#/components/schemas/CreateOrder"}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"404":{"description":"The given resource or object was not found or does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"description":"Contains a detailed description of the error.","type":"string"}}}}}},"406":{"description":"A custom 406 error occurs due to different validation failures in viewset or service level, such as uniqueness checks or other service-related exceptions.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","description":"Detailed message of the 406 error."}}}}}}}},"paths":{"/api/v1/channel/{channel_id}/create_orders/":{"post":{"tags":["SalesChannelCreateOrder"],"summary":"Create a new order","description":"Creates a new order in the system for the specified channel","operationId":"createOrder","parameters":[{"$ref":"#/components/parameters/channel_path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"}}}},"responses":{"201":{"description":"Order created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"406":{"$ref":"#/components/responses/406"}}}}}}
```
