Polar ACTION
Create Checkout
Create a checkout session for one or more products. See the documentation
- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Polar account once, then configure and run Create Checkout from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "polar-create-checkout",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
polar: { authProvisionId: "apn_xxxxxxx" },
products: ["Products"],
prices: "Prices",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "polar-create-checkout",
"configured_props": {
"polar": { "authProvisionId": "apn_xxxxxxx" },
"products": ["Products"],
"prices": "Prices"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "polar",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "polar-create-checkout",
arguments: {
products: ["Products"],
prices: "Prices",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
products Products | string[] | List of product IDs available to select at checkout. Example: ["prod_123", "prod_456"]. The first product is selected by default. Required Dynamic |
prices Prices | object | Optional mapping of product IDs to ad-hoc prices to create for those products. Example: { "prod_123": [{ "amountType": "fixed", "priceAmount": 1000, "priceCurrency": "usd" }] }. Optional |
amount Amount | integer | Custom checkout amount in cents for products using custom pricing. Example: 1000 for $10.00. Optional |
seats Seats | integer | Number of seats for seat-based pricing. Required for seat-based products. Optional |
trialInterval Trial Interval | string | Interval unit for the trial period. Optional |
trialIntervalCount Trial Interval Count | integer | Number of interval units for the trial period. Example: 14 with a trial interval of day. Optional |
allowTrial Allow Trial | boolean | Whether to enable the trial period for the checkout session. If false, the trial is disabled even if the selected product has one configured. Optional |
discountId Discount | string | Select a discount or provide a custom Discount ID (UUID). Optional |
customerId Customer | string | Select a customer or provide a custom Customer ID (UUID). Search by name, email, or Customer ID (UUID). Optional Dynamic |
customerEmail Customer Email | string | Pre-fill the customer's email address in the checkout form. Optional |
customerName Customer Name | string | Pre-fill the customer's name in the checkout form. Optional |
customerIpAddress Customer IP Address | string | Pre-fill the customer's IP address for the checkout session. Optional |
customerBillingName Customer Billing Name | string | Pre-fill the billing name for the checkout session. Optional |
customerBillingAddress Customer Billing Address | object | Pre-fill the customer's billing address. Example: { "line1": "123 Main St", "city": "New York", "state": "NY", "postalCode": "10001", "country": "US" }. Optional |
customerTaxId Customer Tax ID | string | Pre-fill the customer's tax ID for the checkout session. Optional |
customerMetadata Customer Metadata | object | Additional key-value data copied to the created customer. Example: { "crmId": "cust_123" }. Optional |
isBusinessCustomer Is Business Customer | boolean | Whether the customer is a business. If true, the customer must provide their full billing address and billing name. Optional |
externalCustomerId External Customer ID | string | Customer ID from your system. Example: crm_cust_98765. If a matching Polar customer exists, the order is linked to it. Optional |
successUrl Success URL | string | URL where the customer will be redirected after a successful payment. You can include checkout_id={CHECKOUT_ID}. Optional |
returnUrl Return URL | string | URL used by the checkout back button. Optional |
embedOrigin Embed Origin | string | Origin of the page embedding the checkout session, used to allow Polar's iframe to communicate with the parent page. Optional |
locale Locale | string | Locale to use for the checkout session. Example: en-US. Optional |
currency Currency | string | Presentment currency for the checkout session. Optional |
subscriptionId Subscription ID | string | ID of a subscription to upgrade. It must be on free pricing. Use the List Subscriptions action to discover options. Optional |
allowDiscountCodes Allow Discount Codes | boolean | Whether customers can apply discount codes during checkout. Optional |
requireBillingAddress Require Billing Address | boolean | Whether customers must fill their full billing address. Optional |
metadata Metadata | object | Additional key-value data copied to the resulting order or subscription. Example: { "orderId": "12345", "campaignId": "summer-sale" }. Optional |
customFieldData Custom Field Data | object | Key-value object storing custom field values. Example: { "company_size": "50-100" }. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- polar-create-checkout
- Version
- 0.0.2
- App
- Polar
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