Skip to content

Latest commit

 

History

History
397 lines (276 loc) · 13.2 KB

WebhooksApi.md

File metadata and controls

397 lines (276 loc) · 13.2 KB

Conekta\WebhooksApi

All URIs are relative to https://api.conekta.io, except if the operation defines another base path.

Method HTTP request Description
createWebhook() POST /webhooks Create Webhook
deleteWebhook() DELETE /webhooks/{id} Delete Webhook
getWebhook() GET /webhooks/{id} Get Webhook
getWebhooks() GET /webhooks Get List of Webhooks
testWebhook() POST /webhooks/{id}/test Test Webhook
updateWebhook() PUT /webhooks/{id} Update Webhook

createWebhook()

createWebhook($webhook_request, $accept_language): \Conekta\Model\WebhookResponse

Create Webhook

What we do at Conekta translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc.

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$webhook_request = new \Conekta\Model\WebhookRequest(); // \Conekta\Model\WebhookRequest | requested field for webhook
$accept_language = es; // string | Use for knowing which language to use

try {
    $result = $apiInstance->createWebhook($webhook_request, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->createWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
webhook_request \Conekta\Model\WebhookRequest requested field for webhook
accept_language string Use for knowing which language to use [optional] [default to 'es']

Return type

\Conekta\Model\WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

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

deleteWebhook()

deleteWebhook($id, $accept_language): \Conekta\Model\WebhookResponse

Delete Webhook

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use

try {
    $result = $apiInstance->deleteWebhook($id, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']

Return type

\Conekta\Model\WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

getWebhook()

getWebhook($id, $accept_language, $x_child_company_id): \Conekta\Model\WebhookResponse

Get Webhook

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->getWebhook($id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

getWebhooks()

getWebhooks($accept_language, $x_child_company_id, $limit, $search, $url, $next, $previous): \Conekta\Model\GetWebhooksResponse

Get List of Webhooks

Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing)

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.
$limit = 20; // int | The numbers of items to return, the maximum value is 250
$search = 'search_example'; // string | General order search, e.g. by mail, reference etc.
$url = 'url_example'; // string | url for webhook filter
$next = 'next_example'; // string | next page
$previous = 'previous_example'; // string | previous page

try {
    $result = $apiInstance->getWebhooks($accept_language, $x_child_company_id, $limit, $search, $url, $next, $previous);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getWebhooks: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]
limit int The numbers of items to return, the maximum value is 250 [optional] [default to 20]
search string General order search, e.g. by mail, reference etc. [optional]
url string url for webhook filter [optional]
next string next page [optional]
previous string previous page [optional]

Return type

\Conekta\Model\GetWebhooksResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

testWebhook()

testWebhook($id, $accept_language): \Conekta\Model\WebhookResponse

Test Webhook

Send a webhook.ping event

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use

try {
    $result = $apiInstance->testWebhook($id, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->testWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']

Return type

\Conekta\Model\WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

updateWebhook()

updateWebhook($id, $webhook_update_request, $accept_language, $x_child_company_id): \Conekta\Model\WebhookResponse

Update Webhook

updates an existing webhook

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$webhook_update_request = new \Conekta\Model\WebhookUpdateRequest(); // \Conekta\Model\WebhookUpdateRequest | requested fields in order to update a webhook
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->updateWebhook($id, $webhook_update_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->updateWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
webhook_update_request \Conekta\Model\WebhookUpdateRequest requested fields in order to update a webhook
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

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