Direct Debits

Initiate automated bank debits and batch collections

🏦 Direct Debits

Initiate automated bank debits to collect premiums directly from an insured's bank account. Supports individual debits and batch collections across multiple policies.


Initiate a Direct Debit

POST /api/v1/ach/debits
FieldTypeRequiredDescription
employer_idstringYesEmployer ObjectId
carrier_idstringYesCarrier ObjectId
policy_idstringYesPolicy ObjectId
bank_account_idstringYesBank account ID to debit from
amount_centsintegerYesAmount in cents
payment_purposestringYesSee payment purposes below
descriptionstringNoHuman-readable description
idempotency_keystringNoUnique key to prevent duplicate charges
effective_datestringNoDesired effective date (ISO 8601)
metadataobjectNoCustom key-value pairs

Payment Purposes

PurposeDescription
paygoPay-as-you-go premium collection
down_paymentInitial policy down payment
installmentScheduled installment payment
late_paymentLate payment collection
extra_paymentExtra/overpayment
overdue_paymentOverdue amount
curl -X POST /api/v1/ach/debits \
  -H "X-Client-ID: $CLIENT_ID" \
  -H "X-Client-Secret: $CLIENT_SECRET" \
  -d '{
    "employer_id": "681xyz789abc123456789012",
    "carrier_id": "680abc456def789012345678",
    "policy_id": "682def789ghi012345678901",
    "bank_account_id": "684abc123def456789012345",
    "amount_cents": 85000,
    "payment_purpose": "paygo",
    "description": "PayGo premium - March 2026",
    "idempotency_key": "paygo_march_2026_acme"
  }'

Response (201 Created)

{
  "ok": true,
  "data": {
    "success": true,
    "transaction_id": "685def456ghi789012345678",
    "status": "PENDING",
    "amount": 85000
  }
}
⚠️

Idempotency: Always provide an idempotency_key to prevent duplicate charges. If you retry a request with the same key, the original transaction is returned instead of creating a new one.


Check Debit Status

GET /api/v1/ach/debits/{transaction_id}/status

Transaction Statuses

PENDING → UPLOADED → PROCESSING → COMPLETED
                                  ↘ RETURNED → RESOLVED
                                  ↘ FAILED   → RESOLVED
StatusDescription
PENDINGCreated, awaiting batch processing
UPLOADEDSubmitted to the banking network
PROCESSINGBeing processed by the banking network
COMPLETEDFunds received
RETURNEDBank rejected the debit (insufficient funds, closed account, etc.)
FAILEDProcessing error
RESOLVEDReturn or failure has been handled

Batch Collection

Collect from a single employer across multiple policies in one batch.

POST /api/v1/ach/collections
FieldTypeRequiredDescription
employerIdstringYesEmployer to debit
bankAccountIdstringYesBank account ID
policyCollectionsarrayYesOne entry per policy
policyCollections[].policyIdstringYesPolicy ObjectId
policyCollections[].totalInDollarsnumberYesAmount in dollars
policyCollections[].descriptionstringYesLine-item description
policyCollections[].idempotencyKeystringYesUnique per collection
curl -X POST /api/v1/ach/collections \
  -H "X-Client-ID: $CLIENT_ID" \
  -H "X-Client-Secret: $CLIENT_SECRET" \
  -d '{
    "employerId": "681xyz789abc123456789012",
    "bankAccountId": "684abc123def456789012345",
    "policyCollections": [
      {
        "policyId": "682def789ghi012345678901",
        "totalInDollars": 1500.00,
        "description": "WC Premium - Q1 2026",
        "idempotencyKey": "wc_q1_2026_acme"
      },
      {
        "policyId": "682ghi012jkl345678901234",
        "totalInDollars": 850.00,
        "description": "GL Premium - Q1 2026",
        "idempotencyKey": "gl_q1_2026_acme"
      }
    ]
  }'

Response (202 Accepted) — batch processing is asynchronous.


List Transactions

GET /api/v1/ach/transactions?employer_id=...&status=COMPLETED&from_date=2026-01-01&page=1&limit=50
ParameterTypeDescription
carrier_idstringFilter by carrier
employer_idstringFilter by employer
policy_idstringFilter by policy
statusstringPENDING, COMPLETED, RETURNED, etc.
from_datestringStart date (ISO 8601)
to_datestringEnd date
sort_bystringField to sort by
sort_orderstringasc or desc

Transaction History

GET /api/v1/ach/transactions/{id}/history

Returns the audit trail for a specific transaction.

Transaction Fees

GET /api/v1/ach/transactions/{id}/fees

Returns fee breakdown for a transaction.


💡

Bank debit settlement typically takes 2-5 business days. The COMPLETED status means funds have been received. Use webhooks to get notified in real time.