zumpo/docs
Dashboard
Skip to content
billing / API reference
GETgetBilling

Prepaid balance and the insufficient-balance rule

The PREPAID balance of the calling team. Amounts are INTEGER micro-USD; the scale is DECLARED through microsPerUnit, because for X the unit price is BELOW a cent ($0.015) and a cent based integer could not have represented that item at all. A team that has NEVER TOPPED UP gets a zero balance, NOT a 404: the balance is the sum of the ledger and the sum of an empty ledger is zero; the information "no movement ever happened" is carried by updatedAt: null. The balance CAN also be NEGATIVE - escrow reservation is deliberately absent and concurrent publishes can produce a bounded overdraw. WHAT HAPPENS IF THE BALANCE IS NOT ENOUGH, and THE ASYMMETRY: publishing stops only on METERED platforms (today the single item is X). None of the other publish platforms are metered, so on them publishing is NEVER blocked and nothing is deducted from the balance. Both lists are in the response (insufficientBalance) and together they cover ALL generic publish platforms; Ads/Blog account platforms are not in these publish lists; the error code that stops it is there as well (errorCode). A ZERO BALANCE DOES NOT MEAN "exempt": a team that has never topped up CANNOT publish on a metered platform. Whether the rule is enforced TODAY is written in a separate field (enforcement); we do not declare an unenforced rule as if it were in force. This endpoint DOES NOT RETURN PAYMENT METHOD, CARD, INVOICE, collection history or the Stripe customer id.

Authentication

The following security requirement applies to this operation.

  1. bearerhttp

    scheme
    bearer
    bearerFormat
    zumpo-api-key
Read the authentication guide

Parameters

This operation declares no path, query, header or cookie parameters.

Responses

Status codes and shapes declared for this operation. Read each description for the meaning of that response.

200Response schema
application/json
Response 200object
#/components/schemas/BillingDto
additionalProperties
false
required
[ "currency", "microsPerUnit", "balanceMicros", "balanceUsd", "updatedAt", "insufficientBalance", "unsettledFunds" ]
currencystringrequired

Currency of all amounts.

enum
[ "USD" ]
example
USD
microsPerUnitintegerrequired

How many MICROS one unit of currency is. All *Micros fields are INTEGERS at this scale. Floating point is deliberately absent: $0.015 cannot be represented exactly inside IEEE-754 and the sum of thousands of rows drifts. Micros were chosen because the unit price for X is BELOW A CENT ($0.015 = 1.5 cents), so a cent based integer could not have represented that item at all.

example
1000000
balanceMicrosintegerrequired

The current balance, integer micro-USD. IT CAN BE NEGATIVE and this is not an error: two concurrently in-flight publishes can read the same balance, so a bounded overdraw is unavoidable. The ceiling of the overdraw is the number of concurrent attempts times the most expensive tariff. Escrow reservation was deliberately not written: a constraint protecting the balance would blow up inside the transaction that carries the deduction, and that transaction ALSO CARRIES THE PUBLISH - the customer would lose their post instead of running out of money.

example
0
balanceUsdstringrequired

The decimal string rendering of the same balance. NO rounding, six digits fixed. It is a convenience field; if you are reconciling, do it over balanceMicros - integer arithmetic gives the same result on both sides.

example
0.000000
updatedAtstringrequired

The moment the balance LAST CHANGED, or null if there is no balance record at all. A team that has NEVER TOPPED UP gets a zero balance and a null timestamp, NOT a 404: the balance is the sum of the ledger and the sum of an empty ledger is zero. Returning 404 would force the client to distinguish "no balance" from "balance 0"; the distinction is ALREADY here, and only in this field: null = no movement ever happened, filled = the balance changed at least once (even if it is 0 today).

format
date-time
nullable
true
example
null
insufficientBalanceobjectrequired
#/components/schemas/BillingInsufficientBalanceDto
additionalProperties
false
required
[ "blocksPublishOn", "neverBlocksPublishOn", "enforcement", "errorCode" ]
blocksPublishOnarrayrequired

Platforms on which publishing WILL STOP when the balance is insufficient. Only metered platforms are here; today the single item is X (twitter). The list is derived, not counted by hand. LIVE MODE ONLY: publishing in test mode goes to fake platforms, has no real provider cost and DOES NOT TOUCH the balance at all - in that mode no publish is ever stopped because of the balance. The balance itself CARRIES NO mode, so the SAME amount is read in both modes.

