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.
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.
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.
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.
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.
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.
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.
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.
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.
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>?
}