Billing

Change a user's billing plan

Admin-only endpoint that applies an immediate local plan change and refreshes the user's billing state. Set comp=true to tag the change as a non-revenue goodwill/support grant (comp_reason required) instead of a real payment: pricing_source is tagged "comp" (price defaults to 0), the grant is recorded on the billing-state audit trail, and it is excluded from revenue/MRR reporting and from the admin plan-mix stat. comp_expires_at is informational only — nothing auto-reverts it today; revert manually with a follow-up call that omits comp.

post/admin/billing/users/{id}/plan

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/admin/billing/users/{id}/plan
  • Auth: API key in header x-api-key

Path parameters

idstring required

User id

Headers

x-api-keystring required

Admin API key required unless an Admin JWT is already present

Request body

compboolean
comp_expires_atstring
comp_reasonstring
currencystring
monthly_price_centsinteger
planstring required

Example request

{
  "comp": true,
  "comp_expires_at": "2026-12-31T00:00:00Z",
  "comp_reason": "Goodwill upgrade",
  "currency": "usd",
  "monthly_price_cents": 129900,
  "plan": "Pro"
}

Response

Updated credit snapshot

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": {
    "allow_overage": true,
    "credits_remaining": 398750,
    "credits_used": 1250,
    "currency": "usd",
    "daily_credit_limit": 25000,
    "daily_credits_remaining": 24100,
    "daily_credits_used": 900,
    "daily_key": "2026-04-16",
    "expected_subscription_amount_cents": 7900,
    "expected_total_amount_cents": 7900,
    "included_credits": 400000,
    "period_end": "2026-05-01T00:00:00Z",
    "period_key": "2026-04",
    "period_start": "2026-04-01T00:00:00Z",
    "plan": "Pro",
    "pricing_source": "plan_default",
    "subscription_price_cents": 7900,
    "user_id": "user-1"
  },
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.