Magento 2 is robust, scalable and multi feature enable eCommerce platform. You can create Sales Order Using a third party software to Magento 2 backend.
Using below payload you can create sales order using any third party platform to Magento 2. you Just need to pass below payload in your request with PUT data. I have pass data like shipping method with flatrate shipping, Added Custom discount Shopping cart Rule and COD as a payment method in payload request.
Once Order Create using API,
Check Create Invoice Using Magento 2 REST API
Check Create Shipment Using Magento 2 REST API
We have taken reference for “Push It Messenger Bag” simple product in Magento 2 from Sample data.
Request: {YOUR_URL}/rest/V1/orders/create
Type: PUT
Body:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
{
"entity"
:
{
"base_currency_code"
:
"USD"
,
"base_discount_amount"
:
-
4.5
,
"base_grand_total"
:
45.5
,
"base_shipping_amount"
:
5
,
"base_subtotal"
:
45
,
"base_tax_amount"
:
0
,
"customer_email"
:
"rakesh@rakeshjesadiya.com"
,
"customer_firstname"
:
"rakesh"
,
"customer_group_id"
:
1
,
"customer_id"
:
2
,
"customer_is_guest"
:
0
,
"customer_lastname"
:
"jesadiya"
,
"customer_note_notify"
:
1
,
"discount_amount"
:
-
4.5
,
"email_sent"
:
1
,
"coupon_code"
:
"Test1"
,
"discount_description"
:
"Test1"
,
"grand_total"
:
45.5
,
"is_virtual"
:
0
,
"order_currency_code"
:
"USD"
,
"shipping_amount"
:
5
,
"shipping_description"
:
"Flat Rate - Fixed"
,
"state"
:
"new"
,
"status"
:
"pending"
,
"store_currency_code"
:
"USD"
,
"store_id"
:
1
,
"store_name"
:
"Main Website\nMain Website Store\n"
,
"subtotal"
:
45
,
"subtotal_incl_tax"
:
45
,
"tax_amount"
:
0
,
"total_item_count"
:
1
,
"total_qty_ordered"
:
1
,
"weight"
:
1
,
"items"
:
[
{
"base_discount_amount"
:
4.5
,
"base_original_price"
:
45
,
"base_price"
:
45
,
"base_price_incl_tax"
:
45
,
"base_row_invoiced"
:
0
,
"base_row_total"
:
45
,
"base_tax_amount"
:
0
,
"base_tax_invoiced"
:
0
,
"discount_amount"
:
4.5
,
"discount_percent"
:
10
,
"free_shipping"
:
0
,
"is_virtual"
:
0
,
"name"
:
"Push It Messenger Bag"
,
"original_price"
:
45
,
"price"
:
45
,
"price_incl_tax"
:
45
,
"product_id"
:
14
,
"product_type"
:
"simple"
,
"qty_ordered"
:
1
,
"row_total"
:
45
,
"row_total_incl_tax"
:
45
,
"sku"
:
"24-WB04"
,
"store_id"
:
1
}
]
,
"billing_address"
:
{
"address_type"
:
"billing"
,
"city"
:
"Ahmedabad"
,
"company"
:
"Rbj"
,
"country_id"
:
"US"
,
"email"
:
"rakesh@rakeshjesadiya.com"
,
"firstname"
:
"rakesh"
,
"lastname"
:
"jesadiya"
,
"postcode"
:
"30332"
,
"region"
:
"Georgia"
,
"region_code"
:
"GA"
,
"region_id"
:
19
,
"street"
:
[
"Street 1"
,
"Street 2"
]
,
"telephone"
:
"123456"
}
,
"payment"
:
{
"method"
:
"cashondelivery"
}
,
"extension_attributes"
:
{
"shipping_assignments"
:
[
{
"shipping"
:
{
"address"
:
{
"address_type"
:
"shipping"
,
"city"
:
"Ahmedabad"
,
"company"
:
"Rbj"
,
"country_id"
:
"US"
,
"customer_address_id"
:
2
,
"email"
:
"rakesh@rakeshjesadiya.com"
,
"firstname"
:
"rakesh"
,
"lastname"
:
"jesadiya"
,
"postcode"
:
"30332"
,
"region"
:
"Georgia"
,
"region_code"
:
"GA"
,
"region_id"
:
19
,
"street"
:
[
"Street 1"
,
"Street 2"
]
,
"telephone"
:
"123456"
}
,
"method"
:
"flatrate_flatrate"
}
}
]
}
}
}
|
When you run API using above payload,
You got the response from success order data with order_increment id as below format.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
{
"base_currency_code"
:
"USD"
,
"base_discount_amount"
:
-
4.5
,
"base_grand_total"
:
45.5
,
"base_shipping_amount"
:
5
,
"base_subtotal"
:
45
,
"base_tax_amount"
:
0
,
"base_total_due"
:
45.5
,
"billing_address_id"
:
204
,
"coupon_code"
:
"Test1"
,
"created_at"
:
"2018-09-16 18:12:42"
,
"customer_email"
:
"rakesh@rakeshjesadiya.com"
,
"customer_firstname"
:
"rakesh"
,
"customer_group_id"
:
1
,
"customer_id"
:
2
,
"customer_is_guest"
:
0
,
"customer_lastname"
:
"jesadiya"
,
"customer_note_notify"
:
1
,
"discount_amount"
:
-
4.5
,
"discount_description"
:
"Test1"
,
"email_sent"
:
1
,
"entity_id"
:
103
,
"grand_total"
:
45.5
,
"increment_id"
:
"000000107"
,
"is_virtual"
:
0
,
"order_currency_code"
:
"USD"
,
"protect_code"
:
"a0c46ced9e5dfca13a9f4af86a237aeb"
,
"shipping_amount"
:
5
,
"shipping_description"
:
"Flat Rate - Fixed"
,
"state"
:
"new"
,
"status"
:
"pending"
,
"store_currency_code"
:
"USD"
,
"store_id"
:
1
,
"store_name"
:
"Main Website\nMain Website Store\nDefault Store View"
,
"subtotal"
:
45
,
"subtotal_incl_tax"
:
45
,
"tax_amount"
:
0
,
"total_due"
:
45.5
,
"total_item_count"
:
1
,
"total_qty_ordered"
:
1
,
"updated_at"
:
"2018-09-16 18:12:42"
,
"weight"
:
1
,
"items"
:
[
{
"base_discount_amount"
:
4.5
,
"base_original_price"
:
45
,
"base_price"
:
45
,
"base_price_incl_tax"
:
45
,
"base_row_invoiced"
:
0
,
"base_row_total"
:
45
,
"base_tax_amount"
:
0
,
"base_tax_invoiced"
:
0
,
"created_at"
:
"2018-09-16 18:12:42"
,
"discount_amount"
:
4.5
,
"discount_percent"
:
10
,
"free_shipping"
:
0
,
"is_virtual"
:
0
,
"item_id"
:
124
,
"name"
:
"Push It Messenger Bag"
,
"order_id"
:
103
,
"original_price"
:
45
,
"price"
:
45
,
"price_incl_tax"
:
45
,
"product_id"
:
14
,
"product_type"
:
"simple"
,
"qty_ordered"
:
1
,
"row_total"
:
45
,
"row_total_incl_tax"
:
45
,
"sku"
:
"24-WB04"
,
"store_id"
:
1
,
"updated_at"
:
"2018-09-16 18:12:42"
}
]
,
"billing_address"
:
{
"address_type"
:
"billing"
,
"city"
:
"Ahmedabad"
,
"company"
:
"Rbj"
,
"country_id"
:
"US"
,
"email"
:
"rakesh@rakeshjesadiya.com"
,
"entity_id"
:
204
,
"firstname"
:
"rakesh"
,
"lastname"
:
"jesadiya"
,
"parent_id"
:
103
,
"postcode"
:
"30332"
,
"region"
:
"Georgia"
,
"region_code"
:
"GA"
,
"region_id"
:
19
,
"street"
:
[
"Street 1"
,
"Street 2"
]
,
"telephone"
:
"123456"
}
,
"payment"
:
{
"account_status"
:
null
,
"additional_information"
:
[
""
]
,
"cc_last4"
:
null
,
"entity_id"
:
103
,
"method"
:
"cashondelivery"
,
"parent_id"
:
103
}
,
"status_histories"
:
[
]
,
"extension_attributes"
:
{
"shipping_assignments"
:
[
{
"shipping"
:
{
"address"
:
{
"address_type"
:
"shipping"
,
"city"
:
"Ahmedabad"
,
"company"
:
"Rbj"
,
"country_id"
:
"US"
,
"customer_address_id"
:
2
,
"email"
:
"rakesh@rakeshjesadiya.com"
,
"entity_id"
:
205
,
"firstname"
:
"rakesh"
,
"lastname"
:
"jesadiya"
,
"parent_id"
:
103
,
"postcode"
:
"30332"
,
"region"
:
"Georgia"
,
"region_code"
:
"GA"
,
"region_id"
:
19
,
"street"
:
[
"Street 1"
,
"Street 2"
]
,
"telephone"
:
"123456"
}
,
"method"
:
"flatrate_flatrate"
}
,
"items"
:
null
}
]
}
}
New order email
|