> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# PaymentProviderTransaction

> The payment fact: every successful charge a provider reports, stored before any decision and never changed (append-only).

## Primary key

[Navigate to header](#param-commercial-activity)

document\_id

uuid

default:"Random UUID"

public

required

Unique identifier of the payment provider transaction.

## Specific attributes

[Navigate to header](#param-commercial-activity)

amount

numeric

public

required

What the provider charged, not the debt amount. Greater than 0.

**Rules**: Precision: 18, Scale: 2

[Navigate to header](#param-commercial-activity)

document\_number

varchar

public

The document number reported on the first invoice line.

**Rules**: Max length: 100 characters

[Navigate to header](#param-commercial-activity)

invoice\_external\_id

varchar

public

The invoice external id reported on the first invoice line.

**Rules**: Max length: 255 characters

[Navigate to header](#param-commercial-activity)

invoice\_lines

integer

public

How many lines the provider invoice has.

[Navigate to header](#param-commercial-activity)

occurred\_at

timestamp

public

When the provider says the charge happened.

**Rules**: Precision: 6, with timezone

[Navigate to header](#param-commercial-activity)

payload

jsonb

public

required

The evidence: the re-read Toku body or the signed Fintoc webhook body.

[Navigate to header](#param-commercial-activity)

payload\_sha256

varchar

public

required

SHA-256 of the payload, 64 lowercase hex characters.

**Rules**: Max length: 64 characters

[Navigate to header](#param-commercial-activity)

provider\_customer\_id

varchar

public

The provider customer id.

**Rules**: Max length: 255 characters

[Navigate to header](#param-commercial-activity)

provider\_invoice\_id

varchar

public

The provider invoice id reported on the first invoice line.

**Rules**: Max length: 255 characters

[Navigate to header](#param-commercial-activity)

provider\_transaction\_id

varchar

public

required

A real transaction id (Toku `trs_…`, Fintoc `pi_…`); unique per payment gateway.

**Rules**: Max length: 255 characters

[Navigate to header](#param-commercial-activity)

source

varchar

public

required

How the fact arrived: a webhook, a provider sync or a recovery.

**Rules**: Possible values: provider\_sync, recovery, webhook. Max length: 20 characters

## Foreign keys

[Navigate to header](#param-commercial-activity)

account

uuid

public

The Horizon account the provider customer maps to, when there is exactly one. [Ref: Account Schema](https://docs.bbrands.io/schemas/account/account.md)

[Navigate to header](#param-commercial-activity)

currency

uuid

public

required

Reference to the Currency this payment provider transaction belongs to. [Ref: Currency Schema](https://docs.bbrands.io/schemas/general/currency.md)

[Navigate to header](#param-commercial-activity)

payment\_gateway

uuid

public

required

The connection that charged (toku\_1, toku\_2 or fintoc), not only the provider. [Ref: Payment Gateway Schema](https://docs.bbrands.io/schemas/payment/payment-gateway.md)

## Tracking attributes

[Navigate to header](#param-commercial-activity)

created\_at

timestamp

public

required

Timestamp when the record was created.

**Rules**: Precision: 6, with timezone

[Navigate to header](#param-commercial-activity)

deleted\_at

timestamp

public

Timestamp when the record was soft-deleted, when applicable.

**Rules**: Precision: 6, with timezone

[Navigate to header](#param-commercial-activity)

is\_actived

boolean

default:"true"

public

required

Indicates whether the record is currently active.

[Navigate to header](#param-commercial-activity)

is\_deleted

boolean

default:"false"

public

required

Indicates whether the record has been soft-deleted.

[Navigate to header](#param-commercial-activity)

updated\_at

timestamp

public

Timestamp when the record was last updated.

**Rules**: Precision: 6, with timezone


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.