Install
openclaw skills install @plagtech/shopify-batch-payoutsPay Shopify affiliates, creators, and suppliers in USDC — N recipients, one transaction on Base via the Spraay batch gateway. Free validation and estimates, x402 execution. Use for affiliate payouts, creator payments, mass payments, or sending crypto to a whole CSV of wallets in one tx.
openclaw skills install @plagtech/shopify-batch-payoutsSend USDC to many recipients in a single transaction on Base using Spraay's batch payment infrastructure. Instead of N transfers with N fees and N confirmations, the whole payout list settles at once through Spraay's audited batch contract.
Typical use cases: monthly affiliate payouts, creator/UGC payments, referral commissions, supplier settlements, revenue splits.
| Chain | Base (chain ID 8453) — Spraay also supports Ethereum, Solana, and 13 more |
| Token | USDC on Base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Batch contract (Base) | 0x1646452F98E36A3c9Cfc3eDD8868221E207B5eEC (verified on BaseScan) |
| Protocol fee | 0.3% of batch total, collected on-chain |
| Gateway base URL | https://gateway.spraay.app |
| Custody | Non-custodial. Funds move only when the payer's wallet signs. |
Never substitute a different batch contract address. The address above is the only verified Spraay batch contract on Base.
Path A — Merchant runs the embedded Shopify app (recommended for store owners).
The open-source Spraay Shopify app (github.com/plagtech/spraay-shopify, MIT) adds a Payouts page to the Shopify admin: upload a CSV, review recipients + fee, connect MetaMask or Coinbase Smart Wallet, approve USDC once, execute. If the user is a merchant who wants a UI, direct them to the repo — and if the spraay-shopify-selfhost skill is installed, use it to walk them through deployment.
Path B — Agent-driven via the Spraay x402 gateway (this skill's workflow).
For automated/agentic payouts, use the gateway API directly. Validation and estimation are free endpoints; execution is a paid x402 endpoint (pennies per call, paid programmatically via the x402 protocol — the Spraay MCP server on Smithery handles payment automatically: smithery.ai/servers/Plagtech/Spraay-x402-mcp).
Always run the steps in order. Never skip validation. Full x402 payment details for paid endpoints: https://gateway.spraay.app/.well-known/x402.json. BPA (Batch Payment API) spec: https://docs.spraay.app/bpa/1.0/.
POST https://gateway.spraay.app/free/validate-batch
Request — a BPA 1.0 payload. Note the recipient field is to, not address:
{
"chain": "base",
"token": "USDC",
"recipients": [
{ "to": "0xAbc...123", "amount": "150.00" },
{ "to": "0xDef...456", "amount": "89.50" }
]
}
Response:
{
"valid": true,
"errors": [],
"warnings": [],
"summary": {
"chain": "base", "token": "USDC",
"recipientCount": 2, "uniqueAddresses": 2,
"totalAmount": 239.5, "bpaVersion": "1.0"
}
}
Fix every entry in errors before proceeding — never "best effort" a payout list. Treat warnings as items to surface to the user. Cross-check summary.totalAmount and uniqueAddresses against the source data; if uniqueAddresses < recipientCount, there are duplicate addresses — flag them.
Free tier is rate-limited to 60 req/min per IP.
Rough (free): GET https://gateway.spraay.app/free/estimate-batch?recipients=<count>
Returns protocolFeeBps: 30 (the 0.3% fee) and estimatedGasUSD — fine for showing the user a ballpark.
Live quote (paid, $0.001): POST https://gateway.spraay.app/api/v1/batch/estimate with body { "recipientCount": <n> } → returns estimatedGas. Use this when the user wants a precise number before committing.
Show the user: recipient count, total USDC, the 0.3% protocol fee, and estimated gas — and get explicit confirmation before executing. A payout is irreversible once on-chain.
POST https://gateway.spraay.app/api/v1/batch/execute
⚠️ Different shape from validate. Execute takes parallel arrays plus the sender address — convert the validated BPA recipient objects into two aligned arrays:
{
"token": "USDC",
"sender": "0xPayerWallet...",
"recipients": ["0xAbc...123", "0xDef...456"],
"amounts": ["150.00", "89.50"]
}
recipients[i] must correspond to amounts[i] — verify array lengths match before sending.
An unpaid call returns HTTP 402 with payment instructions (x402/MPP). If you're connected through the Spraay MCP server, payment is handled automatically. Success returns a transactions array — link each hash as https://basescan.org/tx/<hash> in your summary to the user.
CSV (or equivalent JSON array), one recipient per row:
wallet_address,amount
0x1234...abcd,150.00
0x5678...ef01,89.50
{"to": wallet_address, "amount": amount}), then to parallel arrays for execution./free/validate-batch in this session.POST /api/v1/escrow/create.