API reference

Base URL https://api.qbill.dev/v1, header x-api-key. Every route below takes a secret key; the routes marked publishable also accept a publishable key (read-only).

Customers

MethodPathPurposeKey
POST/v1/customersCreate a customer.secret
GET/v1/customersList customers (limit, offset).secret
GET/v1/customers/:idRetrieve a customer.secret
PATCH/v1/customers/:idUpdate a customer.secret
DELETE/v1/customers/:idDelete a customer (soft delete).secret
curl -X POST https://api.qbill.dev/v1/customers \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Awa Diop","email":"awa@example.com"}'

Plans

MethodPathPurposeKey
POST/v1/plansCreate a plan.secret
GET/v1/plansList plans.secret
GET/v1/plansList plans.publishable
GET/v1/plans/:idRetrieve a plan.secret
GET/v1/plans/:idRetrieve a plan.publishable
PATCH/v1/plans/:idUpdate a plan.secret
DELETE/v1/plans/:idArchive a plan.secret
POST/v1/plans/:id/restoreRestore an archived plan.secret
POST/v1/plans/:id/cloneClone a plan.secret
GET/v1/plans/:id/tiersList a plan's tiers.secret
GET/v1/plans/:id/tiersList a plan's tiers.publishable
PUT/v1/plans/:id/tiersReplace a plan's tiers.secret
GET/v1/plans/:id/price-componentsList a plan's price components.secret
GET/v1/plans/:id/price-componentsList a plan's price components.publishable
POST/v1/plans/:id/price-componentsAdd a price component.secret
PATCH/v1/plans/:id/price-components/:componentIdUpdate a price component.secret
DELETE/v1/plans/:id/price-components/:componentIdDelete a price component.secret
curl -X POST https://api.qbill.dev/v1/plans \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Pro","pricing_model":"flat_rate","amount_monthly":15000}'

Subscriptions

MethodPathPurposeKey
POST/v1/subscriptionsCreate a subscription.secret
GET/v1/subscriptionsList subscriptions.secret
GET/v1/subscriptions/:idRetrieve a subscription.secret
POST/v1/subscriptions/:id/cancelCancel immediately.secret
POST/v1/subscriptions/:id/pausePause (optional resume_at).secret
POST/v1/subscriptions/:id/resumeResume a paused subscription.secret
POST/v1/subscriptions/:id/change-planChange plan or quantity.secret
DELETE/v1/subscriptions/:id/pending-changeCancel a deferred plan change.secret
POST/v1/subscriptions/:id/reactivateReactivate a subscription.secret
POST/v1/subscriptions/:id/extend-trialExtend the trial.secret
POST/v1/subscriptions/:id/billing-intervalChange the billing interval.secret
POST/v1/subscriptions/:id/promotion-codeApply a promotion code.secret
DELETE/v1/subscriptions/:id/promotion-codeRemove the promotion code.secret
GET/v1/subscriptions/:id/upcoming-invoicePreview the upcoming invoice.secret
GET/v1/subscriptions/:id/addonsList the subscription's add-ons.secret
POST/v1/subscriptions/:id/addonsAdd an add-on to the subscription.secret
PATCH/v1/subscriptions/:id/addons/:addonIdUpdate a subscription add-on.secret
DELETE/v1/subscriptions/:id/addons/:addonIdRemove a subscription add-on.secret
curl -X POST https://api.qbill.dev/v1/subscriptions \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"customer":"<customer_id>","plan":"<plan_id>","billing_interval":"monthly"}'

Invoices

MethodPathPurposeKey
POST/v1/invoicesCreate a one-off invoice.secret
GET/v1/invoicesList invoices.secret
GET/v1/invoices/:idRetrieve an invoice.secret
GET/v1/invoices/:id/pdfDownload the PDF.secret
POST/v1/invoices/:id/finalizeFinalize a draft.secret
POST/v1/invoices/:id/voidVoid a draft, open or failed invoice.secret
POST/v1/invoices/:id/resendResend the invoice by email.secret
curl -X POST https://api.qbill.dev/v1/invoices \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"customer":"<customer_id>","amount":25000,"description":"Setup fee","due_date":"2026-11-01","status":"open"}'

