All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.conekta.CustomersApi Maven / Gradle / Ivy

Go to download

This is a java library that allows interaction with https://api.conekta.io API.

The newest version!
package com.conekta;

import com.conekta.ApiException;
import com.conekta.ApiClient;
import com.conekta.ApiResponse;
import com.conekta.Configuration;
import com.conekta.Pair;

import javax.ws.rs.core.GenericType;

import com.conekta.model.CreateCustomerFiscalEntitiesResponse;
import com.conekta.model.Customer;
import com.conekta.model.CustomerFiscalEntitiesRequest;
import com.conekta.model.CustomerResponse;
import com.conekta.model.CustomerUpdateFiscalEntitiesRequest;
import com.conekta.model.CustomersResponse;
import com.conekta.model.Error;
import com.conekta.model.UpdateCustomer;
import com.conekta.model.UpdateCustomerFiscalEntitiesResponse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class CustomersApi {
  private ApiClient apiClient;

  public CustomersApi() {
    this(Configuration.getDefaultApiClient());
  }

  public CustomersApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Get the API client
   *
   * @return API client
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /**
   * Set the API client
   *
   * @param apiClient an instance of API client
   */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * 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](https://developers.conekta.com/page/web-checkout-tokenizer) 
   * @param customer requested field for customer (required)
   * @param acceptLanguage Use for knowing which language to use (optional, default to es)
   * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
   * @return CustomerResponse
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Status Code Description Response Headers
200 successful operation * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
402 payment required error -
422 parameter validation error -
500 internal server error -
*/ public CustomerResponse createCustomer(Customer customer, String acceptLanguage, String xChildCompanyId) throws ApiException { return createCustomerWithHttpInfo(customer, acceptLanguage, xChildCompanyId).getData(); } /** * 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](https://developers.conekta.com/page/web-checkout-tokenizer) * @param customer requested field for customer (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<CustomerResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
402 payment required error -
422 parameter validation error -
500 internal server error -
*/ public ApiResponse createCustomerWithHttpInfo(Customer customer, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (customer == null) { throw new ApiException(400, "Missing the required parameter 'customer' when calling createCustomer"); } // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.createCustomer", "/customers", "POST", new ArrayList<>(), customer, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Create Fiscal Entity * Create Fiscal entity resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param customerFiscalEntitiesRequest requested field for customer fiscal entities (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return CreateCustomerFiscalEntitiesResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
422 parameter validation error -
500 internal server error -
*/ public CreateCustomerFiscalEntitiesResponse createCustomerFiscalEntities(String id, CustomerFiscalEntitiesRequest customerFiscalEntitiesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException { return createCustomerFiscalEntitiesWithHttpInfo(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId).getData(); } /** * Create Fiscal Entity * Create Fiscal entity resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param customerFiscalEntitiesRequest requested field for customer fiscal entities (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<CreateCustomerFiscalEntitiesResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
422 parameter validation error -
500 internal server error -
*/ public ApiResponse createCustomerFiscalEntitiesWithHttpInfo(String id, CustomerFiscalEntitiesRequest customerFiscalEntitiesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling createCustomerFiscalEntities"); } if (customerFiscalEntitiesRequest == null) { throw new ApiException(400, "Missing the required parameter 'customerFiscalEntitiesRequest' when calling createCustomerFiscalEntities"); } // Path parameters String localVarPath = "/customers/{id}/fiscal_entities" .replaceAll("\\{id}", apiClient.escapeString(id)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.createCustomerFiscalEntities", localVarPath, "POST", new ArrayList<>(), customerFiscalEntitiesRequest, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Delete Customer * Deleted a customer resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return CustomerResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
422 parameter validation error -
401 authentication error -
404 not found entity -
500 internal server error -
*/ public CustomerResponse deleteCustomerById(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { return deleteCustomerByIdWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData(); } /** * Delete Customer * Deleted a customer resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<CustomerResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
422 parameter validation error -
401 authentication error -
404 not found entity -
500 internal server error -
*/ public ApiResponse deleteCustomerByIdWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling deleteCustomerById"); } // Path parameters String localVarPath = "/customers/{id}" .replaceAll("\\{id}", apiClient.escapeString(id)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.deleteCustomerById", localVarPath, "DELETE", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Get Customer * Gets a customer resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return CustomerResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
500 internal server error -
*/ public CustomerResponse getCustomerById(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { return getCustomerByIdWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData(); } /** * Get Customer * Gets a customer resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<CustomerResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
500 internal server error -
*/ public ApiResponse getCustomerByIdWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getCustomerById"); } // Path parameters String localVarPath = "/customers/{id}" .replaceAll("\\{id}", apiClient.escapeString(id)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.getCustomerById", localVarPath, "GET", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * 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. * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20) * @param search General order search, e.g. by mail, reference etc. (optional) * @param next next page (optional) * @param previous previous page (optional) * @return CustomersResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
500 internal server error -
*/ public CustomersResponse getCustomers(String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException { return getCustomersWithHttpInfo(acceptLanguage, xChildCompanyId, limit, search, next, previous).getData(); } /** * 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. * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20) * @param search General order search, e.g. by mail, reference etc. (optional) * @param next next page (optional) * @param previous previous page (optional) * @return ApiResponse<CustomersResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
500 internal server error -
*/ public ApiResponse getCustomersWithHttpInfo(String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException { // Query parameters List localVarQueryParams = new ArrayList<>( apiClient.parameterToPairs("", "limit", limit) ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "next", next)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "previous", previous)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.getCustomers", "/customers", "GET", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Update customer * You can update customer-related data * @param id Identifier of the resource (required) * @param updateCustomer requested field for customer (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return CustomerResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
402 payment required error -
422 parameter validation error -
500 internal server error -
*/ public CustomerResponse updateCustomer(String id, UpdateCustomer updateCustomer, String acceptLanguage, String xChildCompanyId) throws ApiException { return updateCustomerWithHttpInfo(id, updateCustomer, acceptLanguage, xChildCompanyId).getData(); } /** * Update customer * You can update customer-related data * @param id Identifier of the resource (required) * @param updateCustomer requested field for customer (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<CustomerResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
402 payment required error -
422 parameter validation error -
500 internal server error -
*/ public ApiResponse updateCustomerWithHttpInfo(String id, UpdateCustomer updateCustomer, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling updateCustomer"); } if (updateCustomer == null) { throw new ApiException(400, "Missing the required parameter 'updateCustomer' when calling updateCustomer"); } // Path parameters String localVarPath = "/customers/{id}" .replaceAll("\\{id}", apiClient.escapeString(id)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.updateCustomer", localVarPath, "PUT", new ArrayList<>(), updateCustomer, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Update Fiscal Entity * Update Fiscal Entity resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param fiscalEntitiesId identifier (required) * @param customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return UpdateCustomerFiscalEntitiesResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
422 parameter validation error -
500 internal server error -
*/ public UpdateCustomerFiscalEntitiesResponse updateCustomerFiscalEntities(String id, String fiscalEntitiesId, CustomerUpdateFiscalEntitiesRequest customerUpdateFiscalEntitiesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException { return updateCustomerFiscalEntitiesWithHttpInfo(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId).getData(); } /** * Update Fiscal Entity * Update Fiscal Entity resource that corresponds to a customer ID. * @param id Identifier of the resource (required) * @param fiscalEntitiesId identifier (required) * @param customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<UpdateCustomerFiscalEntitiesResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
422 parameter validation error -
500 internal server error -
*/ public ApiResponse updateCustomerFiscalEntitiesWithHttpInfo(String id, String fiscalEntitiesId, CustomerUpdateFiscalEntitiesRequest customerUpdateFiscalEntitiesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling updateCustomerFiscalEntities"); } if (fiscalEntitiesId == null) { throw new ApiException(400, "Missing the required parameter 'fiscalEntitiesId' when calling updateCustomerFiscalEntities"); } if (customerUpdateFiscalEntitiesRequest == null) { throw new ApiException(400, "Missing the required parameter 'customerUpdateFiscalEntitiesRequest' when calling updateCustomerFiscalEntities"); } // Path parameters String localVarPath = "/customers/{id}/fiscal_entities/{fiscal_entities_id}" .replaceAll("\\{id}", apiClient.escapeString(id)) .replaceAll("\\{fiscal_entities_id}", apiClient.escapeString(fiscalEntitiesId)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("CustomersApi.updateCustomerFiscalEntities", localVarPath, "PUT", new ArrayList<>(), customerUpdateFiscalEntitiesRequest, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy