# Simulate a billing event (/docs/api/account/billing_simulate)

Test and simulated modes only: payment failure, dispute (freezes the org), refund, renewal, downgrade, cancel, auto-recharge, grant expiry, or reset simulated state.

`POST /v1/billing/simulate`

```json
{
  "operationId": "billing_simulate",
  "summary": "Simulate a billing event",
  "description": "Test and simulated modes only: payment failure, dispute (freezes the org), refund, renewal, downgrade, cancel, auto-recharge, grant expiry, or reset simulated state.",
  "tags": [
    "billing"
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "scenario": {
              "type": "string",
              "enum": [
                "payment_failed",
                "dispute",
                "dispute_won",
                "refund",
                "renewal",
                "downgrade",
                "cancel",
                "auto_recharge",
                "grant_expiry",
                "reset"
              ]
            },
            "plan": {
              "type": "string",
              "enum": [
                "free",
                "pro",
                "team",
                "agency"
              ]
            }
          },
          "required": [
            "scenario"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "simulation"
                ]
              },
              "scenario": {
                "type": "string",
                "enum": [
                  "payment_failed",
                  "dispute",
                  "dispute_won",
                  "refund",
                  "renewal",
                  "downgrade",
                  "cancel",
                  "auto_recharge",
                  "grant_expiry",
                  "reset"
                ]
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "object",
              "scenario",
              "events",
              "message"
            ]
          }
        }
      }
    },
    "default": {
      "description": "Error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "unauthorized",
                      "insufficient_balance",
                      "max_cost_exceeded",
                      "scope_denied",
                      "budget_blocked",
                      "not_found",
                      "idempotency_mismatch",
                      "invalid_meta",
                      "rate_limited",
                      "upstream_error",
                      "response_buffer_limit",
                      "provider_capacity_unavailable",
                      "grid_saturated",
                      "upstream_timeout",
                      "conflict",
                      "internal_error",
                      "account_frozen",
                      "strict_filters",
                      "plan_limit_reached",
                      "validation_failed",
                      "deadline_exceeded",
                      "cancelled"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "retry_after_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
