A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "recurring",
"currency": "BRL",
"amount_minor": 123,
"currency_exponent": 123,
"interval_unit": "day",
"interval_count": 123,
"trial_days": 123,
"per_seat": true,
"tax_behavior": "inclusive",
"archived": true,
"providers": [
{
"provider": "stripe",
"provider_account_id": "<string>",
"provider_price_id": "<string>",
"provider_product_id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Add a price to a plan
Requires billing:write. Prices a plan in one currency.
A plan has many prices, one per currency and recurrence: R149andUS29 are both correct and neither converts into the other, so each is a number a person chose. amount_minor is an integer in the currency’s minor unit and travels with currency always — an amount without a currency is not a price, and 1000 is R$10.00 in BRL and ¥1000 in JPY.
Exactly one live price may exist per plan per currency per recurrence — that is the offer. Changing the money is not an update: use POST /v1/organization/catalogue/prices/{id}/reprice, which archives the old offer and creates the new one in one step. This endpoint is for the currency or recurrence a plan does not have yet.
A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "recurring",
"currency": "BRL",
"amount_minor": 123,
"currency_exponent": 123,
"interval_unit": "day",
"interval_count": 123,
"trial_days": 123,
"per_seat": true,
"tax_behavior": "inclusive",
"archived": true,
"providers": [
{
"provider": "stripe",
"provider_account_id": "<string>",
"provider_price_id": "<string>",
"provider_product_id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Autorizações
Cabeçalhos
The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.
Parâmetros de consulta
Corpo
A price on the way in — what both creating and repricing send. Every field is stated: there is no PATCH on a price, so no request carrying this is editing one, and "leave that field as it was" has no meaning here.
Whether amount_minor already contains the tax. Required, with no third "undecided" value: we calculate no tax — that is the payment provider's job — but whether the number includes it is an input only the person who typed the number knows, and the moment it matters is the moment somebody is charged.
inclusive, exclusive The free period this offer promises before the first charge, in days. Part of the offer — checkouts started on this price carry it by default — and therefore as immutable as the amount: changing the trial is a reprice. Omit (or send 0) for no trial. Refused on a one_time price rather than ignored: a payment has no trial.
x >= 1The quantity of this price follows the customer's own member count: a checkout on it derives the quantity from the roster and refuses one in the request, and the count is kept in step at the gateway as members join and leave. Part of the offer and as immutable as the amount — changing it is a reprice. Refused on a one_time price rather than ignored: a payment has no period over which a head count could be re-billed.
Resposta
The price. providers is empty until the price is mapped onto a payment provider — until then nothing can charge it.
One plan's amount in one currency. A plan has many prices, one per currency: selling in BRL and USD is a price per currency, a number you chose, never a conversion at display time.
A price is immutable. Repricing means creating a new price and archiving the old one, because a subscription refers to the price it was sold at and editing the amount would silently change what somebody agreed to pay.