cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Third Party API

Trigger Third Party API

Hi Team, 

We created website using Magento 2. 

 

We want to trigger some third party api when we go checkout and after the after placing order.How can we can we trigger API ? 

 

Could please help me out. 

 

 

Thanks in advance

2 REPLIES 2

Re: Trigger Third Party API

Hello @sankar_g 

 

you need to create an observer for that and you need to call that API

 

https://mage2-blog.com/magento-2-get-order-submission/ 

 

hope above link will help you.

 

if my answer helps you then mark as the solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Trigger Third Party API

Hello @sankar_g 

 

For that you will require to create a custom module with event observer !

 

Basically after placing the order if you would like to call any API - then you can used this event - sales_order_place_after

 

Create one event.xml file and place use this event in that file !

 

Now create one observer which you also need to mentioned in the event.xml file

 

Moving forward in that specific observer - create your custom function and put your custom API code over there which you would like to call.

 

For more details reference refer this link - https://magecomp.com/blog/get-order-status-sales_order_place_after-event-magento-2/ 

 

You can also refer the link which @Sunil Patel  has shared !

 

then check it will works ! 

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution