获取产品

获取 Product 详情及其映射的 Entitlement identifier。Product 为 store-agnostic 目录条目。

GET/v1/products/{product_id}

参数

参数类型说明
Authorization必填stringBearer {secret_key}
product_id必填string产品 ID。

请求示例

HTTP
GET /v1/products/prod_01PROMO HTTP/1.1
Host: api.subhub.dev
Authorization: Bearer sk_live_neostudio_8f3k2m9x4l0p7q2r5s8u1v

响应示例

HTTP
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "prod_01PROMO",
  "app_id": "app_01KFOCUSIOS",
  "name": "Premium 首月优惠",
  "identifier": "com.neo.focustimer.promo",
  "entitlement_identifier": "premium",
  "type": "subscription",
  "status": "active",
  "created_at": "2025-11-10T10:00:00.000Z"
}

代码示例

let url = URL(string: "https://api.subhub.dev/v1/products/prod_01PROMO")!
var request = URLRequest(url: url)
request.setValue("Bearer \(secretKey)", forHTTPHeaderField: "Authorization")