先准备当前 App / 环境的 Product,创建并发布 Offering。解析需要 entitlements:read;按需要选择 Current 或固定 Version。
Offering 配置与 JSON 接入
组织三层 Product 结构,发布并解析固定 Offering Version。
SDK 示例对应当前 API。核对匹配版本与 HTTP 接入方式
开始前准备
Offering
An Offering is an ordered hierarchy of direct Autumn Product references, metadata and a published Version. The root is level 0. Product leaves occupy levels 1–3; document-local groups occupy levels 1–2. There is no Package entity or additional pricing authority.
- 在 Offerings 创建配置,从当前 App/环境的 Product 目录选择最多 20 个不同 Product。可拖入分组,整个分组移动时保留其子树。
- 草稿可保留空分组;发布前每个分组必须包含 Product。重复 Product、重复 group key、第四层会被拒绝。
- 发布后按需设为 Current。读取必须显式选择 Current、ID、lookup key 或固定 Version;没有 Current 时不会返回整个目录。
读取并自行展示
需要 entitlements:read。浏览器身份来自 Customer Token,不传 customerId;可信后端可以显式传已验证 Customer。返回 offering、candidates、availability 和可选 check。缺少渠道绑定或商业能力尚未开放时,按 availability/reason 禁用对应 Product。
读取 Offering 不购买、不发放 Entitlement,也不创建 Funnel 或 Paywall。Product 条款与发布证据不一致时须重新报价或更新 Offering,不能展示旧价再执行新价。
// SDK variant: grow is an identified client from the Browser SDK reference.const result = await grow.resolveOffering({ selector: { type: "current" }, commerce: { provider: "stripe", currency: "USD" },});const { offering, candidates, availability } = result;// Preserve offering.id (the Version), offering.offeringId and document.items.// Build your UI from the hierarchy; disable Products whose availability is false.// Resolve again by Version when restoring the same selection:await grow.resolveOffering({ selector: { type: "version", versionId: offering.id }, commerce: { provider: "stripe", currency: "USD" },});对应 HTTP 接口
可以在已完成的 HTTP 接入上调用这些操作。每页参考列出完整请求、响应和凭据要求;有匹配 SDK 时,也可使用本页 SDK 示例。
| 操作 | HTTP | 权限 |
|---|---|---|
| resolveOffering | POST /api/v1/offerings/resolve | entitlements:read |
操作与权限
resolveOffering
- HTTP
- POST /api/v1/offerings/resolve
- 权限
- entitlements:read
完成后检查
预期结果
返回固定 Offering Version、原层级和逐 Product 可用性;不可用项禁用,自己渲染 UI 或交给独立 Paywall。