Class: VoucherifySdk::CustomersApi
- Inherits:
-
Object
- Object
- VoucherifySdk::CustomersApi
- Defined in:
- lib/VoucherifySdk/api/customers_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_customer(opts = {}) ⇒ CustomersCreateResponseBody
Create Customer Creates a customer object.
-
#customer_permanently_deletion(customer_id, opts = {}) ⇒ CustomersPermanentDeletionCreateResponseBody
Delete Customer Permanently The organization user can remove consumer data permanently from the Voucherify system by using this API method.
-
#delete_customer(customer_id, opts = {}) ⇒ nil
Delete Customer This method deletes a customer.
-
#get_customer(customer_id, opts = {}) ⇒ CustomersGetResponseBody
Get Customer Retrieve customer details.
-
#import_customers_using_csv(file, opts = {}) ⇒ CustomersImportCsvCreateResponseBody
Import and Update Customers using CSV This API method lets you import or update customer data.
-
#initialize(api_client = ApiClient.default) ⇒ CustomersApi
constructor
A new instance of CustomersApi.
-
#list_customer_activities(customer_id, opts = {}) ⇒ CustomersActivitiesListResponseBody
List Customer Activities Retrieve customer activities.
-
#list_customer_segments(customer_id, opts = {}) ⇒ CustomersSegmentsListResponseBody
List Customer’s Segments Returns the list of segments IDs to which the customer belongs to.
-
#list_customers(opts = {}) ⇒ CustomersListResponseBody
List Customers Returns a list of customers.
-
#update_customer(customer_id, opts = {}) ⇒ CustomersUpdateResponseBody
Update Customer Updates the specified customer by setting the values of the parameters passed in the request body.
-
#update_customers_consents(customer_id, opts = {}) ⇒ nil
Update Customer’s consents Update marketing permissions for the specified customer.
-
#update_customers_in_bulk(opts = {}) ⇒ CustomersUpdateInBulkResponseBody
Update Customers in bulk Update several customers in one asynchronous operation.
-
#update_customers_metadata_in_bulk(opts = {}) ⇒ CustomersMetadataUpdateInBulkResponseBody
Update Customers’ Metadata in bulk Update several customers metadata properties in one asynchronous operation.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CustomersApi
Returns a new instance of CustomersApi.
19 20 21 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_customer(opts = {}) ⇒ CustomersCreateResponseBody
Create Customer Creates a customer object. 📘 Upsert Mode If you pass an id or a source_id that already exists in the customer database, Voucherify will return a related customer object with updated fields.
27 28 29 30 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 27 def create_customer(opts = {}) data, _status_code, _headers = create_customer_with_http_info(opts) data end |
#customer_permanently_deletion(customer_id, opts = {}) ⇒ CustomersPermanentDeletionCreateResponseBody
Delete Customer Permanently The organization user can remove consumer data permanently from the Voucherify system by using this API method. It deletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.
91 92 93 94 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 91 def customer_permanently_deletion(customer_id, opts = {}) data, _status_code, _headers = customer_permanently_deletion_with_http_info(customer_id, opts) data end |
#delete_customer(customer_id, opts = {}) ⇒ nil
Delete Customer This method deletes a customer.
154 155 156 157 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 154 def delete_customer(customer_id, opts = {}) delete_customer_with_http_info(customer_id, opts) nil end |
#get_customer(customer_id, opts = {}) ⇒ CustomersGetResponseBody
Get Customer Retrieve customer details.
215 216 217 218 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 215 def get_customer(customer_id, opts = {}) data, _status_code, _headers = get_customer_with_http_info(customer_id, opts) data end |
#import_customers_using_csv(file, opts = {}) ⇒ CustomersImportCsvCreateResponseBody
Import and Update Customers using CSV This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas. # Request Example # CSV File Format The CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object. 📘 Standard customer fields mapping **No spaces allowed in field names** Id, Name, Email, Phone, Birthdate, Source_id, Address_line_1, Address_line_2, Address_Postal_Code, Address_City, Address_State, Address_Country, Description, Metadata_name_1, Metadata_name_2 # Update Customers using CSV If you would like to update customers data, you can do it using the CSV file with new data. However, remember to include a source_id in your CSV file to manage the update successfully. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
278 279 280 281 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 278 def import_customers_using_csv(file, opts = {}) data, _status_code, _headers = import_customers_using_csv_with_http_info(file, opts) data end |
#list_customer_activities(customer_id, opts = {}) ⇒ CustomersActivitiesListResponseBody
List Customer Activities Retrieve customer activities.
356 357 358 359 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 356 def list_customer_activities(customer_id, opts = {}) data, _status_code, _headers = list_customer_activities_with_http_info(customer_id, opts) data end |
#list_customer_segments(customer_id, opts = {}) ⇒ CustomersSegmentsListResponseBody
List Customer’s Segments Returns the list of segments IDs to which the customer belongs to. If you pass a customerId which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.
445 446 447 448 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 445 def list_customer_segments(customer_id, opts = {}) data, _status_code, _headers = list_customer_segments_with_http_info(customer_id, opts) data end |
#list_customers(opts = {}) ⇒ CustomersListResponseBody
List Customers Returns a list of customers.
519 520 521 522 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 519 def list_customers(opts = {}) data, _status_code, _headers = list_customers_with_http_info(opts) data end |
#update_customer(customer_id, opts = {}) ⇒ CustomersUpdateResponseBody
Update Customer Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
614 615 616 617 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 614 def update_customer(customer_id, opts = {}) data, _status_code, _headers = update_customer_with_http_info(customer_id, opts) data end |
#update_customers_consents(customer_id, opts = {}) ⇒ nil
Update Customer’s consents Update marketing permissions for the specified customer.
684 685 686 687 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 684 def (customer_id, opts = {}) (customer_id, opts) nil end |
#update_customers_in_bulk(opts = {}) ⇒ CustomersUpdateInBulkResponseBody
Update Customers in bulk Update several customers in one asynchronous operation. In one request, it is possible to update a maximum of 100 records. In the response body, you get a unique async action identifier. If a requested customer object is not found, then an upsert occurs. This is reflected in the Get Async Action endpoint as follows: This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
751 752 753 754 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 751 def update_customers_in_bulk(opts = {}) data, _status_code, _headers = update_customers_in_bulk_with_http_info(opts) data end |
#update_customers_metadata_in_bulk(opts = {}) ⇒ CustomersMetadataUpdateInBulkResponseBody
Update Customers’ Metadata in bulk Update several customers metadata properties in one asynchronous operation. In one request, it is possible to update a maximum of 100 records. In the response body, you get a unique async action identifier. If a requested customer object is not found, then an upsert occurs. This is reflected in the Get Async Action endpoint as follows: This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
815 816 817 818 |
# File 'lib/VoucherifySdk/api/customers_api.rb', line 815 def (opts = {}) data, _status_code, _headers = (opts) data end |