Conekta::CustomersApi

July 21, 2026 ยท View on GitHub

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

MethodHTTP requestDescription
create_customerPOST /customersCreate customer
create_customer_fiscal_entitiesPOST /customers/{id}/fiscal_entitiesCreate Fiscal Entity
delete_customer_by_idDELETE /customers/{id}Delete Customer
get_customer_by_idGET /customers/{id}Get Customer
get_customersGET /customersGet a list of customers
update_customerPUT /customers/{id}Update customer
update_customer_fiscal_entitiesPUT /customers/{id}/fiscal_entities/{fiscal_entities_id}Update Fiscal Entity

create_customer

create_customer(customer, opts)

Create customer

The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. Remember the credit and debit card tokenization process: https://developers.conekta.com/page/web-checkout-tokenizer

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::CustomersApi.new
customer = Conekta::Customer.new({email: 'miguel@gmail.com', name: 'miguel', phone: '+5215555555555'}) # Customer | requested field for customer
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
  # Create customer
  result = api_instance.create_customer(customer, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->create_customer: #{e}"
end

Using the create_customer_with_http_info variant

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

<Array(, Integer, Hash)> create_customer_with_http_info(customer, opts)

begin
  # Create customer
  data, status_code, headers = api_instance.create_customer_with_http_info(customer, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->create_customer_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
customerCustomerrequested field for customer
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

CustomerResponse

Authorization

bearerAuth

HTTP request headers

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

create_customer_fiscal_entities

create_customer_fiscal_entities(id, fiscal_entity_request, opts)

Create Fiscal Entity

Create Fiscal entity resource that corresponds to a customer ID.

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::CustomersApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
fiscal_entity_request = Conekta::FiscalEntityRequest.new({address: Conekta::FiscalEntityRequestAddress.new({street1: 'Nuevo Leon 254', postal_code: '06100', city: 'Ciudad de Mexico'})}) # FiscalEntityRequest | requested field for customer fiscal entities
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
  # Create Fiscal Entity
  result = api_instance.create_customer_fiscal_entities(id, fiscal_entity_request, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->create_customer_fiscal_entities: #{e}"
end

Using the create_customer_fiscal_entities_with_http_info variant

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

<Array(, Integer, Hash)> create_customer_fiscal_entities_with_http_info(id, fiscal_entity_request, opts)

begin
  # Create Fiscal Entity
  data, status_code, headers = api_instance.create_customer_fiscal_entities_with_http_info(id, fiscal_entity_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateCustomerFiscalEntitiesResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->create_customer_fiscal_entities_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
fiscal_entity_requestFiscalEntityRequestrequested field for customer fiscal entities
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

CreateCustomerFiscalEntitiesResponse

Authorization

bearerAuth

HTTP request headers

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

delete_customer_by_id

delete_customer_by_id(id, opts)

Delete Customer

Deleted a customer resource that corresponds to a customer ID.

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::CustomersApi.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
  # Delete Customer
  result = api_instance.delete_customer_by_id(id, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->delete_customer_by_id: #{e}"
end

Using the delete_customer_by_id_with_http_info variant

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

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

begin
  # Delete Customer
  data, status_code, headers = api_instance.delete_customer_by_id_with_http_info(id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->delete_customer_by_id_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

CustomerResponse

Authorization

bearerAuth

HTTP request headers

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

get_customer_by_id

get_customer_by_id(id, opts)

Get Customer

Gets a customer resource that corresponds to a customer ID.

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::CustomersApi.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 Customer
  result = api_instance.get_customer_by_id(id, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->get_customer_by_id: #{e}"
end

Using the get_customer_by_id_with_http_info variant

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

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

begin
  # Get Customer
  data, status_code, headers = api_instance.get_customer_by_id_with_http_info(id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->get_customer_by_id_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

CustomerResponse

Authorization

bearerAuth

HTTP request headers

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

get_customers

get_customers(opts)

Get a list of customers

The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged.

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::CustomersApi.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.
  _next: '_next_example', # String | next page
  previous: 'previous_example' # String | previous page
}

begin
  # Get a list of customers
  result = api_instance.get_customers(opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->get_customers: #{e}"
end

Using the get_customers_with_http_info variant

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

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

begin
  # Get a list of customers
  data, status_code, headers = api_instance.get_customers_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomersResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->get_customers_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]
_nextStringnext page[optional]
previousStringprevious page[optional]

Return type

CustomersResponse

Authorization

bearerAuth

HTTP request headers

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

update_customer

update_customer(id, update_customer, opts)

Update customer

You can update customer-related data

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::CustomersApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
update_customer = Conekta::UpdateCustomer.new # UpdateCustomer | requested field for customer
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 customer
  result = api_instance.update_customer(id, update_customer, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->update_customer: #{e}"
end

Using the update_customer_with_http_info variant

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

<Array(, Integer, Hash)> update_customer_with_http_info(id, update_customer, opts)

begin
  # Update customer
  data, status_code, headers = api_instance.update_customer_with_http_info(id, update_customer, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->update_customer_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
update_customerUpdateCustomerrequested field for customer
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

CustomerResponse

Authorization

bearerAuth

HTTP request headers

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

update_customer_fiscal_entities

update_customer_fiscal_entities(id, fiscal_entities_id, update_fiscal_entity_request, opts)

Update Fiscal Entity

Update Fiscal Entity resource that corresponds to a customer ID.

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::CustomersApi.new
id = '6307a60c41de27127515a575' # String | Identifier of the resource
fiscal_entities_id = 'fis_ent_2tQ8HkkfbauaKP9Ho' # String | identifier
update_fiscal_entity_request = Conekta::UpdateFiscalEntityRequest.new # UpdateFiscalEntityRequest | requested field for customer update fiscal entities
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  Fiscal Entity
  result = api_instance.update_customer_fiscal_entities(id, fiscal_entities_id, update_fiscal_entity_request, opts)
  p result
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->update_customer_fiscal_entities: #{e}"
end

Using the update_customer_fiscal_entities_with_http_info variant

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

<Array(, Integer, Hash)> update_customer_fiscal_entities_with_http_info(id, fiscal_entities_id, update_fiscal_entity_request, opts)

begin
  # Update  Fiscal Entity
  data, status_code, headers = api_instance.update_customer_fiscal_entities_with_http_info(id, fiscal_entities_id, update_fiscal_entity_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <UpdateCustomerFiscalEntitiesResponse>
rescue Conekta::ApiError => e
  puts "Error when calling CustomersApi->update_customer_fiscal_entities_with_http_info: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringIdentifier of the resource
fiscal_entities_idStringidentifier
update_fiscal_entity_requestUpdateFiscalEntityRequestrequested field for customer update fiscal entities
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

UpdateCustomerFiscalEntitiesResponse

Authorization

bearerAuth

HTTP request headers

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