Actions13
Overview
This node integrates with the Polar.sh API to create a checkout session for one or multiple products. It is useful in e-commerce workflows where you want to programmatically generate checkout links or sessions that customers can use to complete purchases. For example, you might use this node to automate creating checkout sessions after a user selects products on your website or to integrate with other systems that manage product sales.
The "Create Checkout" operation allows specifying a primary product and optionally additional products for multi-product checkouts. You can customize the checkout experience by pre-filling customer information, applying discounts, requiring billing addresses, and setting redirect URLs upon successful payment.
Properties
| Name | Meaning |
|---|---|
| Product Name or ID | The main product to checkout. Choose from a list of available products or specify an ID using an expression. |
| Additional Fields | A collection of optional settings to customize the checkout session: |
| - Allow Discount Codes | Whether customers are allowed to apply discount codes during checkout (true/false). |
| - Amount | Custom price amount in dollars for products with custom pricing. This value will be converted to cents internally. |
| - Customer Email | Email address to pre-fill in the checkout form. |
| - Customer ID | ID of an existing customer in Polar to associate with the checkout. |
| - Customer Name | Name to pre-fill in the checkout form. |
| - Discount ID | ID of a discount to automatically apply to the checkout. |
| - Embed Origin | URL origin of the page embedding the checkout iframe, if applicable. |
| - External Customer ID | Your internal identifier for the customer, used for reconciliation purposes. |
| - Metadata | Key-value pairs to store additional metadata with the checkout. Each key can be up to 40 characters, and each value up to 500 characters. |
| - Multiple Product Names or IDs | Additional products to include in a multi-product checkout. The first product is selected by default. |
| - Require Billing Address | Whether to require the full billing address (not just country). Note that US customers always require full billing address regardless of this setting. |
| - Subscription ID to Upgrade | ID of a free subscription to upgrade via this checkout. |
| - Success URL | URL to redirect the customer to after successful payment. You can include {CHECKOUT_ID} as a placeholder to dynamically insert the checkout session ID. |
Output
The node outputs JSON data representing the created checkout session or the result of the requested operation. The JSON structure includes all relevant details returned by the Polar.sh API about the checkout, such as checkout ID, associated products, customer info, applied discounts, amounts, and URLs.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the Polar.sh API.
- The node uses the Polar.sh API endpoints, switching between sandbox and production environments based on the configured environment credential.
- No additional external dependencies beyond the Polar.sh API and n8n's HTTP request capabilities.
Troubleshooting
Common issues:
- Invalid or missing product IDs: Ensure the product ID(s) specified exist in your Polar.sh account.
- Incorrect API credentials or environment configuration: Verify the API key and environment (sandbox vs production) are correctly set.
- Validation errors on fields like amount (must be between 0.5 and 999999.99), metadata key/value length limits, or required fields missing.
- Network or API downtime issues.
Error messages:
- Errors returned from the Polar.sh API will be surfaced with their message and description when available.
- If the node is set to continue on fail, errors will appear in the output JSON under an
errorfield with details. - To resolve, check the error message for invalid parameters or authentication issues and correct accordingly.
Links and References
- Polar.sh API Documentation
- n8n Expressions Documentation
- Polar.sh Checkout API Reference (for detailed parameter descriptions)