Charges are ACH debit transactions that require proper customer authorization. Understanding ACH basics helps ensure compliant implementation and reduces return rates.
What You’ll Learn
This comprehensive guide will walk you through:- Creating charges with required fields and optional configurations
- Understanding the payment status lifecycle and when charges can be modified
- Implementing balance verification to reduce NSF failures
- Handling failures and returns with specific reason codes
- Managing charges through hold, release, and cancellation operations
- Testing charge scenarios in sandbox before production
Charges require a
paykey
- a token representing a verified bank account. Learn about connecting bank accounts in the Bridge guide.The Charge Object
A charge represents a debit transaction with comprehensive status tracking and metadata:Core Fields
Field | Type | Description |
---|---|---|
id | string | Unique charge identifier |
paykey | string | Token for customer’s bank account |
amount | integer | Amount in cents (10000 = $100.00) |
currency | string | Currency code (USD only) |
description | string | Statement descriptor |
payment_date | string | Processing date (YYYY-MM-DD) |
status | string | Current payment status |
status_details | object | Detailed status information |
external_id | string | Your unique reference |
consent_type | string | How consent was obtained |
trace_number | string | ACH network tracking number |
funding_ids | array | Related settlement events |
Creating a Charge
View detailed schema and request information on the Create a Charge API ReferenceRequired Parameters
Payment key for the customer’s verified bank account. Obtained via Bridge flow.
Amount to charge in cents. Must be positive. Example:
10000
for $100.00ISO 4217 currency code. Currently only
"USD"
is supported.Description appearing on bank statements. Maximum 80 characters. Be clear and recognizable.
Date to process payment (YYYY-MM-DD). Can be today or future-dated up to 90 days.
How customer consent was obtained:
"internet"
- Online or mobile app authorization"signed"
- Signed agreement or contract"telephone"
- Phone authorization
Learn more about authorization requirements and the difference between internet vs. contract authorization for ACH compliance.
Customer device information for fraud prevention.
Your unique identifier for this charge. Must be unique across all charges. Used for idempotency.
Processing configuration options.
Optional Parameters
Custom key-value pairs. Maximum 20 keys, 40 characters per key/value.
Payment Status Lifecycle
Charges progress through these statuses:Status | Description | Can Modify? |
---|---|---|
created | Initial state, awaiting verification | ✅ Yes |
scheduled | Verified and queued for processing | ✅ Yes |
pending | Sent to payment network | ❌ No |
paid | Successfully completed | ❌ No |
failed | Declined before funding | ❌ Terminal |
reversed | Returned after funding | ❌ Terminal |
cancelled | Stopped before network submission | ❌ Terminal |
on_hold | Paused for review | ⚠️ Depends |
Critical: Once a charge reaches
pending
status, it has been submitted to the payment network and CANNOT be stopped, held, or cancelled.Status Details
Every status change includes detailed information:Field | Description |
---|---|
message | Human-readable explanation |
reason | Machine-readable reason code |
source | Where the status change originated |
code | ACH return code (when applicable) |
changed_at | When the status changed |
Common Operations
Retrieve a Charge
Update a Charge
Update charges increated
or scheduled
status:
Cancel a Charge
Cancel charges before they reachpending
status:
Place on Hold
Pause a charge for review (only increated
or scheduled
status):
Release a Hold
Release user-initiated holds only:System holds (
watchtower
source) cannot be released via API. They require manual review in the dashboard.Balance Verification
Balance checks help reduce NSF returns:Mode | Behavior | Use Case |
---|---|---|
enabled | Attempts check, proceeds if unavailable | Recommended - Best balance |
required | Must verify balance to proceed | High-value transactions |
disabled | No verification attempted | Future-dated charges |
Balance verification is part of Straddle’s account validation process that helps reduce NSF returns and improve payment success rates.
required
will fail charges if:- The paykey was created with manual bank account entry
- The bank doesn’t provide balance information
- Balance service is temporarily unavailable
Handling Failures
When charges fail, checkstatus_details
for specific information:
Testing in Sandbox
Usesandbox_outcome
in the config to simulate scenarios:
"paid"
- Successful charge"failed_insufficient_funds"
- NSF failure"on_hold_daily_limit"
- Risk hold"reversed_customer_dispute"
- Post-funding reversal
Webhooks
Set up webhooks to receive real-time charge updatesBest Practices
Use Idempotency
Always include a unique
external_id
to prevent duplicate chargesMonitor Status Changes
Set up webhooks to track payment lifecycle in real-time
Handle Failures Gracefully
Implement retry logic for transient failures like NSF
Test Thoroughly
Use sandbox to test all failure scenarios before production