MVP API (v0.1) — The ACH collections surface covers core collection creation and
lifecycle tracking.
What Are ACH Debit Collections?
ACH debit collections pull funds from an external US bank account into your OpenFX account via the ACH network. The counterparty’s payment method must be of type us_bank (routing number and account number).
Unlike ACH credit payments where you push funds to a counterparty, ACH debit collections pull funds from the counterparty’s bank account into yours. This requires prior authorization from the account holder.
Counterparty's US Bank Account
|
| <-- ACH Debit (pull)
|
v
Your OpenFX Account (acc_)
+-- Funds credited after settlement
Authorization required. Before initiating an ACH debit collection, you must have obtained
proper authorization from the account holder. The NACHA SEC code you specify indicates the type
of authorization obtained. Unauthorized debits will be returned and may result in compliance
issues.
SEC Codes for Collections
NACHA SEC (Standard Entry Class) codes indicate how the debit was authorized. Choose the appropriate code based on how you obtained the account holder’s consent.
| SEC Code | Name | Use Case |
|---|
WEB | Internet-initiated | Consumer authorized via web form or online portal. Default for collections. |
PPD | Prearranged Payment | Consumer authorized via signed agreement (recurring payments). |
CCD | Corporate Collection | Business-to-business debits with corporate authorization. |
Use WEB for consumer-facing online payment collection. Use CCD for B2B invoice collection
where you have a corporate authorization agreement in place.
Creating an ACH Debit Collection
The rail-specific POST /collections/ach endpoint provides ACH-native parameters including SEC code and processing speed.
curl -X POST https://sandbox.api.openfx.com/v1/collections/ach \
-H "Authorization: Bearer $API_KEY" \
-H "X-Signature: $SIGNATURE" \
-H "X-Timestamp: $TIMESTAMP" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"destinationAccountId": "acc_01953e1a5f4b7002",
"counterpartyId": "cpt_01953e1a5f4b7004",
"paymentMethodId": "pm_01953e1a5f4b7300",
"achType": "standard",
"secCode": "WEB",
"amount": {
"currency": "USD", "value": "120000"
},
"reference": "MEMBERSHIP-2026-02",
"purpose": "Subscription payment"
}'
The response returns the full collection resource:
{
"id": "col_01953e1a5f4b7e01",
"customerId": "cus_01953e1a5f4b7000",
"destinationAccountId": "acc_01953e1a5f4b7002",
"counterpartyId": "cpt_01953e1a5f4b7004",
"paymentMethodId": "pm_01953e1a5f4b7300",
"rail": "ach",
"amount": {
"currency": "USD",
"exponent": 2,
"value": "120000",
"displayValue": "1200.00"
},
"direction": "inbound",
"status": "pending",
"reference": "MEMBERSHIP-2026-02",
"purpose": "Subscription payment",
"railDetails": {
"achType": "standard",
"secCode": "WEB"
},
"metadata": {},
"createdAt": "2026-02-25T10:00:00Z",
"updatedAt": "2026-02-25T10:00:00Z"
}
Required Fields
| Field | Type | Description |
|---|
destinationAccountId | string | The OpenFX account to credit with collected funds |
paymentMethodId | string | Payment method of type us_bank on the counterparty |
amount | Money | Amount to collect ({ "currency": "USD", "value": "120000" }) |
Optional Fields
| Field | Type | Default | Description |
|---|
counterpartyId | string | Derived from payment method | The counterparty being debited |
achType | enum | standard | standard (1-2 days) or same_day |
secCode | enum | WEB | NACHA SEC code: WEB, PPD, or CCD |
reference | string | — | Payment reference for reconciliation |
purpose | string | — | Purpose of the collection |
metadata | object | {} | Your custom key-value pairs |
ACH Processing Speed
| Type | Settlement Time | Description |
|---|
standard | 1-2 business days | Standard ACH processing. Lower cost, suitable for most use cases. |
same_day | Same business day | Same-day ACH processing. Higher cost, funds available sooner. |
Same-day ACH has cutoff times. Submissions after the cutoff are processed on the next
business day. Check with OpenFX for specific cutoff schedules.
ACH Return Handling
ACH debits can be returned by the originating bank for various reasons. Returns can arrive up to 60 calendar days after settlement.
Common ACH Return Codes
| Code | Reason | Description |
|---|
R01 | Insufficient funds | The account does not have sufficient funds |
R02 | Account closed | The bank account has been closed |
R03 | No account / Unable to locate | The account number does not correspond to an account |
R04 | Invalid account number | The account number structure is invalid |
R07 | Authorization revoked | The receiver revoked authorization |
R08 | Payment stopped | The receiver placed a stop payment |
R10 | Not authorized | The receiver claims they did not authorize the debit |
R29 | Corporate not authorized | Corporate entry not authorized |
When a return is received, the collection transitions to returned status, and the achReturnCode field is populated with the reason code.
{
"id": "col_01953e1a5f4b7e01",
"status": "returned",
"achReturnCode": "R01",
"completedAt": "2026-02-26T14:00:00Z"
}
Design for late returns. Even after a collection reaches completed status and funds are
credited to your account, a return may arrive weeks later. Your system should handle the reversal
of already-credited funds. Subscribe to webhook events to be notified immediately.
Retrieving an ACH Collection
Use the rail-specific GET endpoint for ACH-native response fields.
curl -X GET https://sandbox.api.openfx.com/v1/collections/ach/col_01953e1a5f4b7e01 \
-H "Authorization: Bearer $API_KEY" \
-H "X-Signature: $SIGNATURE" \
-H "X-Timestamp: $TIMESTAMP"
Webhook Events
Subscribe to these events to track collection lifecycle changes:
| Event | Description |
|---|
collection.created | Collection has been created |
collection.submitted | Collection submitted to the ACH network |
collection.processing | ACH network is processing the debit |
collection.completed | Funds received and credited to your account |
collection.returned | The debit was returned by the external bank |
collection.failed | Collection failed |
API Reference