Core API Reference

Accounts — Core API

Account management endpoints. An Account is your billing and administrative entity in AuthPI—it contains Issuers, manages billing, and holds administrative memberships.

Base URL: https://api.authpi.com — see the Core API overview for authentication, pagination, and idempotency, or try these endpoints in the interactive reference.

GET/v1/accounts

List Accounts

List all accounts the authenticated user has access to

Query parameters

NameTypeRequiredDescription
limitintegerOptional
cursorstringOptional

Responses

CodeDescriptionSchema
200Accounts retrieved successfullyobject
401Unauthorized - Authentication is required or has failed.ApiError

GET/v1/accounts/{account_id}

Get Account

Retrieve an account by ID

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID

Responses

CodeDescriptionSchema
200Account retrieved successfullyobject
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError

PATCH/v1/accounts/{account_id}

Update Account

Update an account's settings

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID

Request body

Content type: application/json

PropertyTypeRequiredDescription
owner_user_idstringOptionalUser ID
domainsobject[]Optional
metadataMetadataOptional
namestring | nullOptionalA name for the resource.
descriptionstring | nullOptionalA description for the resource. Markdown supported.
logo_urlstring | nullOptionalA URL

Responses

CodeDescriptionSchema
200Account updated successfullyobject
400Bad Request - The request is malformed or contains invalid data.ApiError
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError
412Precondition Failed - The resource has been modified since the provided ETag.PreconditionFailedError

GET/v1/accounts/{account_id}/credits/ledger

List Account Credit Ledger

List account credit ledger entries, most recent first

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID

Query parameters

NameTypeRequiredDescription
limitintegerOptional
cursorstringOptional

Responses

CodeDescriptionSchema
200Credit ledger retrieved successfullyobject
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError

POST/v1/accounts/{account_id}/credits/topups

Create Account Credit Top-up

Settle an x402 payment and add prepaid credits to the account

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID

Request body

Content type: application/json

PropertyTypeRequiredDescription
amount_μusdintegerRequired

Responses

CodeDescriptionSchema
200Credit top-up settled successfullyobject
400Invalid request
401Unauthorized - Authentication is required or has failed.ApiError
402x402 payment required (challenge), payer wallet not in the method's allowlist, or settlement failed at the facilitator
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError
409Payment method was revoked or its allowlist tightened between the on-chain settlement and the credit write. The payment is recorded on-chain (response includes payment_reference) and queued for manual reconciliation; do not retry — contact support with the payment_reference.
502x402 facilitator unavailable

POST/v1/accounts/{account_id}/payment-methods

Add x402 Payment Method

Register an x402 payment method on the account. At most one active x402 method per account.

Implicit billing_mode change: billing_mode is derived from the count of active payment methods (gated when ≥1, ungated when 0), unless an operator override is set. Adding the first method on an account flips the derived billing_mode to "gated" automatically; removing the only method flips it back to "ungated". There is no public API to write billing_mode directly — operators with a need to pin it (e.g. force-ungated for a grandfathered customer) use the internal setGatingOverride RPC.

Stripe methods are not customer-creatable through this endpoint. Stripe binding requires a Setup Intent flow (not yet exposed); for now, AuthPI staff provision Stripe methods directly via internal tooling. Sending a Stripe payload here returns 400.

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID

Request body

Content type: application/json

PropertyTypeRequiredDescription
typex402Required
labelstringOptional
allowed_payer_walletsstring[]Optional
auto_topup_increment_μusdintegerOptional

Responses

CodeDescriptionSchema
201x402 payment method addedobject
400Bad Request - The request is malformed or contains invalid data.ApiError
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError

PATCH/v1/accounts/{account_id}/payment-methods/{method_id}

Update Account Payment Method

Update mutable fields on a payment method (label, enabled state, x402 batching/restrictions). Disabling a method starts a 15-second grace window during which in-flight settlements still complete.

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID
method_idstringRequiredPayment Method ID

Request body

Content type: application/json

PropertyTypeRequiredDescription
labelstring | nullOptional
enabledbooleanOptional
allowed_payer_walletsarray | nullOptional
auto_topup_increment_μusdinteger | nullOptional

Responses

CodeDescriptionSchema
200Payment method updatedobject
400Bad Request - The request is malformed or contains invalid data.ApiError
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError

DELETE/v1/accounts/{account_id}/payment-methods/{method_id}

Remove Account Payment Method

Soft-remove a payment method. Terminal — the method is retained in the list for audit but no longer accepted for settlements.

Path parameters

NameTypeRequiredDescription
account_idstringRequiredAccount ID
method_idstringRequiredPayment Method ID

Responses

CodeDescriptionSchema
204Payment method removed
401Unauthorized - Authentication is required or has failed.ApiError
403Forbidden - You don't have permission to perform this action.ApiError
404Not Found - The requested resource does not exist.ApiError