API reference

Billing

Prepaid credits — one balance per organization, charged per published post by channel and media kind; Stripe top-ups and purchase history.

Prepaid credits: one balance per organization, charged per published post by channel and media kind; Stripe top-ups and purchase history.

Method Endpoint Summary
GET /v1/billing Credit balance and billing overview
GET /v1/billing/prices Price per published post
GET /v1/billing/transactions Credit ledger
GET /v1/billing/purchases Purchase history
GET /v1/billing/topups Top-up history
POST /v1/billing/checkout Top up credits (Stripe Checkout)
GET /v1/billing/topups/{id} Get a top-up
GET /v1/posts/{id}/cost What publishing a post costs

Credit balance and billing overview#

GET/v1/billing

One prepaid balance per organization, shared by all its workspaces. Returns balance (minor units of currency, e.g. cents), low_balance flag, price list per channel and media kind, per-workspace spend (30 days and total), whether you can top up, and top-up limits. Scope billing:read (agents have it by default).

Auth: API key (Authorization: Bearer obx_live_…). Requires scope billing:read.

Response 200 — Billing. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

Price per published post#

GET/v1/billing/prices

Effective price per provider for text, image and video posts (any video in the post = video; photos, GIFs and documents = image). One published variant (one channel) is one billed item.

Auth: API key (Authorization: Bearer obx_live_…). Requires scope billing:read.

Response 200 — List. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing/prices" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

Credit ledger#

GET/v1/billing/transactions

Top-ups, charges (one per published post), refunds (failed or archived after charging) and manual adjustments, newest first, each with balance_after. Members without billing rights see their own workspaces only. Filters: workspace, type.

Auth: API key (Authorization: Bearer obx_live_…). Requires scope billing:read.

Query parameters

Name Required Description
workspace no
type no
limit no Page size (default 50, max 200).
cursor no Opaque cursor from next_cursor.

Response 200 — List. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing/transactions?workspace=acme" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

Purchase history#

GET/v1/billing/purchases

Stripe top-ups (pending, paid, expired, failed; paid ones with the Stripe receipt_url and who paid) and credits gifted by the platform (kind gift, with its message), newest first, plus totals {purchased, purchases, gifted}. Organization owners, admins and billing users.

Auth: API key (Authorization: Bearer obx_live_…). Organization owners, admins and billing users (people, not agents).

Query parameters

Name Required Description
limit no Page size (default 50, max 200).

Response 200 — List. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing/purchases?limit=50" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

Top-up history#

GET/v1/billing/topups

Stripe Checkout top-ups and their status (pending, paid, expired, failed). Organization owners, admins and billing users.

Auth: API key (Authorization: Bearer obx_live_…). Organization owners, admins and billing users (people, not agents).

Query parameters

Name Required Description
limit no Page size (default 50, max 200).
cursor no Opaque cursor from next_cursor.

Response 200 — List. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing/topups?limit=50" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

Top up credits (Stripe Checkout)#

POST/v1/billing/checkout

Creates a Stripe Checkout session for {amount} minor units and returns checkout_url — send the user there. Credits are added when Stripe confirms payment (webhook), never before. success_url/cancel_url must be web-app pages; {TOPUP_ID} in them is replaced. Users with org_role org_owner, org_admin or billing and scope billing:manage; agents cannot pay.

Auth: API key (Authorization: Bearer obx_live_…). Organization owners, admins and billing users (people, not agents).

Headers

Name Required Description
Idempotency-Key no Replays within 24 h return the original response.

Request body

Field Type Description
amount integer
success_url string
cancel_url string

Response 200 — Object. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X POST "https://api.outboxer.dev/v1/billing/checkout" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 2500
}'

Get a top-up#

GET/v1/billing/topups/{id}

Re-checks a pending top-up with Stripe (credits it if paid) and returns it with the current balance. Poll this after the user returns from Checkout.

Auth: API key (Authorization: Bearer obx_live_…). Organization owners, admins and billing users (people, not agents).

Path parameters

Name Required Description
id yes Top-up id (top_…).

Response 200 — Object. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/billing/topups/top_01j9zq3k8m5v2b7x4c6n1p0r9s" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"

What publishing a post costs#

GET/v1/posts/{id}/cost

Per channel: media kind, price, whether it is billable and already paid; total, amount still due and whether the balance covers it.

Auth: API key (Authorization: Bearer obx_live_…). Requires scope posts:read with workspace role owner / admin / editor / contributor / viewer / agent. Requires scope billing:read.

Path parameters

Name Required Description
id yes Post id (post_…).

Response 200 — Object. Errors: RFC 9457 Problem with a stable code (error codes).

curl -X GET "https://api.outboxer.dev/v1/posts/post_01j9zq3k8m5v2b7x4c6n1p0r9s/cost" \
  -H "Authorization: Bearer $OUTBOXER_API_KEY"