BETCORE Aggregator
Provider IntegrationCasino Integration
Provider IntegrationCasino Integration
Visit Betcore website
Follow Betcore on Instagram
Follow Betcore on LinkedIn
Follow Betcore on Youtube
  1. Bets
  • Getting Started
  • Integrate BETCORE Games (Casino)
    • Integrate BETCORE Gems (Casino)
    • WebFrame Connection
    • Aggregator API for Casino
      • Authentication
        • Verify
        • Jwks
        • Token
      • Payments
        • Accept
      • Cashback
        • Accept
    • Casino API for Aggregator
      • Users
        • Auth
        • Data
      • Payments
        • Info
        • Make
        • Make-list
        • Close
      • Cashback
        • Make
  • Integrate as Games Provider
    • Integrate as Games Provider
    • Provider API for Aggregator
      • Games
        • Games
        • Launch
    • Aggregator API for Provider
      • Get Balance
        • Balance
      • Bets
        • PayIn
          POST
        • PayOut
          POST
        • PayInOut
          POST
        • Refund
          POST
  • Feed
    • Feed Integration
    • REST API
      • Authorization
        • Token
      • Games
        • Info
        • Translations
      • Jackpot
        • Accumulated
    • Websocket
      • SubOnWholeGamesInfo
  • SubOnWholeGamesInfo
  1. Bets

PayInOut

POST
/v1/sessions/{{sessionId}}/bets/pay-in-out

Overview#

The PayInOut endpoint is designed to handle both the acceptance of a bet and the immediate processing of its outcome in a single request. This combined operation is especially useful in scenarios where the game result is known almost instantly after the bet is placed. By merging the functionalities of PayIn (bet acceptance) and PayOut (processing the win/loss outcome) into one call, the endpoint streamlines the betting workflow and reduces the latency of transaction processing.
The main objectives of the PayInOut method are:
Simultaneous Processing: It allows both the acceptance of the user's bet (deducting or earmarking the bet amount) and the payout (crediting the winnings or confirming a loss) to be processed in one atomic call.
Efficiency in Rapid Outcome Scenarios: The method is best suited for games where the result is determined at the same moment the bet is placed, thereby eliminating the need for two separate API calls.
Transaction Linking: The use of a unique bet identifier (betId) ensures that all cash flow transactions (both debit and credit parts) remain linked throughout the betting lifecycle. The system returns separate transaction IDs for the bet and the payout components, ensuring complete traceability.

Security and Authentication#

The PayInOut endpoint, like other API requests within this integration, requires strict authentication to ensure that only authorized parties can interact with it. This is achieved through the use of mandatory HTTP headers. Please see the required headers below in the Header Params section.
📌
Signature of the request shall be calculated using HMAC-SHA256 algorithm and sent in "X-Sign" header of the request.
Please see How to calculate the X-Sign value.

Path Parameters#

ParameterTypeRequiredDescription
sessionIdstringYesGame Session id.

Request

Header Params
X-Counterparty-Id
string 
required
The public identifier of the subject provided during the onboarding process.
Example:
933a215f-a9e6-4f88-9d91-52a87cd50499
X-Timestamp
number 
required
Request generation time. All requests longer than 30 seconds will be considered expired.
Example:
1719766120806
X-Request-Id
string 
required
A random sequence of 32 hexadecimal digits (Nonce) representing a unique request identifier.
Example:
5a0679b6e5fa48f6892c777b0fa92392
X-Sign
string 
required
HMAC.SHA256 message signature.
Example:
c4d62f77cdfaadb6690b3bcbe5a0ca9ef1e5bf41d746d361a1269558eeb7ccd1
Body Params application/json
betId
string 
required
Unique ID of the user's bet in the Game Provider's system.
This ID unites cash flow transactions and is an end-to-end identifier for them.
It is a unique key within one cash flow transaction.
gameRoundId
string 
optional
Game round ID, unique for each game iteration. Single identifier between users in case of a common game round. Provided by the Game Provider.
betAmount
number 
required
Bet amount.
winAmount
number 
required
The winning amount. If the amount is 0, then the bet is lost.
winOdd
number 
optional
Winning coefficient. For a losing bet it is 0.
Example
{
  "betId": "4178696881",
  "gameRoundId": "c5dfa465-93fc-4e8e-a643-954747f74ca1",
  "betAmount": 10.5,
  "winAmount": 55.25,
  "winOdd": 11.05
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://mock.apidog.com/m1/820627-0-default/v1/sessions/{{sessionId}}/bets/pay-in-out' \
--header 'X-Counterparty-Id: 933a215f-a9e6-4f88-9d91-52a87cd50499' \
--header 'X-Timestamp: 1719766120806' \
--header 'X-Request-Id: 5a0679b6e5fa48f6892c777b0fa92392' \
--header 'X-Sign: c4d62f77cdfaadb6690b3bcbe5a0ca9ef1e5bf41d746d361a1269558eeb7ccd1' \
--header 'Content-Type: application/json' \
--data-raw '{
  "betId": "4178696881",
  "gameRoundId": "c5dfa465-93fc-4e8e-a643-954747f74ca1",
  "betAmount": 10.5,
  "winAmount": 55.25,
  "winOdd": 11.05
}'

Responses

🟢200Success
application/json
Body
betTransactionId
string 
optional
Aggregator bet transaction ID.
winTransactionId
string 
optional
Aggregator winning transaction ID.
balance
number 
optional
User balance.
_responseCode
integer 
required
Response code.
Example
{
  "betTransactionId": "390",
  "winTransactionId": "391",
  "balance": 1588.5,
  "_responseCode": 1,
}
🟠402Bad Request
Previous
PayOut
Next
Refund
Built with