billing

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-billing"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/57d29432-927f-4943-8f6a-9965d2ad53d2/social-card.svg?v=3e7ae33eec8b" alt="billing" width="600" height="315"></a>
POSThttps://lucidace.com/v1/auth/referally/webhook

Referally delivery receiver. Deliveries for Lucida's own program are logged; nothing is changed.

Code samples

cURL
curl -X POST "https://lucidace.com/v1/auth/referally/webhook"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
401 bad or stale signature
503 not configured
POSThttps://lucidace.com/v1/billing/stripe/webhook

Stripe event receiver. Answers 200 for events that are valid but irrelevant (so Stripe stops retrying), 400 for a missing, wrong or stale signature, 503 when no signing secret is set.

Request body

application/json

the raw Stripe event

"string"

Code samples

cURL
curl -X POST "https://lucidace.com/v1/billing/stripe/webhook" \
  -H "Content-Type: application/json" \
  -d '"string"'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 event handled or ignored
400 bad signature or payload
503 LC_STRIPE_WEBHOOK_SECRET is not set
GEThttps://lucidace.com/v1/orgs/{org_id}/billing/alertsScope admin

Parameters

org_idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/alerts"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of BillingAlert, newest first
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "id": "string",
      "kind": "string",
      "metric": "string",
      "period": "string",
      "reference": 0,
      "used": 0
    }
  ],
  "next_cursor": "string"
}
Schema
dataBillingAlert[]required
Show child parameters
created_atstringrequired
idstringrequired
kindstringrequired
threshold_80 | threshold_100 | spike.
metricstringrequired
periodstringrequired
Month start for thresholds, the day for spikes.
referenceintegerrequired
The limit for thresholds, the trailing daily mean for spikes.
usedintegerrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/orgs/{org_id}/billing/checkoutScope admin

Start a subscription purchase for an org on the Free plan. Owners and admins only. Going back to Free (and changing between paid plans) happens in the billing portal.

Parameters

org_idstringpathrequired

Request body

application/json
planstringrequired
team | business
{
  "plan": "string"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/orgs/{org_id}/billing/checkout" \
  -H "Content-Type: application/json" \
  -d '{"plan":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "url": "string"
}
Schema
urlstringrequired
One-time Stripe Checkout URL; send the browser there.
400
403
404
409 the org is not on the Free plan
502
503 Stripe or the plan's price is not configured
GEThttps://lucidace.com/v1/orgs/{org_id}/billing/invoicesScope billing:read

Parameters

org_idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/invoices"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 newest first; empty without a billing customer
Example
{
  "data": [
    {
      "amount_due": 0,
      "created": 0,
      "currency": "string",
      "hosted_url": "string",
      "id": "string",
      "number": "string",
      "pdf_url": "string",
      "status": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
amount_dueintegerrequired
Minor units (cents).
createdintegerrequired
Unix seconds.
currencystringrequired
hosted_urlstring
idstringrequired
numberstring
pdf_urlstring
statusstringrequired
draft | open | paid | void | uncollectible
next_cursorstring
403
404
502
POSThttps://lucidace.com/v1/orgs/{org_id}/billing/portal-sessionScope admin

Parameters

org_idstringpathrequired

Code samples

cURL
curl -X POST "https://lucidace.com/v1/orgs/{org_id}/billing/portal-session"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "url": "string"
}
Schema
urlstringrequired
One-time provider URL; send the browser there.
403
404 no billing customer, or this deployment has no portal
502
GEThttps://lucidace.com/v1/orgs/{org_id}/billing/projectionScope admin

Parameters

org_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/projection"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
[
  {
    "limit": 0,
    "metric": "string",
    "month_to_date": 0,
    "projected": 0
  }
]
Schema
limitinteger
Effective monthly limit (plan tightened by spend caps); absent when unlimited.
metricstringrequired
month_to_dateintegerrequired
projectedintegerrequired
Month-to-date pace extended to the end of the month.
404
GEThttps://lucidace.com/v1/orgs/{org_id}/billing/spend-limitsScope admin

Parameters

org_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/spend-limits"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "limits": [
    {
      "max_units": 0,
      "metric": "string"
    }
  ]
}
Schema
limitsSpendLimit[]required
At most one cap per metric (events | replays | flag_requests | ai_calls); monthly units. A cap can only tighten the plan's limits; an empty list removes all caps.
Show child parameters
max_unitsintegerrequired
metricstringrequired
403
404
PUThttps://lucidace.com/v1/orgs/{org_id}/billing/spend-limitsScope admin

Parameters

org_idstringpathrequired

Request body

application/json
limitsSpendLimit[]required
At most one cap per metric (events | replays | flag_requests | ai_calls); monthly units. A cap can only tighten the plan's limits; an empty list removes all caps.
Show child parameters
max_unitsintegerrequired
metricstringrequired
{
  "limits": [
    {
      "max_units": 0,
      "metric": "string"
    }
  ]
}

Code samples

cURL
curl -X PUT "https://lucidace.com/v1/orgs/{org_id}/billing/spend-limits" \
  -H "Content-Type: application/json" \
  -d '{"limits":[{"max_units":0,"metric":"string"}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
PUThttps://lucidace.com/v1/orgs/{org_id}/planScope admin

Change an org's plan. Instance admins may set any plan with no billing (a comp; refused while a Stripe subscription exists). Owners and admins move between purchasable plans through Stripe: the org needs a customer with a default payment method (see checkout); `free` cancels the subscription now; `enterprise` is sales only.

Parameters

org_idstringpathrequired

Request body

application/json
planstringrequired
free | team | business | enterprise
{
  "plan": "string"
}

Code samples

cURL
curl -X PUT "https://lucidace.com/v1/orgs/{org_id}/plan" \
  -H "Content-Type: application/json" \
  -d '{"plan":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "plan": "string",
  "previous": "string"
}
Schema
planstringrequired
previousstringrequired
400
402 no_payment_method: the org has no card on file
403 enterprise is sales only
404
409 plan_not_purchasable (billing not configured), or a comp over a Stripe subscription
502

Updated