Skip to Content
better-auth-nuvion

Schema

The table and column the plugin adds to organization, and its six nuvion tables.

Better Auth's CLI creates these (npx @better-auth/cli migrate, or generate for Prisma and Drizzle). Amounts and timestamps are bigint so they do not overflow on Postgres. id columns are added by Better Auth.

organization (extended)

ColumnTypeNotes
parentOrganizationIdstring, optionalthe parent organization. Not settable through normal organization input; use set a parent

nuvionBinding

Maps an organization to its Nuvion entity and account.

ColumnTypeNotes
organizationIdstringunique
entityIdstringNuvion entity
accountIdstringNuvion account

nuvionDestination

The saved counterparty for one (source, destination) pair of organizations.

ColumnTypeNotes
fromOrganizationIdstringindexed; the organization that sends
toOrganizationIdstringthe organization that receives
counterpartyIdstringNuvion counterparty on the sending entity
paymentDetailIdstringNuvion book-transfer payment detail

nuvionFeeRule

ColumnTypeNotes
organizationIdstringunique; the child whose parent takes the fee
flatMinorbigint
bpsbigint0 to 10000
minMinor, capMinorbigint, optional
bearerstringpayer or merchant

nuvionPayment

ColumnTypeNotes
organizationIdstringindexed; the leaf (merchant)
referencestringunique; pay_<uuid>, sent to Nuvion as unique_reference
providerSessionIdstring, optionalthe Nuvion funding session id
baseMinorbigintwhat the merchant asked to net
chargedMinorbigintwhat the customer is charged
currencystring
statusstringpayment status
createdAtbigintepoch ms

nuvionLeg

One book transfer.

ColumnTypeNotes
paymentIdstring
kindstringsplit or reversal
fromOrganizationId, toOrganizationIdstring
amountMinorbigint
statestringleg state
attemptbigintthe Nuvion reference is {id}-a{attempt}
providerRefstring, optionalthe Nuvion transfer id
errorstring, optionallast failure; cleared when a retry succeeds

nuvionEvent

Claims each webhook event id once, for de-duplication.

ColumnTypeNotes
eventIdstringunique
receivedAtbigintepoch ms

On this page