SportAPI Documentation
EN
C Product documentationCoupon API
v1
Service & pricing ↗ Get access ↗
Coupon API / API overview

API Overview

The Bet Placement and Settlement API allows a partner to submit sports bets selected by users to the SportAPI Coupon Settlement System (hereinafter referred to as the Settlement System), receive confirmation that the bets were accepted, and obtain their results after the sporting event has finished.

The service validates each bet against the current sports line, stores the coupon, and settles every bet included in it. Results can be retrieved through API requests, delivered by callback, or received through both methods at the same time.

Who the API is intended for

The API is suitable for systems that already receive a sports line and want to submit bets for centralized settlement, including:

  • sportsbook platforms;
  • sports prediction services;
  • partner applications and websites;
  • other systems that require sports bet statuses and results.

To create a coupon, the partner needs a pointer to the selected outcome from the sports line. The pointer format is described in Bet pointer.

Key concepts

TermMeaning
OutcomeA result option selected by the user, such as the first team to win or a total over 2.5.
BetOne selected outcome with recorded odds.
CouponA record that contains one or more bets and the total stake amount.
SingleA coupon containing one bet.
AccumulatorA coupon containing multiple bets. Its final result depends on the settlement of every included bet.
coupon_codeThe public unique code of the created coupon. The partner uses it to associate data in the Settlement System with data in the partner’s own system.
SettlementDetermination of the bet result and the coupon’s resulting state: win, loss, return, or another settlement result.

How a coupon is processed

Authentication
→ select an outcome from the sports line
→ place the coupon
→ validate the current state of the bets
→ store coupon_code
→ settle the bets
→ receive the result

1. Authentication

The partner signs in to the Client API with a username and password and receives a JWT. This token must be included in every protected request.

See Authentication for details.

2. Selecting an outcome

The user selects an outcome in the partner’s interface. Together with the outcome, the partner receives from Sport Line API the event, bet group, and outcome type identifiers, as well as the bet parameter and current odds.

These outcome values are used to form the string bet pointer. Team, tournament, or outcome names are not required to place a coupon.

3. Placing a coupon

The partner submits one or more bets, the stake amount, and additional parameters to:

POST /api/partner/coupons/place

Before storing the coupon, the Settlement System validates each outcome against the current sports line:

  • whether the event and selected outcome exist;
  • whether the outcome is available for bet placement;
  • whether the odds have changed;
  • whether the selected bets may be combined in one coupon.

If validation succeeds, the API atomically creates the coupon, debits its stake from the SportAPI client account balance, and returns the coupon data. With multi = true, the stake amount is debited for every single coupon created. If the available balance is insufficient for the total amount, the API returns error 507, creates no partial coupons, and leaves the balance unchanged.

The SportAPI client account balance is not the end user’s balance. The partner manages and updates user wallets independently in the partner’s own system.

Until a successful API response is received, the contents of the partner’s bet slip are only the user’s preliminary selection. They must not be stored as an accepted coupon. The accepted coupon record must be created only from body.coupons after a response with code = 1.

See Coupon placement for details.

4. Storing coupon data

After successful placement, the API returns the coupon-level data and an events_data array containing detailed information about every bet included in the coupon.

The partner decides which coupon and bet fields must be stored in the partner’s system. The coupon_code must always be stored: it is the primary linking key used to retrieve the coupon, reconcile results, and process callbacks.

Store coupon_code as a string because the code may contain leading zeros.

5. Settlement

After the result of the sporting event becomes available, the Settlement System settles each bet and updates the state of the entire coupon.

The result of a single is determined by its only bet. Bets in an accumulator may be settled at different times, so the accumulator’s state may be updated several times before final settlement.

See Settlement lifecycle for details.

6. Receiving the result

The partner can receive results in two ways.

MethodHow it worksWhen to use it
API requestsThe partner’s system requests a single coupon, a list of coupons, active coupons, or recently settled coupons.As the primary method when callbacks are not used, or for periodic reconciliation.
CallbackThe Settlement System sends a signed HTTP request to the partner after the settlement state changes.To receive results automatically without continuously polling the API.

Callbacks are optional. If the partner wants to use them, the partner must inform the manager, obtain a secret phrase for signature verification, and provide a callback_url when placing a coupon.

Even when callbacks are enabled, API requests can still be used for additional verification and recovery of missed data.

See also:

What you need before integration

The manager provides the partner with:

  • the Client API base URL;
  • a username;
  • a password;
  • when callbacks are enabled, a secret phrase for signature verification.

In addition, the partner’s system must receive pointers and selected-outcome data from the sports line.

Important rules

  1. Use the recommended /api/partner/** endpoints.
  2. Include the client JWT in every protected request.
  3. Store coupon_code as a string and preserve leading zeros.
  4. Check the code field in the JSON response. A business error may be returned with HTTP 200.
  5. All dates and times are Unix timestamps in milliseconds.
  6. Amounts, odds, and payouts are decimal numbers without a fixed number of decimal places.
  7. The partner defines its own rounding and display rules for numeric values.
  8. A client can retrieve only the coupons that belong to the client identified by the JWT.

See Common API conventions for details.

If you use the old API

Legacy endpoints remain supported, but /api/partner/** is recommended for new integrations.

All changes to endpoints, requests, responses, errors, and client-side logic are collected in one document: Migrating from the old API.

Next step: place your first coupon by following the Quick Start guide.