I'm looking on an example of where I should place for Magento orders to be sent to a third-party API. I have all documentation and all proper code that I've tested. I just don't know where these API calls fit in.

How and where will it get triggered? Should it be a custom module? Event observer?

2 Answers 2


My first tought would go to creating my own extension with an observer for the checkout_submit_all_after event.

This event covers both front- and backend orders.

You can get your order object(s) like this in your observer:

    if ($observer->getEvent()->hasOrders()) {

               $orders = $observer->getEvent()->getOrders();

           } else {

               $orders[] = $observer->getEvent()->getOrder();


           foreach ($orders as $order) {
           //call here

I have also done a couple of ERP implementations where the client wanted a daily cron to sync the orders, the choise is up to you. In this case you will also create a custom extension that handles this.


Adding to Toon Van Dooren's answer, the observer for the event checkout_submit_all_after didn't work for paypal express checkouts so the event I needed to use was:


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.