Products API CRUD

コア API を通じて製品を管理します。 https://api.licensechain.app/v1 Dashboard で編集できる同じフィールドを使用します (売り手の製品)これには、ポリシー URL、サードパーティの支払いパートナー オプション、および(サポートされているレベルの)配信設定が含まれます。

送信 Authorization: Bearer … ユーザー JWT またはアプリ API キーを使用します。多くの言語でのコピー&ペーストの例: API の例 (多言語).

エンドポイント

  • GET /v1/products — 製品をリストします (以下のページネーションとフィルター)
  • POST /v1/products — 作成 (必須: name, price;例のようにオプションのフィールド)
  • GET /v1/products/{id} — 一冊読んで
  • PUT /v1/products/{id} — 提供されたキーの完全な置き換え (PATCH と同じ検証)
  • PATCH /v1/products/{id} — 部分的な更新。省略されたキーは変更されません
  • DELETE /v1/products/{id} — 製品を参照するライセンスまたはサブスクリプションがない場合は削除します

リストクエリパラメータ

GET /v1/products?limit=20&offset=0&active=true&search=pro&sortBy=createdAt&sortDir=desc

limit (デフォルトは 20、最大 100)、offset、オプションの active (true/false)、search (製品名の大文字と小文字を区別しない部分文字列)、sortBy (createdAt | name | price)、sortDir (asc | desc)。

製品の作成(本体例)

Enterprise のみのフィールド (hideEmailautoRedirectlicenseEmailssendLicenseToCustomer) は、アカウントがEnterprise にない場合、403 を返します。定期的な請求には stripePriceIdRecurring が必要です。 cryptoPaymentsEnabled を無効にするには、Business または Enterprise が必要です。 API リポジトリの OpenAPI には、すべてのフィールドと制約がリストされています。

{
  "name": "Pro Monthly",
  "description": "Recurring access to premium feature set",
  "price": 49.99,
  "currency": "USD",
  "active": true,
  "successUrl": "https://merchant.example.com/pay/success",
  "cancelUrl": "https://merchant.example.com/pay/cancel",
  "helpUrl": "https://merchant.example.com/help",
  "supportUrl": "https://merchant.example.com/support",
  "termsUrl": "https://merchant.example.com/terms",
  "privacyUrl": "https://merchant.example.com/privacy",
  "refundUrl": "https://merchant.example.com/refund",
  "productType": "subscription",
  "billingType": "recurring",
  "interval": "month",
  "stripePriceIdRecurring": "price_1AbCdEfGhIjKlMn",
  "stripeTaxEnabled": true,
  "stripeIdentityRequired": false,
  "cryptoPaymentsEnabled": true,
  "hideEmail": false,
  "autoRedirect": false
}

製品を更新する

部分的な更新には PATCH を使用するか、変更するフィールドには PUT を使用します。リダイレクト URL は http または https で、最大 2000 文字である必要があります。

PATCH /v1/products/{id}
{
  "name": "Pro Monthly Updated",
  "price": 59.99,
  "active": true,
  "stripeTaxEnabled": true
}

製品の削除

DELETE /v1/products/{id}

ライセンスまたは顧客のサブスクリプションがまだ製品にリンクされている場合は、409 を返します。

応答形状

callbackSecret は新製品に対して発行され、電子メール非表示フローを有効にするときにローテーションされる可能性があります。これを Webhook 署名のシークレットとして扱います (支払い Webhook ガイドを参照)。一部の内部行またはレガシー行では、userIdnull になる場合があります。クライアントは所有者 ID の欠落を許容する必要があります。

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "userId": "user_123",
  "name": "Pro Monthly",
  "description": "Recurring access to premium feature set",
  "price": 49.99,
  "currency": "USD",
  "active": true,
  "successUrl": "https://merchant.example.com/pay/success",
  "cancelUrl": "https://merchant.example.com/pay/cancel",
  "helpUrl": "https://merchant.example.com/help",
  "supportUrl": "https://merchant.example.com/support",
  "termsUrl": "https://merchant.example.com/terms",
  "privacyUrl": "https://merchant.example.com/privacy",
  "refundUrl": "https://merchant.example.com/refund",
  "productType": "subscription",
  "billingType": "recurring",
  "interval": "month",
  "stripePriceIdRecurring": "price_1AbCdEfGhIjKlMn",
  "stripeTaxEnabled": true,
  "stripeIdentityRequired": false,
  "cryptoPaymentsEnabled": true,
  "hideEmail": false,
  "autoRedirect": false,
  "licenseEmails": [
    "licenses-a@merchant.example.com",
    "licenses-b@merchant.example.com"
  ],
  "sendLicenseToCustomer": true,
  "callbackSecret": "base64url_or_base64_secret_from_product_record",
  "createdAt": "2026-05-11T07:00:00.000Z",
  "updatedAt": "2026-05-11T07:00:00.000Z"
}