Debit a bet, credit a win, or both
POST/v2/provider_a8r.Round/BetWin
Prediction Markets calls this endpoint to debit a bet, to credit a win, or to do both, in one request.
Requirements
- You must process every transaction in the request. If one transaction fails, you must reverse all transactions in the request.
- You must process the transactions in the order in which they appear in the request.
- This request is idempotent. If you receive the same
id_providera second time, do not process it a second time. Return the original response. - You must accept a win transaction even if the matching bet transaction did not arrive.
- A transaction amount is never 0.
Closed round behavior
Do not reject a transaction only because the round is already closed. Do not do an action only because of the finished flag. Reject a transaction for a closed round only if Prediction Markets tells you to do it.
Rejections and retries
To reject a transaction for a business reason, set meta.api_code in the error response. Prediction Markets reads meta.api_code even in a response with status code 200. See the api_code field for the codes and their effect.
Prediction Markets treats a response with status code 200 as a failure if the response has no balance, has no round_id, or has no item for a transaction in the request. Prediction Markets then sends a Round/Rollback request.
Required headers:
X-REQUEST-SIGN— HMAC-SHA256 hex signature of the raw request body
Request
Responses
- 200
- 400
- 403
- 5XX
You processed all transactions in the request.
You cannot process the request. Use meta.api_code to give the reason.
The signature is not correct. The X-REQUEST-SIGN header is missing, or it does not match the signature of the raw request body.
Your system has an internal error. Prediction Markets can send the request again.