Questions? Talk to the team on Telegram Contact us
Open account
Open your account40,000+ games and a sportsbook on one API. No setup fee, live in days.
Open account →
Home / Betting API: how a sports bet API integration really works

Betting API: how a sports bet API integration really works

A sports betting API on the seamless model asks your platform for one thing: move money correctly when told to. Here is how the launch, the four wallet callbacks and the testing work for Nocturn Sport, written for the developers who will build it and the managers who will sign it off.

Get API access Compare

Two very different things called a betting API

Search for "betting API" and you will find two families of product under the same name. The first is a data API: it sends you fixtures, markets and prices, and expects you to build everything else. The second is a sportsbook API: it gives you a working book to place in front of players and asks your platform for only one thing in return, which is to move money when told to. Both are legitimate. They demand completely different integration projects.

The betting API we provide belongs to the second family. Nocturn Sport is delivered as a complete sportsbook, launched through the same API that launches our casino games, and it talks to your platform through the seamless wallet you already maintain. This page walks through what that integration involves in practice, step by step, and where operators most often get it wrong. If you are still deciding whether you need raw prices or a managed book, read the comparison of both models on our sportsbook API page first.

The shape of a bet API integration

Strip away the marketing and a sports betting API integration on the seamless model has four moving parts:

  1. Player identity. Your platform tells us who the player is and which currency they bet in. We never hold credentials, documents or personal data beyond what the session needs.
  2. Launch. Your platform requests a launch URL for the sportsbook, exactly as it would for a slot, and opens it in your page.
  3. Wallet callbacks. While the player bets, the sportsbook calls your endpoint to read the balance, take stakes, pay returns and reverse transactions.
  4. Reconciliation. Your finance and support teams match what your wallet recorded against bet history and reports.

Operators already connected to our casino game aggregator API, have items one, two and four in place already. The sportsbook adds new traffic to the callbacks, and that traffic has a few characteristics worth understanding before go-live.

The four callbacks, seen from a sportsbook

Balance

The sportsbook asks for the player's current balance when it opens and when it needs to refresh the figure shown to the player. Answer it from your source of truth and answer quickly. A slow balance response does not lose money, but it makes the bet slip feel sluggish, and in a live market a sluggish slip means more rejected prices.

Bet

A bet call is a debit: the player has placed a bet, it has been accepted on the sportsbook side, and the stake must leave the balance. Your endpoint checks the funds, records the transaction against its unique identifier, deducts the stake and returns the new balance. If the player cannot cover the stake, you return the insufficient-funds response and the bet does not stand.

One difference from casino traffic matters a great deal: a casino bet is usually followed by its win within seconds, while a sports bet may stay open for hours, days or, for outright markets, weeks. Your wallet must not expect a quick matching win, must not time out an "unanswered" round, and should report open sports stakes as outstanding liabilities.

Win

A win call is a credit. It arrives when a market is resulted and the bet has won, or partly won in the case of some handicap and combination outcomes. Lost bets simply end without a credit; there is no zero-value call you should wait for. Credits must be idempotent: if the same win identifier reaches you twice because of a network retry, you pay once and return the same result the second time.

Rollback

A rollback reverses an earlier movement. In sports betting this is routine rather than exceptional: matches are abandoned, markets are voided after a scoring error, events are postponed beyond the rules window. The rollback references the original transaction, and your wallet should restore the balance accordingly. Treat rollbacks as normal, identifiable transactions with their own audit trail, never as manual adjustments.

Idempotency is the whole game

Most wallet incidents on the seamless model come down to the same root cause: a request was retried and processed twice, or a retry was rejected because the first attempt was considered "in progress". On the seamless model, retries are expected. A network hiccup between the request and your response leaves the sender with no way of knowing whether you processed the call, so it sends it again.

The rules that keep a betting wallet clean are short:

  • Store every transaction identifier you process, with its outcome and the resulting balance.
  • When an identifier you have already processed arrives again, return the stored result. Do not process it a second time, and do not return an error.
  • When a rollback arrives for a transaction you never received, record it so that a late original cannot later be applied.
  • Make the check and the balance update a single atomic operation in your database.

