Direct Debit Management
Direct Debit endpoints allow you to manage the full lifecycle of payment authorizations, from creation to activation and status management.
IMPORTANTTo follow the steps below, it is essential to have the corresponding Authorization Token. For more information, please refer to the following documentation page: Authorization Token
Create Direct Debit
Register a new Direct Debit for automatic payment collection from a customer's CLABE.
Endpoint
POST https://ecartpay.com/api/direct-debitsPOST https://sandbox.ecartpay.com/api/direct-debits
Headers
Authorization: tokenContent-Type: application/json
Request Payload
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | The ID of the customer to be charged |
currency | string | Yes | Must be MXN |
is_fixed_amount | boolean | Yes | true for scheduled, false for variable |
payment_method_id | string | No | Existing CLABE payment method ID (shortens activation) |
amount | number | Conditional | Required if is_fixed_amount: true. Min: 10, Max: 50000 |
is_recurring | boolean | Conditional | Required if is_fixed_amount: true |
interval | string | Conditional | Required if is_recurring: true. Options: weekly, monthly, quarterly, semiannual, yearly |
next_payment_date | date | Conditional | Required if is_fixed_amount: true. Must be future business day |
end_date | date | No | Must be after next_payment_date |
concept | string | No | Description, max 39 characters |
Response Key Features
| Field | Description |
|---|---|
_id | Unique Direct Debit identifier |
reference | 7-digit numeric reference (1000000-9999999) |
status | Initial status: created |
validation_level | 1 or 2 based on account feature flags |
is_fixed_amount | Scheduled fixed amount vs variable charges |
is_recurring | One-time vs recurring payments |
next_payment_date | First/next scheduled charge date |
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "6944a4946afaf625504595e3",
"currency": "MXN",
"is_fixed_amount": true,
"amount": 1500.00,
"is_recurring": true,
"interval": "monthly",
"next_payment_date": "2026-04-01",
"end_date": "2026-12-01",
"concept": "Monthly Subscription"
}'Response
{
"_id": "6944a5366afaf625504595ea",
"account_id": "68a4c3150b28a9584305a2a6",
"customer_id": "6944a4946afaf625504595e3",
"authorization_id": "6944a5366afaf625504595eb",
"reference": 1234567,
"concept": "Monthly Subscription",
"currency": "MXN",
"status": "created",
"is_fixed_amount": true,
"is_recurring": true,
"amount": 1500.00,
"interval": "monthly",
"next_payment_date": "2026-04-01T12:00:00.000Z",
"end_date": "2026-12-01T12:00:00.000Z",
"validation_level": 1,
"created_at": "2026-03-20T10:00:00.000Z",
"updated_at": "2026-03-20T10:00:00.000Z"
}Get Direct Debit
Retrieve full details of a specific Direct Debit including customer, merchant, and payment method data.
Endpoint
GET https://ecartpay.com/api/direct-debits/{directDebitId}GET https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}
Headers
Authorization: token
Path Parameters
directDebitId: The ID of the Direct Debit to retrieve
Response Key Features
| Field | Description |
|---|---|
customer | Embedded customer object (first_name, last_name, email, phone, customer_rfc) |
merchant | Embedded account object (name, image) |
payment_method | Embedded payment method (name, number, method, bank, bank_name, verified, validation) |
kyc_verification | KYC status for Level 2 accounts (pending, approved, rejected, inherited) |
acknowledge_by | Customer acknowledgment metadata (IP, browser, location, timestamp) |
errors | Array of validation and processing errors |
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...'Response
{
"_id": "6944a5366afaf625504595ea",
"account_id": "68a4c3150b28a9584305a2a6",
"customer_id": "6944a4946afaf625504595e3",
"payment_method_id": "6944a5386afaf625504595ec",
"authorization_id": "6944a5366afaf625504595eb",
"reference": 1234567,
"concept": "Monthly Subscription",
"currency": "MXN",
"status": "active",
"is_fixed_amount": true,
"is_recurring": true,
"amount": 1500.00,
"interval": "monthly",
"next_payment_date": "2026-04-01T12:00:00.000Z",
"last_payment_date": "2026-03-01T12:00:00.000Z",
"end_date": "2026-12-01T12:00:00.000Z",
"validation_level": 1,
"kyc_verification": {
"status": "approved"
},
"acknowledge_by": {
"ip": "192.168.1.1",
"browser": "Mozilla/5.0...",
"acknowledged_at": "2026-03-20T10:30:00.000Z"
},
"customer": {
"_id": "6944a4946afaf625504595e3",
"first_name": "Juan",
"last_name": "Perez",
"email": "[email protected]",
"phone": "5555555555",
"customer_rfc": "PERJ950714DL2"
},
"merchant": {
"_id": "68a4c3150b28a9584305a2a6",
"name": "Acme Store",
"first_name": "John",
"last_name": "Doe"
},
"payment_method": {
"_id": "6944a5386afaf625504595ec",
"name": "Juan Perez",
"number": "012555555555555555",
"method": "clabe",
"bank": "012",
"bank_name": "BBVA México",
"verified": true,
"validation": {
"status": "approved",
"rfc": "PERJ950714DL2"
}
},
"created_at": "2026-03-20T10:00:00.000Z",
"updated_at": "2026-03-20T10:30:00.000Z"
}Update Direct Debit Status
Update the status or next payment date of a Direct Debit.
Endpoint
PATCH https://ecartpay.com/api/direct-debits/{directDebitId}PATCH https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}
Headers
Authorization: tokenContent-Type: application/json
Path Parameters
directDebitId: The ID of the Direct Debit to update
Request Key Features
| Field | Type | Description |
|---|---|---|
status | string | New status: cancelled, active, or completed |
next_payment_date | date | Reschedule next payment (must be future business day) |
Status Transition Rules
| Current | Can Transition To |
|---|---|
created | cancelled |
active | cancelled, completed |
pending | cancelled, active |
cancelled | (none - final state) |
completed | (none - final state) |
Cancellation Restrictions: A direct debit cannot be cancelled if it has pending orders (status:
created,pending, orin_process).
Examples
Request - Cancel Direct Debit
curl --location --request PATCH 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"status": "cancelled"
}'Response
{
"_id": "6944a5366afaf625504595ea",
"status": "cancelled",
"updated_at": "2026-03-20T11:00:00.000Z"
}List Direct Debits
Retrieve a paginated list of Direct Debits with filtering and search capabilities.
Endpoint
GET https://ecartpay.com/api/direct-debitsGET https://sandbox.ecartpay.com/api/direct-debits
Headers
Authorization: token
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: created, active, pending, cancelled, completed |
currency | string | Filter by currency (always MXN) |
interval | string | Filter by interval: weekly, monthly, quarterly, semiannual, yearly |
customer_id | string | Filter by specific customer |
next_payment_date | date | Filter by next payment date |
q | string | Search by customer name, email, amount, reference, or concept |
page | number | Page number for pagination |
limit | number | Items per page |
sort | string | Sort order (JSON array format) |
Special Status Filters
| Filter | Behavior |
|---|---|
status=pending | Returns active direct debits with no next_payment_date set |
status=active | Returns active direct debits with next_payment_date set |
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits?status=active&limit=10' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...'Response
{
"docs": [
{
"_id": "6944a5366afaf625504595ea",
"reference": 1234567,
"concept": "Monthly Subscription",
"currency": "MXN",
"status": "active",
"is_fixed_amount": true,
"is_recurring": true,
"amount": 1500.00,
"interval": "monthly",
"next_payment_date": "2026-04-01T12:00:00.000Z",
"customer": {
"_id": "6944a4946afaf625504595e3",
"first_name": "Juan",
"last_name": "Perez",
"email": "[email protected]"
},
"payment_method": {
"_id": "6944a5386afaf625504595ec",
"name": "Juan Perez",
"number": "012555555555555555",
"method": "clabe",
"bank": "012",
"bank_name": "BBVA México",
"verified": true
},
"created_at": "2026-03-20T10:00:00.000Z"
}
],
"total": 1,
"limit": 10,
"page": 1,
"pages": 1
}Acknowledge Direct Debit
Customer acknowledgment endpoint used during activation. Links payment method and captures customer acceptance data.
Endpoint
POST https://ecartpay.com/api/direct-debits/acknowledgePOST https://sandbox.ecartpay.com/api/direct-debits/acknowledge
Headers
Authorization: tokenContent-Type: application/json
Request Payload
| Field | Type | Required | Description |
|---|---|---|---|
direct_debit_id | string | Yes | The ID of the Direct Debit to acknowledge |
fingerprint | string | No | Device fingerprint for fraud detection |
payment_method_id | string | No | Existing payment method ID to link |
Response Scenarios
| Scenario | Response |
|---|---|
| CLABE not verified | { "status": "acknowledged" } - triggers CEP validation |
| CLABE verified, Level 1 | { "status": "active" } - immediate activation |
| Needs KYC (Level 2) | { "status": "pending", "verification_id": "...", "sumsub_access_token": "..." } |
| KYC inherited from PM | { "status": "active" } - KYC already passed on payment method |
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/acknowledge' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"direct_debit_id": "6944a5366afaf625504595ea",
"payment_method_id": "6944a5386afaf625504595ec",
"fingerprint": "abc123def456"
}'Response - Immediate Activation
{
"status": "active"
}Response - KYC Required (Level 2)
{
"status": "pending",
"verification_id": "6944a5396afaf625504595ed",
"sumsub_access_token": "eyJhbGciOiJIUzUxMiIs..."
}Retry Direct Debit
Retry a failed single-charge Direct Debit. Only available for non-recurring debits in pending status.
Endpoint
POST https://ecartpay.com/api/direct-debits/{directDebitId}/retryPOST https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}/retry
Headers
Authorization: token
Path Parameters
directDebitId: The ID of the Direct Debit to retry
Retry Rules
- Direct debit must be in
pendingstatus - Must be a non-recurring (
is_recurring: false) scheduled debit - Previous order must have
attempts >= 1or statusfailed - Retry date automatically set to next business day
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea/retry' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...'Response
{
"_id": "6944a5366afaf625504595ea",
"status": "active",
"next_payment_date": "2026-03-23T12:00:00.000Z",
"is_extended_for_retry": true,
"updated_at": "2026-03-20T11:00:00.000Z"
}Resend Activation Email
Resend the activation email to the customer. Only works for Direct Debits in created status.
Endpoint
POST https://ecartpay.com/api/direct-debits/{directDebitId}/resend-emailPOST https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}/resend-email
Headers
Authorization: token
Path Parameters
directDebitId: The ID of the Direct Debit
Behavior
- Resends activation email to customer
- If acknowledgment already done but KYC rejected/pending, resets those fields
- Allows customer to restart activation process
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea/resend-email' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...'Response
{
"message": "Email sent successfully"
}Create Charge (Variable Direct Debit)
Create a one-time charge on a variable (non-fixed amount) Direct Debit.
Endpoint
POST https://ecartpay.com/api/direct-debits/{directDebitId}/chargesPOST https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}/charges
Headers
Authorization: tokenContent-Type: application/json
Path Parameters
directDebitId: The ID of the variable Direct Debit
Request Payload
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Charge amount (10 - 50000 MXN) |
scheduled_date | date | Yes | Future business day for the charge |
Requirements
- Direct debit must have
is_fixed_amount: false - Direct debit status must be
active
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea/charges' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"amount": 2500.00,
"scheduled_date": "2026-04-15"
}'Response
{
"_id": "6944a53a6afaf625504595ee",
"direct_debit_id": "6944a5366afaf625504595ea",
"account_id": "68a4c3150b28a9584305a2a6",
"customer_id": "6944a4946afaf625504595e3",
"number": "ORD-123456",
"reference": 1234567,
"currency": "MXN",
"status": "created",
"totals": {
"total": 2500.00
},
"scheduled_date": "2026-04-15T12:00:00.000Z",
"created_at": "2026-03-20T11:00:00.000Z"
}Retry Charge (Variable Direct Debit)
Retry a failed charge on a variable Direct Debit.
Endpoint
POST https://ecartpay.com/api/direct-debits/{directDebitId}/charges/{orderId}/retryPOST https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}/charges/{orderId}/retry
Headers
Authorization: tokenContent-Type: application/json
Path Parameters
directDebitId: The ID of the Direct DebitorderId: The ID of the failed order to retry
Request Payload
| Field | Type | Required | Description |
|---|---|---|---|
scheduled_date | date | No | New scheduled date (defaults to next business day) |
Retry Rules
- Direct debit must be
active - Order must have
status: failed - Resets
attemptsto 0 and setsis_retry_order: true
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea/charges/6944a53a6afaf625504595ee/retry' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"scheduled_date": "2026-04-20"
}'Response
{
"_id": "6944a53a6afaf625504595ee",
"status": "created",
"attempts": 0,
"is_retry_order": true,
"scheduled_date": "2026-04-20T12:00:00.000Z",
"updated_at": "2026-03-20T11:30:00.000Z"
}Get Direct Debit Payments
Retrieve payment history and statistics for a Direct Debit.
Endpoint
GET https://ecartpay.com/api/direct-debits/{directDebitId}/paymentsGET https://sandbox.ecartpay.com/api/direct-debits/{directDebitId}/payments
Headers
Authorization: token
Path Parameters
directDebitId: The ID of the Direct Debit
Response Key Features
| Field | Description |
|---|---|
statistics | Aggregated stats: total_orders, paid_orders, failed_orders, total_amount_paid, total_amount_failed |
payment_history | Array of orders with activities, status, attempts, and scheduled dates |
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/direct-debits/6944a5366afaf625504595ea/payments' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...'Response
{
"statistics": {
"total_orders": 5,
"paid_orders": 4,
"failed_orders": 1,
"total_amount_paid": 6000.00,
"total_amount_failed": 1500.00
},
"payment_history": [
{
"order_id": "6944a53b6afaf625504595ef",
"order_number": "ORD-123457",
"amount": 1500.00,
"currency": "MXN",
"status": "paid",
"attempts": 0,
"is_retry_order": false,
"scheduled_date": "2026-03-01T12:00:00.000Z",
"created_at": "2026-03-01T10:00:00.000Z",
"activities": [
{
"activity_id": "6944a53c6afaf625504595f0",
"status": "paid",
"message": "Direct debit payment successful",
"fee": 5.80,
"attempt_number": 1,
"created_at": "2026-03-01T12:00:00.000Z"
}
]
}
]
}Updated 12 days ago