# ユーザーのロイヤルティポイント残高を引き落とす 指定した金額分、ユーザーのロイヤルティポイント残高を引き落とします。 Endpoint: POST /projects/{project_id}/users/{user_id}/points/{point_id}/balance/debit Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横、またはプロジェクトの作業中にブラウザのアドレスバーで確認できます。URLの形式は以下の通りです:https://publisher.xsolla.com//projects/。 Example: 44056 - `user_id` (string, required) システム内のユーザーID。ロイヤルティポイントはこのユーザーIDに関連付けられるため、決済トークンを作成する際に渡すuser.idパラメータの値と一致している必要があります。 Example: "d342dad2-9d59-11e9-a384-42010aa8003f" - `point_id` (string, required) ロイヤルティポイントのID。ロイヤルティポイントは、パブリッシャーアカウントのLiveOps > ロイヤルティプログラムセクションで設定されます。このIDを取得するには、カタログ取得APIコールを使用してください。IDはloyalty_rewards[].skuパラメータに含まれます。 Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" ## Request fields (application/json): - `amount` (number, required) 引き落とすロイヤルティポイントの数量。正の値を指定する必要があります。 Example: 50 - `reason` (string, required) 自由記述形式による残高変動の理由(例:報酬、補償、手動調整など)。 Example: "Manual adjustment" ## Response 200 fields (application/json): - `transaction_id` (string, required) 本リクエストにより作成された引き落とし取引のID。 Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" - `previous_balance` (number, required) 引き落とし前の残高。 Example: 150.5 - `new_balance` (number, required) 引き落とし後の残高。 Example: 100.5 - `amount` (number, required) 残高から引き落とされた数。 Example: 50 ## Response 400 fields (application/json): - `message_id` (string, required) エラーコード。 Example: "error_bad_request" - `message` (string, required) エラーの簡潔な説明。 Example: "Invalid request body." ## Response 401 fields (application/json): - `statusCode` (integer) HTTPレスポンスステータス。 - `errorCode` (integer) エラーコード。 - `errorMessage` (string) エラーの簡潔な説明。 - `transactionId` (string) リクエストID。この特定のリクエストまたは操作に関連するログエントリを追跡し、関連付けるために使用されるIDです。このIDは、トラブルシューティング、デバッグ、および監査の目的に役立ちます。 ## Response 404 fields (application/json): - `message_id` (string, required) エラーコード。 Example: "error_not_found" - `message` (string, required) エラーの簡潔な説明。 Example: "User account or loyalty points not found." ## Response 422 fields (application/json): - `message_id` (string, required) エラーコード。 Example: "error_bad_request" - `message` (string, required) エラーの簡潔な説明。 Example: "Insufficient loyalty point balance."