POST{clientApi}/ticket/reserve
When placing a bet, the CmsWager system will send this request to the client system to check if the user has enough balance to play the bet
If the user has sufficient balance, the withdraw amount in the request must be deducted from the user, and a record should be created, with the specific 'code' under ticket.
After the withdraw amount is deducted and a record is successfully created, a 200 success response should be returned.
Sometimes, a server error may occur on each side during `ticket/reserve` request, due to a gateway timeout, or a technical issue. Also, the ticket may just get rejected by the user's risk limits and fail to successfully create. In this case, the CmsWager system will send a rollback request with the same ticket code of "reserve" request to prevent discrepancies.
If this request encounters a server error, it will be retried for 24 hours until it gets a meaningful response
If the rollback request is received more than one time and it was just processed, the client system does not need to change the user balance and a success response must be returned
Success response must be returned in these cases:
if a record is found and the status is not setted to "rollbacked".
If a record is not found: it mean that the reserve request was not processed and client system does not need to modify the user balance
If the ticket/reserve request returns a success response, and the bet is successfully created with no problems, a `ticket/confirm` request will be sent by the CmsWager system, to the client system.
This request may bring a lower stake amount compared to 'reserve' request. This is caused by risk limits and counter offers. If that is the case, the difference (amount indicated by "deposit" key inside the request) should be refunded to the user.
If this request encounters a server error, it will be retried for 24 hours until it gets a meaningful response.
If the "ticket confirm" request is received more than one time and it was just processed, a success response must be returned
If the ticket is saved successfully in client system, the bet placement operation can be considered concluded. A 200 response with "success" status should be returned.