I want to place an order with "Paypal express" OR via "Credit Card" using REST API but not get any success.
I tried with "Braintree" extension but they also not provide API. Also, I checked the Magento2 REST API document but not got any API endpoint.
I develop a standalone application for place order with "Paypal Express" and after the success, I got "Token" and "Payer ID" and after that, I passed in Magento REST API but got an error message.
REST Endpoint : rest/V1/carts/mine/order
Method : PUT
RAW Data :
{
"paymentMethod": {
"method": "paypal_express",
"additional_data": {
"paypal_express_checkout_token" : "EC-xxxxxxxxxxxx",
"paypal_express_checkout_redirect_required" : false,
"paypal_express_checkout_payer_id" : "xxxxxxxxxx"
}
}
}
Response :
{
"message": "PayPal gateway has rejected request. %1",
"parameters": [
"Invalid token (#10410: Invalid token)."
]
}