Lifecycle status & Workflows

Understanding the Direct Debit lifecycle is essential for managing automated payments effectively. This page details the various states a debit can inhabit and the automated workflows—from creation to final completion—that drive the payment engine.

Direct Debit Lifecycle Status

Each Direct Debit follows a strict state machine to ensure security and billing accuracy.

StatusDescriptionPermitted Next States
createdInitial state; the Direct Debit exists but lacks a validated CLABE bank account.active, cancelled
activeThe CLABE is validated and active. The system is ready to perform automated charges.paused, cancelled, completed
pausedThe Direct Debit is temporarily suspended. No charges will be attempted until reactivated.active, cancelled
cancelledThe authorization has been permanently revoked by the merchant or customer.None (Final state)
completedThe Direct Decit has reached its end_date or the payment limit has been met.None (Final state)


Core Workflows

Direct Debit Creation

The creation workflow initiates the lifecycle of a Direct Debit by processing initial transaction data and determining the necessary activation steps.

1234

Step 1: Client sends POST

The merchant initiates the process by sending a POST request with the initial transaction data to the system.

1. Client sends POST

Initial transaction data

2. System validates data

Business and security validations

3. Creates Direct Debit

Initial Status: 'created'

Without billing_account
Sends activation email
With billing_account
Active CLABE?

Status verification

No
Sends CLABE validation emal
Yes
Status: active


Direct Debit Activation

This workflow occurs when a customer needs to provide their banking details for the first time to enable the service.

12345

Step 1: Access Activation Link

The user opens the secure link provided in the activation email, which includes a temporary validation token.

1. Customer accesses activation link

GET /direct-debit/activate/id?_v=token

2. Customer enters CLABE details

18-digit CLABE, Bank, RFC (optional), and Alias (optional)

3. POST /api/direct-debits/activate

Sends customer_clabe data and the direct_debit_id

4. System Processes

Verifies CLABE, creates/updates records, and sets status to 'active'

5. Activate related debits

Finds and automatically activates other direct debits with the same CLABE



CLABE Validation

The validation workflow is used when the system already has the customer's banking information on file but requires explicit confirmation before resuming or starting charges.

123

Step 1: Access Validation Link

The user clicks the validation link sent via email, which directs them to a secure verification page.

1. Customer accesses validation link

GET /direct-debit/id?_v=token

2. Customer confirms existing CLABE details

The user verifies that the stored bank information is correct

3. System marks CLABE as active

Sets is_active = true and updates direct_debit status to 'active'