6

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

Rafael Corrêa Gomes
13.9k15 gold badges92 silver badges190 bronze badges
asked Feb 12, 2017 at 7:25

1 Answer 1

3

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"
 }
}
answered May 11, 2017 at 14:59
1
  • 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? Commented Aug 27, 2018 at 6:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.