3.1 KiB
3.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=...
All marketplace endpoints require authenticated app/session context.
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.
- Quote/confirm must deny cross-boundary paid execution when
org_root_iddoes not match active suite entitlement. availability_state=parkedmust block paid execution paths.- Quote generation must fail closed when entitlement contract is unconfigured (
entitlement_contract_unconfigured).
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 sends org-boundary context (
org_root_id,principal_id,workspace_id) when available. - 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 + decimalstotal_amountortotal_amount_atomic + decimalsmembership_activation_includedline_itemswith transparent breakdown (license + optional membership)policy_hashexpires_attxexecution object or equivalent fieldsorg_root_id(when workspace-bound)availability_stateandaccess_classsnapshot
Confirm Response Requirements
status = entitlement_activeentitlement_idoffer_idwallet(ownership wallet)payer_wallet(optional)tx_hashpolicy_hashactivated_atorg_root_idandprincipal_id(when provided)availability_statesnapshot
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.
- Bundled membership component must be explicit in quote line items when included.
- Continuity policy enforcement: growth actions blocked when
availability_state=continuity.
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.