Products and Prices: the catalog that Checkout, subscriptions, and invoices bill against. See https://docs.stripe.com/api/products and https://docs.stripe.com/api/prices.
Functions
create-price
fn (request: CreatePriceRequest): Map
fn (request: CreatePriceRequest, options: ::stripe::api/RequestOptions | Map): Map
POST /v1/prices - Create a price for a product. unit_amount is in the smallest currency unit. For subscriptions, set recurring: {interval: "month"} (add meter: "mtr_..." and usage_type: "metered" for usage-based billing).
Example
::products ::stripe::products
price ::products/create-price(::products/CreatePriceRequest({
product: "prod_...",
currency: "usd",
unit_amount: 1500,
recurring: {interval: "month"},
lookup_key: "pro_monthly"
}))
create-product
fn (request: CreateProductRequest): Map
fn (request: CreateProductRequest, options: ::stripe::api/RequestOptions | Map): Map
POST /v1/products - Create a product. Provide default_price_data to create a price in the same call.
Example
::products ::stripe::products
product ::products/create-product(::products/CreateProductRequest({
name: "Pro Plan",
default_price_data: {currency: "usd", unit_amount: 1500, recurring: {interval: "month"}}
}))
product.default_price // => "price_..."
delete-product
fn (product: Str): Map
fn (product: Str, opts: Map): Map
DELETE /v1/products/{id} - Delete a product. Only possible if it has no
prices attached; otherwise set active: false via update-product.
Example
::products ::stripe::products
result ::products/delete-product("prod_123")
result.deleted
get-price
fn (price: Str): Map
fn (price: Str, params: Map): Map
fn (price: Str, params: Map, opts: Map): Map
GET /v1/prices/{price} - Retrieve a price by ID.
Example
::products ::stripe::products
price ::products/get-price("price_123", {expand: ["product"]})
price.unit_amount
price.product.name
get-product
fn (product: Str): Map
fn (product: Str, params: Map): Map
fn (product: Str, params: Map, opts: Map): Map
GET /v1/products/{id} - Retrieve a product by ID.
Example
::products ::stripe::products
product ::products/get-product("prod_123", {expand: ["default_price"]})
product.default_price.unit_amount
list-prices
fn (): Map
fn (request: ListPricesRequest): Map
fn (request: ListPricesRequest, opts: Map): Map
GET /v1/prices - List prices. Filter by product, active, currency,
type ("one_time" or "recurring"), or lookup_keys.
Example
::products ::stripe::products
page ::products/list-prices(::products/ListPricesRequest({lookup_keys: ["pro_monthly"], active: true}))
price-id page.data[0].id
list-products
fn (): Map
fn (request: ListProductsRequest): Map
fn (request: ListProductsRequest, opts: Map): Map
GET /v1/products - List products, most recent first. Filter by active
or specific ids.
Example
::products ::stripe::products
page ::products/list-products(::products/ListProductsRequest({active: true, limit: 20}))
names map(page.data, %.name)
search-prices
fn (query: Str): Map
fn (query: Str, params: Map): Map
fn (query: Str, params: Map, opts: Map): Map
GET /v1/prices/search - Search prices with Stripe's search query
language, e.g. active:"true" AND product:"prod_...". Pass next_page
back as page in params to continue.
Example
::products ::stripe::products
results ::products/search-prices(`active:"true" AND product:"prod_123"`)
amounts map(results.data, %.unit_amount)
search-products
fn (query: Str): Map
fn (query: Str, params: Map): Map
fn (query: Str, params: Map, opts: Map): Map
GET /v1/products/search - Search products with Stripe's search query
language, e.g. active:"true" AND name~"plan". Pass next_page back as
page in params to continue.
Example
::products ::stripe::products
results ::products/search-products(`active:"true" AND name~"plan"`, {limit: 20})
ids map(results.data, %.id)
update-price
fn (price: Str, request: UpdatePriceRequest): Map
fn (price: Str, request: UpdatePriceRequest, options: ::stripe::api/RequestOptions | Map): Map
POST /v1/prices/{price} - Update a price. Amounts are immutable — create a new price and deactivate the old one to change pricing.
Example
::products ::stripe::products
::products/update-price("price_123", ::products/UpdatePriceRequest({
active: false,
nickname: "Pro monthly (retired)"
}))
update-product
fn (product: Str, request: UpdateProductRequest): Map
fn (product: Str, request: UpdateProductRequest, options: ::stripe::api/RequestOptions | Map): Map
POST /v1/products/{id} - Update a product.
Example
::products ::stripe::products
::products/update-product("prod_123", ::products/UpdateProductRequest({
name: "Pro Plan",
default_price: "price_123"
}))
Types
CreatePriceRequest
CreatePriceRequest type {
currency: Str,
product: Str?,
product_data: Map?,
unit_amount: Int?,
unit_amount_decimal: Str?,
custom_unit_amount: Map?,
currency_options: Map?,
recurring: Map?,
billing_scheme: Str?,
tiers: Vec<Map>?,
tiers_mode: Str?,
transform_quantity: Map?,
lookup_key: Str?,
transfer_lookup_key: Bool?,
nickname: Str?,
metadata: Map?,
active: Bool?,
tax_behavior: Str?,
expand: Vec<Str>?
}
CreateProductRequest
CreateProductRequest type {
name: Str,
description: Str?,
id: Str?,
active: Bool?,
metadata: Map?,
images: Vec<Str>?,
marketing_features: Vec<Map>?,
url: Str?,
shippable: Bool?,
statement_descriptor: Str?,
unit_label: Str?,
tax_code: Str?,
default_price_data: Map?,
expand: Vec<Str>?
}
ListPricesRequest
ListPricesRequest type {
product: Str?,
active: Bool?,
currency: Str?,
type: Str?,
recurring: Map?,
lookup_keys: Vec<Str>?,
created: Any?,
limit: Int?,
starting_after: Str?,
ending_before: Str?,
expand: Vec<Str>?
}
ListProductsRequest
ListProductsRequest type {
active: Bool?,
ids: Vec<Str>?,
shippable: Bool?,
url: Str?,
created: Any?,
limit: Int?,
starting_after: Str?,
ending_before: Str?,
expand: Vec<Str>?
}
UpdatePriceRequest
UpdatePriceRequest type {
active: Bool?,
nickname: Str?,
lookup_key: Str?,
transfer_lookup_key: Bool?,
currency_options: Map?,
metadata: Map?,
tax_behavior: Str?,
expand: Vec<Str>?
}
UpdateProductRequest
UpdateProductRequest type {
name: Str?,
description: Str?,
active: Bool?,
metadata: Map?,
images: Vec<Str>?,
marketing_features: Vec<Map>?,
url: Str?,
shippable: Bool?,
statement_descriptor: Str?,
unit_label: Str?,
default_price: Str?,
tax_code: Str?,
expand: Vec<Str>?
}