Array itemstring
enum
[ "instagram", "facebook", "threads", "whatsapp", "twitter", "linkedin", "youtube", "tiktok", "pinterest", "reddit", "bluesky", "telegram", "discord", "slack", "google_business", "snapchat", "mastodon" ]
neverBlocksPublishOnarrayrequired

Platforms on which publishing is NEVER blocked whatever the balance is. Together with blocksPublishOn this list covers ALL generic publish platforms: a publish target is either in one or in the other. Dedicated Ads/Blog accounts are in neither list. Consumption is not billed on these platforms, so there is no balance to deduct either.

Array itemstring
enum
[ "instagram", "facebook", "threads", "whatsapp", "twitter", "linkedin", "youtube", "tiktok", "pinterest", "reddit", "bluesky", "telegram", "discord", "slack", "google_business", "snapchat", "mastodon" ]
enforcementstringrequired

WHETHER THE RULE ABOVE IS ENFORCED TODAY. enforced: the pre-publish admission gate is active and an insufficient balance stops publishing on the platforms in the blocksPublishOn list. not_enforced: the rule is settled as a product decision but the gate is not active, the balance is only READ. This field exists deliberately: declaring an unenforced rule as enforced would promise the customer a behavior that does not exist.

enum
[ "not_enforced", "enforced" ]
example
enforced
errorCodestringrequired

The error code carried by a target that failed because of an insufficient balance while the gate is active (enforcement = enforced). The same code appears both on the target row and in the post_target.failed webhook event, so the client can branch on this single string. IT IS NOT RETRIED: trying again without a top-up changes nothing.

example
insufficient_balance
unsettledFundsobjectrequired
#/components/schemas/BillingUnsettledFundsDto
additionalProperties
false
required
[ "errorCode", "settlementWindowDays", "spendAllowanceMicros", "spendAllowanceUsd" ]
errorCodestringrequired

The error code carried by a target stopped because of unsettled card money. It IS NOT THE SAME as insufficient_balance and must not be confused with it: with this code the customer DOES HAVE a balance, only their last payment has not yet passed the dispute window. The same code appears both on the target row and in the post_target.failed webhook event. IT IS NOT RETRIED; it clears by itself once the window elapses.

example
unsettled_funds_hold
settlementWindowDaysnumberrequired

The number of DAYS that must pass for a CARD payment to count as settled. The period runs from the moment the payment lands and is independent of whether any publishing happens. Wire transfers and operator credits do NOT enter this window at all, they count as settled instantly.

example
7
spendAllowanceMicrosnumberrequired

The MOST that can be spent with unsettled money, micro-USD. The rule: cumulative metered spend cannot exceed the amount found by adding this allowance to the settled balance. So the allowance is not a BALANCE, it is a tolerance added ON TOP of the settled money.

example
250000000
spendAllowanceUsdstringrequired

The decimal USD rendering of spendAllowanceMicros - for DISPLAY. Do your arithmetic over the integer field; this field CARRIES NO rounding.

example
250.000000
Original schema
{
  "$ref": "#/components/schemas/BillingDto"
}
400Invalid request

Invalid request

application/json
Response 400object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
401Authentication failed

Authentication failed

application/json
Response 401object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
403Permission denied

Permission denied

application/json
Response 403object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
404Resource not found

Resource not found

application/json
Response 404object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
409Conflict

Conflict

application/json
Response 409object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
429Rate limit exceeded

Rate limit exceeded

application/json
Response 429object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Response headers

X-RateLimit-Limit

Request ceiling that applied to this request. Authenticated requests use the team tier ceiling; unauthenticated identity endpoints use a per-IP ceiling. Usage is measured continuously against a trailing period rather than tallied and cleared at a boundary, so the full ceiling never becomes available again in one step.

X-RateLimit-Limitinteger
minimum
1
Original schema
{
  "type": "integer",
  "minimum": 1
}

X-RateLimit-Remaining

Requests still allowed against that ceiling; never negative. On a 429 produced by the request throttler this is 0. Such a refused request is not counted, so retrying too early costs you no capacity and does not push your recovery further away.

X-RateLimit-Remaininginteger
minimum
0
Original schema
{
  "type": "integer",
  "minimum": 0
}

X-RateLimit-Reset

Absolute Unix epoch time, in SECONDS, at which the current counting period turns over. This is NOT the number of seconds left: subtract the current time to obtain that. It is also NOT the moment your capacity returns: earlier usage keeps weighing on the ceiling across the turnover, so after a 429 wait for Retry-After instead, which is usually later than this value.

