Plain icon

Plain

Interact with Plain API

Customer → Update

AI-generated

Overview

This node interacts with the Plain API to manage customer data, specifically supporting operations on the "Customer" resource. The Update operation allows you to modify existing customer details such as email, full name, short name, external ID, and customer group assignments.

Typical use cases include:

  • Updating customer contact information after receiving new data.
  • Synchronizing customer records between systems by updating fields like external IDs.
  • Managing customer group memberships dynamically based on business logic.

For example, you might update a customer's email and assign them to specific customer groups after they complete a signup form or change their preferences.

Properties

Name Meaning
Customer ID The unique identifier of the customer to update.
Update Fields A collection of fields to update for the customer:
- Email The customer's email address.
- Full Name The customer's full name.
- Short Name The customer's short name or display name.
- External ID An external identifier for the customer (e.g., from your own system).
- Customer Groups List of customer group IDs to assign the customer to. These are selectable options loaded dynamically from the API.

Output

The output is a JSON object representing the updated customer record. It includes fields such as:

  • id: The customer's unique ID.
  • email: An object containing the email address, verification status, and verification timestamp.
  • fullName: The customer's full name.
  • shortName: The customer's short or display name.
  • externalId: The external ID associated with the customer.
  • createdAt and updatedAt: Timestamps indicating when the customer was created and last updated.
  • customerGroups: If customer groups were assigned during update, this field contains an array of the assigned groups with their IDs and names.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate with the Plain API.
  • Uses GraphQL queries and mutations to interact with the Plain backend.
  • Dynamically loads customer group options via a method that queries the API for available groups.

Troubleshooting

  • Missing Customer ID: The update operation requires a valid customer ID. Omitting this will cause an error.
  • Empty Update Fields: At least one field must be specified to update; otherwise, the node throws an error.
  • API Errors: If the Plain API returns errors (e.g., validation errors), these are surfaced with detailed messages including field-specific issues.
  • Customer Group Assignment Failures: If assigning customer groups fails, the error message from the API is thrown. Ensure the group IDs are valid and the user has permission.
  • Network or Authentication Issues: Standard API request failures due to network problems or invalid credentials will result in errors. Verify API key validity and connectivity.

Links and References

Discussion