Update a price
POST / v1 / prices /:id
Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.
Parameters
- active boolean Whether the price can be used for new purchases. Defaults to
true. - metadata map Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata. - nickname string A brief description of the price, hidden from customers.
- tax _ behavior enum Recommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed. Possible enum valuesexclusiveinclusiveunspecified
More parameters
- currency _ options map
- lookup _ key string
- transfer _ lookup _ key boolean
Returns
The updated price object is returned upon success. Otherwise, this call raises an error.
Response
{ "id": "price_1MoBy5LkdIwHu7ixZhnattbh", "object": "price", "active": true, "billing_scheme": "per_unit", "created": 1679431181, "currency": "usd", "custom_unit_amount": null, "livemode": false, "lookup_key": null, "metadata": { "order_id": "6735" }, "nickname": null, "product": "prod_NZKdYqrwEYx6iK", "recurring": { "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": "1000"}
Retrieve a price
GET / v1 / prices /:id
Retrieves the price with the given ID.
Parameters
No parameters.
Returns
Returns a price if a valid price or plan ID was provided. Raises an error otherwise.
Response
{ "id": "price_1MoBy5LkdIwHu7ixZhnattbh", "object": "price", "active": true, "billing_scheme": "per_unit", "created": 1679431181, "currency": "usd", "custom_unit_amount": null, "livemode": false, "lookup_key": null, "metadata": {}, "nickname": null, "product": "prod_NZKdYqrwEYx6iK", "recurring": { "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": "1000"}
List all prices
GET / v1 / prices
Returns a list of your active prices, excluding inline prices. For the list of inactive prices, set active to false.
Parameters
- active boolean Only return prices that are active or inactive (e.g., pass
falseto list all inactive prices). - currency enum Only return prices for the given currency.
- product string Only return prices for the given product.
- type enum Only return prices of type
recurringorone_time. Possible enum valuesone_timerecurring
More parameters
- created object
- ending _ before string
- limit integer
- lookup _ keys array of strings
- recurring object
- starting _ after string
Returns
A dictionary with a data property that contains an array of up to limit prices, starting after prices starting_after. Each entry in the array is a separate price object. If no more prices are available, the resulting array will be empty.
Response
{ "object": "list", "url": "/v1/prices", "has_more": false, "data": [ { "id": "price_1MoBy5LkdIwHu7ixZhnattbh", "object": "price", "active": true, "billing_scheme": "per_unit", "created": 1679431181, "currency": "usd", "custom_unit_amount": null, "livemode": false, "lookup_key": null, "metadata": {}, "nickname": null, "product": "prod_NZKdYqrwEYx6iK", "recurring": { "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": "1000" } ]}
