Skip to main content
GET /v1/mandates/{mandate_id}/evidence returns a flattened JWS with media type application/jose+json.
Verify the signature before decoding or trusting the evidence payload. Pin the format and ES256, resolve the protected kid only from Attesso’s JWKS, and reject every mismatch.

The signed envelope

  • protected decodes to {"alg":"ES256","kid":"<key id>"}.
  • payload decodes to the evidence JSON: schema, generated_at, organization_id, mandate, and events.
  • signature is an ES256 (ECDSA P-256) signature over the bytes protected + "." + payload. The signature is the raw 64-byte R || S form (IEEE P1363), not DER.

Node.js verification (no dependencies)

Fetch the JWKS from GET /.well-known/jwks.json (no API key required). The dsaEncoding: 'ieee-p1363' option is required: Node defaults to DER, but Attesso signs with raw R || S.

Go verification (stdlib only)

Python verification (stdlib + cryptography)

What the signature covers

  • The immutable Mandate and policy digest
  • For a recurring Mandate, the authorized terms digest and the terms it covers
  • The verified approval proof
  • Every proposed action and Attesso decision, including the period each approved charge was attributed to
  • Reservation, commit, cancellation, revocation, and expiry events
  • Source-labelled lifecycle assertions supplied by your platform

Event shape

Each event is {sequence, type, resource_version, payload, created_at}. Decision data lives inside payload, so a charge’s period is event.payload.period_index, not event.period_index.
Timestamps carry six fractional digits. Date.parse keeps milliseconds, so compare instants rather than strings when you mix precisions.

Reconstructing per-period spend

A recurring Mandate carries execution_mode, the period terms (period_unit, period_days, period_count, period_max_amount, period_currency, period_anchor), and authorized_terms_digest. Every authorization.created event for an approved charge carries period_index. Together those are enough to rebuild what was spent in each period without reimplementing the cadence arithmetic: take the terms from mandate, and sum the payment amount on each allowed event by its period_index. Compare the result against period_max_amount to check that no period was overspent, and against period_count to check that no charge fell outside the authorized term. authorized_terms_digest is the value the approval was bound to. Recompute it over the terms above and the mandate’s valid_from and valid_until, in the order the mandate lists them, newline-separated after the domain line attesso.authorized-terms.v1, and compare. A mismatch means the authority changed after it was approved, so treat it as a verification failure.

Verifying single-use commitments

An authorization created under the single-use requirement records a commitment on its authorization.created event: the SHA-256 of a domain line plus a random opening you keep, so Attesso never sees the opening until the commit reveals it. The commit carries the opening on its authorization.committed event. Check:
  • Recompute SHA-256("attesso:authorization:commitment:v1\n" || opening) over the opening’s raw bytes (not its hex text) and compare against the commitment’s hex digest. A mismatch means the commit does not belong to the creation it claims.
  • A committed event without a well-formed opening, or more than one committed event for one authorization, is a failure.
  • Commits recorded before the requirement carry no commitment on their creation and are labelled historical, not failures.
The runnable script examples/verify-evidence.js performs these checks after the signature verifies and reports them in its summary:

Verifying refund reports

An authorization.reported event is a refund or other external-report claim your platform submitted; Attesso records it and it never changes state. The single-use checks above do not cover it, so check its provenance:
  • Every authorization.reported payload carries "source": "integrator_reported". Any other source is a failure: the event is not a claim your platform made.
  • The cumulative report amounts for one authorization never exceed the committed amount on its payment.
The runnable script examples/verify-evidence.js counts report events separately and fails any unlabelled one.
Evidence is not a payment receipt or proof that an external provider performed an action. It distinguishes Attesso-verified events from facts your platform reported.
Store the original signed envelope when you need a portable audit artifact. Treat any verification failure as a security incident.