I working on an APIs to create mobile application, everything worked ok, now I need to pay for the mobile application using Magento 2 rest API.
how can I pay using rest API?
Is there any API available which can process payment and validate payments?
I am new to Magento, I need to pay using credit cards and debit cards using Magento default configurations.
It will be great if anyone can help,
Thanks
1 Answer 1
To process the payment you can use the native API of the payment method, but you can use these methods to get the payment methods available and to place an order in Magento using the REST API.
Get Payment Method
curl -g -X GET "XXXXX_STOREURL_XXXXX/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/payment-information" \
-H "Authorization: Bearer XXXXX_TOKEN_XXXXX"
Place Order
curl -g -X PUT "XXXXX_STOREURL_XXXXX/index.php/rest/V1/guest-carts/56241bf6bc084cd7589426c8754fc9c5/order" \
-H "Authorization: Bearer XXXXX_TOKEN_XXXXX" \
-H "Content-Type:application/json" \
-d '
{
"method": {
"method": "checkmo"
}
}
-
While we can place an order with API the store_id stored as 0. is there any way where we can pass store id for Guest?Ketan Panchal– Ketan Panchal2018年08月27日 06:35:32 +00:00Commented Aug 27, 2018 at 6:35