Skip to main content
All CollectionsINTEGRATIONCUSTOMISED SOLUTIONS
How to implement order cancel event?
How to implement order cancel event?
Weronika Kapias avatar
Written by Weronika Kapias
Updated over a week ago

Does your online store offer customers the ability to cancel an order and do you want such orders to be canceled in the edrone system as well?

You just need to implement the following script from our documentation.

<?php

function orderCancel(){

$edroneData = 'version=' . '1.0.0' .

'&app_id=' . 'YOUR APP ID' .

'&email=' . 'email@example.pl' .

'&order_id=' . '00001' .

'&action_type=' . 'order_cancel' .

'&sender_type=' . 'server';

return $edroneData;

}

function httpPost($url, $params) {

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_HEADER, false);

curl_setopt($ch, CURLOPT_POSTFIELDS, $params);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

$output = curl_exec($ch);

curl_close($ch);

return $output;

}

httpPost('https://api.edrone.me/trace', orderCancel());

This script can be implemented anywhere on the store's website - for edrone, it is essential to receive the appropriate request.

It is also important to remember to substitute specific variables dedicated to your e-commerce platform for certain parameters such as email or order ID.


Need more help?

If you have any further questions about the order cancel event, please do not hesitate to contact us at hello@edrone.me

Did this answer your question?