Magento rest API For Order
We had followed the add order process of
Magento 2 - Create order using REST API on the process of "Place Order" using the API "$base_url/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/order
" with the params of { "paymentMethod": { "method": "checkmo" } }
as put Method we are getting "Please select a valid payment method." from Rest API.
magento2 api
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
We had followed the add order process of
Magento 2 - Create order using REST API on the process of "Place Order" using the API "$base_url/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/order
" with the params of { "paymentMethod": { "method": "checkmo" } }
as put Method we are getting "Please select a valid payment method." from Rest API.
magento2 api
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
We had followed the add order process of
Magento 2 - Create order using REST API on the process of "Place Order" using the API "$base_url/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/order
" with the params of { "paymentMethod": { "method": "checkmo" } }
as put Method we are getting "Please select a valid payment method." from Rest API.
magento2 api
We had followed the add order process of
Magento 2 - Create order using REST API on the process of "Place Order" using the API "$base_url/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/order
" with the params of { "paymentMethod": { "method": "checkmo" } }
as put Method we are getting "Please select a valid payment method." from Rest API.
magento2 api
magento2 api
edited Jun 19 '18 at 6:11
Teja Bhagavan Kollepara
2,98641847
2,98641847
asked Dec 12 '16 at 12:45
harishharish
412
412
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Is the payment method checkmo enabled for use in a normal checkout?
Do a normal onepage checkout and check what is being sent in the network tab of chrome developer tools. If my memory serves me, it also uses the rest api for that step.
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
add a comment |
1. Get Customer Token
http://magento-host/index.php/rest/V1/integration/customer/token?
username=aditya.shah@test.com&password=test@123
method : POST
2. Get Cart ID (Quote ID) - using customer id.
This will return quote id, which will be used for placing an order.
http://magento-host/rest/V1/carts/mine
method : POST
Authorization : Bearer <customer token>
3. Add Configurable product in cart.
http://magento-host/index.php/rest/default/V1/carts/mine/items
method : POST
Authorization : Bearer <customer token>
body data : json
{
"cartItem": {
"sku": "HKrh15hc", <product SKU>
"qty": 5,
"quote_id": "75", <Quote ID - Cart ID [see. step 2]>
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 49
},
{
"option_id": "141",
"option_value": 168
}
]
}
},
"extension_attributes": {}
}
}
Now, this will save your configurable product in your cart.
4. Get & put Shipping Information.
http://magento-host/index.php/rest/V1/carts/mine/shipping-information
method : POST
Authorization : Bearer <customer token>
body data : json
{
"addressInformation": {
"shippingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "400001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH",
"sameAsBilling": 1
},
"billingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "4000001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH"
},
"shipping_method_code": "flatrate",
"shipping_carrier_code": "flatrate"
}
}
5. Get payment method.
http://magento-host/index.php/rest/V1/carts/75/payment-methods
method : POST
Authorization : Bearer <customer token>
6. Place an order.
http://magento-host/index.php/rest/V1/carts/mine/order
method : POST
Authorization : Bearer <customer token>
body data : json
{
"paymentMethod": {
"method": "checkmo"
}
}
And finally, this will return order ID, which you just placed!
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f149909%2fmagento-rest-api-for-order%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is the payment method checkmo enabled for use in a normal checkout?
Do a normal onepage checkout and check what is being sent in the network tab of chrome developer tools. If my memory serves me, it also uses the rest api for that step.
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
add a comment |
Is the payment method checkmo enabled for use in a normal checkout?
Do a normal onepage checkout and check what is being sent in the network tab of chrome developer tools. If my memory serves me, it also uses the rest api for that step.
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
add a comment |
Is the payment method checkmo enabled for use in a normal checkout?
Do a normal onepage checkout and check what is being sent in the network tab of chrome developer tools. If my memory serves me, it also uses the rest api for that step.
Is the payment method checkmo enabled for use in a normal checkout?
Do a normal onepage checkout and check what is being sent in the network tab of chrome developer tools. If my memory serves me, it also uses the rest api for that step.
answered Dec 12 '16 at 15:21
nennenenne
469615
469615
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
add a comment |
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
in Stores -> configuration -> sales -> checkout, the checkout Option for "Allow Guest Checkout" is set to yes. The onepage checkout is working but not able to get the API in network which they are using for the same, We are currently using Magento 2.1.2 version
– harish
Dec 13 '16 at 8:37
add a comment |
1. Get Customer Token
http://magento-host/index.php/rest/V1/integration/customer/token?
username=aditya.shah@test.com&password=test@123
method : POST
2. Get Cart ID (Quote ID) - using customer id.
This will return quote id, which will be used for placing an order.
http://magento-host/rest/V1/carts/mine
method : POST
Authorization : Bearer <customer token>
3. Add Configurable product in cart.
http://magento-host/index.php/rest/default/V1/carts/mine/items
method : POST
Authorization : Bearer <customer token>
body data : json
{
"cartItem": {
"sku": "HKrh15hc", <product SKU>
"qty": 5,
"quote_id": "75", <Quote ID - Cart ID [see. step 2]>
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 49
},
{
"option_id": "141",
"option_value": 168
}
]
}
},
"extension_attributes": {}
}
}
Now, this will save your configurable product in your cart.
4. Get & put Shipping Information.
http://magento-host/index.php/rest/V1/carts/mine/shipping-information
method : POST
Authorization : Bearer <customer token>
body data : json
{
"addressInformation": {
"shippingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "400001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH",
"sameAsBilling": 1
},
"billingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "4000001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH"
},
"shipping_method_code": "flatrate",
"shipping_carrier_code": "flatrate"
}
}
5. Get payment method.
http://magento-host/index.php/rest/V1/carts/75/payment-methods
method : POST
Authorization : Bearer <customer token>
6. Place an order.
http://magento-host/index.php/rest/V1/carts/mine/order
method : POST
Authorization : Bearer <customer token>
body data : json
{
"paymentMethod": {
"method": "checkmo"
}
}
And finally, this will return order ID, which you just placed!
add a comment |
1. Get Customer Token
http://magento-host/index.php/rest/V1/integration/customer/token?
username=aditya.shah@test.com&password=test@123
method : POST
2. Get Cart ID (Quote ID) - using customer id.
This will return quote id, which will be used for placing an order.
http://magento-host/rest/V1/carts/mine
method : POST
Authorization : Bearer <customer token>
3. Add Configurable product in cart.
http://magento-host/index.php/rest/default/V1/carts/mine/items
method : POST
Authorization : Bearer <customer token>
body data : json
{
"cartItem": {
"sku": "HKrh15hc", <product SKU>
"qty": 5,
"quote_id": "75", <Quote ID - Cart ID [see. step 2]>
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 49
},
{
"option_id": "141",
"option_value": 168
}
]
}
},
"extension_attributes": {}
}
}
Now, this will save your configurable product in your cart.
4. Get & put Shipping Information.
http://magento-host/index.php/rest/V1/carts/mine/shipping-information
method : POST
Authorization : Bearer <customer token>
body data : json
{
"addressInformation": {
"shippingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "400001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH",
"sameAsBilling": 1
},
"billingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "4000001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH"
},
"shipping_method_code": "flatrate",
"shipping_carrier_code": "flatrate"
}
}
5. Get payment method.
http://magento-host/index.php/rest/V1/carts/75/payment-methods
method : POST
Authorization : Bearer <customer token>
6. Place an order.
http://magento-host/index.php/rest/V1/carts/mine/order
method : POST
Authorization : Bearer <customer token>
body data : json
{
"paymentMethod": {
"method": "checkmo"
}
}
And finally, this will return order ID, which you just placed!
add a comment |
1. Get Customer Token
http://magento-host/index.php/rest/V1/integration/customer/token?
username=aditya.shah@test.com&password=test@123
method : POST
2. Get Cart ID (Quote ID) - using customer id.
This will return quote id, which will be used for placing an order.
http://magento-host/rest/V1/carts/mine
method : POST
Authorization : Bearer <customer token>
3. Add Configurable product in cart.
http://magento-host/index.php/rest/default/V1/carts/mine/items
method : POST
Authorization : Bearer <customer token>
body data : json
{
"cartItem": {
"sku": "HKrh15hc", <product SKU>
"qty": 5,
"quote_id": "75", <Quote ID - Cart ID [see. step 2]>
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 49
},
{
"option_id": "141",
"option_value": 168
}
]
}
},
"extension_attributes": {}
}
}
Now, this will save your configurable product in your cart.
4. Get & put Shipping Information.
http://magento-host/index.php/rest/V1/carts/mine/shipping-information
method : POST
Authorization : Bearer <customer token>
body data : json
{
"addressInformation": {
"shippingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "400001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH",
"sameAsBilling": 1
},
"billingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "4000001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH"
},
"shipping_method_code": "flatrate",
"shipping_carrier_code": "flatrate"
}
}
5. Get payment method.
http://magento-host/index.php/rest/V1/carts/75/payment-methods
method : POST
Authorization : Bearer <customer token>
6. Place an order.
http://magento-host/index.php/rest/V1/carts/mine/order
method : POST
Authorization : Bearer <customer token>
body data : json
{
"paymentMethod": {
"method": "checkmo"
}
}
And finally, this will return order ID, which you just placed!
1. Get Customer Token
http://magento-host/index.php/rest/V1/integration/customer/token?
username=aditya.shah@test.com&password=test@123
method : POST
2. Get Cart ID (Quote ID) - using customer id.
This will return quote id, which will be used for placing an order.
http://magento-host/rest/V1/carts/mine
method : POST
Authorization : Bearer <customer token>
3. Add Configurable product in cart.
http://magento-host/index.php/rest/default/V1/carts/mine/items
method : POST
Authorization : Bearer <customer token>
body data : json
{
"cartItem": {
"sku": "HKrh15hc", <product SKU>
"qty": 5,
"quote_id": "75", <Quote ID - Cart ID [see. step 2]>
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 49
},
{
"option_id": "141",
"option_value": 168
}
]
}
},
"extension_attributes": {}
}
}
Now, this will save your configurable product in your cart.
4. Get & put Shipping Information.
http://magento-host/index.php/rest/V1/carts/mine/shipping-information
method : POST
Authorization : Bearer <customer token>
body data : json
{
"addressInformation": {
"shippingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "400001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH",
"sameAsBilling": 1
},
"billingAddress": {
"region": "MH",
"region_id": 0,
"country_id": "IN",
"street": [
"221,Baker-street (e)"
],
"company": "Lumos",
"telephone": "12345678",
"postcode": "4000001",
"city": "Mumbai",
"firstname": "Aditya",
"lastname": "Shah",
"email": "Aditya@Shah.com",
"prefix": "address_",
"region_code": "MH"
},
"shipping_method_code": "flatrate",
"shipping_carrier_code": "flatrate"
}
}
5. Get payment method.
http://magento-host/index.php/rest/V1/carts/75/payment-methods
method : POST
Authorization : Bearer <customer token>
6. Place an order.
http://magento-host/index.php/rest/V1/carts/mine/order
method : POST
Authorization : Bearer <customer token>
body data : json
{
"paymentMethod": {
"method": "checkmo"
}
}
And finally, this will return order ID, which you just placed!
answered Sep 24 '18 at 12:59
Aditya ShahAditya Shah
3,91421036
3,91421036
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f149909%2fmagento-rest-api-for-order%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown