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 the AI-native quote-to-revenue platform for B2B 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. Everything reads from one record per customer, the versioned agreement: an activated quote becomes the billing schedule, the subscription is the contract that was quoted, and invoices, payments, and revenue schedules read from it. Your integration works on that record. 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). The MCP server can read quotes and draft new-business quotes; sending, signing and activation stay in the dashboard
- 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 throws
ValidationError (400), UnprocessableEntityError (422, extends ValidationError), AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), RateLimitError (429), InternalServerError (any 5xx) and ApiError (any other status). When no response arrives it throws ConnectionError, or TimeoutError for a timed-out attempt, and AbortError when you abort the call. All extend AlgunaError and carry statusCode, code and requestId.
Every SDK retries a failed attempt twice before it throws: on 408, 429, 502, 503 and 504, on a 409 with Retry-After, and when no response arrived. It waits for Retry-After when the response has one, else it backs off exponentially. Every write carries an Idempotency-Key, yours or a generated one, that its retries reuse. events.ingest, credits.track and credits.check get no generated key: the events in the request body identify the work, so the SDK retries them without one. Do not wrap SDK calls in your own retry loop. 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.