comecerodocs

Quote a spending limit raise or a one-time extra

POST
/customers/{customer_id}/usage/{subscription_id}/spend_limit/quotes

Prices a change of the customer's spending limit for them to accept, with the words they accept (consent_text). Nothing is changed. raise quotes a new limit above the one in force (only when the shop lets customers set one; set a first limit or lower one with PUT .../spend_limit). burst quotes this period's one-time extra: the shop's spend_limit_burst, fixed now, on a limit above 0, ending at the renewal, once per period. A raise quoted while this period's extra is in force names the most the period may then be charged, the new limit plus the extra (max_total_amount, burst_amount). A raise never states less than what the period already committed, which stays billed: with 115 committed, a raise from 100 to 105 states 115 for this period, and its words say why. Every amount in the words is before tax, and they say that usage already recorded this period, which the limit held back, may be billed. The quote is for the billing period it is made in and can be accepted until expires_at (10 minutes, or the end of the period if that comes first), once: a raise with PATCH .../spend_limit, an extra with PUT .../spend_limit/burst, each only from the customer's own login. A shopper's token quotes only for its own customer (me works).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

customer_id*string

The Comecero customer id, or me.

subscription_id*string

The customer's subscription.

Request Body

application/json
  1. body

What to quote: a raise of the customer's spending limit to amount, or this period's one-time extra (the shop's, worked out by Comecero). These are the only fields; anything else is refused (400, reference UbV145).

operation*string
Value in"raise""burst"
amount?string

A raise only, and required for one: the new limit, a decimal string in the plan's currency above the limit in force, no finer than the currency. A burst takes none, not even null.

Match^(?=\.?[0-9])(?:0*[0-9]{0,9}(?:\.[0-9]{0,6}0*)?|0*1000000000(?:\.0*)?)$
currency*string

The currency of the subscription's usage (the spending limit's currency).

expected_revision*integer

The revision read with GET. A quote is made only when the limit is still at it (409, reference UbV153); missing, not a whole number or below 0 is a 400 (reference UbV154).

Range0 <= value

Response Body

The quote.

application/json
  1. response

A priced offer of a raise of the customer's spending limit or of this period's one-time extra, with the words the customer accepts. Nothing is changed until it is accepted, once at most, before expires_at (10 minutes, never past the end of the billing period it was made in) and in that same period: a raise with PATCH .../spend_limit, an extra with PUT .../spend_limit/burst. Amounts are decimal strings in currency, before tax.

object?string
quote_id?string
operation?string
Value in"raise""burst"
subscription_id?string
customer_id?string
currency?string
base_limit_amount?string

The spending limit in force now.

amount?|

A raise, the new limit. Null for a burst.

burst_amount?|

A burst, the extra for this period, fixed now (a percent is turned into an amount once, rounded down to the currency). A raise, the extra already in force this period, which stays on top of the new limit until the renewal; null when there is none.

max_total_amount?string

The most the period's usage may be charged if it is accepted, before tax, and never less than what the period already committed (that stays billed): for a raise, max(committed, new limit + any extra in force); for a burst, max(committed, limit + extra).

period_id?string

The subscription period it was made in, and the only one it can be accepted in (UbV173 after the renewal).

burst_expires_at?|

A burst, when it ends (the renewal). Null for a raise.

Formatdate-time
consent_text?string

The words the customer accepts, with every amount in it. Show them as they are. In English (locale).

consent_version?string
Value in"spend_limit_raise.v3""spend_limit_burst.v3"
consent_hash?string

A hash of consent_text, kept with the consent.

locale?string

The language of consent_text; en for now.

policy_revision?string

The shop's spending limit settings it was made under; a change of them makes it unusable (UbV176).

control_revision?integer

The spending limit's revision it was made at; a change of the limit makes it unusable (UbV176).

Range0 <= value
expires_at?string
Formatdate-time
date_created?string
Formatdate-time
curl -X POST 'https://api.comecero.com/api/v1/customers/string/usage/string/spend_limit/quotes' \  -H 'Content-Type: application/json' \  -d '{  "operation": "raise",  "amount": "80",  "currency": "USD",  "expected_revision": 3}'
Example Response
{  "object": "usage_spend_limit_quote",  "quote_id": "usq_5b7d9f1a3c5e4b6d8f0a2c4e6b8d0f1a",  "operation": "raise",  "subscription_id": "SB0123456789",  "customer_id": "0093717976099CuAiEBXu4",  "currency": "USD",  "base_limit_amount": "50",  "amount": "80",  "burst_amount": null,  "max_total_amount": "80",  "period_id": "2026120100",  "burst_expires_at": null,  "consent_text": "I raise my spending limit on this subscription's usage from 50.00 USD to 80.00 USD, before tax. Up to 80.00 USD of usage, before tax, may be charged to me in each billing period until I change it. Usage already recorded this period that the old limit held back may be billed under the new limit.",  "consent_version": "spend_limit_raise.v3",  "consent_hash": "6c8e0a2b4d6f8a1c3e5b7d9f1a3c5e7b",  "locale": "en",  "policy_revision": "9b2d4f6a8c0e1b3d5f7a9c1e3b5d7f9a",  "control_revision": 3,  "expires_at": "2026-11-15T12:10:00Z",  "date_created": "2026-11-15T12:00:00Z"}

Set a customer's spending limit PUT

Sets or clears the customer's own spending limit on one subscription's usage. The limit covers usage charges only, before tax (not the plan's regular price); 0 means no usage spend. Usage past it is neither billed nor drawn from prepaid credit. The shop must let customers set one (`allow_spend_limit` in `usage_customer_settings`); this holds for your own tokens too. Every change is logged with who made it, when and from where. Raising the limit may bill usage already recorded this period that the old limit held back. A new limit applies at once to usage not billed yet; what this period's bills already committed still counts, so a limit below it means no more usage spend this period. `expected_revision` is required, so a change made since you read it is never overwritten. Send an `Idempotency-Key` header so a retry is harmless: for a day, the same key with the same `amount` and `expected_revision` changes nothing and answers what the first request answered (the limit and `revision` as that change left them), even after a later change; the key with another body is refused. The key is noted before the change is made, so a retry of a request that never answered never makes the change twice. An empty header counts as none. Setting the same amount again changes nothing. A shopper's token sets only its own customer's (`me` works). To raise a limit with the customer's recorded consent, quote it (`POST .../spend_limit/quotes`) and accept it with `PATCH`.

Take back this period's one-time extra DELETE

Takes back this period's one-time extra, from the customer's login or one of your tokens. What the period already committed stays billable; only the headroom not used yet goes, and the period gets no other extra. Send the `revision` read with GET as `If-Match`, and an `Idempotency-Key`: the same key again answers what the first request answered, even after a later change; the key with another revision is refused. The customer gets an email confirming it (notification `subscription:spend_limit_changed`, when it is on) and you get the `usage:burst_revoked` webhook. A shopper's token takes back only its own customer's (`me` works).