Wallet IntegrationUnsettlement

Unsettlement

This method is used to unsettle a bet that was previously settled. The wallet should reverse the corresponding settlement for the given betId, adjusting the player’s balance based on the original settlement transaction.

If the PAM does not support balance deduction or the player has insufficient funds, an INSUFFICIENT_FUNDS error response should be returned. In this case, the Sportsbook platform accumulates the uncollected clawback amount for the player and deducts it from future BET_PAID (settlement) amounts until it is fully recovered.

Request

  • Path: /unsettlement
  • Retried: yes
FieldTypeDescription
transactionIdstring (required)Unique transaction identifier. The basis of idempotency.
betIdstring (required)Unique identifier of bet. Can be used to correlate unsettlement with corresponding placebets and settlement(s)
playerIdstring (required)Unique player identifier in Operator’s PAM
typeenum (required)Values: UNVOIDED, UNSCORED
transactionDatedatetime (required)The actual date when the transaction created and saved into the Sportsbook database.

Example Unsettlement request - UNVOIDED

POST https://{wallet base url}/unsettlement HTTP/1.1
Content-Type: application/json
 
{
    "transactionId": "7229be34-8e56-4fe5-a837-71bcd041c46c",
    "betId": "3937da17-b20b-4c3b-90ea-817dd74987e5",
    "playerId": "2b84aabc-e2cb-4fbc-a038-e2123e0a0311",
    "type": "UNVOIDED"
}

Response

FieldTypeDescription
balancedecimal (required)Player’s current balance in player’s currency
currencystring (required)Currency code for player’s balance
walletTransactionIdstringWallet (PAM) transaction reference

Example Unsettlement response

{
    "balance": 100.0,
    "currency": "USD",
    "walletTransactionId": "c744cd1e-e1c3-4f6d-9905-752ab37a3ddd"
}

Error Response

On error, the wallet returns an HTTP error status (4xx/5xx) with only errorCode and description.

{
    "errorCode": "INSUFFICIENT_FUNDS",
    "description": "The player does not have sufficient funds"
}

See Error Handling for all applicable error codes.

Unsettlement Types

Unsettlement types in unsettlement request is used to determine the purpose of the unsettlement.

FieldDescription
UNVOIDEDA previously voided bet is being reversed. The wallet should reverse the corresponding void settlement for this betId, deducting the amount that was credited during the void from the player’s balance.
UNSCOREDA previously paid (scored) bet is being reversed (clawback). The wallet should deduct the amount that was paid out during the corresponding BET_PAID settlement for this betId. Return INSUFFICIENT_FUNDS if the player has insufficient funds.