Skip to content

Latest commit

 

History

History
463 lines (336 loc) · 13.2 KB

WebhooksApi.md

File metadata and controls

463 lines (336 loc) · 13.2 KB

Conekta::WebhooksApi

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

Method HTTP request Description
create_webhook POST /webhooks Create Webhook
delete_webhook DELETE /webhooks/{id} Delete Webhook
get_webhook GET /webhooks/{id} Get Webhook
get_webhooks GET /webhooks Get List of Webhooks
test_webhook POST /webhooks/{id}/test Test Webhook
update_webhook PUT /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', synchronous: false}) # 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

Name Type Description Notes
webhook_request WebhookRequest requested field for webhook
accept_language 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

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

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

WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.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

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

WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.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

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 Integer 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

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

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

WebhookResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.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({url: 'https://webhook.site/89277eaa-a8e4-4306-8dc5-f55c80703dc8'}) # 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

Name Type Description Notes
id String Identifier of the resource
webhook_update_request 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

WebhookResponse

Authorization

bearerAuth

HTTP request headers

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