Actions13
Overview
This node integrates with the Polar.sh API to manage products, including creating new products. Specifically, the Product - Create operation allows users to add a new product to their Polar.sh account by specifying its name and optional additional details such as description, pricing, subscription status, and metadata.
Typical use cases include:
- Automating product creation workflows in e-commerce or subscription platforms.
- Bulk importing products from other systems into Polar.sh.
- Dynamically creating products based on user input or external triggers.
For example, you could use this node to create a new subscription product with multiple pricing options and metadata tags that help categorize or describe the product further.
Properties
| Name | Meaning |
|---|---|
| Name | The name of the product to be created. This is a required string field. |
| Additional Fields | A collection of optional fields to provide more details about the product: |
| - Description | A text description of the product. |
| - Is Recurring | Boolean flag indicating whether the product is a subscription (recurring) or a one-time purchase. |
| - Prices | One or more price entries for the product. Each price includes: |
| β’ Amount Type: Fixed, Custom, or Free pricing. | |
| β’ Currency: Supported currencies include AUD, CAD, DKK, EUR, GBP, NOK, SEK, USD. | |
| β’ Price Amount: Numeric value representing the price in dollars (converted internally to cents). | |
| β’ Recurring Interval: If recurring, interval can be "Month" or "Year". | |
| β’ Type: Either "One Time" or "Recurring". | |
| - Metadata | Key-value pairs for custom metadata associated with the product. Useful for tagging or adding extra information not covered by standard fields. |
Output
The node outputs the JSON response returned by the Polar.sh API after creating the product. This typically includes all details of the newly created product such as its unique ID, name, description, pricing details, subscription status, metadata, and timestamps.
The output structure is:
{
"id": "string",
"name": "string",
"description": "string",
"is_recurring": true,
"prices": [
{
"id": "string",
"type": "one_time" | "recurring",
"amount_type": "fixed" | "custom" | "free",
"price_amount": 1000,
"price_currency": "usd",
"recurring_interval": "month" | "year"
}
],
"metadata": {
"key1": "value1",
"key2": "value2"
},
...
}
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authenticating with the Polar.sh API.
- The node uses the Polar.sh base URL which switches between sandbox and production environments based on the configured environment credential parameter.
- No additional external dependencies are needed beyond the Polar.sh API access.
Troubleshooting
Common issues:
- Missing required "Name" property will cause the API request to fail.
- Incorrectly formatted prices (e.g., missing amount or currency) may result in validation errors.
- Network or authentication errors if the API key is invalid or missing.
Error messages:
- API error responses will be passed through and included in the node's error output.
- Typical errors include "Unauthorized" (invalid API key), "Bad Request" (invalid parameters), or "Internal Server Error".
Resolution tips:
- Ensure the API key credential is correctly set up and has necessary permissions.
- Validate all required fields before execution.
- Check price amounts are positive numbers and currencies are valid ISO codes.
- Use the sandbox environment for testing before switching to production.
Links and References
- Polar.sh API Documentation
- Polar.sh Product Management API Reference
- n8n documentation on Creating Custom Nodes