Create Order
This API is offering to create Order for Physical products.
PUT {{Base_url}}/rest/V1/orders/create
This request contains the details for the order, including customer information, products, billing and shipping addresses, payment method, and order status. Here's a detailed explanation of the key components.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
{
"entity": {
"base_currency_code": "INR",
"base_discount_amount": 0,
"base_grand_total": 1018.00,
"base_shipping_amount": 0,
"base_subtotal": 1018.00,
"base_tax_amount": 0,
"customer_email": "qa@zrpl.co.in",
"customer_firstname": "Surya",
"created_at": "2025-1-02 4:14:17",
"customer_group_id": 1,
"customer_id": 980,
"customer_is_guest": 0,
"customer_lastname": "U",
"customer_note_notify": 0,
"discount_amount": 0,
"email_sent": 0,
"coupon_code": "",
"discount_description": "",
"grand_total": 1018.00,
"is_virtual": 0,
"order_currency_code": "INR",
"shipping_amount": 0,
"shipping_description": "Flat Rate - Fixed",
"state": "new",
"status": "processing",
"store_currency_code": "INR",
"store_id": 14,
"store_name": "Main Website\nMain Website Store\n",
"subtotal": 1018.00,
"subtotal_incl_tax": 1018.00,
"tax_amount": 0,
"total_item_count": 1,
"total_qty_ordered": 1,
"weight": 1,
"items": [{
"base_discount_amount": 0,
"base_original_price": 1018.00,
"base_price": 1018.00,
"base_price_incl_tax": 1018.00,
"base_row_invoiced": 0,
"base_row_total": 1018.00,
"base_tax_amount": 0,
"base_tax_invoiced": 0,
"discount_amount": 1018.00,
"discount_percent": 1018.00,
"free_shipping": 0,
"is_virtual": 0,
"name": "iFrogz Audio- Ear Pollution Plugz with Mic - Blue",
"original_price": 1018.00,
"price": 1018.00,
"price_incl_tax": 1018.00,
"product_id": 404,
"product_type": "simple",
"qty_ordered": 1,
"row_total": 1018.00,
"row_total_incl_tax": 1018.00,
"sku": "IFPZMB-BL0",
"store_id": 28
}],
"billing_address": {
"address_type": "billing",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"email": "qa@zrpl.co.in",
"firstname": "Surya",
"lastname": "U",
"postcode": "560032",
"region": "Karnataka",
"region_code": "KA",
"region_id": 19,
"street": [
"Street 1",
"Street 2"
],
"telephone": "1234567890"
},
"payment": {
"method": "razorpay"
},
"extension_attributes": {
"shipping_assignments": [{
"shipping": {
"address": {
"address_type": "shipping",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"customer_address_id": 2,
"email": "qa@zrpl.co.in",
"firstname": "Surya",
"lastname": "U",
"postcode": "560032",
"region": "Karnataka",
"region_code": "KA",
"region_id": 19,
"street": [
"HSR Layout",
"Street 2"
],
"telephone": "1234567890"
},
"method": "flatrate_flatrate"
}
}]
},
"status_histories": [
{
"comment": "This is a test comment",
"created_at": "",
"entity_id": 0,
"entity_name": "",
"is_customer_notified": 0,
"is_visible_on_front": 0,
"parent_id": 0,
"status": "processing",
"extension_attributes": {}
}
]
}
}curl --location --request PUT '{{Base_url}}/rest/V1/orders/create' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjU1LCJ1dHlwaWQiOjIsImlhdCI6MTczNTgyNjcyOCwiZXhwIjoxNzM1ODMwMzI4fQ.e9fBW4B1akohJ4SXz-IGycfak6GWZWU6nyO8nXS7Mi0' \
--header 'Content-Type: application/json' \
--header 'Cookie: PHPSESSID=fub7nl27col74oap3tmu5b268q; private_content_version=b6b94ce90f040495da87911d2a615bf1; PHPSESSID=fub7nl27col74oap3tmu5b268q; PHPSESSID=fub7nl27col74oap3tmu5b268q; private_content_version=5ab80b7def0c212f723edead3c971a19' \
--data-raw '{
"entity": {
"base_currency_code": "INR",
"base_discount_amount": 0,
"base_grand_total": 1018.00,
"base_shipping_amount": 0,
"base_subtotal": 1018.00,
"base_tax_amount": 0,
"customer_email": "qa@zrpl.co.in",
"customer_firstname": "Surya",
"created_at": "2025-1-02 4:14:17",
"customer_group_id": 1,
"customer_id": 980,
"customer_is_guest": 0,
"customer_lastname": "U",
"customer_note_notify": 0,
"discount_amount": 0,
"email_sent": 0,
"coupon_code": "",
"discount_description": "",
"grand_total": 1018.00,
"is_virtual": 0,
"order_currency_code": "INR",
"shipping_amount": 0,
"shipping_description": "Flat Rate - Fixed",
"state": "new",
"status": "processing",
"store_currency_code": "INR",
"store_id": 14,
"store_name": "Main Website\nMain Website Store\n",
"subtotal": 1018.00,
"subtotal_incl_tax": 1018.00,
"tax_amount": 0,
"total_item_count": 1,
"total_qty_ordered": 1,
"weight": 1,
"items": [{
"base_discount_amount": 0,
"base_original_price": 1015.00,
"base_price": 1018.00,
"base_price_incl_tax": 1018.00,
"base_row_invoiced": 0,
"base_row_total": 1018.00,
"base_tax_amount": 0,
"base_tax_invoiced": 0,
"discount_amount": 1018.00,
"discount_percent": 1018.00,
"free_shipping": 0,
"is_virtual": 0,
"name": "iFrogz Audio- Ear Pollution Plugz with Mic - Blue",
"original_price": 1018.00,
"price": 1018.00,
"price_incl_tax": 1018.00,
"product_id": 1,
"product_type": "simple",
"qty_ordered": 1,
"row_total": 1018.00,
"row_total_incl_tax": 1018.00,
"sku": "IFPZMB-BL0",
"store_id": 28
}],
"billing_address": {
"address_type": "billing",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"email": "qa@zrpl.co.in",
"firstname": "Surya",
"lastname": "U",
"postcode": "560032",
"region": "Karnataka",
"region_code": "KA",
"region_id": 19,
"street": [
"Street 1",
"Street 2"
],
"telephone": "1234567890"
},
"payment": {
"method": "razorpay"
},
"extension_attributes": {
"shipping_assignments": [{
"shipping": {
"address": {
"address_type": "shipping",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"customer_address_id": 2,
"email": "qa@zrpl.co.in",
"firstname": "Surya",
"lastname": "U",
"postcode": "560032",
"region": "Karnataka",
"region_code": "KA",
"region_id": 19,
"street": [
"HSR Layout",
"Street 2"
],
"telephone": "1234567890"
},
"method": "flatrate_flatrate"
}
}]
},
"status_histories": [
{
"comment": "This is a test comment",
"created_at": "",
"entity_id": 0,
"entity_name": "",
"is_customer_notified": 0,
"is_visible_on_front": 0,
"parent_id": 0,
"status": "processing",
"extension_attributes": {}
}
]
}
}'Responses
{
"base_currency_code": "INR",
"base_discount_amount": 0,
"base_grand_total": 1018,
"base_shipping_amount": 0,
"base_subtotal": 1018,
"base_tax_amount": 0,
"base_total_due": 1018,
"billing_address_id": 462794,
"coupon_code": "",
"created_at": "2025-01-02 04:14:17",
"customer_email": "qa@zrpl.co.in",
"customer_firstname": "Surya",
"customer_group_id": 1,
"customer_id": 980,
"customer_is_guest": 0,
"customer_lastname": "U",
"customer_note_notify": 0,
"discount_amount": 0,
"discount_description": "",
"email_sent": 0,
"entity_id": 238332,
"grand_total": 1018,
"increment_id": "14000007501",
"is_virtual": 0,
"order_currency_code": "INR",
"protect_code": "a5046f3075f34f5b59c074f9e32662de",
"shipping_amount": 0,
"shipping_description": "Flat Rate - Fixed",
"state": "new",
"status": "processing",
"store_currency_code": "INR",
"store_id": 14,
"store_name": "ZEPP SPP\nZEPP-SPP\nZEPP Store view",
"subtotal": 1018,
"subtotal_incl_tax": 1018,
"tax_amount": 0,
"total_due": 1018,
"total_item_count": 1,
"total_qty_ordered": 1,
"updated_at": "2025-01-02 14:30:53",
"weight": 1,
"items": [
{
"base_discount_amount": 0,
"base_original_price": 1015,
"base_price": 1018,
"base_price_incl_tax": 1018,
"base_row_invoiced": 0,
"base_row_total": 1018,
"base_tax_amount": 0,
"base_tax_invoiced": 0,
"created_at": "2025-01-02 14:30:53",
"discount_amount": 1018,
"discount_percent": 1018,
"free_shipping": 0,
"is_virtual": 0,
"item_id": 239851,
"name": "iFrogz Audio- Ear Pollution Plugz with Mic - Blue",
"order_id": 238332,
"original_price": 1018,
"price": 1018,
"price_incl_tax": 1018,
"product_id": 1,
"product_type": "simple",
"qty_ordered": 1,
"row_total": 0,
"row_total_incl_tax": 0,
"sku": "IFPZMB-BL0",
"store_id": 28,
"updated_at": "2025-01-02 14:30:53",
"base_row_total_incl_tax": 1018
}
],
"billing_address": {
"address_type": "billing",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"email": "qa@zrpl.co.in",
"entity_id": 462794,
"firstname": "Surya",
"lastname": "U",
"parent_id": 238332,
"postcode": "560032",
"region": "Karnataka",
"region_code": "Karnataka",
"region_id": 19,
"street": [
"Street 1",
"Street 2"
],
"telephone": "1234567890"
},
"payment": {
"account_status": null,
"additional_information": [],
"cc_last4": null,
"entity_id": 238172,
"method": "razorpay",
"parent_id": 238332
},
"status_histories": [
{
"comment": "This is a test comment",
"created_at": "",
"entity_id": 557226,
"entity_name": "",
"is_customer_notified": 0,
"is_visible_on_front": 0,
"parent_id": 238332,
"status": "processing"
}
],
"extension_attributes": {
"shipping_assignments": [
{
"shipping": {
"address": {
"address_type": "shipping",
"city": "Bengaluru",
"company": "ZRPL",
"country_id": "IN",
"customer_address_id": 2,
"email": "qa@zrpl.co.in",
"entity_id": 462795,
"firstname": "Surya",
"lastname": "U",
"parent_id": 238332,
"postcode": "560032",
"region": "Karnataka",
"region_code": "Karnataka",
"region_id": 19,
"street": [
"HSR Layout",
"Street 2"
],
"telephone": "1234567890"
},
"method": "flatrate_flatrate"
},
"items": null
}
]
}
}Order Overview:
Root Object:
Entity: The entire order data is encapsulated within the "entity" key, representing a customer's order.
Order Information:
base_currency_code:
"INR"The order is priced in Indian Rupees (INR).base_discount_amount:
0No discount applied at the base level of the order.base_grand_total:
1018The total cost of the order (₹1018), excluding any discounts and taxes.base_shipping_amount:
0No shipping charge, indicating free shipping.base_subtotal:
1018Subtotal before any discounts or taxes, set to ₹1018.base_tax_amount:
0No tax applied to the order.base_total_due:
1018The total amount due (same as base grand total).billing_address_id:
462794ID of the billing address associated with the order.coupon_code:
""No coupon code was applied to the order.created_at:
"2025-01-02 04:14:17"The order was created on January 2, 2025, at 04:14:17.customer_email:
"qa@zrpl.co.in"The email address of the customer placing the order.customer_firstname:
"Surya"The customer's first name.customer_group_id:
1Customer group ID (indicating which customer group the customer belongs to).customer_id:
980Unique customer ID in the system.customer_is_guest:
0Indicates the customer has an account (not a guest user).customer_lastname:
"U"The customer's last name.customer_note_notify:
0No notifications have been sent to the customer regarding notes.discount_amount:
0No discount applied to the order.email_sent:
0The email for the order has not been sent yet.entity_id:
238332Unique identifier for the order entity in the system.grand_total:
1018The final total cost of the order (₹1018), same as the base grand total.increment_id:
"14000007501"The increment ID (unique sequential identifier) for the order. This is useful for tracking and identifying orders within the system. In this case, the increment ID is14000007501.is_virtual:
0Indicates that the order is for physical products (not virtual).order_currency_code:
"INR"The currency used for the order (Indian Rupees).protect_code:
"a5046f3075f34f5b59c074f9e32662de"A unique protection code for the order to ensure authenticity.shipping_amount:
0No shipping charge applied to the order (free shipping).shipping_description:
"Flat Rate - Fixed"The method of shipping, which is flat-rate fixed shipping.state:
"new"The order is in a "new" state, indicating it has just been created.status:
"processing"The current status of the order is "processing", meaning it's being handled.store_currency_code:
"INR"The currency used by the store where the order was placed.store_id:
14The store ID, representing which store the order was placed at.store_name:
"ZEPP SPP\nZEPP-SPP\nZEPP Store view"The name of the store where the order was made, with different subdivisions indicated.subtotal:
1018The subtotal of the order before taxes and shipping (same as base subtotal).subtotal_incl_tax:
1018The subtotal including taxes (same as subtotal, as no tax is applied).tax_amount:
0No tax applied to the order.total_due:
1018The total due for the order (same as base grand total).total_item_count:
1The order contains a single item.total_qty_ordered:
1The customer ordered 1 unit of the product.updated_at:
"2025-01-02 14:30:53"The last update for this order was on January 2, 2025, at 14:30:53.weight:
1The total weight of the order is 1 kg (used for shipping calculations).
Order Items (Items Array):
This section contains details of the products in the order:
base_discount_amount:
0No discount applied to the product.base_original_price:
1015The original price of the product before any discounts.base_price:
1018The price of the product before any discounts are applied.base_price_incl_tax:
1018The price of the product, including tax (no tax in this case).base_row_invoiced:
0No invoiced amount for this item.base_row_total:
1018The total price of the item excluding any taxes or discounts.base_tax_amount:
0No tax applied to the item.discount_amount:
1018A discount amount of ₹1018 applied to the item (it seems to be applied to the entire price).discount_percent:
1018The discount percentage, indicating a full discount applied to the product (this seems to be a data anomaly).free_shipping:
0No free shipping applied to this product.is_virtual:
0This is a physical product, not virtual.name:
"iFrogz Audio- Ear Pollution Plugz with Mic - Blue"The name of the product.original_price:
1018The original price of the product.price:
1018The price of the product.price_incl_tax:
1018The price of the product, including taxes (none in this case).product_id:
1The unique product ID.product_type:
"simple"This is a simple product (not configurable or bundled).qty_ordered:
1The customer ordered 1 quantity of this product.row_total:
1018The total amount for the item, excluding any taxes or discounts.row_total_incl_tax:
1018The total amount for the item, including taxes (no tax applied).sku:
"IFPZMB-BL0"The SKU (Stock Keeping Unit) of the product.store_id:
28The ID of the store where this product is listed.updated_at:
"2025-01-02 14:30:53"The last update timestamp for the item.
Billing Address (billing_address):
This section contains the billing address for the customer:
address_type:
"billing"This address is used for billing purposes.city:
"Bengaluru"The city of the billing address.company:
"ZRPL"The company name.country_id:
"IN"The country is India.email:
"qa@zrpl.co.in"The customer's email address.firstname:
"Surya"The customer's first name.lastname:
"U"The customer's last name.postcode:
"560032"The postal code of the billing address.region:
"Karnataka"The state of the billing address.region_code:
"KA"The region code for Karnataka.region_id:
19The unique ID for the region (Karnataka).street:
"Street 1""Street 2"
The street addresses.
telephone:
"1234567890"The phone number for the customer.
Payment Method (payment):
method:
"razorpay"The payment method used is Razorpay, an Indian payment gateway.
Shipping Assignments (extension_attributes):
shipping:
address: The shipping address, which mirrors the billing address.
method:
"flatrate_flatrate"The shipping method used is flat-rate shipping.
Status Histories (status_histories):
comment:
"This is a test comment"A test comment added to the status history.status:
"processing"The current status of the order
{
"message": "The consumer isn't authorized to access %resources.",
"parameters": {
"resources": "Magento_Sales::create"
}
}Last updated