Skip to content

Latest commit

 

History

History
391 lines (283 loc) · 12.2 KB

CustomersApi.md

File metadata and controls

391 lines (283 loc) · 12.2 KB

Synctera::CustomersApi

All URIs are relative to https://api-sandbox.synctera.com/v0

Method HTTP request Description
create_customer POST /customers Create a Customer
get_customer GET /customers/{customer_id} Get Customer
list_customers GET /customers List Customers
patch_customer PATCH /customers/{customer_id} Patch Customer
update_customer PUT /customers/{customer_id} Update Customer

create_customer

create_customer(customer_in_body, opts)

Create a Customer

The customer object represents your customer's identity. You can then verify the identity of this customer and associate them with other people and accounts. Note that if no shipping_address attribute is provided in the request, the shipping_address will be set to a copy of the legal_address.

Examples

require 'time'
require 'synctera'
# setup authorization
Synctera.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Synctera::CustomersApi.new
customer_in_body = Synctera::Customer.new({status: 'ACTIVE'}) # CustomerInBody | Customer to create
opts = {
  idempotency_key: '7d943c51-e4ff-4e57-9558-08cab6b963c7' # String | An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.
}

begin
  # Create a Customer
  result = api_instance.create_customer(customer_in_body, opts)
  p result
rescue Synctera::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_in_body, opts)

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

Parameters

Name Type Description Notes
customer_in_body CustomerInBody Customer to create
idempotency_key String An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. [optional]

Return type

CustomerInBody

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

get_customer

get_customer(customer_id)

Get Customer

Get Customer based on ID

Examples

require 'time'
require 'synctera'
# setup authorization
Synctera.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Synctera::CustomersApi.new
customer_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The customer's unique identifier

begin
  # Get Customer
  result = api_instance.get_customer(customer_id)
  p result
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->get_customer: #{e}"
end

Using the get_customer_with_http_info variant

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

<Array(, Integer, Hash)> get_customer_with_http_info(customer_id)

begin
  # Get Customer
  data, status_code, headers = api_instance.get_customer_with_http_info(customer_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerInBody>
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->get_customer_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
customer_id String The customer's unique identifier

Return type

CustomerInBody

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

list_customers

list_customers(opts)

List Customers

Retrieves paginated list of Customers associated with the authorized requester

Examples

require 'time'
require 'synctera'
# setup authorization
Synctera.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Synctera::CustomersApi.new
opts = {
  has_accounts: true, # Boolean | Filter on resources that have an account(s) 
  ssn_last_4: '6789', # String | 
  last_name: 'Smith', # String | 
  email: '[email protected]', # String | 
  first_name: 'Alice', # String | 
  phone_number: '+12065550100', # String | 
  page_token: 'a8937a0d', # String | 
  id: ['7d943c51-e4ff-4e57-9558-08cab6b963c7'], # Array<String> | Unique resource identifier
  limit: 100, # Integer | 
  sort_by: ['creation_time:asc'], # Array<String> | Specifies the sort order for the returned customers. 
  status: 'ACTIVE' # String | 
}

begin
  # List Customers
  result = api_instance.list_customers(opts)
  p result
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->list_customers: #{e}"
end

Using the list_customers_with_http_info variant

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

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

begin
  # List Customers
  data, status_code, headers = api_instance.list_customers_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerList>
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->list_customers_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
has_accounts Boolean Filter on resources that have an account(s) [optional]
ssn_last_4 String [optional]
last_name String [optional]
email String [optional]
first_name String [optional]
phone_number String [optional]
page_token String [optional]
id Array<String> Unique resource identifier [optional]
limit Integer [optional][default to 100]
sort_by Array<String> Specifies the sort order for the returned customers. [optional]
status String [optional]

Return type

CustomerList

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

patch_customer

patch_customer(customer_id, patch_customer, opts)

Patch Customer

Patch fields of customer based on ID Note that if: * legal address is provided in the request, AND * shipping_address is not provided in the request, AND * the customer resource does not have shipping_address then shipping_address will be set to a copy of the legal_address.

Examples

require 'time'
require 'synctera'
# setup authorization
Synctera.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Synctera::CustomersApi.new
customer_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The customer's unique identifier
patch_customer = Synctera::PatchCustomer.new # PatchCustomer | Customer to be patched
opts = {
  idempotency_key: '7d943c51-e4ff-4e57-9558-08cab6b963c7' # String | An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.
}

begin
  # Patch Customer
  result = api_instance.patch_customer(customer_id, patch_customer, opts)
  p result
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->patch_customer: #{e}"
end

Using the patch_customer_with_http_info variant

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

<Array(, Integer, Hash)> patch_customer_with_http_info(customer_id, patch_customer, opts)

begin
  # Patch Customer
  data, status_code, headers = api_instance.patch_customer_with_http_info(customer_id, patch_customer, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerInBody>
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->patch_customer_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
customer_id String The customer's unique identifier
patch_customer PatchCustomer Customer to be patched
idempotency_key String An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. [optional]

Return type

CustomerInBody

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

update_customer

update_customer(customer_id, customer_in_body)

Update Customer

Update customer based on ID Note that if no shipping_address attribute is provided in the request, the shipping_address will be set to a copy of the legal_address.

Examples

require 'time'
require 'synctera'
# setup authorization
Synctera.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Synctera::CustomersApi.new
customer_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The customer's unique identifier
customer_in_body = Synctera::Customer.new({status: 'ACTIVE'}) # CustomerInBody | Customer to be updated

begin
  # Update Customer
  result = api_instance.update_customer(customer_id, customer_in_body)
  p result
rescue Synctera::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(customer_id, customer_in_body)

begin
  # Update Customer
  data, status_code, headers = api_instance.update_customer_with_http_info(customer_id, customer_in_body)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CustomerInBody>
rescue Synctera::ApiError => e
  puts "Error when calling CustomersApi->update_customer_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
customer_id String The customer's unique identifier
customer_in_body CustomerInBody Customer to be updated

Return type

CustomerInBody

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json