Skip to content

Latest commit

 

History

History
314 lines (214 loc) · 9.68 KB

WebhooksApi.md

File metadata and controls

314 lines (214 loc) · 9.68 KB

\VoloCommerce\Api\v1\WebhooksApi

All URIs are relative to https://api.volocommerce.io/1.0

Method HTTP request Description
createHook POST /webhooks Returns registed webhook id
doDelete DELETE /webhooks/{webHookId} Delete registered webhook
getAvailableEvents GET /webhooks/events Returns list of available events
getAvailableScope GET /webhooks/scopes/{eventType} Returns list of available scopes
getWebHooks GET /webhooks Returns registered webhooks
updateWebhooks PUT /webhooks/{webHookId} Update registered webhook

createHook

\VoloCommerce\Api\v1\Model\WebHookSubcribeResponse createHook($authorization, $x_api_key, $body)

Returns registed webhook id

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key
$body = new \VoloCommerce\Api\v1\Model\RegisterWebHookRequest(); // \VoloCommerce\Api\v1\Model\RegisterWebHookRequest | 

try {
    $result = $api_instance->createHook($authorization, $x_api_key, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->createHook: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
authorization string Auth token
x_api_key string API Key
body \VoloCommerce\Api\v1\Model\RegisterWebHookRequest [optional]

Return type

\VoloCommerce\Api\v1\Model\WebHookSubcribeResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

doDelete

\VoloCommerce\Api\v1\Model\DeleteWebHookResponse doDelete($web_hook_id, $authorization, $x_api_key)

Delete registered webhook

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$web_hook_id = 56; // int | WebHook ID
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key

try {
    $result = $api_instance->doDelete($web_hook_id, $authorization, $x_api_key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->doDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
web_hook_id int WebHook ID
authorization string Auth token
x_api_key string API Key

Return type

\VoloCommerce\Api\v1\Model\DeleteWebHookResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAvailableEvents

\VoloCommerce\Api\v1\Model\EventResponse getAvailableEvents($authorization, $x_api_key)

Returns list of available events

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key

try {
    $result = $api_instance->getAvailableEvents($authorization, $x_api_key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getAvailableEvents: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
authorization string Auth token
x_api_key string API Key

Return type

\VoloCommerce\Api\v1\Model\EventResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAvailableScope

\VoloCommerce\Api\v1\Model\ScopeResponse getAvailableScope($event_type, $authorization, $x_api_key)

Returns list of available scopes

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$event_type = "event_type_example"; // string | Event Type
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key

try {
    $result = $api_instance->getAvailableScope($event_type, $authorization, $x_api_key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getAvailableScope: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
event_type string Event Type
authorization string Auth token
x_api_key string API Key

Return type

\VoloCommerce\Api\v1\Model\ScopeResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebHooks

\VoloCommerce\Api\v1\Model\WebHookResponse getWebHooks($authorization, $x_api_key, $web_hook_id, $event, $type, $code)

Returns registered webhooks

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key
$web_hook_id = 56; // int | WebHook ID to join scopes and fetch subscriptions
$event = "event_example"; // string | Event - example REFUND
$type = "type_example"; // string | Type to group scope codes for a WebHook
$code = "code_example"; // string | Code - example amazon.fr|3

try {
    $result = $api_instance->getWebHooks($authorization, $x_api_key, $web_hook_id, $event, $type, $code);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getWebHooks: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
authorization string Auth token
x_api_key string API Key
web_hook_id int WebHook ID to join scopes and fetch subscriptions [optional]
event string Event - example REFUND [optional]
type string Type to group scope codes for a WebHook [optional]
code string Code - example amazon.fr 3

Return type

\VoloCommerce\Api\v1\Model\WebHookResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateWebhooks

\VoloCommerce\Api\v1\Model\WebHookUpdateResponse updateWebhooks($web_hook_id, $authorization, $x_api_key, $body)

Update registered webhook

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new \VoloCommerce\Api\v1\Client\WebhooksApi();
$web_hook_id = 56; // int | WebHook ID
$authorization = "authorization_example"; // string | Auth token
$x_api_key = "x_api_key_example"; // string | API Key
$body = new \VoloCommerce\Api\v1\Model\UpdateWebHookRequest(); // \VoloCommerce\Api\v1\Model\UpdateWebHookRequest | 

try {
    $result = $api_instance->updateWebhooks($web_hook_id, $authorization, $x_api_key, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->updateWebhooks: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
web_hook_id int WebHook ID
authorization string Auth token
x_api_key string API Key
body \VoloCommerce\Api\v1\Model\UpdateWebHookRequest [optional]

Return type

\VoloCommerce\Api\v1\Model\WebHookUpdateResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]