Modelo de datos
Ver diagrama ER (resumen)
||--o{1 — N||--||1 — 1}o--o{N — N
Customer customers
End customers (payers) of the tenant. The natural key tenants share with their billing system (CRM, ERP, Salesforce) is typically `email`, `identification_number` or a key inside `metadata`.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique customer public ID. ej. CSljikas98 |
email | stringnullable | Customer's email address. ej. mail@example.com |
name | stringnullable | Customer's full name or business name. ej. Jorgelina Castro |
gateway_identifier | stringnullable | Customer's reference for bank account statements (used in some gateways). ej. 383473 |
identification_type | stringnullable | Document type (e.g. DNI, CUIT, CUIL, RUT, PASSPORT). ej. DNI |
identification_number | stringnullable | Document number. ej. 15.555.324 |
mobile_number | stringnullable | E.164 mobile phone number. ej. +5491123456789 |
metadata | jsonnullable | Free-form key/value pairs attached by the tenant via the API. |
created_at | required | When the customer was created (RFC3339). |
updated_at | required | Time at which the source record was last updated (RFC3339). |
deleted_at | nullable | Time at which the customer was archived (soft delete), or null if active. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Payment Method payment_methods
Tokenized payment instruments stored against a customer: credit/debit cards, CBU, CVU, SEPA debit or bank transfer accounts. Fields are populated according to `type`.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique payment method public ID. ej. PMyma6Ql8Wo9 |
bin | stringnullable | Bank Identification Number (first digits of the card) when applicable. ej. 453248 |
type | stringrequired | Type of payment instrument. cardsepa_debitcbucvutransfer |
card_network | stringnullable | Card brand when `type = card`. amexdinersdiscoverfavacardjcbmastercardnaranjaunknownvisa |
card_issuer | stringnullable | Card issuer when `type = card`. ej. argencard |
last_four_digits | stringnullable | Last four digits of the card or account. ej. 9876 |
bank | stringnullable | Bank name (for bank-backed payment methods). |
name | stringnullable | Display name (e.g. `Visa`). |
card_funding | stringnullable | Funding type when `type = card`. creditdebitprepaidunknown |
card_expiration_month | integernullable | Expiration month when `type = card`. |
card_expiration_year | integernullable | Expiration year when `type = card`. |
country | stringnullable | ISO 3166-1 alpha-2 country code. |
metadata | jsonnullable | Free-form key/value pairs. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
fingerprint | stringnullable | Stable hash that identifies the same underlying instrument across customers (useful for de-duping). |
bank_account_data_id | stringnullable | Reference to the bank account record backing CBU/CVU/transfer methods. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Mandate mandates
Authorization linking a customer and a payment method, granting permission to charge it (e.g. for recurring payments). A mandate is required to make payments with CBU/CVU/SEPA.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique mandate public ID. ej. MAmQ6j9NWxblNv |
customer_id🔗 | stringnullable | Authorizing customer. FK → customers.id |
payment_method_id🔗 | stringnullable | Authorized payment instrument. FK → payment_methods.id |
metadata | jsonnullable | Free-form key/value pairs. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
deleted_at | nullable | Time at which the mandate was archived (soft delete), or null if active. |
expires_at | nullable | When the mandate expires (if applicable). |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
customer_id→ customers.idN — 1payment_method_id→ payment_methods.idN — 1
Subscription subscriptions
Recurring billing plan: amount, currency, interval and customer. Subscriptions generate `payments` on every charge date.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique subscription public ID. ej. SBmQ6j9NWxblNv |
customer_id🔗 | stringnullable | Customer being charged. FK → customers.id |
payment_method_id🔗 | stringnullable | Default payment method for this subscription. FK → payment_methods.id |
amount | decimalrequired | Amount per charge in major units (e.g. 12.50). |
currency | stringrequired | ISO 4217 currency code. ej. ARS |
count | integernullable | Total number of charges to perform (null = open-ended). |
start_date | daterequired | First charge date (YYYY-MM-DD). |
status | stringrequired | Subscription lifecycle status. activepausedcancelledfinishedincompleteincomplete_expired |
interval_unit | stringrequired | Billing interval unit. weeklymonthlyyearly |
interval | integerrequired | Number of `interval_unit`s between charges (e.g. `2` + `monthly` = bi-monthly). |
day_of_month | integernullable | 1–28. Required when `interval_unit = monthly`. |
day_of_week | integernullable | 0=Sun … 6=Sat. Required when `interval_unit = weekly`. |
auto_retries_max_attempts | integernullable | Override for max automatic retries on failed payments. |
description | stringnullable | Short subscription description. |
metadata | jsonnullable | Free-form key/value pairs. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
customer_id→ customers.idN — 1payment_method_id→ payment_methods.idN — 1
Payment payments
Individual charge attempt. Most payments originate from a `subscription`; one-off payments are also possible (via API, link or session). Status transitions are tracked via `payment_logs`.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique payment public ID. ej. PYa8EJ1DkDnY |
customer_id🔗 | stringnullable | Customer being charged. FK → customers.id |
gateway_id🔗 | stringnullable | Gateway used to process the payment. FK → gateways.id |
payment_method_id🔗 | stringnullable | Payment method used. FK → payment_methods.id |
subscription_id🔗 | stringnullable | Parent subscription, if any. FK → subscriptions.id |
amount | decimalrequired | Charge amount in major units. |
amount_refunded | decimalrequired | Amount refunded so far. |
charge_date | datenullable | Date the payment should be collected. |
estimated_charge_date | datenullable | Best estimate of when the bank will actually debit. |
estimated_accreditation_date | datenullable | When the funds are estimated to settle to the merchant. |
effective_charged_date | datenullable | Actual debit date once known. |
currency | stringrequired | ISO 4217 currency code. |
description | stringnullable | Free-text description. |
related_to | stringnullable | Reference to a related resource (polymorphic, e.g. import ID). |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
metadata | jsonnullable | Free-form key/value pairs. |
status | stringrequired | Current payment status. pending_submissioncancelledsubmittedfailedwill_retryapprovedrejectedchargebackrefundedpartially_refundedrequires_actionincomplete |
response_message | stringnullable | Free-text response from the financial institution (e.g. "Falta de fondos"). |
rejection_code | stringnullable | Normalized rejection code (Debi taxonomy). |
provider_rejection_code | stringnullable | Raw rejection code from the provider/bank. |
rejection_recovery_score | decimalnullable | Score 0–1 used by recovery analytics; higher = more likely to recover on retry. |
updated_status | nullable | Last time `status` changed. |
notifyed_at | nullable | When the customer/merchant was notified. |
subscription_payment_number | integernullable | Sequence number of this charge within the parent subscription (1, 2, 3, ...). |
can_auto_retry_until | datenullable | Cut-off date for automatic retries. |
auto_retries_max_attempts | integernullable | Max automatic retries for this payment. |
submissions_count | integerrequired | How many times the payment was submitted to the bank/processor. |
retryable_after_date | datenullable | Earliest date the payment may be retried after a rejection. |
presentable_at | nullable | When the payment became eligible for presentation to the bank. |
confirmable_at | nullable | When the payment became eligible for confirmation. |
not_retried_reason | stringnullable | Why a rejected payment wasn't retried. |
binary_mode | booleannullable | True if processed in binary mode (synchronous, no retries). |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
customer_id→ customers.idN — 1subscription_id→ subscriptions.idN — 1payment_method_id→ payment_methods.idN — 1gateway_id→ gateways.idN — 1
Payment Log payment_logs
Append-only audit trail of state transitions for a payment (submission, response, rejection, retry, etc.). Use this to reconstruct lifecycle timelines.
| Columna | Tipo | Descripción |
|---|---|---|
payment_id🔗 | stringrequired | Payment this event belongs to. FK → payments.id |
gateway_id🔗 | stringnullable | Gateway involved in this event (if any). FK → gateways.id |
action | stringrequired | Action taken (e.g. `submitted`, `approved`, `rejected`, `retry_scheduled`). |
rejection_code | stringnullable | Normalized rejection code at this step (if applicable). |
provider_rejection_code | stringnullable | Provider-specific rejection code. |
created_at | required | When the log row was created in Debi. |
updated_at | required | Time at which the source record was last updated. |
processed_at | nullable | When the underlying action was processed by the bank/provider. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
payment_id→ payments.idN — 1gateway_id→ gateways.idN — 1
Gateway gateways
A provider/processor configuration owned by the tenant (e.g. Fiserv, Prisma, Mercado Pago, CBU-Galicia). Connects Debi to a specific bank or PSP credentials.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique gateway public ID. ej. GWBZqKYEK7Y2 |
provider | stringrequired | Provider name. amexbacbanamexbanistmobanortecabalcbu-bindcbu-galiciacbu-patagoniafavacardfiserv-argentinafiserv-mexicomercado-pagonaranjapaywayprisma-visaprisma-visa-debitprisma-mastercardwompi |
number | stringrequired | Merchant identifier with the provider (e.g. comercio number). |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
approved_at | nullable | When the gateway was approved/activated. |
last_connected_at | nullable | Last successful connection. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Link links
Shareable, reusable hosted page that creates `sessions` and (depending on `kind`) collects payments, subscriptions or mandates from the link's URL.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique link public ID. ej. LKLj0JV8xzdMoRk549 |
metadata | jsonnullable | Free-form key/value pairs. |
body | stringnullable | Body shown on the hosted page. |
title | stringnullable | Title shown on the hosted page. |
external_id_required | booleannullable | Whether an external ID is required on submission. |
uuid | stringnullable | Legacy UUID identifier. |
enabled | booleanrequired | Whether the link is publishable. |
customer_metadata | jsonnullable | Customer metadata configuration (JSON). |
smart_merge | booleannullable | Whether to smart-merge with existing customers when matching identifiers. |
options | jsonnullable | Generic link options (JSON). |
extra_fields | jsonnullable | Extra fields stored on the resulting object's metadata (JSON array). |
payment_method_options | jsonnullable | Per-method options (JSON). |
success_url | stringnullable | Where to redirect after completion. |
allowed_brands | jsonnullable | Allowed card networks (JSON array). |
kind | stringrequired | What the link generates when used. paymentsubscriptionmandate |
payment_method_types | jsonnullable | Allowed payment method types (JSON array). |
name_text | stringnullable | Display name shown to the customer. |
external_id_display_name | stringnullable | Label for the external ID input. |
extra_fields_customer | jsonnullable | Extra fields stored on the resulting customer's metadata (JSON array). |
button_text | stringnullable | Custom CTA button label. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Session sessions
Hosted-checkout or link-driven session. Each session represents a single attempt by a customer to complete a payment, subscription or mandate flow. Generated by a `link` or directly by the API.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique session public ID. ej. SSmQ6j9NWxblNv |
link_id | integernullable | Parent link. |
resource_id | integernullable | Polymorphic reference to the created resource (payment / subscription / mandate). |
customer_id | integernullable | Customer that opened the session. |
kind | stringrequired | What the session is meant to create. paymentsubscriptionmandate |
description | stringnullable | Session description. |
metadata | jsonnullable | Free-form key/value pairs. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
opened_at | nullable | When the customer opened the hosted page. |
completed_at | nullable | When the customer completed the flow. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
link_id→ links.idN — 1customer_id→ customers.idN — 1
Event events
Immutable log of every API event emitted by the tenant's account (the same events fired to webhook endpoints). One row per event delivery.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique event public ID. ej. EVm3RnKn3knw |
resource_id | stringnullable | Public ID of the resource the event refers to (extracted from `data.object.id`). ej. PYa8EJ1DkDnY |
type | stringrequired | Event type. See webhooks docs for the full list (e.g. `payment.created`, `subscription.cancelled`). |
resource | stringrequired | Type of resource the event refers to. customergatewayimportmandatepaymentpayment_methodsubscription |
data | jsonrequired | Full snapshot of the resource at the time of the event (mirrors webhook payload). |
request_id | stringnullable | API request that produced the event (if any). |
ip | stringnullable | IP address of the request. |
created_at | required | When the event was created. |
updated_at | required | Time at which the source record was last updated. |
delivered_at | nullable | When all webhook endpoints were successfully notified (null if pending or undeliverable). |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |
Relaciones
resource_id→ customers.id | payments.id | payment_methods.id | subscriptions.id | mandates.id | gateways.idN — 1· polymorphic on `resource`
Webhook webhooks
Webhook endpoints configured by the tenant. Each row is an endpoint registration.
| Columna | Tipo | Descripción |
|---|---|---|
id🔑 | stringrequired | Unique webhook public ID. ej. WHA8EJ1DkDnY |
url | stringrequired | Endpoint URL receiving events. |
enabled_events | jsonrequired | Array of event types this endpoint subscribes to (`['*']` for all). |
enabled | booleanrequired | Whether the endpoint is currently active. |
created_at | required | Creation time. |
updated_at | required | Time at which the source record was last updated. |
dw_loaded_at | required | Warehouse load timestamp. Use this column as the incremental cursor when ingesting changes: it advances every time a row is published to the warehouse, so polling on it will not skip late-arriving updates. |