2.1 KiB
2.1 KiB
Backend Handoff Checklist: Marketplace Checkout and Entitlements
This checklist maps store behavior to required marketplace backend implementation.
Required Endpoints
GET /marketplace/offersGET /marketplace/offers/{offer_id}POST /marketplace/checkout/quotePOST /marketplace/checkout/confirmGET /marketplace/entitlements?wallet=...
Required Gate Behavior
- Quote endpoint must deny checkout when membership is not active.
- Confirm endpoint must verify quote policy hash and tx match.
- Entitlement state must default fail-closed for unknown values.
Store Dependency Mapping
- Store catalog requests
/marketplace/offers(fallback to local JSON until live). - Store quote action posts selected
offer_idand ownership wallet. - Optional payer wallet may differ and must include ownership proof.
- Store expects quote payload with tx execution fields.
- Store confirm path expects
entitlement_activeresponse.
Quote Response Requirements
quote_idwallet(ownership wallet)payer_wallet(optional)offer_idcurrencyamountoramount_atomic + decimalspolicy_hashexpires_attxexecution object or equivalent fields
Confirm Response Requirements
status = entitlement_activeentitlement_idoffer_idwallet(ownership wallet)payer_wallet(optional)tx_hashpolicy_hashactivated_at
Persistence Requirements
- Quote record with policy hash and expiry.
- Confirm record linked to tx hash and entitlement id.
- Entitlement lifecycle state with immutable issued event evidence.
Security Requirements
- Membership gate check on quote and confirm paths.
- Quote TTL enforcement.
- Tx chain, amount, and destination validation.
- Idempotent confirm handling for repeated tx hash submissions.
- Ownership wallet proof validation when payer wallet differs.
Done Criteria
- Store can request quotes for active members only.
- Confirm endpoint issues active entitlements deterministically.
- Entitlement listing endpoint returns current state records.
- API matches
docs/api/marketplace.openapi.yaml.