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

Compatible Legacy Routes

Legacy routes remain supported, and there are currently no plans to remove them.

This section is only for existing integrations. For a new integration, use:

/api/partner/**

The complete code-upgrade sequence is in Migrating from the Legacy API.

Legacy Route Map

MethodLegacy routePurposeRecommended replacement
POST/api/v2/loginObtain a JWT under the legacy contract./api/partner/login
POST/bet/placeCreate a coupon under the legacy contract./api/partner/coupons/place
GET/coupons/getOne coupon in the legacy DTO./api/partner/coupons/get
GET/coupons/calculatedRecent settlements in the legacy DTO./api/partner/coupons/calculated
GET/coupons/listCoupons by creation period.POST /api/partner/coupons/results
GET/api/v3/partner/bet/listAlias for the legacy list.POST /api/partner/coupons/results
GET/coupons/cashoutExperimental cashout quote.No new route yet

Legacy Response Envelope

Legacy routes return five top-level fields:

{
  "code": 1,
  "body": {},
  "error_code": null,
  "error_message": null,
  "date": 1784970000000
}

The legacy envelope does not contain:

  • time_ms;
  • path.

A business error usually uses HTTP 200 with code = 0.

Legacy API Authentication

Obtaining a Token

POST /api/v2/login

Request:

{
  "login": "<login>",
  "password": "<password>"
}

Response:

{
  "code": 1,
  "body": {
    "token": "eyJhbGciOiJIUzI1NiJ9..."
  },
  "error_code": null,
  "error_message": null,
  "date": 1784970000000
}

Invalid credentials:

{
  "code": 0,
  "body": null,
  "error_code": 99,
  "error_message": "Wrong login or password",
  "date": 1784970000000
}

Legacy login returns this same response for every authentication rejection: unknown username, incorrect password, disabled account, expired access, or insufficient balance. Separate reasons are available only through the new POST /api/partner/login.

Invalid JWT

Protected legacy routes preserve the previous behavior:

{
  "code": 0,
  "body": false,
  "error_code": 1003,
  "error_message": "Wrong token",
  "date": 1784970000000
}

The response uses HTTP 200.

The new API uses HTTP 401 and 403 instead.

Coupon Creation

POST /bet/place

The legacy route preserves its previous request and response contract.

Its fields are:

  • list_bets;
  • amount;
  • callback_url;
  • currency;
  • lang;
  • mode;
  • mode_type;
  • multi.

For the legacy route, lang, mode, and multi are required. Invalid or incomplete data returns error_code = 505.

Successful Result

The current compatible route returns created coupons as a direct array in body, without a body.coupons object:

{
  "code": 1,
  "body": [
    {
      "coupon_code": "000000000272",
      "amount": 10,
      "win": 18.5,
      "coef": 1.85,
      "status": 0,
      "calculate_date": null,
      "coupon_type": 1,
      "events_count": 1,
      "events_data": [
        {
          "uuid": "912",
          "game_id": 737779544,
          "status": 0,
          "coef": 1.85,
          "calc_coef": null,
          "calculate_date": null
        }
      ]
    }
  ],
  "error_code": null,
  "error_message": null,
  "date": 1784970000000
}

Historical versions of the legacy documentation included examples where one coupon was returned directly as an object in body. When migrating an existing integration, verify the actual contract of the environment in use. The new /api/partner/coupons/place always uses the unambiguous body.coupons[] array.

Feed Validation Errors

For all four reasons, legacy /bet/place uses:

error_code = 501
error_message = "Coefficient is change"

Reasons are sent as a direct array in body:

{
  "code": 0,
  "body": [
    {
      "game_id": 738917381,
      "bet_coefficient": 3.6,
      "actual_coefficient": null,
      "change_type": null,
      "status": "no_data"
    }
  ],
  "error_code": 501,
  "error_message": "Coefficient is change",
  "date": 1784970000000
}

Possible status values:

  • rejected;
  • no_data;
  • block;
  • error.

change_type:

  • 1 — odds increased;
  • 2 — odds decreased;
  • null — blocked, absent outcome, or validation error.

String values increase and decrease are not used.

The new /api/partner/coupons/place separates these reasons into 501–504 and returns the array in body.changes.

Retrieving One Coupon

GET /coupons/get?coupon_code=000000000272

Requirements:

  • Bearer JWT;
  • a code containing exactly 12 digits.

Errors:

error_codeMeaning
560Code is missing or incorrectly formatted.
561Coupon was not found or belongs to another client.

The legacy route returns the legacy coupon model. The internal bet ID is named uuid and is sent as a string.

Recently Settled Coupons

GET /coupons/calculated?time={minutes}

time rules:

  • default is 5 minutes;
  • time <= 0 is replaced with 5;
  • maximum is 120 minutes;
  • filtering uses final settlement time;
  • active coupons and coupons owned by another client are not returned.

The result is a direct array of legacy DTOs in body.

The current replacement preserves the window logic but returns the complete new model:

GET /api/partner/coupons/calculated?time={minutes}

Coupon List

GET /coupons/list
GET /api/v3/partner/bet/list

Query parameters:

FieldTypeDescription
start_dateinteger/nullStart of creation period, Unix milliseconds.
end_dateinteger/nullEnd of creation period, Unix milliseconds.

Rules:

  • without dates, the last 24 hours are returned;
  • with only start_date, the 24 hours after it are returned;
  • with only end_date, the 24 hours before it are returned;
  • with both dates, the interval must be positive and no longer than 24 hours;
  • coupons are returned in the legacy DTO.

Current replacement:

POST /api/partner/coupons/results

It accepts either both dates in JSON or up to 100 coupon_ids values.

Compatible /api/v3/partner/bet/** Routes

Despite the /api/v3 prefix, the routes serve different purposes:

RouteFormat
POST /api/v3/partner/bet/placeAlias for new /api/partner/coupons/place.
GET /api/v3/partner/bet/getAlias for new /api/partner/coupons/get.
GET /api/v3/partner/bet/activeAlias for new /api/partner/coupons/active.
GET /api/v3/partner/bet/listAlias for legacy /coupons/list; returns the legacy DTO.

Do not use a mixed set of /api/v3/** routes in a new integration. Move to the consistent /api/partner/** routes.

Legacy DTO Differences

In the legacy model:

  • a bet is identified by string uuid;
  • there is no complete separation of potential_win and real_win;
  • there is no complete set of original and settlement odds;
  • there is less sub-event information;
  • there are fewer extended score fields;
  • some compatible fields use historical names.

Starting from version 1.2.0, a legacy-model bet also contains:

  • settlement_reason_code — stable code for the reason for settlement or return;
  • settlement_reason — explanatory reason text.

Do not use settlement_reason text as a programmatic key. The set of codes may expand.

In the new model:

  • a bet has numeric events_data[].id;
  • uuid is used in callbacks;
  • potential_win, real_win, original_coef, and calculate_coef were added;
  • live and sub-event information was added;
  • complete names and extended score fields were added.

Legacy Error Codes

CodeMeaning
99Incorrect username or password.
501General outcome-validation error.
505Invalid or incomplete /bet/place data.
506Multiple bets from one match in a coupon.
507Insufficient client account balance; no coupons are created.
560Invalid coupon code.
561Coupon not found.
565Cashout unavailable.
1003Invalid JWT.
10000Unknown or internal error.

Historical documentation associated 507 with a general server error. In the current 1.2.0 contract, it means Insufficient balance: creation is rejected completely, no coupons are created, and the client balance does not change. Code 540 is historical and is not part of the current OpenAPI contract.

Cashout

GET /coupons/cashout?coupon_code={coupon_code}

The function:

  • is under development;
  • is not fully tested;
  • is not recommended for production;
  • only calculates an estimate;
  • does not sell a coupon or change any balance.

There is no new /api/partner/** route yet.

See Cashout for details.

Changes Required in Existing Code

Do not mix legacy and new DTOs in one implicit handler.

During gradual migration:

  1. explicitly identify the contract by the route called;
  2. store coupon_code as a string;
  3. support the new body.coupons object during creation;
  4. match the new bet id to legacy or callback uuid;
  5. add the new statuses and settlement fields;
  6. move to the new API’s HTTP 401/403 behavior;
  7. after verification, disable legacy routes one at a time.

Complete checklist: Migrating from the Legacy API.

Legacy Support Checklist

  • Legacy routes are used only by existing code.
  • New code uses /api/partner/**.
  • The legacy envelope does not expect time_ms or path.
  • Invalid legacy JWT is handled through error_code = 1003.
  • A legacy /bet/place error is read from the direct body array.
  • coupon_code is stored as a string.
  • Legacy uuid is not confused with batchId.
  • /api/v3/partner/bet/list is recognized as a legacy DTO.
  • Cashout is not used in production.

Next section: Glossary.