Documentation

Batch settlement

Batch settlement combines multiple relayed_intent payments into a single relay call. Each payer signs their own PaymentIntent; your backend collects signatures and calls POST /payments/settlements/intents/batch. All payments settle atomically with flow relayed_batch, one transaction, multiple payment.settled webhooks. Group project energy, but it actually ships.

Need machine-readable request/response bodies for your AI or codebase? Download this page as plain Markdown.

When should I use this?

  • Customers sign multiple payment intents (cart line items, split invoices).
  • You want one on-chain transaction for multiple authorized payments.
  • Gas efficiency matters for high-volume intent-based checkout.

Why use Videpay?

  • Atomic settlement, all intents in the batch succeed or none do.
  • Same fee structure as individual intent relays.
  • Videpay also auto-batches queued intents on the relay lane when thresholds are met.

Multi-item cart

A buyer signs three PaymentIntents for cart items. Your backend collects all signatures and calls POST /payments/settlements/intents/batch with batchReference cart-1042. One transaction settles all three; three payment.settled webhooks arrive with flow relayed_batch.

Before you start

  • Secret API key
  • Prepared relayed_intent payment per item (POST /payments/settlements/intents/prepare)
  • Valid EIP-712 signature per payment from each payer wallet

How batch settlement works

Auto-batching on the relay lane

When you relay intents individually via POST /payments/settlements/intents/relay, Videpay may combine queued intents on the same settlement contract into an automatic relayed_batch if the lane threshold or wait window is reached. Explicit batch calls give you immediate control over grouping and batchReference.

  1. Prepare one relayed_intent payment per line item or payer authorization.
  2. Collect EIP-712 signatures from each payer (USDC approval required per wallet).
  3. Call POST /payments/settlements/intents/batch with 1–50 { paymentId, signature } pairs.
  4. Videpay submits one on-chain batch transaction and emits payment.settled per payment.

Relay batch settlement

Submit all signatures in one request. Payments must be prepared relayed_intent records on the same chain and settlement contract.

FieldTypeRequiredDescription
businessIduuidNoTarget business. Omit when your API key is scoped to one business.
chainstringNoChain scope for settlement APIs (base, polygon, etc.). Required for wallet direct/intent prepare. Sandbox resolves to testnets automatically.
batchReferencestringNoOptional reconciliation label for the batch (max 100). Auto-generated when omitted.
paymentsarrayYesSigned intents to settle atomically. 1–50 items; each item requires paymentId and signature.
payments[].paymentIduuidYesPrepared relayed_intent payment ID.
payments[].signaturehex stringYesEIP-712 signature for that payment intent.
POST/payments/settlements/intents/batch

Relay multiple signed payment intents atomically. Requires secret API key.

Headers

headers
01x-api-key: sk_AbCdEfGhIj_XyZ1234567890abcdefghijklmnopqrstuvwxyz01234502Content-Type: application/json

Request body

request.json
01{02  "batchReference": "batch-cart-001",03  "chain": "base",04  "payments": [05    {06      "paymentId": "pst_4a8f2c1d9e7b6a3f5c2d8e1b0a9f7c6d",07      "signature": "0x..."08    },09    {10      "paymentId": "pst_bbb2c1d9e7b6a3f5c2d8e1b0a9f7c6e",11      "signature": "0x..."12    }13  ]14}

Invalidate an unused intent

When a prepared intent will not be used, prepare an on-chain nonce invalidation transaction for the payer to sign. Only relayed_intent payments that have not settled can be invalidated.

Settled intents cannot be invalidated

Invalidation is only available before settlement. If the intent was already relayed and settled, use POST /payments/refund on the Refunds page instead.

FieldTypeRequiredDescription
businessIduuidNoTarget business. Omit when your API key is scoped to one business.
chainstringNoChain scope for settlement APIs (base, polygon, etc.). Required for wallet direct/intent prepare. Sandbox resolves to testnets automatically.
POST/payments/settlements/intents/pst_4a8f2c1d9e7b6a3f5c2d8e1b0a9f7c6d/invalidate/prepare

Prepare invalidation of an unused payment intent. Requires secret API key.

Headers

headers
01x-api-key: sk_AbCdEfGhIj_XyZ1234567890abcdefghijklmnopqrstuvwxyz01234502Content-Type: application/json

Webhooks you'll receive

Register a webhook endpoint and verify the X-Protocol-Signature header on every delivery before fulfilling orders or updating your database.

Webhookpayment.settled

Sent when funds are confirmed on-chain and credited to your merchant balance.

Delivery headers

webhook-headers
01Content-Type: application/json02User-Agent: Protocol-Webhooks/1.003X-Protocol-Event: payment.settled04X-Protocol-Delivery: wev_1a2b3c4d-5e6f-7890-abcd-ef123456789005X-Protocol-Business-Id: a1b2c3d4-e5f6-7890-abcd-ef123456789006X-Protocol-Attempt: 107X-Protocol-Signature: sha256=abc123def456...