> ## Documentation Index
> Fetch the complete documentation index at: https://docs.utage-system.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 商品詳細更新

> 商品詳細を更新します。指定したフィールドのみを更新する部分更新で、リクエストに含めなかったフィールドは既存の値が維持されます（`chat_notify_token` / `chat_notify_webhook_url` も省略時は既存値を維持し、null でクリアします）。

項目の意味と組み合わせの制約は商品詳細作成と同じですが、制約はリクエストで値が変わるフィールドに関わるものだけを検証します（取得した値をそのまま送り返すことができます。ただし `trial_days` が負の値の既存データは 0 以上の範囲で検証されるため、0 以上に直してから送ります）。`payment_provider` は値が変わるときだけ enum を検証し、`name` に null を指定できるのは既存の値が null のときだけです。

- 購入実績のある商品詳細は `payment_type` / `payment_provider` を変更できません（`422` `validation_error`）
- `payment_setting_id` に null を指定するとデフォルトの決済連携設定に差し替えます
- `payment_provider` / `payment_setting_id` / `stripe_plan_id` / `stripe_test_plan_id` を変更したとき、または `charge_type` を `multiple` / `subscription` に変更したときは、Stripe プランの実在を検証します。`payment_provider` / `use_different_first_amount` / `amount` / `recurring_amount` / `payment_setting_id` のいずれかを変更し、更新後が `stripe` + `use_different_first_amount=true` で金額に差がある場合は Stripe のクーポンを作り直します。決済連携設定にシークレットキーが無い場合は `400`（`stripe_not_configured`）です
- 保存時の補正（`installment_count` / `trial_days` / `registration_form_id` のクリア、`is_hidden=true` のときの表記・販売期間のクリア、送信元方式による `*_from_mail` / `*_reply_to_mail` のクリア、販売期間の秒の正規化）は作成と同じです。`*_from_mail` を null にすると、システム標準の送信元が設定された環境では次回取得時の `*_from_address_type` が `system` になります


`PATCH`

```
https://api.utage-system.com/v1/products/{product_id}/details/{detail_id}
```


## OpenAPI

````yaml PATCH /products/{product_id}/details/{detail_id}
openapi: 3.0.3
info:
  title: UTAGE API
  description: >
    UTAGEのパブリックAPIです。ファネル、メール・LINE配信、会員サイト、イベント・予約、決済、メディアなどのリソースをプログラムから操作できます。


    ## 認証

    すべてのリクエストにAPIキーによるBearer認証が必要です（要素タイプ・LINEメッセージタイプ・配信条件タイプの参照エンドポイントを除く）。


    ```

    Authorization: Bearer {api_key}

    ```


    APIキーはUTAGE管理画面から発行できます。APIキーが未指定・無効・無効化済みの場合、またはアカウントが利用停止中の場合は `401
    Unauthorized`（`error.code` は `unauthorized`）が返されます。


    ## レート制限

    リクエスト数には以下の制限があります。表の値は既定値で、契約内容により異なる場合があります。


    | 分間上限 | 日間上限 |

    |----------|----------|

    | 60リクエスト/分（APIキー単位・暦の1分ごと） | 10,000リクエスト/日（アカウント単位・暦日ごと） |


    レスポンスヘッダーで分間上限の窓が終わる時刻を確認できます（分間の残数と日間の残数はヘッダーに含まれません）。


    | ヘッダー | 説明 |

    |----------|------|

    | X-RateLimit-Limit | 接続元IP単位でAPI全体に掛かる制限の上限値（APIキー単位の分間上限ではありません） |

    | X-RateLimit-Remaining | 接続元IP単位の制限の残りリクエスト数（分間上限の残数ではありません） |

    | X-RateLimit-Reset | APIキー単位の分間上限で、現在の1分間の窓が終わる（次の分が始まる）UNIXタイムスタンプ |


    上限を超えた場合は `429 Too Many Requests`（`error.code` は
    `rate_limit_exceeded`）が返されます。日間上限の超過時は `X-RateLimit-Reset`
    が翌日0:00になります（`X-RateLimit-Limit` / `X-RateLimit-Remaining`
    は超過時も接続元IP単位の値です）。認証不要のエンドポイントと読者作成（`POST
    /accounts/{account_id}/scenarios/{scenario_id}/readers`、`POST
    /accounts/{account_id}/line/friends/{friend_id}/readers`）はレート制限の対象外で、`X-RateLimit-Reset`
    ヘッダーは付きません。


    データを作成するAPIには、これとは別にAPI経由の作成件数の上限があります。超過時は `429` で `total_limit_exceeded` /
    `hourly_limit_exceeded` / `monthly_limit_exceeded`
    が返され、`details.resource_type` に対象のリソース種別が含まれます。


    ## エラーレスポンス

    エラー時は以下の形式で返されます。


    ```json

    {
      "error": {
        "code": "error_code",
        "message": "エラーメッセージ"
      }
    }

    ```


    エラーの種類によっては `error.details`
    に補足情報（バリデーションの項目別エラー、`retry_after`、`resource_type` など）が含まれます。
  version: '1.0'
  contact:
    name: UTAGE サポート
servers:
  - url: https://api.utage-system.com/v1
    description: UTAGE API
security:
  - BearerAuth: []
tags:
  - name: ファネル
    description: ファネルの作成・更新・一覧取得
  - name: ステップ
    description: ファネル内のステップの作成・更新・並び替え・一覧取得
  - name: ページ
    description: ステップ内のページの作成・更新・取得・削除・一覧取得
  - name: 配信アカウント
    description: 配信アカウントの作成・一覧取得
  - name: シナリオ
    description: シナリオの作成・一覧取得
  - name: メディア
    description: 動画・音声・通常メディアの一覧取得・アップロード・名称変更
  - name: 要素タイプ
    description: ファネルページ・レッスン・HTMLメールの要素タイプ定義、LINEメッセージタイプ・配信条件タイプの取得（認証不要）
  - name: ファネル統計
    description: ファネルの集計データ・登録者・登録経路の取得
  - name: 配信メッセージ
    description: 配信メッセージの作成・更新・テスト送信・配信統計、置き換え文字の取得
  - name: 読者
    description: 読者の作成・更新・取得、ラベル・配信履歴・開封/クリック履歴の取得
  - name: LINE
    description: LINE友だち・カスタム送信者・1対1チャット・テンプレート・テンプレートグループ・リッチメニュー・自動応答の操作
  - name: ラベル・共通読者・登録経路
    description: ラベル・共通読者・アクション・登録経路の操作
  - name: 登録経路
    description: ファネルの登録経路・登録経路グループの作成・取得・更新・削除
  - name: ファネルアクション
    description: ファネルアクション（管理画面「アクション設定」）の作成・取得・更新・削除とアクショングループの一覧取得
  - name: 登録フォーム・読者項目
    description: 読者項目と登録フォーム項目の作成・更新・取得・削除・並び替え
  - name: 連携
    description: Googleスプレッドシート連携アカウント・広告連携設定の一覧取得
  - name: 会員サイト
    description: 会員サイトの一覧取得・作成・取得・更新・削除・並び替え
  - name: コース
    description: 会員サイト配下のコースの一覧取得・作成・取得・更新・削除・並び替え
  - name: コースグループ
    description: コースグループの一覧取得・作成・取得・更新・削除
  - name: バンドル
    description: バンドル（受講生に開放するコース・コミュニティグループのセット）の一覧取得・作成・取得・更新・削除・並び替え
  - name: レッスン
    description: 会員サイトのレッスン・レッスングループの操作と、レッスンごと受講状況・受講完了者の取得
  - name: 受講生
    description: 会員サイトの受講生の作成・更新・取得・削除、受講状況・操作履歴の取得、コース・バンドルの登録受講生一覧
  - name: 登録コース・コミュニティ
    description: 受講生のバンドル・単一コース・コミュニティグループへの登録の追加・更新・解除・一覧取得
  - name: コミュニティグループ
    description: 会員サイトのコミュニティグループの一覧取得
  - name: イベント
    description: イベント（セミナー・説明会、個別相談・個別予約）の一覧取得・作成・取得・更新・削除
  - name: 日程
    description: イベントの日程の一覧取得・作成・取得・更新・削除
  - name: 日程設定
    description: 個別相談・個別予約タイプのイベントの日程設定（開催する曜日・時間帯・特定日の開催設定・担当者・日程の表示期間）の取得・更新
  - name: 申込フォーム・申込者項目
    description: イベントの申込フォームの基本項目・申込者項目の取得・更新
  - name: 申込者
    description: イベントの申込者の一覧取得・詳細取得・更新
  - name: イベントグループ
    description: イベントグループ（イベント一覧の「グループ管理」）の作成・更新・一覧取得・削除
  - name: 担当者
    description: 担当者（個別相談・個別予約の「担当者設定」）の作成・更新・一覧取得・削除と連携用リンクの発行・削除
  - name: 商品
    description: 商品の一覧取得・作成・取得・更新・削除・並び替え
  - name: 商品グループ
    description: 商品グループの一覧取得・作成・取得・更新・削除
  - name: 商品詳細
    description: 商品配下の商品詳細（価格・支払方法・決済代行会社・支払回数・購入後の動作・通知設定）の作成・更新・並び替え・取得・削除
  - name: 売上
    description: 売上の一覧・詳細取得、領収書・請求書設定の更新、銀行振込の入金反映、削除、月別・日別売上集計
paths:
  /products/{product_id}/details/{detail_id}:
    patch:
      tags:
        - 商品詳細
      summary: 商品詳細更新
      description: >
        商品詳細を更新します。指定したフィールドのみを更新する部分更新で、リクエストに含めなかったフィールドは既存の値が維持されます（`chat_notify_token`
        / `chat_notify_webhook_url` も省略時は既存値を維持し、null でクリアします）。


        項目の意味と組み合わせの制約は商品詳細作成と同じですが、制約はリクエストで値が変わるフィールドに関わるものだけを検証します（取得した値をそのまま送り返すことができます。ただし
        `trial_days` が負の値の既存データは 0 以上の範囲で検証されるため、0
        以上に直してから送ります）。`payment_provider` は値が変わるときだけ enum を検証し、`name` に null
        を指定できるのは既存の値が null のときだけです。


        - 購入実績のある商品詳細は `payment_type` / `payment_provider` を変更できません（`422`
        `validation_error`）

        - `payment_setting_id` に null を指定するとデフォルトの決済連携設定に差し替えます

        - `payment_provider` / `payment_setting_id` / `stripe_plan_id` /
        `stripe_test_plan_id` を変更したとき、または `charge_type` を `multiple` /
        `subscription` に変更したときは、Stripe プランの実在を検証します。`payment_provider` /
        `use_different_first_amount` / `amount` / `recurring_amount` /
        `payment_setting_id` のいずれかを変更し、更新後が `stripe` +
        `use_different_first_amount=true` で金額に差がある場合は Stripe
        のクーポンを作り直します。決済連携設定にシークレットキーが無い場合は `400`（`stripe_not_configured`）です

        - 保存時の補正（`installment_count` / `trial_days` / `registration_form_id`
        のクリア、`is_hidden=true` のときの表記・販売期間のクリア、送信元方式による `*_from_mail` /
        `*_reply_to_mail` のクリア、販売期間の秒の正規化）は作成と同じです。`*_from_mail` を null
        にすると、システム標準の送信元が設定された環境では次回取得時の `*_from_address_type` が `system` になります
      operationId: updateProductDetail
      parameters:
        - $ref: '#/components/parameters/PaymentProductId'
        - $ref: '#/components/parameters/PaymentProductDetailId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentProductDetailUpdateRequest'
      responses:
        '200':
          description: 更新後の商品詳細
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PaymentProductDetail'
        '400':
          description: >
            決済連携設定に Stripe のシークレットキーが登録されていないため、Stripe
            プランの検証またはクーポンの更新ができません（`stripe_not_configured`）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: stripe_not_configured
                  message: >-
                    Stripeの決済連携設定が完了していません（本番用シークレットキーが登録されていないため、Stripeクーポンを更新できません）
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: >
            入力内容が不正です（`validation_error`。`details` に項目別のエラー）。型・範囲・enum
            の違反、変更したフィールドに関わる組み合わせの制約の違反、購入実績のある商品詳細の `payment_type` /
            `payment_provider` の変更、存在しない参照IDの指定、Stripe クーポンの更新失敗に返ります。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: validation_error
                  message: 入力内容に誤りがあります
                  details:
                    payment_type:
                      - 購入実績のある商品詳細ではpayment_typeを変更できません
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  parameters:
    PaymentProductId:
      name: product_id
      in: path
      required: true
      description: 商品ID
      schema:
        type: string
    PaymentProductDetailId:
      name: detail_id
      in: path
      required: true
      description: 商品詳細ID
      schema:
        type: string
  schemas:
    PaymentProductDetailUpdateRequest:
      description: >
        商品詳細更新リクエスト（部分更新）。指定したフィールドのみ変更され、省略したフィールドは既存値を維持します。

        項目の意味と制約は `PaymentProductDetailFields` と同じです。`name` に null を指定できるのは既存の値が
        null のときだけです。`payment_provider` は値が変わるときだけ enum
        を検証します（取得した値をそのまま送り返せます。ただし `trial_days` が負の値の既存データは 0 以上の範囲で検証されるため、0
        以上に直してから送ります）。
      allOf:
        - $ref: '#/components/schemas/PaymentProductDetailFields'
    PaymentProductDetail:
      type: object
      description: >
        商品詳細の全項目。管理画面「商品詳細管理」の設定画面の内容です。`chat_notify_token` /
        `chat_notify_webhook_url` は設定専用のため含まれません。

        各メールの `*_from_address_type`
        は保存されず、保存されている送信者メールアドレス（`*_from_mail`）の有無から復元します（システム標準の送信元が設定された環境で空なら
        `system`、それ以外は `own_domain`）。
      properties:
        id:
          type: string
          description: 商品詳細ID
        name:
          type: string
          nullable: true
          description: 名称
        payment_type:
          type: string
          enum:
            - credit_card
            - bank_transfer
          description: '支払方法。credit_card: クレジットカード払い / bank_transfer: 銀行振込'
        payment_provider:
          type: string
          enum:
            - none
            - stripe
            - univapay
            - aquagates
            - telecom
            - firstpayment
            - robotpayment
          description: >-
            決済代行会社。none: なし / stripe: Stripe / univapay: UnivaPay / aquagates:
            AQUAGATES / telecom: テレコムクレジット / firstpayment: FirstPayment /
            robotpayment: RobotPayment
        charge_type:
          type: string
          enum:
            - one_time
            - multiple
            - subscription
          description: '支払回数。one_time: 一回払い / multiple: 複数回払い・分割払い / subscription: 継続課金'
        payment_setting_id:
          type: string
          nullable: true
          description: >-
            決済連携設定ID（未設定の場合は null）。削除済みの決済連携設定を参照している場合もその ID
            を返します（商品詳細更新に同じ値を送り返すことはできます）
        is_bump:
          type: boolean
          description: オーダーバンプ商品か（false は通常商品）
        is_hidden:
          type: boolean
          description: 連携フォームへの表示（true は表示しない）
        amount:
          type: integer
          nullable: true
          description: >-
            金額（円・税込）。`one_time` は決済金額、`use_different_first_amount=true`
            のときは初回決済時の金額、`multiple` + `aquagates` は決済総額、その他の `multiple`
            は1回当たりの金額
        use_different_first_amount:
          type: boolean
          description: 初回決済時の金額と2回目以降の金額を分けるか
        recurring_amount:
          type: integer
          nullable: true
          description: 2回目以降の金額（円）
        installment_count:
          type: integer
          nullable: true
          description: 支払回数・分割回数（`charge_type` が `multiple` 以外は null）
        trial_days:
          type: integer
          nullable: true
          description: 無料お試し日数（`charge_type` が `subscription` 以外は 0）
        billing_cycle:
          type: string
          enum:
            - month
            - year
          description: '課金サイクル。month: 毎月 / year: 毎年'
        show_payment_count:
          type: boolean
          description: 分割払いオプション（購入フォームに分割払い回数の選択肢を表示するか）
        stripe_plan_id:
          type: string
          nullable: true
          description: StripeプランのプランID（画面の「Stripeプラン」。本番用の Stripe アカウントのプラン）
        stripe_test_plan_id:
          type: string
          nullable: true
          description: Stripeプラン(テストモード)のプランID
        telecom_rebill_param_id:
          type: string
          nullable: true
          description: テレコムクレジットの rebill_param_id
        has_sales_limit:
          type: boolean
          description: 販売上限を指定するか
        max_sales_quantity:
          type: integer
          description: 販売上限数（未指定時は 0）
        display_name:
          type: string
          nullable: true
          description: 連携フォームでの商品名表記（null は商品名をそのまま表示）
        display_price:
          type: string
          nullable: true
          description: 連携フォームでの価格表記（null は金額をそのまま表示）
        use_sales_period:
          type: boolean
          description: 販売期間を指定するか
        sales_period_from:
          type: string
          nullable: true
          description: 販売期間の開始日時（Y-m-d H:i:s）
        sales_period_to:
          type: string
          nullable: true
          description: 販売期間の終了日時（Y-m-d H:i:s）
        receipt_name:
          type: string
          nullable: true
          description: 領収書の品名
        receipt_description:
          type: string
          nullable: true
          description: 領収書の但し書き
        purchase_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            購入後（銀行振込は入金反映後）の動作設定「登録するシナリオ」。none: 登録しない / scenario: シナリオに登録 /
            external_form: 外部連携フォームを利用
        purchase_scenario_id:
          type: string
          nullable: true
          description: 購入後に登録するシナリオID（`purchase_register_type` が `scenario` 以外は null）
        purchase_form_id:
          type: string
          nullable: true
          description: 購入後に利用する外部連携フォームID
        purchase_bundle_id:
          type: string
          nullable: true
          description: 購入後に開放するバンドルID（null は開放しない）
        purchase_action_id:
          type: string
          nullable: true
          description: 購入後に実行するアクションID（null は実行しない）
        registration_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            申込後の動作設定「登録するシナリオ」（銀行振込で有効）。none: 登録しない / scenario: シナリオに登録 /
            external_form: 外部連携フォームを利用
        registration_scenario_id:
          type: string
          nullable: true
          description: 申込後に登録するシナリオID（`registration_register_type` が `scenario` 以外は null）
        registration_form_id:
          type: string
          nullable: true
          description: >-
            申込後に利用する外部連携フォームID（`registration_register_type` が `external_form`
            以外は null）
        registration_action_id:
          type: string
          nullable: true
          description: 申込後に実行するアクションID（null は実行しない）
        has_registration_mail:
          type: boolean
          description: 申込後のメール自動送信（申込受付メール）を送信するか（銀行振込で有効）
        registration_from_name:
          type: string
          nullable: true
          description: 申込受付メールの送信者名
        registration_from_mail:
          type: string
          nullable: true
          description: 申込受付メールの送信者メールアドレス（送信元が `system` のときは null）
        registration_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: '申込受付メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system: システム標準のアドレスを利用'
        registration_reply_to_mail:
          type: string
          nullable: true
          description: 申込受付メールのお問い合わせ先メールアドレス（送信元が `own_domain` のときは null）
        is_registration_custom_mail:
          type: boolean
          description: 申込受付メールの送信内容をカスタムするか（false はデフォルトの文面）
        registration_subject:
          type: string
          nullable: true
          description: 申込受付メールの件名（カスタム時）
        registration_body:
          type: string
          nullable: true
          description: 申込受付メールの本文（カスタム時）
        deadline_days:
          type: integer
          nullable: true
          description: 支払い期限（申し込みから何日後か。銀行振込で有効）
        has_deadline_mail:
          type: boolean
          description: リマインドメールを送信するか（銀行振込で有効）
        deadline_from_name:
          type: string
          nullable: true
          description: リマインドメールの送信者名
        deadline_from_mail:
          type: string
          nullable: true
          description: リマインドメールの送信者メールアドレス（送信元が `system` のときは null）
        deadline_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: 'リマインドメールの送信元。own_domain: 独自ドメインのアドレスを利用 / system: システム標準のアドレスを利用'
        deadline_reply_to_mail:
          type: string
          nullable: true
          description: リマインドメールのお問い合わせ先メールアドレス（送信元が `own_domain` のときは null）
        is_deadline_custom_mail:
          type: boolean
          description: リマインドメールの送信内容をカスタムするか
        deadline_subject:
          type: string
          nullable: true
          description: リマインドメールの件名（カスタム時）
        deadline_body:
          type: string
          nullable: true
          description: リマインドメールの本文（カスタム時）
        deadline_mail_sent_before_days:
          type: integer
          nullable: true
          description: リマインドメールの送信のタイミング（支払い締切の何日前か）
        cancel_unregister_scenario_id:
          type: string
          nullable: true
          description: 解除時（継続課金解除時・中途解除時）に解除するシナリオID（null は解除しない）
        cancel_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            解除時の動作設定「登録するシナリオ」（複数回払い・分割払い・継続課金で有効）。none: 登録しない / scenario:
            シナリオに登録 / external_form: 外部連携フォームを利用
        cancel_register_scenario_id:
          type: string
          nullable: true
          description: 解除時に登録するシナリオID（`cancel_register_type` が `scenario` 以外は null）
        cancel_form_id:
          type: string
          nullable: true
          description: 解除時に利用する外部連携フォームID
        cancel_bundle_id:
          type: string
          nullable: true
          description: 解除時に停止するバンドルID（null は停止しない）
        cancel_action_id:
          type: string
          nullable: true
          description: 解除時に実行するアクションID（null は実行しない）
        has_failed_mail:
          type: boolean
          description: 課金失敗時に顧客へメールを送信するか（複数回払い・分割払い・継続課金で有効）
        failed_from_name:
          type: string
          nullable: true
          description: 課金失敗メールの送信者名
        failed_from_mail:
          type: string
          nullable: true
          description: 課金失敗メールの送信者メールアドレス（送信元が `system` のときは null）
        failed_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: '課金失敗メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system: システム標準のアドレスを利用'
        failed_reply_to_mail:
          type: string
          nullable: true
          description: 課金失敗メールのお問い合わせ先メールアドレス（送信元が `own_domain` のときは null）
        failed_subject:
          type: string
          nullable: true
          description: 課金失敗メールの件名
        failed_body:
          type: string
          nullable: true
          description: 課金失敗メールの本文
        has_purchase_mail:
          type: boolean
          description: 購入後のメール自動送信（顧客向けの購入後メール）を送信するか
        purchase_from_name:
          type: string
          nullable: true
          description: 購入後メールの送信者名
        purchase_from_mail:
          type: string
          nullable: true
          description: 購入後メールの送信者メールアドレス（送信元が `system` のときは null）
        purchase_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: '購入後メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system: システム標準のアドレスを利用'
        purchase_reply_to_mail:
          type: string
          nullable: true
          description: 購入後メールのお問い合わせ先メールアドレス（送信元が `own_domain` のときは null）
        is_purchase_custom_mail:
          type: boolean
          description: 購入後メールの送信内容をカスタムするか（false はデフォルトの文面）
        purchase_subject:
          type: string
          nullable: true
          description: 購入後メールの件名（カスタム時）
        purchase_body:
          type: string
          nullable: true
          description: 購入後メールの本文（カスタム時）
        notify_mail:
          type: string
          nullable: true
          description: 通知設定の通知先メールアドレス（購入通知の送信先。カンマ区切りで複数。null は通知しない）
        is_purchase_custom_notify:
          type: boolean
          description: 購入通知の通知内容をカスタムするか
        purchase_custom_notify_subject:
          type: string
          nullable: true
          description: 購入通知の件名（カスタム時）
        purchase_custom_notify_body:
          type: string
          nullable: true
          description: 購入通知の本文（カスタム時）
        chat_notify_type:
          type: string
          enum:
            - none
            - chatwork
            - slack
            - discord
          description: >-
            チャット通知の通知先。none: 通知しない / chatwork: Chatwork / slack: Slack /
            discord: Discord
        chat_notify_to:
          type: string
          nullable: true
          description: チャット通知の通知先（Slack はチャンネル名、Chatwork はルームID）
        is_chat_custom_notify:
          type: boolean
          description: チャット通知の通知内容をカスタムするか
        chat_notify_text:
          type: string
          nullable: true
          description: チャット通知の内容（カスタム時）
        order:
          type: integer
          description: 表示順（0始まり。通常商品のみ並び替えの対象）
        created_at:
          type: string
          nullable: true
          description: 作成日時（Y-m-d H:i:s）
        updated_at:
          type: string
          nullable: true
          description: 更新日時（Y-m-d H:i:s）
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード
            message:
              type: string
              description: エラーメッセージ
            details:
              type: object
              nullable: true
              description: >-
                エラーの補足情報（`retry_after` /
                `resource_type`、項目別のエラーメッセージ等）。エラー種別により含まれる場合があります。`422`
                の項目別エラーの値は通常はメッセージの配列ですが、会員サイト更新・コース更新の変更時だけ行う検証では文字列です。
    PaymentProductDetailFields:
      type: object
      description: >
        商品詳細の設定項目（作成・更新で共通）。`payment_type`（支払方法）・`payment_provider`（決済代行会社）・`charge_type`（支払回数）の組み合わせで、必須になる項目と指定できる値が変わります（各エンドポイントの説明を参照）。

        区分の条件に該当しない項目（例: 一回払いの解除時の動作）も受理・保存されますが動作には影響しません。
      properties:
        name:
          type: string
          maxLength: 255
          description: 名称
        payment_type:
          type: string
          enum:
            - credit_card
            - bank_transfer
          example: credit_card
          description: >-
            支払方法。credit_card: クレジットカード払い / bank_transfer: 銀行振込（作成時の省略値は
            credit_card。null 不可）
        payment_provider:
          type: string
          enum:
            - none
            - stripe
            - univapay
            - aquagates
            - telecom
            - firstpayment
            - robotpayment
          example: stripe
          description: >-
            決済代行会社。none: なし（bank_transfer のみ） / stripe: Stripe / univapay:
            UnivaPay / aquagates: AQUAGATES（有効な環境のみ） / telecom: テレコムクレジット /
            firstpayment: FirstPayment / robotpayment:
            RobotPayment。bank_transfer は none / univapay のみ
        charge_type:
          type: string
          enum:
            - one_time
            - multiple
            - subscription
          example: one_time
          description: >-
            支払回数。one_time: 一回払い / multiple: 複数回払い・分割払い / subscription:
            継続課金。bank_transfer は one_time のみ
        payment_setting_id:
          type: string
          nullable: true
          description: 決済連携設定ID（null・省略はデフォルトの決済連携設定。デフォルトが無い場合は自動作成されます）
        is_bump:
          type: boolean
          description: オーダーバンプ商品か（作成時の省略値は false＝通常商品）
        is_hidden:
          type: boolean
          description: >-
            連携フォームへの表示（true は表示しない。作成時の省略値は false）。true で保存すると `display_name` /
            `display_price` は null、`use_sales_period` は false になります
        amount:
          type: integer
          minimum: 0
          maximum: 99999999
          description: >-
            金額（円・税込）。`one_time` は決済金額、`use_different_first_amount=true`
            のときは初回決済時の金額、`multiple` + `aquagates` は決済総額、その他の `multiple`
            は1回当たりの金額。`stripe` + `one_time` は 50 以上。Stripe はプランの金額と一致させてください
        use_different_first_amount:
          type: boolean
          description: 初回決済時の金額と2回目以降の金額を分けるか（作成時の省略値は false）
        recurring_amount:
          type: integer
          nullable: true
          minimum: 0
          maximum: 99999999
          description: >-
            2回目以降の金額（円）。`stripe` + `use_different_first_amount=true`
            のとき必須で、`amount` 以上にします
        installment_count:
          type: integer
          nullable: true
          minimum: 0
          maximum: 999
          description: 支払回数・分割回数。`charge_type=multiple` のとき必須（`multiple` 以外では null で保存されます）
        trial_days:
          type: integer
          nullable: true
          minimum: 0
          description: >-
            無料お試し日数（作成時の省略値は 0）。`charge_type=subscription` のとき必須。`aquagates` +
            `subscription` は 24 以下（`subscription` 以外では 0 で保存されます）
        billing_cycle:
          type: string
          enum:
            - month
            - year
          example: month
          description: '課金サイクル。month: 毎月 / year: 毎年（作成時の省略値は month。null 不可）'
        show_payment_count:
          type: boolean
          description: 分割払いオプション（購入フォームに分割払い回数の選択肢を表示するか。作成時の省略値は false）
        stripe_plan_id:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            StripeプランのプランID（画面の「Stripeプラン」）。決済連携設定の本番用 Stripe
            アカウント（本番用シークレットキー）に実在するプラン。`stripe` + `multiple` / `subscription` では
            `stripe_test_plan_id` とどちらか一方が必須
        stripe_test_plan_id:
          type: string
          nullable: true
          maxLength: 255
          description: Stripeプラン(テストモード)のプランID。決済連携設定のテスト用 Stripe アカウントに実在するプラン
        telecom_rebill_param_id:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            テレコムクレジットの rebill_param_id（`telecom` + `multiple` / `subscription`
            で使用）
        has_sales_limit:
          type: boolean
          description: 販売上限を指定するか（作成時の省略値は false）
        max_sales_quantity:
          type: integer
          minimum: 0
          description: >-
            販売上限数（null 不可）。作成時は `has_sales_limit=true` なら必須（`false` で省略すると
            0）。更新時は省略すると既存の値を維持します
        display_name:
          type: string
          nullable: true
          maxLength: 1024
          description: 連携フォームでの商品名表記（null は商品名をそのまま表示）
        display_price:
          type: string
          nullable: true
          maxLength: 1024
          description: 連携フォームでの価格表記（null は金額をそのまま表示）
        use_sales_period:
          type: boolean
          description: 販売期間を指定するか（作成時の省略値は false）
        sales_period_from:
          type: string
          nullable: true
          description: >-
            販売期間の開始日時（`YYYY-MM-DD HH:mm:ss` または `YYYY-MM-DD HH:mm`。秒は 00
            に正規化されます）
        sales_period_to:
          type: string
          nullable: true
          description: >-
            販売期間の終了日時（`YYYY-MM-DD HH:mm:ss` または `YYYY-MM-DD HH:mm`。秒は 59
            に正規化されます）
        receipt_name:
          type: string
          nullable: true
          maxLength: 1024
          description: 領収書の品名
        receipt_description:
          type: string
          nullable: true
          maxLength: 255
          description: 領収書の但し書き
        purchase_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            購入後（銀行振込は入金反映後）の動作設定「登録するシナリオ」。none: 登録しない / scenario: シナリオに登録 /
            external_form: 外部連携フォームを利用（作成時の省略値は none）
        purchase_scenario_id:
          type: string
          nullable: true
          description: >-
            購入後に登録するシナリオID。`purchase_register_type=scenario`
            のとき必須（それ以外では検証されず無視されます）
        purchase_form_id:
          type: string
          nullable: true
          description: 購入後に利用する外部連携フォームID（`purchase_register_type=external_form` のとき使用）
        purchase_bundle_id:
          type: string
          nullable: true
          description: 購入後に開放するバンドルID（null は開放しない）
        purchase_action_id:
          type: string
          nullable: true
          description: 購入後に実行するアクション（ファネルアクション）のID（null は実行しない）
        registration_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            申込後の動作設定「登録するシナリオ」（銀行振込で有効）。none: 登録しない / scenario: シナリオに登録 /
            external_form: 外部連携フォームを利用（作成時の省略値は none）
        registration_scenario_id:
          type: string
          nullable: true
          description: >-
            申込後に登録するシナリオID。`registration_register_type=scenario`
            のとき必須（それ以外では検証されず無視されます）
        registration_form_id:
          type: string
          nullable: true
          description: >-
            申込後に利用する外部連携フォームID（`registration_register_type` が `external_form`
            以外では null で保存されます）
        registration_action_id:
          type: string
          nullable: true
          description: 申込後に実行するアクション（ファネルアクション）のID（null は実行しない）
        has_registration_mail:
          type: boolean
          description: >-
            申込後のメール自動送信（申込受付メール）を送信するか（銀行振込で有効。作成時の省略値は true、`bank_transfer` +
            `univapay` は false）
        registration_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: 申込受付メールの送信者名。`bank_transfer` + `has_registration_mail=true` のとき必須
        registration_from_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            申込受付メールの送信者メールアドレス（フリーメール・携帯キャリアメール不可）。`bank_transfer` +
            `has_registration_mail=true` + 送信元 `own_domain` のとき必須（`system` では
            null で保存されます）
        registration_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: >-
            申込受付メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system:
            システム標準のアドレスを利用（システム標準の送信元が設定された環境のみ。作成時の省略値は
            own_domain。更新時に省略すると保存されている送信者メールアドレスの有無から復元）
        registration_reply_to_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            申込受付メールのお問い合わせ先メールアドレス。`bank_transfer` +
            `has_registration_mail=true` + 送信元 `system` のとき必須（`own_domain` では
            null で保存されます）
        is_registration_custom_mail:
          type: boolean
          description: 申込受付メールの送信内容をカスタムするか（作成時の省略値は false＝デフォルトの文面）
        registration_subject:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            申込受付メールの件名。`bank_transfer` + `has_registration_mail=true` +
            `is_registration_custom_mail=true` のとき必須
        registration_body:
          type: string
          nullable: true
          description: >-
            申込受付メールの本文（65,535文字・65,535バイトまで）。`bank_transfer` +
            `has_registration_mail=true` + `is_registration_custom_mail=true`
            のとき必須
        deadline_days:
          type: integer
          nullable: true
          minimum: 0
          maximum: 32767
          description: 支払い期限（申し込みから何日後か。作成時の省略値は 7）。`bank_transfer` のとき必須
        has_deadline_mail:
          type: boolean
          description: >-
            リマインドメールを送信するか（銀行振込で有効。作成時の省略値は true、`bank_transfer` + `univapay` は
            false）
        deadline_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: リマインドメールの送信者名。`bank_transfer` + `has_deadline_mail=true` のとき必須
        deadline_from_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            リマインドメールの送信者メールアドレス（フリーメール・携帯キャリアメール不可）。`bank_transfer` +
            `has_deadline_mail=true` + 送信元 `own_domain` のとき必須（`system` では null
            で保存されます）
        deadline_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: >-
            リマインドメールの送信元。own_domain: 独自ドメインのアドレスを利用 / system:
            システム標準のアドレスを利用（システム標準の送信元が設定された環境のみ。作成時の省略値は own_domain）
        deadline_reply_to_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            リマインドメールのお問い合わせ先メールアドレス。`bank_transfer` + `has_deadline_mail=true` +
            送信元 `system` のとき必須（`own_domain` では null で保存されます）
        is_deadline_custom_mail:
          type: boolean
          description: リマインドメールの送信内容をカスタムするか（作成時の省略値は false）
        deadline_subject:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            リマインドメールの件名。`bank_transfer` + `has_deadline_mail=true` +
            `is_deadline_custom_mail=true` のとき必須
        deadline_body:
          type: string
          nullable: true
          description: >-
            リマインドメールの本文（65,535文字・65,535バイトまで）。`bank_transfer` +
            `has_deadline_mail=true` + `is_deadline_custom_mail=true` のとき必須
        deadline_mail_sent_before_days:
          type: integer
          nullable: true
          minimum: 0
          maximum: 32767
          description: リマインドメールの送信のタイミング（支払い締切の何日前か。作成時の省略値は 3）。`bank_transfer` のとき必須
        cancel_unregister_scenario_id:
          type: string
          nullable: true
          description: 解除時（継続課金解除時・中途解除時）に解除するシナリオID（null は解除しない）
        cancel_register_type:
          type: string
          enum:
            - none
            - scenario
            - external_form
          description: >-
            解除時の動作設定「登録するシナリオ」（複数回払い・分割払い・継続課金で有効）。none: 登録しない / scenario:
            シナリオに登録 / external_form: 外部連携フォームを利用（作成時の省略値は none）
        cancel_register_scenario_id:
          type: string
          nullable: true
          description: >-
            解除時に登録するシナリオID。`cancel_register_type=scenario`
            のとき必須（それ以外では検証されず無視されます）
        cancel_form_id:
          type: string
          nullable: true
          description: 解除時に利用する外部連携フォームID
        cancel_bundle_id:
          type: string
          nullable: true
          description: 解除時に停止するバンドルID（null は停止しない）
        cancel_action_id:
          type: string
          nullable: true
          description: 解除時に実行するアクション（ファネルアクション）のID（null は実行しない）
        has_failed_mail:
          type: boolean
          description: 課金失敗時に顧客へメールを送信するか（複数回払い・分割払い・継続課金で有効。作成時の省略値は false）
        failed_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: 課金失敗メールの送信者名（作成時の省略値はアカウント名）
        failed_from_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            課金失敗メールの送信者メールアドレス（メールアドレス形式。作成時の省略値はアカウントのメールアドレス、システム標準の送信元が設定された環境では
            null）。`multiple` / `subscription` + `has_failed_mail=true` + 送信元
            `own_domain` のとき必須（フリーメール・携帯キャリアメール不可。`system` では null で保存されます）
        failed_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: >-
            課金失敗メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system:
            システム標準のアドレスを利用（システム標準の送信元が設定された環境のみ。作成時の省略値は own_domain）
        failed_reply_to_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            課金失敗メールのお問い合わせ先メールアドレス（メールアドレス形式）。`multiple` / `subscription` +
            `has_failed_mail=true` + 送信元 `system` のとき必須（`own_domain` では null
            で保存されます）
        failed_subject:
          type: string
          nullable: true
          maxLength: 255
          description: 課金失敗メールの件名（作成時の省略値は既定の件名）
        failed_body:
          type: string
          nullable: true
          description: 課金失敗メールの本文（65,535文字・65,535バイトまで。作成時の省略値は既定の本文）
        has_purchase_mail:
          type: boolean
          description: 購入後のメール自動送信（顧客向けの購入後メール。管理者向けの通知設定とは別）を送信するか（作成時の省略値は false）
        purchase_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: 購入後メールの送信者名。`has_purchase_mail=true` のとき必須
        purchase_from_address_type:
          type: string
          enum:
            - own_domain
            - system
          description: >-
            購入後メールの送信元。own_domain: 独自ドメインのアドレスを利用 / system:
            システム標準のアドレスを利用（システム標準の送信元が設定された環境のみ。作成時の省略値は own_domain）
        purchase_from_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            購入後メールの送信者メールアドレス（フリーメール・携帯キャリアメール不可）。`has_purchase_mail=true` + 送信元
            `own_domain` のとき必須（`system` では null で保存されます）
        purchase_reply_to_mail:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            購入後メールのお問い合わせ先メールアドレス。`has_purchase_mail=true` + 送信元 `system`
            のとき必須（`own_domain` では null で保存されます）
        is_purchase_custom_mail:
          type: boolean
          description: 購入後メールの送信内容をカスタムするか（作成時の省略値は false＝デフォルトの文面）
        purchase_subject:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            購入後メールの件名。`has_purchase_mail=true` + `is_purchase_custom_mail=true`
            のとき必須
        purchase_body:
          type: string
          nullable: true
          description: >-
            購入後メールの本文（65,535文字・65,535バイトまで）。`has_purchase_mail=true` +
            `is_purchase_custom_mail=true` のとき必須
        notify_mail:
          type: string
          nullable: true
          maxLength: 2048
          description: >-
            通知設定の通知先メールアドレス（購入通知の送信先。カンマ区切りで複数指定可。作成時の省略値はアカウントのメールアドレス。null
            は通知しない）
        is_purchase_custom_notify:
          type: boolean
          description: 購入通知の通知内容をカスタムするか（作成時の省略値は false）
        purchase_custom_notify_subject:
          type: string
          nullable: true
          maxLength: 1024
          description: 購入通知の件名（カスタム時）
        purchase_custom_notify_body:
          type: string
          nullable: true
          description: 購入通知の本文（カスタム時。65,535文字・65,535バイトまで。置き換え文字を利用できます）
        chat_notify_type:
          type: string
          enum:
            - none
            - chatwork
            - slack
            - discord
          description: >-
            チャット通知の通知先。none: 通知しない / chatwork: Chatwork / slack: Slack /
            discord: Discord（作成時の省略値は none）
        chat_notify_token:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            Chatwork の APIトークン、または Slack の Bot User OAuth
            Token（設定専用。応答には含まれません。更新時に省略すると既存値を維持、null でクリア）
        chat_notify_webhook_url:
          type: string
          nullable: true
          maxLength: 255
          description: Discord のウェブフックURL（URL形式。設定専用。応答には含まれません。更新時に省略すると既存値を維持、null でクリア）
        chat_notify_to:
          type: string
          nullable: true
          maxLength: 255
          description: チャット通知の通知先（Slack はチャンネル名、Chatwork はルームID）
        is_chat_custom_notify:
          type: boolean
          description: チャット通知の通知内容をカスタムするか（作成時の省略値は false）
        chat_notify_text:
          type: string
          nullable: true
          description: チャット通知の内容（カスタム時。65,535文字・65,535バイトまで）
  responses:
    Unauthorized:
      description: 認証エラー。APIキーが未指定・無効・無効化済み、またはアカウントが利用停止中。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthorized
              message: APIキーが無効です
    NotFound:
      description: 指定されたリソースが見つかりません（`error.code` は `not_found`。`message` は資源ごとに異なります）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: not_found
              message: ページが見つかりません
    RateLimitExceeded:
      description: >-
        レート制限超過（`rate_limit_exceeded`）。`X-RateLimit-Reset`
        の時刻（`details.retry_after` がある場合はその日時）以降に再試行してください。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: レート制限を超過しました
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: APIキーをBearerトークンとして指定

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.