Skip to main content
POST
/
payments
{
  "errors": [
    {
      "status": "400",
      "title": "Bad Request",
      "detail": "Invalid routing number",
      "source": {
        "pointer": "/data/attributes/bank/routingNumber"
      }
    }
  ]
}

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

HeaderValueRequired
x-api-keyYour API key from onboardingYes
AuthorizationBearer {appToken}Yes
appIdYour application IDYes
Content-Typeapplication/jsonYes

Request Body

data
object
required
Container for API data
data.requestId
string
UUID for idempotency. If provided, must be in valid UUID format. Optional but recommended for preventing duplicate transactions.
data.type
string
required
Must be "payments"
data.attributes
object
required
Container for payment attributes
data.attributes.paymentType
string
required
Must be "ACH" for ACH payments
data.attributes.merchantId
string
required
The merchant account identifier
data.attributes.miscData
string
Optional JSON string containing additional metadata like email, IP addresses, or custom data
data.attributes.StandardEntryClassCode
string
required
Must be "WEB" for internet-initiated ACH transactions
data.attributes.bank
object
required
Bank account information
data.attributes.transaction
object
required
Transaction details

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
data
object
Container for response data

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 -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

{
  "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.
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

  1. Validate Bank Information: Verify routing and account numbers before submitting to reduce failed payments
  2. Store Payment IDs: Save the returned payment ID for status checking and reconciliation
  3. Handle Async Nature: ACH is asynchronous - implement webhooks or polling to track payment status
  4. Collect Customer Consent: Ensure you have proper authorization to debit the customer’s account
  5. 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