# Call external API once the stock level updated

**URL:** https://forum.shopware.com/t/call-external-api-once-the-stock-level-updated/62092
**Category:** International (English Only)
**Tags:** programming
**Created:** [1. Oktober 2019 um 13:28 UTC](https://forum.shopware.com/t/call-external-api-once-the-stock-level-updated/62092 "2019-10-01T13:28:34Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![vasims\_zignuts](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vasims\_zignuts](https://forum.shopware.com/u/vasims_zignuts)
#### Post date: [1. Oktober 2019 um 13:46 UTC](https://forum.shopware.com/t/call-external-api-once-the-stock-level-updated/62092/7 "2019-10-01T13:46:18Z")

</div>

Main Plugin File&nbsp;

```
scheduleClearCache(ActivateContext::CACHE_LIST_DEFAULT);
    }
    public function deactivate(DeactivateContext $context)
    {
        $context->scheduleClearCache(DeactivateContext::CACHE_LIST_DEFAULT);
    }
    public function uninstall()
    {
        return true;
    }
    public function install()
    {
        # this event will be used after saving the order in the database
        return [
            'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout_Finish' => 'OnOrder_SaveOrderProcessDetails'
           
        ];
      
    }

    public function onOrder_SaveOrderProcessDetails(Enlight_Event_EventArgs $args)
	{
        $basketContent = $args->getDetails();     
	    $order = $args->getSubject();
	    $orderNumber = $order->sOrderNumber;

	    var_dump ($basketContent);
	}
  
}

?>

```

&nbsp;

**Config File :&nbsp;**

&nbsp;

```
            Korona Pos
             API Token
             API Token
            API Tken                        
            An API token provided by Support.

```

&nbsp;

---

_[View the full topic](https://forum.shopware.com/t/call-external-api-once-the-stock-level-updated/62092)._
