comecerodocs

Take back this period's one-time extra

DELETE
/customers/{customer_id}/usage/{subscription_id}/spend_limit/burst

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).

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.

Header Parameters

If-Match*string

The spending limit's revision read with GET, a whole number (3, "3" and W/"3" are all read as 3). Missing or not a whole number is a 400 (reference UbV154); a revision that is not the current one is a 409 (reference UbV153).

Idempotency-Key*string

Required. Names one change: the same request again with the same key (after a timeout, say) changes nothing more and answers as the first one did, for a day. 1 to 128 printable ASCII characters, sent once; missing or empty is refused (400, reference UbV150). Use a new random key, such as a UUID, for each change you mean to make. The same key with another body is refused (409, reference UbV151).

Match^[ -~]{1,128}$
Length1 <= length <= 128

Response Body

The spending limit now, with the extra taken back (burst.status revoked). changes is left out for a shopper's token.

application/json
  1. response

A customer's spending limit on one subscription's usage, in the usage plan's currency. The limit covers usage charges only, before tax: not the plan's regular price, and not tax, which is added on the invoice as usual. Usage paid with prepaid credit counts toward it too, and usage past it in a period is neither billed nor drawn from credit: the limit is shared out across the usage first, and only that share is paid with credit or cash. A limit of 0 means no usage spend. A change 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. The customer gets a warning email at 50 and 80% and an email at 100%; at 100% you get the usage:spend_limit_reached webhook, once per period and limit (again after a change). While your shop uses spending limits, a period that has ended, and its late usage, is billed under the limit in force at its end: the customer's own limit and your allow_spend_limit and default_spend_limit as they were then. While it uses none (allow_spend_limit false and default_spend_limit null), an ended period whose first bill runs then has no limit, and late usage for a period billed under a limit keeps the limit that bill used. Amounts are decimal strings.

object?string
subscription_id?string
currency?string

The currency of the subscription's usage plans, which every amount is in.

amount?|

The customer's own limit. Null when they set none, when the shop does not let customers set one (customer_can_set false), or when it was set for a plan in another currency.

default?|

The shop's limit for customers who set none (default_spend_limit). Null when there is none.

effective?|

The limit now, amount or else default. Null when there is none.

source?|

Where effective comes from, customer (their own) or default (the shop's). Null when there is no limit.

Value in"customer""default"null
spent?string

The usage spend this period so far, before tax: what the period's bills already took (committed) and the usage not billed yet, credit paid and cash, every usage plan of the subscription.

committed?string

The part of spent that bills of this period already charged.

remaining?|

What is left of this period's limit, before tax, never below 0, with this period's one-time extra (burst) while it is in force. Null when there is no limit.

reset_at?|

When the period ends and spent starts again from 0. Null when not known.

Formatdate-time
customer_can_set?boolean

Whether the shop lets customers set their own limit (allow_spend_limit).

revision?integer

Goes up by one with every change; 0 before any. Send it back as expected_revision to change the limit only if nobody changed it since.

Range0 <= value
changes?array<>

Every change, newest first (the last 500), as evidence for a dispute. Secret and trusted tokens only: left out for a shopper's token.

burst_offered?boolean

Whether the customer can ask for a one-time extra this period now (POST .../spend_limit/quotes with operation burst): the shop offers one, the limit in force is above 0, and this period has had none. Left out when the shop never set spend_limit_burst.

burst?

This period's one-time extra, in any status. Left out when the period has none.

effective_limit_amount?string

The most this period's usage may be charged, before tax: the limit in force (effective) plus the one-time extra while it is in force, never below what this period's bills already committed. After the extra is taken back, the limit, or what was committed if that is more. Left out when the period has no extra (the most is then effective).

Example Request
curl -X DELETE 'https://api.comecero.com/api/v1/customers/string/usage/string/spend_limit/burst' \  -H 'If-Match: "4"' \  -H 'Idempotency-Key: 3f2b6c1e-9d4a-4e8b-a1f7-5c0d2e9b8a64'
Example Response
{  "object": "usage_spend_limit",  "subscription_id": "SB0123456789",  "currency": "USD",  "amount": "50",  "default": null,  "effective": "50",  "source": "customer",  "spent": "52",  "committed": "52",  "remaining": "0",  "reset_at": "2026-12-01T00:00:00Z",  "customer_can_set": true,  "revision": 5,  "burst_offered": false,  "effective_limit_amount": "52",  "burst": {    "object": "usage_spend_limit_burst",    "burst_id": "usb_0f4c2a9e7d1b3856c0a4e2f9b7d1c3a5",    "subscription_id": "SB0123456789",    "currency": "USD",    "period_id": "2026120100",    "base_limit_amount": "50",    "amount": "10",    "max_total_amount": "60",    "policy_revision": "9b2d4f6a8c0e1b3d5f7a9c1e3b5d7f9a",    "consent_id": "usc_3a5c7e9b1d2f4a6c8e0b2d4f6a8c0e1b",    "opted_in_at": "2026-11-15T12:01:00Z",    "expires_at": "2026-12-01T00:00:00Z",    "consumed_amount": "2",    "status": "revoked",    "revoked_at": "2026-11-20T08:30:00Z",    "committed_floor_amount": "52",    "control_revision": 5  }}

Quote a spending limit raise or a one-time extra POST

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).

Opt in to this period's one-time extra PUT

Accepts this period's one-time extra quoted with `POST .../spend_limit/quotes` (`operation` `burst`): until the renewal, the period's usage may go past the spending limit by the quote's `burst_amount`. The customer's consent (the quote's `consent_text`, when and from where) is kept in the change log as evidence. Only from the customer's own login, before the quote's `expires_at` (10 minutes, never past the end of the period), in the period it was made for, while the limit and the shop's settings are as they were quoted, and once per period. The same quote sent again answers what the first request answered. An `Idempotency-Key` header is required, new for each change, so a retry after a timeout answers the first answer (for a day) even if the extra was granted but its answer was lost; the key with another body is refused. The customer gets an email confirming it (notification `subscription:spend_limit_changed`, when it is on) and you get the `usage:burst_opted_in` webhook.