Data types
ℹ️
This diagram serves as a supplement to the api documentation. The up-to-date diagrams can be found in the documentation.
Development
https://dev-api.onchainfeed.org/api/v1/public/gateway/docs
Production
https://api.onchainfeed.org/api/v1/public/gateway/docs
Enums
BonusType
Schema
| Value | Description |
|---|---|
| FreeBet | Represents a free bet bonus type |
BonusStatus
Schema
| Value | Description |
|---|---|
| Used | The bonus has been used |
| Available | The bonus is available for use |
FreebetBonusType
Schema
| Value | Description |
|---|---|
| OnlyWin | The bettor receives only the winnings; the stake amount is returned to the pool. isSponsoredBetReturnable = true |
| AllWin | The bettor receives both the full stake and the winnings; the stake amount is not returned to the pool. isSponsoredBetReturnable = false |
BetRestrictionBetType
Schema
| Value | Description |
|---|---|
| All | All bet types are allowed |
| Ordinar | Only ordinar bets are allowed |
| Combo | Only combo bets are allowed |
EventRestrictionEventStatus
Schema
| Value | Description |
|---|---|
| All | All event statuses are allowed |
| Live | Only live events are allowed |
| Prematch | Only prematch events are allowed |
PromoCodeStatus
Schema
| Value | Description |
|---|---|
| Active | The promo code has not been deactivated. Expiry and usage are not statuses: an expired or used-up code is still Active |
| Deactivated | The promo code was deactivated. This is final |
BonusSource
Schema
| Value | Description |
|---|---|
| All | Bonuses from every source (default) |
| Manual | Bonuses granted manually, not through a promo code |
| PromoCode | Bonuses issued by activating a promo code |
Common types
FreebetSettings
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| bonusType | FreebetBonusType | Type of the freebet bonus | Yes |
| feeSponsored | boolean | Indicates if fee is sponsored | Yes |
| betRestriction | BetRestriction | Restrictions applied to bets | Yes |
| eventRestriction | EventRestriction | Restrictions applied to events | Yes |
| periodOfValidityMs | number | Period of validity in milliseconds | Yes |
BetRestriction
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| betType | BetRestrictionBetType | Type of bet restriction | Yes |
| minOdds | string | Minimum odds allowed | Yes |
| maxOdds | string | Maximum odds allowed | No |
EventRestriction
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| eventStatus | EventRestrictionEventStatus | Status of event restriction | Yes |
| eventFilter | EventFilter | Filter for events | No |
EventFilter
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| exclude | boolean | If exclude = true, it means "allow all, except.". If exclude = false, it means "deny all, except." | Yes |
| filter | FilterItem[] | List of filter items | Yes |
FilterItem
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| sportId | string | ID of the sport | Yes |
| leagues | string[] | List of leagues | No |
| markets | Market[] | List of markets | No |
Market
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| marketId | number | ID of the market | Yes |
| gamePeriodId | number | ID of the game period | Yes |
| gameTypeId | number | ID of the game type | Yes |
Public types
GetClientBonusesResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| bonuses | ClientBonus[] | Array of bonus objects | Yes |
ClientBonus
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | Unique identifier of the bonus | Yes |
| bonusType | BonusType | Type of the bonus | Yes |
| freebetParam | FreebetParam | Parameters specific to freebet | Yes |
| publicCustomData | object (JSON) | This field is custom and arbitrary, meaning it is defined by the offer creators. It is used for any additional technical information that may be needed for integration with your systems. It prohibits dangerous constructs such as <script> to ensure safe usage. Max length 500 | No |
| address | string | Wallet address | Yes |
| amount | string | Bonus amount | Yes |
| status | BonusStatus | Current status of the bonus | Yes |
| network | string | Blockchain network | Yes |
| currency | string | Currency code | Yes |
| expiresAt | string | Expiration timestamp | Yes |
| usedAt | string | Usage timestamp | Yes |
| createdAt | string | Creation timestamp | Yes |
FreebetParam
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| isBetSponsored | boolean | Is bet sponsored | Yes |
| isFeeSponsored | boolean | Is fee sponsored | Yes |
| isSponsoredBetReturnable | boolean | Is sponsored bet returnable | Yes |
| settings | FreebetSettings | Freebet settings configuration | Yes |
ActivatePromoCodeDto
The response is one ClientBonus.
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| code | string | The promo code. Trimmed and upper-cased by the server. Max length 32 | Yes |
| bettorAddress | string | Address of the bettor who activates the code | Yes |
| affiliate | string | Your affiliate address. Must equal the address of the code’s pool | Yes |
Private types
CreateFreebetOfferDto
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| name | string | Name of the freebet offer | Yes |
| key | string | Unique key for the offer | Yes |
| publicCustomData | object (JSON) | This field is custom and arbitrary, meaning it is defined by the offer creators. It is used for any additional technical information that may be needed for integration with your systems. It prohibits dangerous constructs such as <script> to ensure safe usage. Max length 500 | No |
| description | string | Description of the offer | No |
| settings | FreebetSettings | Freebet settings configuration | Yes |
BonusResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | The ID of the bonus | Yes |
| operatorId | string | The ID of the operator | Yes |
| productId | string | The ID of the product | Yes |
| poolId | string | The ID of the pool | Yes |
| offerId | string | The ID of the offer | Yes |
| address | string | The address of the bonus | Yes |
| amount | string | The amount of the bonus | Yes |
| status | enum | The status of the bonus | Yes |
| campaignGroup | string | The campaign group of the bonus | Yes |
| network | string | The network of the bonus | Yes |
| currency | string | The currency of the bonus | Yes |
| expiresAt | Date | The expiration date of the bonus | No |
| usedAt | Date | The date when the bonus was used | No |
| createdAt | Date | The creation date of the bonus | Yes |
| offer | OfferResponse | Offer model | Yes |
| pool | PoolResponse | Pool model | Yes |
| operator | OperatorResponse | Operator model | Yes |
| isPromoCode | boolean | Whether the bonus was issued by activating a promo code rather than granted manually | No |
| promoCode | string | The promo code that issued the bonus. Absent for manual bonuses | No |
BonusesResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| bonuses | BonusResponse[] | List of bonuses | Yes |
OfferResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | Offer id | Yes |
| operatorId | string | Operator id | Yes |
| productId | string | Product id | Yes |
| type | enum | Type of bonus offer | Yes |
| name | string | Name of the offer | Yes |
| key | string | Unique key for the offer | Yes |
| description | string | Description of the offer | Yes |
| settings | FreebetSettings | Freebet settings configuration | Yes |
| publicCustomData | object (JSON) | This field is custom and arbitrary, meaning it is defined by the offer creators. It is used for any additional technical information that may be needed for integration with your systems. It prohibits dangerous constructs such as <script> to ensure safe usage. Max length 500 | No |
| createdAt | Date | Creation timestamp | Yes |
| operator | OperatorResponse | Operator model | No |
OffersResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| offers | OfferResponse[] | List of offers | Yes |
PoolResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | The ID of the pool | Yes |
| address | string | The address of the pool | Yes |
| network | string | The network of the pool | Yes |
| currency | string | The currency of the pool | Yes |
| token | string | The token of the pool | Yes |
| chainId | number | The chain ID of the pool | Yes |
| productId | string | The ID of the product | Yes |
| status | string | The status of the pool | Yes |
| createdAt | Date | The creation date of the pool | Yes |
PoolsResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| pools | PoolResponse[] | List of pools | Yes |
OperatorResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | The ID of the operator | Yes |
| userName | string | The username of the operator | Yes |
| string | The email of the operator | Yes | |
| productId | string | The ID of the product | Yes |
| role | string | The role of the operator | Yes |
| status | enum | The status of the operator | Yes |
| createdAt | Date | The creation date of the operator | Yes |
OperatorsResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| operators | OperatorResponse[] | List of operators | Yes |
CreateBonusRecipientsDto
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| address | string | Wallet address of the bonus recipient | Yes |
| amount | string | Amount of the bonus to be distributed | Yes |
CreateBonusDto
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| offerId | string | ID of the offer to create bonuses for | Yes |
| poolId | string | ID of the pool to create bonuses in | Yes |
| recipients | CreateBonusRecipientsDto[] | List of bonus recipients | Yes |
| campaignGroup | string | Campaign group identifier | Yes |
BonusStatisticsByCampaignItem
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| createdAt | string | Created date | Yes |
| campaign | string | Campaign name | Yes |
| offerId | string | Offer ID | Yes |
| poolId | string | Pool ID | Yes |
| amountSum | string | Total amount sum | Yes |
| amountSumUsed | string | Used amount sum | Yes |
| amountSumUsedPercent | string | Percentage of used amount sum | Yes |
| amountCount | string | Total amount count | Yes |
| amountCountUsed | string | Used amount count | Yes |
| amountCountUsedPercent | string | Percentage of used amount count | Yes |
| userUniqCount | string | Unique users count | Yes |
| userCount | string | Total users count | Yes |
| userCountUsed | string | Count of users who used bonus | Yes |
| userCountUsedPercent | string | Percentage of users who used bonus | Yes |
BonusStatisticsByCampaignResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| statistics | BonusStatisticsByCampaignItem[] | Bonus statistics items | Yes |
BonusStatisticsByPoolItem
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | The ID of the pool | Yes |
| address | string | The address of the pool | Yes |
| network | string | The network of the pool | Yes |
| currency | string | The currency of the pool | Yes |
| token | string | The token of the pool | Yes |
| chainId | number | The chain ID of the pool | Yes |
| productId | string | The ID of the product | Yes |
| status | string | The status of the pool | Yes |
| createdAt | Date | The creation date of the pool | Yes |
| amountSum | string | Total amount sum | Yes |
| amountSumUsed | string | Used amount sum | Yes |
| amountCount | string | Total amount count | Yes |
| amountCountUsed | string | Used amount count | Yes |
BonusStatisticsByPoolResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| statistics | BonusStatisticsByPoolItem[] | Bonus statistics items | Yes |
CreatePromoCodeDto
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| code | string | The promo code. Trimmed and upper-cased by the server; A-Z, 0-9, -, _, 1 to 32 characters; must be unique | Yes |
| offerId | string | ID of the freebet offer the code issues | Yes |
| poolId | string | ID of the pool the freebets are paid from | Yes |
| amount | string | Amount per activation in the base units of the pool’s token, e.g. "5000000" is 5 USDT on a 6-decimal token. Copied as is into every freebet the code issues | Yes |
| maxActivations | number | Activation limit, a whole number of at least 1 | Yes |
| expiresAt | string | Date-time (ISO 8601) at which the code stops working. Non-inclusive: from that instant on, the code can no longer be activated. Must be in the future | Yes |
UpdatePromoCodeDto
Send only the fields you change. code cannot be changed. After the first activation offerId, poolId and amount are locked, and maxActivations cannot go below activationsCount.
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | ID of the promo code | Yes |
| offerId | string | ID of the freebet offer the code issues | No |
| poolId | string | ID of the pool the freebets are paid from | No |
| amount | string | Amount per activation in the base units of the pool’s token, e.g. "5000000" is 5 USDT on a 6-decimal token. Copied as is into every freebet the code issues | No |
| maxActivations | number | Activation limit, a whole number of at least 1 | No |
| expiresAt | string | Date-time (ISO 8601) at which the code stops working. Non-inclusive: from that instant on, the code can no longer be activated. Must be in the future | No |
DeactivatePromoCodeDto
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | ID of the promo code to deactivate | Yes |
PromoCodeResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | The ID of the promo code | Yes |
| code | string | The promo code, trimmed and upper-cased | Yes |
| productId | string | The ID of the product | Yes |
| operatorId | string | The ID of the operator | Yes |
| offerId | string | The ID of the freebet offer the code issues | Yes |
| poolId | string | The ID of the pool the freebets are paid from | Yes |
| amount | string | Amount per activation in the base units of the pool’s token, e.g. "5000000" is 5 USDT on a 6-decimal token. Copied as is into every freebet the code issues | Yes |
| maxActivations | number | Activation limit | Yes |
| activationsCount | number | Number of freebets issued by the code so far | Yes |
| expiresAt | Date | Date-time (ISO 8601) at which the code stops working. Non-inclusive: from that instant on, the code can no longer be activated | Yes |
| status | PromoCodeStatus | The status of the promo code | Yes |
| createdAt | Date | The creation date of the promo code | Yes |
| offer | OfferResponse | Offer model | Yes |
PromoCodesResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| promoCodes | PromoCodeResponse[] | List of promo codes, newest first | Yes |
SportsUniqueMarketsCombinationsResponse
You can find the names of the markets in the library
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| [key: string] | array | Object with market combinations grouped by key | Yes |
| [key: string][].marketId | number | Market ID | Yes |
| [key: string][].gamePeriodId | number | Game period ID | Yes |
| [key: string][].gameTypeId | number | Game type ID | Yes |
ActualSportIdsResponse
You can find the names of the sports in the library
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| [index] | number[] | Array of sport IDs | Yes |
ActualLeaguesResponse
Schema
| Field | Type | Description | Required |
|---|---|---|---|
| [sportId: string] | array | Object with leagues grouped by sport ID | Yes |
| [sportId: string][].country | string | Country name | Yes |
| [sportId: string][].league | string | League name | Yes |