Get these four right and the sportsbook's traffic will be no harder to handle than a busy slot lobby.

Security and signatures

Every callback is signed, and your endpoint must verify the signature before touching a balance. Reject requests that fail verification or whose timestamp falls outside the accepted window, and answer them with the documented error rather than a crash or an empty response. Keep your secret out of client-side code and out of logs. The exact signature scheme, field names and error codes are in the API documentation you receive with your credentials.

A testing checklist before go-live

Our sandbox lets you run the full flow against your endpoint before real money is involved. Operators who work through the scenarios below rarely see surprises in production:

  1. Place a single bet and confirm the debit, the balance shown in the slip and the transaction in your logs.
  2. Place a bet larger than the balance and confirm it is refused cleanly.
  3. Settle a winning bet and confirm the credit, then replay the same credit and confirm nothing is paid twice.
  4. Let a bet lose and confirm your system closes it without waiting for a credit.
  5. Trigger a void and confirm the rollback restores the stake with its own audit entry.
  6. Place a combination bet and check how it appears in your history and reports.
  7. Switch a casino game and the sportsbook back and forth in one session and confirm the balance follows the player in both.
  8. Simulate a slow or failed response from your endpoint and confirm that retries are handled idempotently.

Reporting and support after launch

Once real bets flow, two teams start living with the integration: finance and support. Finance needs to see sports GGR separately from casino GGR, because the commercial terms differ and because a single big football weekend can swing the month. Tag every transaction in your wallet with the product it came from, so that sports stakes, returns and rollbacks can be summed on their own without guesswork.

Support needs to answer one question above all others: "why was my bet settled like that?" Make sure your agents can look up a player's sports transactions by date and identifier, see whether a stake was returned by a rollback, and tell an open bet from a lost one. A player who sees a stake leave the balance and nothing come back for three days is usually holding a perfectly normal open bet on a later fixture, and an agent who can show that in thirty seconds saves a complaint.

What the API does not do for you

A sportsbook API on the seamless model deliberately leaves certain responsibilities on your side. Registration, identity verification, deposits, withdrawals, responsible-gambling limits, self-exclusion and the decision about which countries may access the sportsbook all happen in your platform before the launch URL is ever requested. If a player is self-excluded, the correct behaviour is that your platform never opens the sportsbook for them. The API is a supply line for a product; the licence and the customer relationship stay with you.

Bonus money follows the same logic. If you run sports bonuses, the rules about which balance is used and how sports stakes count toward wagering are defined and enforced in your platform, because your wallet is the one answering the bet call.

Commercial terms in one place

The sportsbook is charged at 12% of GGR, with no setup fee. It draws on the same prepaid credit as casino content, and the minimum top-up is 100 USD. The full breakdown sits on our pricing page. When you are ready to start building against the sandbox, request credentials on the get an API key page; a single set of keys covers casino titles and the sportsbook. For the live side of the book specifically, including bet delays and suspended markets, continue with our live betting API guide.

Frequently asked questions

What is the difference between a betting API and an odds API?

An odds API sends prices and fixtures and leaves bet acceptance, settlement and the front end to you. A sportsbook betting API like Nocturn Sport delivers the complete book and only asks your wallet to debit and credit balances.

Which wallet callbacks does the sportsbook use?

Balance, bet, win and rollback, the same callbacks your casino integration already answers. Sports traffic simply adds longer gaps between a bet and its settlement.

Why can a sports bet stay open for days?

Because a bet is settled only when its market is resulted. Outright, tournament and later fixtures can stay open far longer than any casino round, so your wallet should treat them as open liabilities.

What happens if a win request is sent twice?

Your endpoint should recognise the transaction identifier, return the stored result and pay nothing more. Idempotent handling of retries is the most important rule of a seamless wallet.

Do I need separate API keys for sport and casino?

No. One set of credentials covers the casino catalogue and the sportsbook, and both draw on the same prepaid credit.

Who handles responsible-gambling limits?

Your platform does. Limits, self-exclusion and geo-restrictions are applied before the sportsbook is launched, because the licence and the player relationship remain with the operator.