Payments

MethodPathPurposeKey
POST/v1/payments/initiateStart paying an invoice and return redirectUrl.secret
curl -X POST https://api.qbill.dev/v1/payments/initiate \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"invoice_id":"<invoice_id>","phone_number":"+221770000000","provider":"wave"}'

Refunds

MethodPathPurposeKey
POST/v1/refundsFully refund a paid invoice.secret
GET/v1/refundsList credit notes.secret
curl -X POST https://api.qbill.dev/v1/refunds \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"invoice_id":"<invoice_id>","reason":"Duplicate charge"}'

Usage

MethodPathPurposeKey
POST/v1/usageRecord usage.secret
GET/v1/usageList a subscription's usage (?subscription=).secret
GET/v1/usage/alertsRecent threshold alerts (80% and 100%).secret
curl -X POST https://api.qbill.dev/v1/usage \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"subscription":"<subscription_id>","metric_name":"api_calls","quantity":120,"idempotency_key":"batch-2026-10-04"}'

Webhooks

MethodPathPurposeKey
POST/v1/webhooksCreate a webhook endpoint.secret
GET/v1/webhooksList endpoints.secret
GET/v1/webhooks/eventsList the available events.secret
PATCH/v1/webhooks/:idUpdate an endpoint (url, events, status).secret
DELETE/v1/webhooks/:idDelete an endpoint.secret
POST/v1/webhooks/:id/testSend a webhook.test event.secret
GET/v1/webhooks/:id/deliveriesList an endpoint's deliveries.secret
POST/v1/webhooks/:id/deliveries/:deliveryId/retryRetry a delivery.secret
curl -X POST https://api.qbill.dev/v1/webhooks \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/qbill","events":["invoice.paid"]}'

Add-ons

MethodPathPurposeKey
GET/v1/addonsList add-ons.secret
GET/v1/addons/:idRetrieve an add-on.secret
POST/v1/addonsCreate an add-on.secret
PATCH/v1/addons/:idUpdate an add-on.secret
DELETE/v1/addons/:idTake an add-on off sale.secret
POST/v1/addons/:id/restorePut an add-on back on sale.secret
curl -X POST https://api.qbill.dev/v1/addons \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Extra seats","price_monthly":5000}'

Coupons

MethodPathPurposeKey
GET/v1/couponsList coupons.secret
POST/v1/couponsCreate a coupon.secret
PATCH/v1/coupons/:idUpdate a coupon.secret
DELETE/v1/coupons/:idDelete a coupon.secret
curl -X POST https://api.qbill.dev/v1/coupons \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Launch","type":"percentage","value":20,"duration":"repeating","duration_in_periods":3}'

Promotion codes

MethodPathPurposeKey
GET/v1/promotion-codesList promotion codes.secret
POST/v1/promotion-codesCreate a promotion code.secret
PATCH/v1/promotion-codes/:idUpdate a promotion code.secret
DELETE/v1/promotion-codes/:idDelete a promotion code.secret
curl -X POST https://api.qbill.dev/v1/promotion-codes \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"code":"LAUNCH20","coupon":"<coupon_id>"}'
MethodPathPurposeKey
POST/v1/sales-linksCreate a sales link.secret
GET/v1/sales-linksList sales links.secret
GET/v1/sales-links/:idRetrieve a sales link.secret
GET/v1/sales-links/:id/checkoutsList the sales made through this link.secret
POST/v1/sales-links/:id/deactivateDeactivate the link.secret
POST/v1/sales-links/:id/activateReactivate the link.secret
curl -X POST https://api.qbill.dev/v1/sales-links \
  -H "x-api-key: qb_test_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"kind":"plan","title":"Pro plan","plan_id":"<plan_id>","billing_interval":"monthly"}'