Create Stripe price

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Creates a one-time or recurring price for the product identified by product_id.

Uses the Stripe account selected by the app's stored credentials. Live keys select the live catalog and test keys select the test catalog. Products and prices belong to that Stripe account, so multiple apps configured with the same account share the same catalog.

Requires write access to the app. Workspace viewers cannot call this operation.

post/api/apps/{app_id}/payments/stripe/prices

Path parameters

app_idstring required

ID of the Base44 app.

ID of the Base44 app.

Request body

product_idstring required

Stripe product ID to price.

unit_amountinteger required

Amount in the currency's smallest unit. For USD, 2500 represents $25.00.

currencystring

Three-letter ISO 4217 currency code. Converted to lowercase before sending to Stripe. Defaults to usd.

recurring_intervalstring nullable

Billing interval. Use day, week, month, or year. Omit it or send null for a one-time price. Defaults to null.

recurring_interval_countinteger

Number of billing intervals between charges. Used only when a recurring interval is supplied. Defaults to 1.

metadataobject nullable

Metadata to store, as string key-value pairs. Stripe's metadata rules limit it to 50 keys, 40 characters per key, and 500 characters per value. Defaults to null.

Example request

{
  "product_id": "prod_T7mK2p9Q4r6S8v",
  "unit_amount": 2500,
  "currency": "usd",
  "recurring_interval": "month",
  "recurring_interval_count": 1,
  "metadata": {
    "tier": "standard"
  }
}

Response

The operation result.

idstring required

Stripe price ID.

productstring required

Stripe product ID this price belongs to.

unit_amountinteger nullable required

Amount in the currency's smallest unit, or null for pricing without a fixed integer unit amount.

currencystring required

Currency as a lowercase three-letter ISO 4217 code.

activeboolean required

Whether the price is active.

metadataobject required

Metadata stored on the price.

Example response

{
  "id": "price_1T7mK2Q4r6S8v9Ab",
  "product": "prod_T7mK2p9Q4r6S8v",
  "unit_amount": 2500,
  "currency": "usd",
  "active": true,
  "metadata": {
    "tier": "standard"
  },
  "recurring": {
    "interval": "month",
    "interval_count": 1,
    "usage_type": "licensed"
  }
}

Changes

Changed in 1 of the 14 revisions of this API.1