Register Order Webhook

This endpoint stores client webhook (url) for to be called when an Order is created or altered. A successful response includes the order number and the status of the order.

Note that the registered url should be a POST route. Json body will be sent to this route and will contain orderNumber and orderStatus as request body.

Register.

POST /webhooks/store

Headers

{
    "status": "Success",
    "description": "Request successful",
    "data": {
        "webhook": "https://example.com",
        "webhooks": [
            {
                "url": "https://example.com",
                "type": "App\\Models\\Order",
                "is_active": 1
            }
        ]
    }
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/webhooks/store',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "webhook":"https://example.com",
}',
  CURLOPT_HTTPHEADER => array(
    'secret-key: {{Your Secret Key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Last updated