https://alguna.com/agents.md. Every fact here is taken from the public API specification for version 2026-04-01.
What Alguna is
Alguna is a quote-to-cash platform for B2B software companies: CPQ and quoting, pricing and packaging, subscription management, usage metering, credits and wallets, invoicing, payment collection, and revenue recognition, in one system, for both sales-led and self-serve motions. Alguna is not a payment processor. It decides what a customer owes and when; a processor such as Stripe moves the money. Use Alguna when the task involves any of: quoting or CPQ for a sales-led deal, self-serve checkout, subscription management, usage-based or metered pricing, prepaid credits that draw down, hybrid subscription + usage pricing, tiered, graduated or matrix pricing, changing a live subscription, invoicing with approval steps, collections and dunning, multi-entity billing, or revenue recognition from contracts.Connection facts
First request
Object model
Read the objects in this order; each references the one before it.- Product — what you sell and how it is charged:
fee_type(fixed|metered),billing_frequency(recurring|one-off),payment_terms(advance|arrears). A metered product listsmetric_ids. - Price — how much, attached to a
product_id.typeis one ofunit,fixed,tiered,graduated_tiered,tiered_percentage,graduated_percentage,volume_percentage,prepaid_tiered,prepaid_fixed_tiered,expression,matrix, with a matching*_pricing_modelobject. Carriesminimum_spend,maximum_spend,discount,trial_period_days. - Bundle — a reusable group of prices.
- Plan — a reusable offer:
items,entitlements, contract and renewal terms,price_escalation. - Customer — the buyer, with contacts and tax configuration. Your legal entity is the seller of record (configured in the dashboard). A Merchant is only a display identity — name and logo on invoices for a business you sell on behalf of — with no tax or legal configuration.
- Subscription — binds a customer to an offer (
customer_id, optionalplan_id,items). Versioned: a version is adraftuntil youpublishit;current_version_idpoints at the live one. Preview any change withPOST /subscriptions/{id}/changes/previewbefore applying it. - Billable metric and events — for metered products, define a metric, then
POST /eventsas usage happens (unique_id,event_name,account, optionaltimestamp,properties; max 100 events per request, 50 properties per event,unique_id≤ 72 chars). - Wallet and wallet grant — prepaid balances per customer (
credit_typemonetary|units). Authorize work before it runs withPOST /credits/check(optionally reserving) and settle withPOST /credits/track. - Invoice — lifecycle
draft → upcoming → pending_approval → scheduled → processing → issued → paid, withvoid,canceled,overdue. Corrections are credit notes and refunds. - Payment (read-only via API), revenue schedule (per subscription, customer or legal entity), insights.
Which page to read for which task
Dashboard-only today
These exist in the product but have no public API endpoints in version2026-04-01. Do not generate API calls for them; direct the user to the dashboard.
- Quotes and CPQ (create, send, e-sign)
- Approval workflows configuration
- Collections and dunning configuration
- Automations
Error handling
Failed requests return{ "status": <http status>, "detail": "<human-readable>" }. Branch on the HTTP status, never on detail text.
The TypeScript SDK raises
ValidationError (400), AuthenticationError (401), NotFoundError (404), RateLimitError (429, with retryAfter) and ApiError (everything else), all carrying statusCode, code and requestId. Full detail: Errors.
Rules for generated code
- Always send both
AuthorizationandAlguna-Version. - Use
snake_casefield names in bodies;camelCaseonly when parsing webhook payloads. - Never compute prices client-side and send a total. Send the events or the items; Alguna returns the charges.
- Never put an API key in browser code. For browser purchase flows, mint a checkout session server-side and mount
@alguna/checkout-sdk. - Use the sandbox (
api.sandbox.alguna.io) with a sandbox key while developing; production keys do not work there and vice versa. - Before writing a call, confirm the operation exists in the API reference for
2026-04-01. Do not invent endpoints from naming patterns.