Problem
Currently, to void or commit multiple inflight transactions, we need to make N separate API calls:
PUT /transactions/inflight/hold_001 → void
PUT /transactions/inflight/hold_002 → void
PUT /transactions/inflight/hold_003 → void
... N calls
This is inefficient for batch operations like:
- Cron jobs expiring multiple holds at once
- Bulk cancellations
- Mass void/commit processing
Proposed Solution
Add a new bulk endpoint:
PUT /transactions/inflight/bulk
Request Body
{
"transaction_ids": ["txn_001", "txn_002", "txn_003"],
"status": "void"
}
Response
{
"batch_id": "batch_xyz",
"status": "completed",
"succeeded": 148,
"failed": 2,
"errors": ["txn_099: already voided", "txn_123: not found"]
}
Implementation Suggestion
Following the existing ProcessTransactionInBatches pattern with worker pools:
- Add BulkInflightUpdate model in model/transaction.go
- Add route transactions.PUT("/inflight/bulk", a.BulkUpdateInflightStatus) in api/api.go
- Add handler in api/transactions.go that validates and delegates to service
- Add BulkUpdateInflight method in transaction.go using existing VoidWorker/CommitWorker
This reuses the existing concurrent processing infrastructure.
Use Case
Any application with scheduled expiration of inflight holds needs to void them in bulk. Individual API calls create unnecessary overhead when processing 100+ transactions.
Happy to submit a PR if this feature is accepted!
Problem
Currently, to void or commit multiple inflight transactions, we need to make N separate API calls:
This is inefficient for batch operations like:
Proposed Solution
Add a new bulk endpoint:
Request Body
{ "transaction_ids": ["txn_001", "txn_002", "txn_003"], "status": "void" }Response
{ "batch_id": "batch_xyz", "status": "completed", "succeeded": 148, "failed": 2, "errors": ["txn_099: already voided", "txn_123: not found"] }Implementation Suggestion
Following the existing ProcessTransactionInBatches pattern with worker pools:
This reuses the existing concurrent processing infrastructure.
Use Case
Any application with scheduled expiration of inflight holds needs to void them in bulk. Individual API calls create unnecessary overhead when processing 100+ transactions.
Happy to submit a PR if this feature is accepted!