X-RateLimit-Resetinteger
format
int64
minimum
0
Original schema
{
  "type": "integer",
  "format": "int64",
  "minimum": 0
}

Retry-After

Seconds to wait before retrying. Always a positive integer delta (never an HTTP-date), at least 1. On a 429 from the request throttler it is the wait until your usage actually drops back under the ceiling; prefer it over any delay you compute from X-RateLimit-Reset.

Retry-Afterinteger
minimum
1
maximum
86400
Original schema
{
  "type": "integer",
  "minimum": 1,
  "maximum": 86400
}
500Server error

Server error

application/json
Response 500object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
502Platform error

Platform error

application/json
Response 502object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
503Service unavailable

Service unavailable

application/json
Response 503object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Referenced schemas

Original local definitions used by this operation. Recursive and deeply nested references can be inspected here without expanding them repeatedly.

BillingDto

#/components/schemas/BillingDto

{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "enum": [
        "USD"
      ],
      "example": "USD",
      "description": "Currency of all amounts."
    },
    "microsPerUnit": {
      "type": "integer",
      "example": 1000000,
      "description": "How many MICROS one unit of currency is. All `*Micros` fields are INTEGERS at this scale. Floating point is deliberately absent: $0.015 cannot be represented exactly inside IEEE-754 and the sum of thousands of rows drifts. Micros were chosen because the unit price for X is BELOW A CENT ($0.015 = 1.5 cents), so a cent based integer could not have represented that item at all."
    },
    "balanceMicros": {
      "type": "integer",
      "example": 0,
      "description": "The current balance, integer micro-USD. IT CAN BE NEGATIVE and this is not an error: two concurrently in-flight publishes can read the same balance, so a bounded overdraw is unavoidable. The ceiling of the overdraw is the number of concurrent attempts times the most expensive tariff. Escrow reservation was deliberately not written: a constraint protecting the balance would blow up inside the transaction that carries the deduction, and that transaction ALSO CARRIES THE PUBLISH - the customer would lose their post instead of running out of money."
    },
    "balanceUsd": {
      "type": "string",
      "example": "0.000000",
      "description": "The decimal string rendering of the same balance. NO rounding, six digits fixed. It is a convenience field; if you are reconciling, do it over `balanceMicros` - integer arithmetic gives the same result on both sides."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "example": null,
      "description": "The moment the balance LAST CHANGED, or null if there is no balance record at all. A team that has NEVER TOPPED UP gets a zero balance and a null timestamp, NOT a 404: the balance is the sum of the ledger and the sum of an empty ledger is zero. Returning 404 would force the client to distinguish \"no balance\" from \"balance 0\"; the distinction is ALREADY here, and only in this field: null = no movement ever happened, filled = the balance changed at least once (even if it is 0 today)."
    },
    "insufficientBalance": {
      "$ref": "#/components/schemas/BillingInsufficientBalanceDto"
    },
    "unsettledFunds": {
      "$ref": "#/components/schemas/BillingUnsettledFundsDto"
    }
  },
  "additionalProperties": false,
  "required": [
    "currency",
    "microsPerUnit",
    "balanceMicros",
    "balanceUsd",
    "updatedAt",
    "insufficientBalance",
    "unsettledFunds"
  ]
}
BillingInsufficientBalanceDto

#/components/schemas/BillingInsufficientBalanceDto

