Conekta::WebhooksApi

April 10, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
create_webhookPOST /webhooksCreate Webhook
delete_webhookDELETE /webhooks/{id}Delete Webhook
get_webhookGET /webhooks/{id}Get Webhook
get_webhooksGET /webhooksGet List of Webhooks
test_webhookPOST /webhooks/{id}/testTest Webhook
update_webhookPUT /webhooks/{id}Update Webhook

create_webhook

create_webhook(webhook_request, opts)

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.

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
webhook_request = Conekta::WebhookRequest.new({url: 'https://webhook.site/89277eaa-a8e4-4306-8dc5-f55c80703dc8'}) # WebhookRequest | requested field for webhook
opts = {
  accept_language: 'es' # String | Use for knowing which language to use
}

begin
  # Create Webhook
  result = api_instance.create_webhook(webhook_request, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->create_webhook: #{e}"
end

Using the create_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_webhook_with_http_info(webhook_request, opts)

begin
  # Create Webhook
  data, status_code, headers = api_instance.create_webhook_with_http_info(webhook_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <WebhookResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->create_webhook_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
webhook_requestWebhookRequestrequested field for webhook
accept_languageStringUse 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.2.0+json

delete_webhook

delete_webhook(id, opts)

Delete Webhook

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
opts = {
  accept_language: 'es' # String | Use for knowing which language to use
}

begin
  # Delete Webhook
  result = api_instance.delete_webhook(id, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->delete_webhook: #{e}"
end

Using the delete_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_webhook_with_http_info(id, opts)

begin
  # Delete Webhook
  data, status_code, headers = api_instance.delete_webhook_with_http_info(id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <WebhookResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
accept_languageStringUse 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.2.0+json

get_webhook

get_webhook(id, opts)

Get Webhook

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
opts = {
  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.
}

begin
  # Get Webhook
  result = api_instance.get_webhook(id, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->get_webhook: #{e}"
end

Using the get_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_webhook_with_http_info(id, opts)

begin
  # Get Webhook
  data, status_code, headers = api_instance.get_webhook_with_http_info(id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <WebhookResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
accept_languageStringUse for knowing which language to use[optional][default to 'es']
x_child_company_idStringIn 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.2.0+json

get_webhooks

get_webhooks(opts)

Get List of Webhooks

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

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
opts = {
  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: 56, # Integer | 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
}

begin
  # Get List of Webhooks
  result = api_instance.get_webhooks(opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->get_webhooks: #{e}"
end

Using the get_webhooks_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_webhooks_with_http_info(opts)

begin
  # Get List of Webhooks
  data, status_code, headers = api_instance.get_webhooks_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetWebhooksResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->get_webhooks_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
accept_languageStringUse for knowing which language to use[optional][default to 'es']
x_child_company_idStringIn the case of a holding company, the company id of the child company to which will process the request.[optional]
limitIntegerThe numbers of items to return, the maximum value is 250[optional][default to 20]
searchStringGeneral order search, e.g. by mail, reference etc.[optional]
urlStringurl for webhook filter[optional]
_nextStringnext page[optional]
previousStringprevious page[optional]

Return type

GetWebhooksResponse

Authorization

bearerAuth

HTTP request headers

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

test_webhook

test_webhook(id, opts)

Test Webhook

Send a webhook.ping event

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
opts = {
  accept_language: 'es' # String | Use for knowing which language to use
}

begin
  # Test Webhook
  result = api_instance.test_webhook(id, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->test_webhook: #{e}"
end

Using the test_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> test_webhook_with_http_info(id, opts)

begin
  # Test Webhook
  data, status_code, headers = api_instance.test_webhook_with_http_info(id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <WebhookResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->test_webhook_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
accept_languageStringUse 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.2.0+json

update_webhook

update_webhook(id, webhook_update_request, opts)

Update Webhook

updates an existing webhook

Examples

require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
  # Configure Bearer authorization: bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Conekta::WebhooksApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
webhook_update_request = Conekta::WebhookUpdateRequest.new # WebhookUpdateRequest | requested fields in order to update a webhook
opts = {
  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.
}

begin
  # Update Webhook
  result = api_instance.update_webhook(id, webhook_update_request, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->update_webhook: #{e}"
end

Using the update_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_webhook_with_http_info(id, webhook_update_request, opts)

begin
  # Update Webhook
  data, status_code, headers = api_instance.update_webhook_with_http_info(id, webhook_update_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <WebhookResponse>
rescue Conekta::ApiError => e
  puts "Error when calling WebhooksApi->update_webhook_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
webhook_update_requestWebhookUpdateRequestrequested fields in order to update a webhook
accept_languageStringUse for knowing which language to use[optional][default to 'es']
x_child_company_idStringIn 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.2.0+json