# Rebalance Wallet Synchronizes your Transactional account to match the total exposure you report. How it works: - If targetAmount is greater than the current transactional balance → funds are pulled from the Proprietary account (Top-up) - If targetAmount is less than the current transactional balance → excess funds are swept back to the Proprietary account The targetAmount represents the total exposure of your platform (sum of all user wallet balances + in-flight bets). This endpoint requires the DigitalSignature header. Endpoint: POST /account/rebalance Version: 2.0.0 Security: bearerAuth ## Header parameters: - `ApplicationToken` (string, required) Fixed GUID that uniquely identifies your integration. Provided during ConnectPSP onboarding. Example: "{{ApplicationToken}}" - `DigitalSignature` (string, required) HMAC-SHA256 hash of the JWT token + your CryptoToken. Required for sensitive operations. See the Authentication Guide for the exact computation steps. Example: "{{DigitalSignature}}" ## Request fields (application/json): - `targetAmount` (number, required) The target transactional balance (in BRL) representing your total current user exposure (sum of all user wallet balances + in-flight operations). ConnectPSP will automatically calculate the direction (Top-up or Sweep). Example: 1000000 ## Response 200 fields (application/json): - `success` (boolean) Example: true - `message` (string) Example: "Rebalancing completed successfully." ## Response 401 fields (application/problem+json): - `type` (string) URI identifying the error type. Example: "https://connect-psp.redocly.app/errors/insufficient-funds" - `title` (string) Short, human-readable summary. Example: "Insufficient Funds" - `status` (integer) HTTP status code. Example: 422 - `code` (string) Machine-readable error code for programmatic handling. Example: "INSUFFICIENT_FUNDS" - `detail` (string) Human-readable explanation of this specific occurrence. Example: "The requested amount of R$ 500.00 exceeds available balance of R$ 100.00." ## Response 422 fields (application/problem+json): - `type` (string) URI identifying the error type. Example: "https://connect-psp.redocly.app/errors/insufficient-funds" - `title` (string) Short, human-readable summary. Example: "Insufficient Funds" - `status` (integer) HTTP status code. Example: 422 - `code` (string) Machine-readable error code for programmatic handling. Example: "INSUFFICIENT_FUNDS" - `detail` (string) Human-readable explanation of this specific occurrence. Example: "The requested amount of R$ 500.00 exceeds available balance of R$ 100.00."