Update overage spend policy for the organization
PATCH
/api/v1/billing/spend-policy
const url = 'https://api.yggy.tech/api/v1/billing/spend-policy';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"overageMode":"stop","extraBudgetCents":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.yggy.tech/api/v1/billing/spend-policy \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "overageMode": "stop", "extraBudgetCents": 1 }'Sets the monthly amount allowed beyond the included pool (shared by credits and storage) and whether to stop at it or continue without a limit. Requires a Pro or Enterprise plan.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ” Media type application/json
object
overageMode
required
Stop at the extra budget, or keep billing usage without a limit
string
extraBudgetCents
required
Monthly amount in minor units allowed beyond the included pool, shared by credits and storage
integer
Responses
Section titled “ Responses ”Updated spend policy
Media type application/json
object
spendPolicy
required
object
overageMode
required
Stop at the extra budget, or keep billing usage without a limit
string
extraBudgetCents
required
Monthly amount in minor units allowed beyond the included pool, shared by credits and storage
integer
Example
{ "spendPolicy": { "overageMode": "stop" }}No active organization, or continue requires a payment method
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Not authenticated
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Spend controls require a Pro or Enterprise plan, or staff manage the credit cap
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}