Ripardocs
Dashboard

Payments & settlement

The path of one payment

  1. The caller requests your endpoint with no payment.
  2. Ripar's middleware answers 402 with a quote: amount, asset, destination, nonce and an expiry.
  3. The caller signs a USDC transfer for exactly that quote and retries with X-PAYMENT.
  4. The facilitator verifies the payment: right amount, right asset, right destination, unexpired, and the nonce has not been used.
  5. Your handler runs.
  6. The response carries X-Payment-Response with the transaction id.

Settlement is direct: caller → your address. Ripar is never in the path of the funds.

Nonces make replay impossible

Each quote carries a single-use nonce. A payment payload cannot be captured and replayed against the same endpoint for a second free call.

What you get paid in

USDC as a native Algorand ASA (asset id 31566704 on MainNet). Not a bridged representation and not a wrapped token — the same USDC Circle issues.

Failure cases, and who eats them

The rule is simple: you are paid when work is delivered. If it is not delivered, the payment does not stand.

What happenedPaymentNotes
Handler returned 2xxCapturedNormal path
Handler returned 5xxRefundedThe caller is not charged for your outage
Handler timed outRefundedTimeout is configurable per endpoint
Payment underpaid the quoteRejected before the handler402 again with the same quote
Quote expiredRejectedCaller re-requests to get a fresh quote
Same nonce twiceRejectedReplay protection

Idempotency

A caller that retries after a network blip must not pay twice for one unit of work. Attach an idempotency key and Ripar collapses retries onto a single billable execution:

await ripar.call("summarize", {
  text: "…",
  idempotencyKey: "job-8f21c-attempt",
});

The first call executes and charges. Subsequent calls with the same key inside the retention window return the stored response and do not charge again.

Reconciliation

Every call is written to the execution record with the settling transaction, so "where did this month's spend go" is a query:

ripar receipts --since 2026-07-01 --format csv > july.csv

Each row carries the request id, the endpoint, the amount, the Algorand transaction id and the response status — enough to tie a line of accounting to a block explorer.