Documentation for the "getOneCustomer" Logic Node
Purpose
This node node is designed to retrieve customer information from a connected Stripe account. This functionality enables users to look up detailed customer data based on a unique customer identifier (customer ID). This is particularly useful in e-commerce platforms, customer relationship management (CRM) tools, and analytics dashboards that rely on accurate customer information for reporting and operational purposes.
Settings
1. Customer ID
- Input Type: String
- Description: This setting specifies the unique identifier for the customer whose details are to be retrieved from Stripe. It is mandatory for the logic to function correctly.
- Effect of Changes: If the
customerIdis changed, the logic will attempt to retrieve the information for the new customer ID. An incorrect or non-existent customer ID will lead to an error indicating that the customer could not be found. - Default Value:
None. This is a required field, and if not provided, an error will be thrown stating "Customer ID is required".
Configuration Input
- Inputs: An object containing
customerId. - Context: An optional object to hold contextual information related to the execution environment.
- Outputs: Returns customer data or an error message in the event of a failure.
How It Works
- Connection Initialization: The logic begins by establishing a connection to the Stripe service using a secure connection. The connection is initiated with the
stripekey and any passed context, allowing integration with the Stripe API. - Customer ID Retrieval: The logic checks for the presence of the
customerIdeither from theinputsor from theconfigobject. - Error Handling: If no valid customer ID is found, an error is thrown, stating that the customer ID is required.
- Data Retrieval: Once a valid
customerIdis obtained, the logic calls thegetOneCustomermethod from the Stripe integration instance, which queries the Stripe API for the customer details. - Output Delivery: The customer data received from Stripe is then returned as
output1. If there is a failure during this process, a structured error message is returned.
Data Expectations
This node expects the following data input:
- A valid
customerIdstring that corresponds to a customer registered in the Stripe platform.
Integration with AI
Currently, there are no specific AI integrations associated with this node node. It primarily functions as an API interaction layer.
Billing Impacts
Using the getOneCustomer node may generate API usage that could impact billing, depending on the Stripe pricing model and the number of requests made to their API. Each request to retrieve customer data counts against the API rate limits defined by Stripe.
Use Cases & Examples
Use Cases
- E-commerce Applications: Automatically retrieve customer information during the checkout process to provide personalized support or order history.
- Customer Support Tools: Customer support representatives can quickly access customer details for better service and issue resolution.
- Analytics Dashboards: Analyze customer behavior by pulling in detailed customer profiles for reporting and insights.
Example Use Case Configuration
Scenario: Customer Support Tool Integration
A customer support tool may need to fetch customer information when agents receive inquiries. The configuration might look as follows:
{
"inputs": {
"customerId": "cus_Jh3d8yZi678c2"
},
"config": {
"customerId": "cus_Jh3d8yZi678c2"
},
"context": {}
}In this example, the customerId provided is "cus_Jh3d8yZi678c2". The logic will connect to Stripe, fetch the customer's information associated with that ID, and return it as output, allowing support agents to access necessary customer details effortlessly.
Note on Execution
It is crucial to ensure that the customer ID provided is valid and corresponds to a customer in the Stripe database. Otherwise, the system will throw an error, halting the retrieval process.