cancel
Showing results for 
Search instead for 
Did you mean: 

PUT /V1/orders/create Sample?

PUT /V1/orders/create Sample?

Hi,

  

Can anyone help in posting a sample or the model schema for /V1/orders/create? I checked Magento Documentation on REST API but haven't found one specifically for creating order.

 

List of REST API:

http://devdocs.magento.com/guides/v2.0/rest/list.html

 

Limited Model Schema for REST API:
http://devdocs.magento.com/swagger/index_20.html

 

I am currently working with Magento ver. 2.1.0

 

Thank you,
Tenzin K

2 REPLIES 2

Re: PUT /V1/orders/create Sample?

0. create empty cart

call: post
response: cartID eg: 4290
 
1. Add item to the cart
body: 
 
 
{
	"cartItem": {
		"sku": "JFCO00017",
		"qty": 1,
		"name": "Devil May Cry III 3 Dante Cosplay Costume",
		"price": 81.55,
		"product_type": "simple",
		"quote_id": "4290",
		"product_option": {
			"extension_attributes": {
				"custom_options": [{
					"option_id": "thumbnail",
					"option_value": "\/d\/e\/devilmaycryiii3dantecosplay_1_.jpg"
				}, {
					"option_id": "color_2",
					"option_value": "Red"
				}, {
					"option_id": "google_size",
					"option_value": "xxs"
				}]
			}
		}
	}
}
 

2. Add billling info
body: 
 
{
	"address": {
		"city": "noida",
		"company": "iprag",
		"countryId": "IN",
		"email": "manish+2@gmail.com",
		"firstname": "Manish",
		"lastname": "Kumar",
		"postcode": "201301",
		"region": "UP",
		"saveInAddressBook": 1,
		"street": ["D-84"],
		"telephone": "8802045390"
	},
	"useForShipping": true
}
 
3. add shipping info
body:
   
{
	"addressInformation": {
		"billingAddress": {
			"city": "noida",
			"company": "iprag",
			"email": "nkn@gmail.com",
			"firstname": "Manish",
			"lastname": "Kumar",
			"postcode": "335001",
			"region": "UP",
			"street": ["D-84"],
			"telephone": "9413433217"
		},
		"shippingAddress": {
			"city": "noida",
			"company": "iprag",
			"email": "nkn@gmail.com",
			"firstname": "Manish",
			"lastname": "Kumar",
			"postcode": "335001",
			"region": "UP",
			"street": ["D-84"],
			"telephone": "9413433217"
		},
		"shippingCarrierCode": "flatrate",
		"shippingMethodCode": "flatrate"
	}
}
 
 
response: payment method and cart detail
 
4. Order place
body :
 
  
{ 
	"paymentMethod": {
		"method": "checkmo"
	},
	 "shippingMethod":  {       
		"method_code": "flatrate",
		               "carrier_code": "flatrate",
		       "additionalProperties": {}              
	}  
}
response: orderid

Re: PUT /V1/orders/create Sample?

Thank you for the response!

 

I noticed that there wasn't a step in the use of "/v1/orders/create" ?