Plain icon

Plain

Interact with Plain API

Tenant → Add Customers

AI-generated

Overview

This node integrates with the Plain API to manage tenants and their customer associations. Specifically, the Tenant - Add Customers operation allows you to add one or more customers to one or more tenants within the Plain system.

Typical use cases include:

  • Associating existing customers with specific tenants for organizational or access control purposes.
  • Automating tenant-customer relationships in workflows where customer data is managed across multiple tenants.
  • Synchronizing customer memberships when onboarding new tenants or updating tenant configurations.

For example, you might use this node to add a customer identified by email address to several tenants identified by their IDs or external IDs, enabling those customers to be linked properly in your system.

Properties

Name Meaning
Customer Identifier Specifies which customer to add. You can identify the customer by one of:
- Customer ID
- Email Address
- External ID
Tenant Identifiers Specifies one or more tenants to which the customer will be added. Each tenant can be identified by:
- Tenant ID
- External ID

The Customer Identifier property is a fixed collection containing a single customer identification method and value.

The Tenant Identifiers property is a fixed collection that supports multiple values, allowing you to specify multiple tenants by their identifiers.

Output

The output JSON contains the updated customer object after the addition operation, including:

  • id: The unique identifier of the customer.
  • fullName: The full name of the customer.
  • email: An object containing the customer's email address.

If the operation encounters an error, it throws an error message describing the issue.

Example output JSON structure:

{
  "id": "customer-id",
  "fullName": "Customer Name",
  "email": {
    "email": "customer@example.com"
  }
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate with the Plain API.
  • The node uses GraphQL queries and mutations to interact with the Plain API endpoints.
  • No additional external dependencies are required beyond the configured API authentication.

Troubleshooting

Common Issues

  • Missing or incomplete customer identifier: The node requires a valid customer identifier (ID, email, or external ID). If missing or incomplete, the node will throw an error.
  • Missing tenant identifiers: At least one tenant identifier must be provided; otherwise, the operation fails.
  • API errors: Errors returned from the Plain API (e.g., invalid IDs, permission issues) will be surfaced as node errors.

Error Messages and Resolutions

  • "Customer identifier is required": Ensure the customer identifier field is filled with a valid identification method and value.
  • "Customer identifier data is incomplete": Verify that the chosen identification method has a corresponding non-empty value.
  • "Tenant identifiers are required": Provide at least one tenant identifier with a valid ID or external ID.
  • API error messages may include field-specific validation errors; review these messages to correct input data accordingly.

Links and References


This summary focuses exclusively on the Tenant - Add Customers operation as requested, based on static analysis of the provided source code and property definitions.

Discussion