列出产品

列出应用下的所有 Product。用于控制台同步与 catalog 管理。

GET/v1/products

参数

参数类型说明
Authorization必填stringBearer {secret_key}
app_id必填string应用 ID。

请求示例

HTTP
GET /v1/products?app_id=app_01KFOCUSIOS HTTP/1.1
Host: api.subhub.dev
Authorization: Bearer sk_live_neostudio_8f3k2m9x4l0p7q2r5s8u1v

响应示例

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

{
  "object": "list",
  "data": [
    {
      "id": "prod_01PROMO",
      "name": "Premium 首月优惠",
      "identifier": "com.neo.focustimer.promo",
      "entitlement_identifier": "premium",
      "type": "subscription",
      "status": "active"
    },
    {
      "id": "prod_02PROYR",
      "name": "Premium 年费",
      "identifier": "com.neo.focustimer.pro.yearly",
      "entitlement_identifier": "premium",
      "type": "subscription",
      "status": "active"
    }
  ]
}

代码示例

var components = URLComponents(string: "https://api.subhub.dev/v1/products")!
components.queryItems = [URLQueryItem(name: "app_id", value: "app_01KFOCUSIOS")]