{
  "type": "object",
  "properties": {
    "blocksPublishOn": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "instagram",
          "facebook",
          "threads",
          "whatsapp",
          "twitter",
          "linkedin",
          "youtube",
          "tiktok",
          "pinterest",
          "reddit",
          "bluesky",
          "telegram",
          "discord",
          "slack",
          "google_business",
          "snapchat",
          "mastodon"
        ]
      },
      "description": "Platforms on which publishing WILL STOP when the balance is insufficient. Only metered platforms are here; today the single item is X (twitter). The list is derived, not counted by hand. LIVE MODE ONLY: publishing in test mode goes to fake platforms, has no real provider cost and DOES NOT TOUCH the balance at all - in that mode no publish is ever stopped because of the balance. The balance itself CARRIES NO mode, so the SAME amount is read in both modes."
    },
    "neverBlocksPublishOn": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "instagram",
          "facebook",
          "threads",
          "whatsapp",
          "twitter",
          "linkedin",
          "youtube",
          "tiktok",
          "pinterest",
          "reddit",
          "bluesky",
          "telegram",
          "discord",
          "slack",
          "google_business",
          "snapchat",
          "mastodon"
        ]
      },
      "description": "Platforms on which publishing is NEVER blocked whatever the balance is. Together with `blocksPublishOn` this list covers ALL generic publish platforms: a publish target is either in one or in the other. Dedicated Ads/Blog accounts are in neither list. Consumption is not billed on these platforms, so there is no balance to deduct either."
    },
    "enforcement": {
      "type": "string",
      "enum": [
        "not_enforced",
        "enforced"
      ],
      "example": "enforced",
      "description": "WHETHER THE RULE ABOVE IS ENFORCED TODAY. `enforced`: the pre-publish admission gate is active and an insufficient balance stops publishing on the platforms in the `blocksPublishOn` list. `not_enforced`: the rule is settled as a product decision but the gate is not active, the balance is only READ. This field exists deliberately: declaring an unenforced rule as enforced would promise the customer a behavior that does not exist."
    },
    "errorCode": {
      "type": "string",
      "example": "insufficient_balance",
      "description": "The error code carried by a target that failed because of an insufficient balance while the gate is active (`enforcement` = `enforced`). The same code appears both on the target row and in the `post_target.failed` webhook event, so the client can branch on this single string. IT IS NOT RETRIED: trying again without a top-up changes nothing."
    }
  },
  "additionalProperties": false,
  "required": [
    "blocksPublishOn",
    "neverBlocksPublishOn",
    "enforcement",
    "errorCode"
  ]
}
BillingUnsettledFundsDto

#/components/schemas/BillingUnsettledFundsDto

{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "example": "unsettled_funds_hold",
      "description": "The error code carried by a target stopped because of unsettled card money. It IS NOT THE SAME as `insufficient_balance` and must not be confused with it: with this code the customer DOES HAVE a balance, only their last payment has not yet passed the dispute window. The same code appears both on the target row and in the `post_target.failed` webhook event. IT IS NOT RETRIED; it clears by itself once the window elapses."
    },
    "settlementWindowDays": {
      "type": "number",
      "example": 7,
      "description": "The number of DAYS that must pass for a CARD payment to count as settled. The period runs from the moment the payment lands and is independent of whether any publishing happens. Wire transfers and operator credits do NOT enter this window at all, they count as settled instantly."
    },
    "spendAllowanceMicros": {
      "type": "number",
      "example": 250000000,
      "description": "The MOST that can be spent with unsettled money, micro-USD. The rule: cumulative metered spend cannot exceed the amount found by adding this allowance to the settled balance. So the allowance is not a BALANCE, it is a tolerance added ON TOP of the settled money."
    },
    "spendAllowanceUsd": {
      "type": "string",
      "example": "250.000000",
      "description": "The decimal USD rendering of `spendAllowanceMicros` - for DISPLAY. Do your arithmetic over the integer field; this field CARRIES NO rounding."
    }
  },
  "additionalProperties": false,
  "required": [
    "errorCode",
    "settlementWindowDays",
    "spendAllowanceMicros",
    "spendAllowanceUsd"
  ]
}
ZumpoErrorDto

#/components/schemas/ZumpoErrorDto

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable message. UNSTABLE — do not branch on it.",
      "example": "WhatsApp session window expired; use a template message."
    },
    "type": {
      "type": "string",
      "description": "Stable error category (does not change across versions).",
      "enum": [
        "invalid_request_error",
        "authentication_error",
        "permission_error",
        "not_found",
        "conflict",
        "rate_limit_error",
        "platform_error",
        "platform_rejected",
        "account_disconnected",
        "media_error",
        "api_error"
      ],
      "example": "invalid_request_error"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code.",
      "example": "whatsapp_window_expired"
    },
    "param": {
      "type": "string",
      "description": "Offending parameter, present only when relevant.",
      "example": "body"
    },
    "docUrl": {
      "type": "string",
      "description": "https://docs.zumpo.io/errors/{code}",
      "example": "https://docs.zumpo.io/errors/whatsapp_window_expired"
    },
    "requestId": {
      "type": "string",
      "description": "Support correlation id: req_ + 16 hex.",
      "example": "req_7f3a9c2e1b8d4056"
    },
    "details": {
      "type": "object",
      "additionalProperties": true,
      "description": "Additional structured context, present only when an error has more to say than a single `param` can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.",
      "example": {
        "created": [
          {
            "kind": "campaign",
            "platformId": "120210000000000001"
          },
          {
            "kind": "adSet",
            "platformId": "120210000000000002"
          }
        ]
      }
    }
  },
  "required": [
    "error",
    "type",
    "code",
    "docUrl",
    "requestId"
  ]
}