Base 3:16
API

Endpoint reference

Every endpoint, by resource.

All paths are relative to https://api.base316.com. See Using the API for authentication, errors and pagination.

Access and metering

The two calls on your request path.

POST /v1/access/checkMay this account do this? Also answers permissions
POST /v1/eventsRecord usage. idempotencyKey required

Customers

GET /v1/customersList
POST /v1/customersCreate
GET /v1/customers/:idOne customer
PATCH /v1/customers/:idUpdate name, email, your id, currency, terms, collection
GET /v1/customers/:id/billedThe accounts it pays for, with usage this period
GET /v1/customers/:id/entitlementsEvery feature as check would answer it now, and why

Catalog

GET · POST /v1/metersThe raw things you count
GET · PATCH · DELETE /v1/meters/:id
GET · POST /v1/featuresWhat a customer buys
GET · PATCH · DELETE /v1/features/:id
GET · POST /v1/plansPrices and entitlements; each version has status and subscriberCount
GET · PATCH · DELETE /v1/plans/:id
POST /v1/plans/:id/versionsA new immutable version, or a draft with publish: false
PATCH · DELETE /v1/plans/:id/versions/:versionIdEdit or discard a draft. 409 for a published version
POST /v1/plans/:id/versions/:versionId/publishPublish a draft. Idempotent
GET · POST /v1/product-familiesProducts
PATCH · DELETE /v1/product-families/:id
PUT /v1/plans/:id/familyFile a plan under a product

Subscriptions

GET · POST /v1/subscriptions
GET /v1/subscriptions/:id
GET /v1/subscriptions/:id/upcoming-invoicePreview the next invoice. Stores nothing
GET /v1/subscriptions/:id/plan-change-preview?planVersionId=. Now vs at period end
POST /v1/subscriptions/:id/plan-changetiming: NOW or PERIOD_END
GET · PUT · DELETE /v1/subscriptions/:id/phasesThe schedule: a ramp, or its undo
POST /v1/subscriptions/:id/resumeUndo a cancellation at period end
PATCH /v1/subscriptions/:id/quantityChange the quantity, prorated
GET /v1/subscriptions/:id/quantity/previewWhat that change would charge. Stores nothing
DELETE /v1/subscriptions/:idCancel. ?atPeriodEnd=false to cancel now
GET · POST · DELETE /v1/subscriptions/:id/discountsA recurring coupon
GET · POST /v1/subscriptions/:id/price-overridesCustom prices for this subscription
PATCH · DELETE /v1/subscriptions/:id/price-overrides/:overrideIdEdit or remove one
PATCH /v1/subscriptions/:id/contractPO number, invoice memo, billing day
GET /v1/subscriptions/:id/contract/billing-anchor-preview?billingAnchorDay=. The stub it creates. Stores nothing

Invoices and payments

GET · POST /v1/invoices
GET /v1/invoices/:id
POST /v1/invoices/:id/finalizeDraft becomes owed
POST /v1/invoices/:id/paySettle in full
POST /v1/invoices/:id/void
GET · POST /v1/invoices/:id/paymentsRecord a payment received outside Stripe
POST /v1/invoices/:id/payments/:paymentId/reverseA bounced cheque
GET /v1/invoices/:id/pdfThe invoice as a PDF

Quotes

GET · POST /v1/quotes
GET /v1/quotes/:id
POST /v1/quotes/:id/sendFreezes the terms
POST /v1/quotes/:id/acceptCreates the subscription
POST /v1/quotes/:id/decline
GET /v1/quotes/:id/pdfThe quote as a PDF

Billing extras

GET · POST /v1/coupons
DELETE /v1/coupons/:idArchive
GET · POST /v1/credit-notes
POST /v1/credit-notes/:id/void
GET /v1/credit-notes/:id/pdfAs a PDF
GET · POST /v1/tax-rates
DELETE /v1/tax-rates/:idArchive
GET /v1/wallets · /v1/wallets/:customerIdPrepaid balance
POST /v1/wallets/credit · /v1/wallets/debit

Identity

Your application's own users and organisations.

GET · POST /v1/users
GET · PATCH /v1/users/:id
POST /v1/users/:id/disableKeeps history attributable
GET · POST /v1/organizationsYour customers' tenants
PATCH /v1/organizations/:idRename, re-key, default role
DELETE /v1/organizations/:idDelete an empty tenant. ?exceptUserId=
GET /v1/organizations/:id/childrenThe tenants it manages
POST /v1/organizations/:id/detachMake a managed tenant standalone
GET · PUT /v1/organizations/:id/inherited-rolesWhich parent roles reach the children
GET · PUT /v1/organizations/:id/brandingA tenant's own look
GET · POST · DELETE /v1/organizations/:id/domainA tenant's own sign-in domain
POST /v1/organizations/:id/domain/verifyCheck its DNS
POST · DELETE /v1/organizations/:id/members
GET · POST /v1/roles · GET · PATCH · DELETE /v1/roles/:id
GET · POST /v1/permissions · GET · PATCH · DELETE /v1/permissions/:id
GET /v1/custom-fields

Authentication

End-user sign-in, if you use Base316 for it.

POST /v1/auth/signup · /signin · /signoutSign-up takes invitationToken to join a team instead
GET /v1/auth/session · /sessions
POST /v1/auth/sessions/revoke-all
POST /v1/auth/password/reset-request · /password/reset
POST /v1/auth/verify-email
POST /v1/auth/mfa/enroll · /mfa/confirm · /mfa/verify · /mfa/disable
POST /v1/auth/mfa/required/start · /mfa/required/completeEnrol a required factor mid-sign-in. Challenge, no session
GET /v1/auth/password-policyPassword rules. Publishable key
POST /v1/auth/code/exchangeHosted sign-in callback
POST /v1/auth/impersonateSupport access. Audited
GET /v1/auth/eventsSign-in history

Customer-facing

For a self-serve portal, called with the end user's own session.

----------------------------------------------------------------------------------------------------------------------------------------------------------
GET /v1/me/subscription
GET /v1/me/subscription/upcoming-invoiceThe user's next bill. 403 billed_by_parent for a client tenant
GET /v1/me/subscription/quantity/preview · POST /v1/me/subscription/quantityThe user's own seat count: preview, then change
POST /v1/me/subscription/change · /cancel
GET /v1/me/subscription/plan-change-previewWhat a change would do. ?planVersionId=
DELETE /v1/me/subscription/scheduled-changeUndo a scheduled change
GET /v1/me/invoices · /me/invoices/:id
GET /v1/me/invoices/:id/pdfOne of the user's own invoices, as a PDF
GET /v1/public/plans · /public/brandingPublishable key. ?organizationId= for a tenant's brand
GET /v1/me/organizationsThe person's teams, inherited ones included. Paged with limit
POST /v1/checkout/sessions

Import and export

GET /v1/export/:resourcecustomers, subscriptions, invoices as CSV
GET /v1/import/:resource/templateAn empty file with the right columns
POST /v1/import/:resourcecustomers, subscriptions, users; skipPastInvoices for back-dated subscriptions

Payments

GET /v1/payment-accountsStripe Connect status
POST /v1/payment-accounts/refreshRe-read it from Stripe

Utility

GET /v1/whoamiWhich project and environment this key is for

On this page