Skip to content

Latest commit

 

History

History
301 lines (208 loc) · 10.5 KB

WebhooksApi.md

File metadata and controls

301 lines (208 loc) · 10.5 KB

conekta.api.WebhooksApi

Load the API package

import 'package:conekta/api.dart';

All URIs are relative to https://api.conekta.io

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

WebhookResponse createWebhook(webhookRequest, acceptLanguage)

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

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final WebhookRequest webhookRequest = ; // WebhookRequest | requested field for webhook
final String acceptLanguage = es; // String | Use for knowing which language to use

try {
    final response = api.createWebhook(webhookRequest, acceptLanguage);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->createWebhook: $e\n');
}

Parameters

Name Type Description Notes
webhookRequest WebhookRequest requested field for webhook
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']

Return type

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

WebhookResponse deleteWebhook(id, acceptLanguage)

Delete Webhook

Example

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use

try {
    final response = api.deleteWebhook(id, acceptLanguage);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->deleteWebhook: $e\n');
}

Parameters

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

Return type

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

WebhookResponse getWebhook(id, acceptLanguage, xChildCompanyId)

Get Webhook

Example

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.getWebhook(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->getWebhook: $e\n');
}

Parameters

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

Return type

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

GetWebhooksResponse getWebhooks(acceptLanguage, xChildCompanyId, limit, search, url, next, previous)

Get List of Webhooks

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

Example

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.
final int limit = 56; // int | The numbers of items to return, the maximum value is 250
final String search = search_example; // String | General order search, e.g. by mail, reference etc.
final String url = url_example; // String | url for webhook filter
final String next = next_example; // String | next page
final String previous = previous_example; // String | previous page

try {
    final response = api.getWebhooks(acceptLanguage, xChildCompanyId, limit, search, url, next, previous);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->getWebhooks: $e\n');
}

Parameters

Name Type Description Notes
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId 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

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

WebhookResponse testWebhook(id, acceptLanguage)

Test Webhook

Send a webhook.ping event

Example

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use

try {
    final response = api.testWebhook(id, acceptLanguage);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->testWebhook: $e\n');
}

Parameters

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

Return type

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

WebhookResponse updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId)

Update Webhook

updates an existing webhook

Example

import 'package:conekta/api.dart';

final api = Conekta().getWebhooksApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final WebhookUpdateRequest webhookUpdateRequest = ; // WebhookUpdateRequest | requested fields in order to update a webhook
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WebhooksApi->updateWebhook: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
webhookUpdateRequest WebhookUpdateRequest requested fields in order to update a webhook
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

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]