4 min read

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

Configuration Input

How It Works

  1. Connection Initialization: The logic begins by establishing a connection to the Stripe service using a secure connection. The connection is initiated with the stripe key and any passed context, allowing integration with the Stripe API.
  2. Customer ID Retrieval: The logic checks for the presence of the customerId either from the inputs or from the config object.
  3. Error Handling: If no valid customer ID is found, an error is thrown, stating that the customer ID is required.
  4. Data Retrieval: Once a valid customerId is obtained, the logic calls the getOneCustomer method from the Stripe integration instance, which queries the Stripe API for the customer details.
  5. 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:

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

  1. E-commerce Applications: Automatically retrieve customer information during the checkout process to provide personalized support or order history.
  2. Customer Support Tools: Customer support representatives can quickly access customer details for better service and issue resolution.
  3. 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:

json
{
  "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.