Summary
Currently, paying multiple Request Network invoices requires executing a separate on-chain transaction for each invoice. For businesses processing 10-50+ invoices per month, this means:
- N separate
approve + transfer calls
- N× gas costs
- Manual wallet interaction per invoice
- Extended settlement time
Proposal
Add batch payment support that allows users to settle multiple USDC invoices in a single on-chain transaction using multi-recipient batch transfer contracts.
How it works:
- Fetch pending invoices from Request Network (filtered by payer address + currency)
- Validate all recipients and amounts
- Execute a single
batchTransfer(token, recipients[], amounts[]) call
- All payments are atomic — either all succeed or all revert
Gas savings:
- 10 invoices on Base: ~$0.10 individually → ~$0.02 batched (80% savings)
- 30 invoices on Ethereum: ~$45 individually → ~$10 batched (78% savings)
Implementation
I've built an integration module (spraay-request-network) that bridges Request Network's @requestnetwork/request-client.js with Spraay Protocol's batch transfer contracts deployed across Base, Ethereum, Arbitrum, Polygon, BNB Chain, and Avalanche.
The module provides:
SpraayBatchPayer.payInvoices() — pay specific invoices by ID
SpraayBatchPayer.payPendingInvoices() — auto-discover and batch-pay all pending USDC invoices
batchPayViaGateway() — server-side / AI agent batch payments via API
I'd like to submit a PR adding a batch payment example to the monorepo and a reference to this integration in the documentation.
Use Cases
- Accounts payable automation — Settle a month's vendor invoices in one click
- Payroll — Pay all contractor invoices in a single batch
- DAO treasury — Batch-process approved grant payments
- AI agents — Programmatic invoice settlement via x402 micropayments
References
Happy to discuss the approach and adjust based on your feedback. Would love to align this with the existing @requestnetwork/payment-processor patterns.
Summary
Currently, paying multiple Request Network invoices requires executing a separate on-chain transaction for each invoice. For businesses processing 10-50+ invoices per month, this means:
approve+transfercallsProposal
Add batch payment support that allows users to settle multiple USDC invoices in a single on-chain transaction using multi-recipient batch transfer contracts.
How it works:
batchTransfer(token, recipients[], amounts[])callGas savings:
Implementation
I've built an integration module (spraay-request-network) that bridges Request Network's
@requestnetwork/request-client.jswith Spraay Protocol's batch transfer contracts deployed across Base, Ethereum, Arbitrum, Polygon, BNB Chain, and Avalanche.The module provides:
SpraayBatchPayer.payInvoices()— pay specific invoices by IDSpraayBatchPayer.payPendingInvoices()— auto-discover and batch-pay all pending USDC invoicesbatchPayViaGateway()— server-side / AI agent batch payments via APII'd like to submit a PR adding a batch payment example to the monorepo and a reference to this integration in the documentation.
Use Cases
References
Happy to discuss the approach and adjust based on your feedback. Would love to align this with the existing
@requestnetwork/payment-processorpatterns.