Skip to content

Hosted HTTP API

The hosted billing HTTP API is operated by Autlantic. This open-source repo ships the TypeScript client and engine packages; it does not run the production API process.

Set AUTLANTIC_BILLING_API_URL to the base URL Autlantic gives you with your API key (same value you pass to the SDK). Paths below are relative to that base.

ts
import { AutlanticBilling } from "@autlantic/payments-recurring";

const billing = AutlanticBilling.fromEnv();
// AUTLANTIC_BILLING_API_URL   // base URL from Autlantic
// AUTLANTIC_BILLING_API_KEY
// AUTLANTIC_BILLING_MERCHANT_ID
// AUTLANTIC_BILLING_SANDBOX
// AUTLANTIC_BILLING_WEBHOOK_SECRET

For local demos without a remote API, use AutlanticBilling.sandbox() instead. See Sandbox & testing.

Public checkout (no API key)

Hosted checkout is a React wallet flow with EIP-6963 discovery, WalletConnect, and Connect → Approve → Pay for subscriptions (Connect → Pay for one-time). Redirect buyers to checkoutUrl from createSubscription / createPayment.

Subscribe /status (and .json) is a fast session payload: amounts, PDFs, coupon fields, and flags such as onchainPending. It does not call Base RPC. The hosted SPA then loads GET .../onchain for allowance and vault resume when the session is still incomplete on live.

MethodPathPurpose
GET/checkout/subscribe/:idHosted subscription checkout (React SPA)
GET/checkout/subscribe/:id/statusFast session status (no Base RPC)
GET/checkout/subscribe/:id.jsonSame as /status
GET/checkout/subscribe/:id/onchainAllowance + vault resume (Base RPC; live incomplete only)
POST/checkout/subscribe/:id/walletSync connected customerWallet (incomplete only)
POST/checkout/subscribe/:id/activateActivate (sandbox or live with { onChainSubscriptionId })
POST/checkout/subscribe/:id/couponApply merchant coupon ({ code })
DELETE/checkout/subscribe/:id/couponRemove applied coupon; restore list price
GET/checkout/pay/:idHosted one-time checkout (React SPA)
GET/checkout/pay/:id/statusEnriched one-time session
GET/checkout/pay/:id.jsonSame as /status
POST/checkout/pay/:id/confirmConfirm (sandbox, or live with { txHash })
POST/checkout/pay/:id/couponApply merchant coupon ({ code })
DELETE/checkout/pay/:id/couponRemove applied coupon; restore list price

Coupons are configured in the merchant portal. Apply/remove only works while the checkout session is still open (subscription incomplete, or payment open).

Authenticated (X-Autlantic-Api-Key)

MethodPathPurpose
GET/v1/productsList active catalog products and prices
POST/v1/paymentsCreate one-time payment (priceId once, or amountUsdc)
GET/v1/payments/:idFetch one-time payment
GET/v1/subscriptionsList (?status=active)
POST/v1/subscriptionsCreate (priceId or amountUsdc + interval)
GET/v1/subscriptions/:idFetch
PATCH/v1/subscriptions/:idUpdate
POST/v1/subscriptions/:id/completeComplete mandate
POST/v1/subscriptions/:id/activateActivate
POST/v1/subscriptions/:id/cancelCancel
GET/v1/invoicesList (?subscriptionId=)
GET/v1/invoices/:idFetch
POST/v1/invoices/:id/chargeCharge
POST/v1/invoices/:id/refundRefund
POST/v1/invoices/:id/voidVoid

Idempotency

Pass Idempotency-Key on POST requests. Replays return the cached response for 24 hours.

Renewals

On Autlantic’s hosted stack, due invoices are processed by Autlantic’s billing worker using the same AUTLANTIC_BILLING_* configuration as the API. Self-hosting that worker is outside the scope of this public SDK repo.

Autlantic Payments SDK