# Ticket Fairy direct AP2 receipts

Version: `2026-10-23`. Capability: `com.ticketfairy.www.ap2_receipts`.

This UCP extension delivers independently signed AP2 Checkout and Payment Receipts
for a buyer-approved purchase. Ticket Fairy verifies the mandates as Merchant and
as its owned Merchant Payment Processor. Stripe is the underlying payment service
provider. These are Ticket Fairy signatures, not Stripe or Link signatures.

## Negotiate before Create

Advertise this capability together with `dev.ucp.shopping.checkout` and
`dev.ucp.common.payment.ap2_mandate`, both at UCP `2026-08-25`. Both profiles must
include this exact receipt definition before the checkout is created:

```json
{
  "version": "2026-10-23",
  "spec": "https://www.ticketfairy.com/agentic/ap2-receipts/2026-10-23/spec.md",
  "schema": "https://www.ticketfairy.com/agentic/ap2-receipts/2026-10-23/schema.json",
  "extends": "dev.ucp.shopping.checkout"
}
```

The existing AP2 mandate lock, signed HTTP requests, buyer approval and offered
payment handler remain required. This capability supplies no payment credential
or new authority. A checkout created without it keeps its existing contract;
adding it to a later request does not upgrade that checkout.

Use the [owned AP2 handler](https://www.ticketfairy.com/api/v1/agentic/ucp/payment-handlers/ap2-spt/2026-08-25/spec.md)
for source acquisition, consent and the two mandates. The [response schema](schema.json)
defines the additive checkout overlay and decoded receipt claims. The supplemental
[OpenAPI document](openapi.json) describes existing GET and Complete delivery;
the [base UCP OpenAPI](https://ucp.dev/2026-08-25/services/shopping/rest.openapi.json)
continues to define the shopping service.

## Read the result

A negotiated Complete response can contain these members inside its existing
`ap2` object:

- `checkout_receipt`: a compact ES256 JWT for the final checkout outcome.
- `payment_receipt`: a separate compact ES256 JWT for the final payment outcome.
- `receipt_delivery`: separate `checkout` and `payment` availability values.

Availability is `available`, `pending` or `unavailable`. `available` includes its
matching JWT. `pending` means the relevant outcome or evidence is not yet ready;
read the same authenticated checkout after its retry instructions.
`unavailable` means the required receipt evidence is unavailable. It does not
mean a successful payment failed and is not permission to make another payment.
These values describe delivery. Signed receipts have only `Success` or `Error`,
never a fabricated `Pending` outcome.

A successful Payment Receipt requires the original succeeded payment, its real
Stripe charge ID and a nonempty card-network transaction reference. Its
`payment_id` is the stable native payment-attempt reference;
`psp_confirmation_id` is the original charge ID; `network_confirmation_id` is the
network reference from that same charge. A provider can omit the network
reference. In that case delivery is `unavailable`, without a false Payment Error
or another charge.

Payment success can precede ticket fulfilment. A successful Checkout Receipt is
issued only after the native checkout and its required ticket-delivery effects
have completed. Continue reading the checkout until it confirms the completed
order before telling the buyer their tickets are ready.

The authenticated platform receives the receipts through the existing UCP
response. REST, dedicated A2A 0.3 and root A2A 1.0 carry the same nested receipt
values. An independent credential provider needs its own agreed forwarding
contract; this extension does not invent a callback or establish that Link acts
as an AP2 credential provider.

## Verify each JWT

Require `alg: ES256`, `typ: JWT` and a trusted `kid` from Ticket Fairy's root UCP
`keys`. Verify the signature and require `iss: https://www.ticketfairy.com`.
Retain the validated public verification key with the receipt for later checks.
Do not follow an untrusted `jku`, substitute an arbitrary key or treat a decoded
JWT as verified evidence.

Each receipt has `status`, `iss`, `iat` and `reference`. This profile also includes
`result: success` for `status: Success`, or `result: error` for `status: Error`.
Checkout Success includes the canonical native `order_id`. Payment Success
includes the payment and confirmation IDs described above. Error receipts contain
a stable `error` code and a safe `error_description`; provider exceptions and
private payment credentials are not included.

The reference profile is `ap2-v0.2-final-sd-jwt-sha256`. For each mandate separately,
take the exact final received SD-JWT segment after the last `~~` delegation
separator. Hash that segment, including selected disclosures and its final `~`,
with SHA-256 as declared by `_sd_alg`, then base64url-encode the digest without
padding. Bind a Checkout Receipt to its Checkout Mandate and a Payment Receipt
to its Payment Mandate. Existing full-presentation security digests have a
different purpose and are not replaced.

This follows the normative AP2 authorization receipt reference. The v0.2 Python
SDK helper's comment instead suggests hashing the bare leaf JWT. This profile
explicitly uses the final SD-JWT bytes; do not silently try both reference rules.

## Retry and recover

Keep the original Complete body, `Idempotency-Key`, checkout and payment identity.
An exact Complete retry returns its retained response. It does not refresh a
receipt timestamp, sign another JWT, or take another payment. A subsequent
current authenticated GET can deliver receipts that became available later;
it does not rewrite the original Complete response. A retained receipt is replayed
with the same signed bytes even after the active signing key changes.

A definitive rejection of an actual supplied mandate with a determinable exact
reference can return HTTP 400 with signed Error receipts after authentication and
checkout-ownership checks. A malformed mandate whose reference cannot be determined
retains the unsigned parse refusal; no substitute hash is invented.
A Payment Error is supplied only when its Payment Mandate can be identified.
Its prepayment `payment_id` uses `ap2_correlation_` followed by the existing
operation reference; no payment attempt is created just to supply that identifier.
The rejected operation is terminal. Start a new checkout for corrected approval;
reusing the original operation returns its original rejection.

A missing mandate keeps the existing unsigned `mandate_required` refusal.
Unknown, foreign or unauthenticated requests retain their existing concealed
responses. Every issuer and holder signature, delegation hash binding,
and audience/nonce binding must pass before a signed semantic refusal can be
issued. An invalid signature or delegation remains unsigned and concealed even
when another signed claim has expired or uses an unsupported constraint. Bank authentication, processing or an uncertain result continue the
original payment and do not produce a false Error receipt. Temporary receipt
signing or delivery failures do not authorise a replacement payment.

## Scope and sources

This profile covers the supported direct, buyer-approved AP2 purchase and receipt
exchange. It does not advertise autonomous budgets, recurring mandates, User VDC
issuance, an unverified wallet integration or provider certification.

The pinned sources were checked on 23 October 2026:

- [AP2 v0.2.0 roles and receipts](https://github.com/google-agentic-commerce/AP2/blob/v0.2.0/docs/ap2/specification.md).
- [AP2 v0.2.0 authorization and receipt references](https://github.com/google-agentic-commerce/AP2/blob/v0.2.0/docs/ap2/agent_authorization.md).
- [UCP 2026-08-25 AP2 mandate extension](https://github.com/Universal-Commerce-Protocol/ucp/blob/v2026-08-25/docs/specification/payment/extensions/ap2-mandates.md).
- [Checkout Receipt schema](https://github.com/google-agentic-commerce/AP2/blob/v0.2.0/code/sdk/schemas/ap2/checkout_receipt.json)
  and [Payment Receipt schema](https://github.com/google-agentic-commerce/AP2/blob/v0.2.0/code/sdk/schemas/ap2/payment_receipt.json).
