# Debit user's loyalty point balance Debits the user's loyalty point balance by the specified amount. 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 de projeto. Você pode encontrar esse parâmetro na sua Conta de Distribuidor, próximo ao nome do projeto e na barra de endereços do navegador ao trabalhar com um projeto. O URL tem o seguinte formato: https://publisher.xsolla.com//projects/. Example: 44056 - `user_id` (string, required) User ID in your system. This ID must match the value you pass in the user.id parameter when creating a creating a payment token, as loyalty points are associated with this user ID. Example: "d342dad2-9d59-11e9-a384-42010aa8003f" - `point_id` (string, required) Loyalty point ID. Loyalty points are configured in Publisher Account in the LiveOps > Loyalty program section. To get the ID, use the catalog retrieval API call call — the ID is returned in the loyalty_rewards[].sku parameter. Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" ## Request fields (application/json): - `amount` (number, required) Amount of loyalty points to debit. Must be a positive value. Example: 50 - `reason` (string, required) Reason for the balance change in free-text format (e.g., reward, compensation, manual adjustment). Example: "Manual adjustment" ## Response 200 fields (application/json): - `transaction_id` (string, required) ID of the debit transaction created as a result of this request. Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" - `previous_balance` (number, required) Balance before the debit. Example: 150.5 - `new_balance` (number, required) Balance after the debit. Example: 100.5 - `amount` (number, required) Amount that was debited from the balance. Example: 50 ## Response 400 fields (application/json): - `message_id` (string, required) Código de erro. Example: "error_bad_request" - `message` (string, required) Short error description. Example: "Invalid request body." ## Response 401 fields (application/json): - `statusCode` (integer) HTTP response status. - `errorCode` (integer) Código de erro. - `errorMessage` (string) Short error description. - `transactionId` (string) Request ID. The ID used to track and associate log entries related to this specific request or operation. This ID can be helpful for troubleshooting, debugging, and auditing purposes. ## Response 404 fields (application/json): - `message_id` (string, required) Código de erro. Example: "error_not_found" - `message` (string, required) Short error description. Example: "User account or loyalty points not found." ## Response 422 fields (application/json): - `message_id` (string, required) Código de erro. Example: "error_bad_request" - `message` (string, required) Short error description. Example: "Insufficient loyalty point balance."