Endpoint
POST https://api.digitzs.com/payments
Overview
Use this endpoint to process ACH payments directly from a customer’s bank account. This method does not require creating a customer account or storing payment method tokens.
ACH payments typically take 3-5 business days to settle. Funds are not immediately available.
Authentication
Header Value Required
x-api-keyYour API key from onboarding Yes AuthorizationBearer {appToken}Yes appIdYour application ID Yes Content-Typeapplication/jsonYes
Request Body
UUID for idempotency. If provided, must be in valid UUID format. Optional but recommended for preventing duplicate transactions.
Container for payment attributes
data.attributes.paymentType
Must be "ACH" for ACH payments
data.attributes.merchantId
The merchant account identifier
Optional JSON string containing additional metadata like email, IP addresses, or custom data
data.attributes.StandardEntryClassCode
Must be "WEB" for internet-initiated ACH transactions
Bank account information Show Bank object properties
data.attributes.bank.bankName
Name of the financial institution
data.attributes.bank.accountType
Type of account - must be "checking" or "savings"
data.attributes.bank.accountName
Full name of the account holder
data.attributes.bank.accountNumber
Bank account number
data.attributes.bank.routingNumber
9-digit bank routing number. Must be a valid routing number even in test environment.
data.attributes.transaction
Transaction details Show Transaction object properties
data.attributes.transaction.amount
Payment amount in cents (e.g., “3635” for $36.35)
data.attributes.transaction.currency
Three-letter currency code (ISO 4217). Currently only "USD" is supported.
data.attributes.transaction.invoice
Invoice or reference number for the transaction
Example Request
{
"data" : {
"requestId" : "f8d0fedd-fad0-4c53-bb8d-44a4cd28573b" ,
"type" : "payments" ,
"attributes" : {
"paymentType" : "ACH" ,
"merchantId" : "merchant_123456" ,
"miscData" : "{ \" email \" : \" customer@example.com \" , \" originIp \" : \" 192.168.1.1 \" , \" customerIp \" : \" 203.0.113.0 \" }" ,
"StandardEntryClassCode" : "WEB" ,
"bank" : {
"bankName" : "Wells Fargo" ,
"accountType" : "checking" ,
"accountName" : "John Doe" ,
"accountNumber" : "1234567890" ,
"routingNumber" : "026009593"
},
"transaction" : {
"amount" : "3635" ,
"currency" : "USD" ,
"invoice" : "INV-2024-001"
}
}
}
}
Response
Success Response (201 Created)
Contains URLs related to the resource URL of the current endpoint
Container for response data Resource type - will be "payments"
Unique payment transaction identifier
data.attributes.paymentType
Payment type - "ACH"
data.attributes.transaction
data.attributes.transaction.code
Response code - "0" indicates success
data.attributes.transaction.message
Human-readable response message
data.attributes.transaction.amount
Transaction amount in cents
data.attributes.transaction.currency
Currency code
data.attributes.transaction.invoice
Invoice reference number
Example Response
{
"links" : {
"self" : "https://api.digitzs.com/payments"
},
"data" : {
"type" : "payments" ,
"id" : "pay_ach_abc123xyz" ,
"attributes" : {
"paymentType" : "ACH" ,
"transaction" : {
"code" : "0" ,
"message" : "Success" ,
"amount" : "3635" ,
"currency" : "USD" ,
"invoice" : "INV-2024-001"
}
}
}
}
Code Examples
cURL
JavaScript
Python
PHP
Ruby
curl -X POST https://api.digitzs.com/payments \
-H "x-api-key: your-api-key" \
-H "Authorization: Bearer your-app-token" \
-H "appId: your-app-id" \
-H "Content-Type: application/json" \
-d '{
"data": {
"type": "payments",
"attributes": {
"paymentType": "ACH",
"merchantId": "merchant_123456",
"StandardEntryClassCode": "WEB",
"bank": {
"bankName": "Wells Fargo",
"accountType": "checking",
"accountName": "John Doe",
"accountNumber": "1234567890",
"routingNumber": "026009593"
},
"transaction": {
"amount": "3635",
"currency": "USD",
"invoice": "INV-2024-001"
}
}
}
}'
Error Responses
400 Bad Request
401 Unauthorized
422 Unprocessable Entity
{
"errors" : [
{
"status" : "400" ,
"title" : "Bad Request" ,
"detail" : "Invalid routing number" ,
"source" : {
"pointer" : "/data/attributes/bank/routingNumber"
}
}
]
}
Common Error Scenarios
Error: 400 Bad RequestSolution: Verify the routing number is a valid 9-digit ABA routing number. The test environment requires real routing numbers.
Error: 400 Bad RequestSolution: Ensure accountType is either “checking” or “savings” (lowercase).
Error: 400 Bad RequestSolution: Verify all required fields are present: paymentType, merchantId, StandardEntryClassCode, bank object, and transaction object.
Payment processing failed
Error: 422 Unprocessable EntitySolution: The payment was rejected by the bank. Common reasons include insufficient funds, closed account, or invalid account information.
Important Notes
Real Routing Numbers Required: Even in the test environment, you must use valid bank routing numbers. Invalid routing numbers will be rejected.
Settlement Time: ACH payments take 3-5 business days to settle. The payment will appear as “pending” during this time.
Idempotency: Use the optional requestId field with a UUID to prevent duplicate payments if your request is accidentally submitted multiple times.
Best Practices
Validate Bank Information: Verify routing and account numbers before submitting to reduce failed payments
Store Payment IDs: Save the returned payment ID for status checking and reconciliation
Handle Async Nature: ACH is asynchronous - implement webhooks or polling to track payment status
Collect Customer Consent: Ensure you have proper authorization to debit the customer’s account
Use miscData Field: Store additional context like customer email, IP addresses for fraud prevention and customer support
Next Steps
Get Payment Status Check the status of your ACH payment
Refund Payment Learn how to refund an ACH payment