▪️Deals management API

This document describes the API for the Operator to manage deals for affiliates

Creating new deals for affiliates

The operator can use the HTTP POST method to build deals for specified affilite_id.

The platform supports the following deals:


export enum AffDealType {
    // Pure deals
    CPL = 1,
    CPA = 2,
    RevShare_NetPL = 4,
    RevShare_NetDeposit = 8,

    // Hybrid deals
    CPL_CPA = 3,
    CPL_RevShare_NetPL = 5,
    CPA_RevShare_NetPL = 6,
    CPL_RevShare_NetDeposit = 9,
    CPA_RevShare_NetDeposit = 10,
}

To create a new deal for an affiliate, you need to make an HTTP POST request to the API endpoint with the following JSON body.


{
    "affiliate_id": 64257,
    "deal_type_id": 2, // One of deal types
    "deal_group_name": "Some name of the deal",
    
    // parameters specific for CPA deal
    "cpa_amount": 10.5,         // required, CPA amount that will be paid for affiliate
    "qua_cpa_net_deposit": 10,  // optional, NetDeposit qualifier amount
    "qua_cpa_deposit": 20,      // optional, Deposit qualifier amount  
    "qua_cpa_ftd": 10,          // optional, FTD qualifier amount  
    "qua_cpa_volume": 100,      // optional, Volume (wagering) qualifier amount
    "qua_cpa_activity_count": 5 // optional, activities (bets) count qualifier amount

    // parameters specific for CPA deal
    "cpl_amount": 10.5,         // required, CPL amount that will be paid for affiliate
    "qua_cpl_volume": 100,      // optional, Volume (wagering) qualifier amount
    
    // parameters specific for RevShare deals (both P&L and NetDeposit based)
    "rev_share_percentage": 25, // required, % of rev share
        
}

For hybrid deals, you can use a combination of parameters. For example, for CPA + RevShare_NetPL deal, the required fields will be cpa_amount and rev_share_percentage.

The API key to access the end-point is the same as described here

Example of the call that creates a CPA + RevShare_NetPL deal with

  • CPA amount of - 10

  • Rev share percentage - 25

  • CPA FTD Qualifier - 30

curl --location 'https://boapi.smartico.ai/api/af2_deals_op' \
--header 'authorization: your-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "affiliate_id": 64257,
    "deal_type_id": 6,
    "deal_group_name": "CPA + REV & FTD Qualifier",
    "cpa_amount": 10,    
    "qua_cpa_ftd": 30, 
    "rev_share_percentage": 25
}'

Such a deal will correspond to the following configurations made from the platform BackOffice.

Getting a list of deals for the affiliate

You can use the HTTP GET method to get a list of all deals for the affiliate


curl --location 'https://boapi.smartico.ai/api/af2_deals_op?affiliate_id=100508' \
--header 'authorization: your-api-key'

You need to pass affiliate_id; as a response, you will get a list of all deals, including the sub-deals. Example of the response

[
    {
        "id": 93195,
        "affiliate_id": 100508,
        "deal_id": 93195,
        "deal_original_id": 93195,
        "deal_parent_original_id": null,
        "deal_group_name": "Default deal",
        "match_brand_ids": [
            -1
        ],
        "match_af_product_ids": [
            -1
        ],
        "match_countries": [
            "ANY"
        ],
        "match_source_ids": [],
        "match_campaign_ids": [
            -1
        ],
        "match_date_from": null,
        "match_date_till": null,
        "cpa_tiers_enabled": true,
        "cpa_tiers_structure": [
            {
                "step": 1,
                "amount": 2
            },
            {
                "step": 3,
                "amount": 4
            },
            {
                "step": 5,
                "amount": 6
            }
        ],
        "rev_share_tiers_enabled": 0,
        "rev_share_tiers_structure": [],
        "cpa_amount": 1,
        "rev_share_percentage": null,
        "cpl_amount": null,
        "qua_cpa_net_deposit": null,
        "qua_cpa_volume": null,
        "qua_cpa_activity_count": null,
        "qua_cpa_ftd": null,
        "qua_cpa_deposit": null,
        "qua_cpl_volume": null,
        "qua_rev_on_cpa_amount": null,
        "deal_type_id": 2,
        "is_default": true,
        "create_date": "2023-08-03T10:18:10.168Z",
        "close_date": null,
        "create_by": 2342,
        "is_latest": true,
        "cpl_users_count": "0",
        "cpa_users_count": "0",
        "rev_users_count": "0",
        "level_id": 1,
        "match_readable_brands": "Any brand",
        "match_readable_countries": "Any country",
        "match_readable_other": "",
        "cpa_tier_step_1": 1,
        "cpa_tier_amount_1": 2,
        "cpa_tier_step_2": 3,
        "cpa_tier_amount_2": 4,
        "cpa_tier_step_3": 5,
        "cpa_tier_amount_3": 6
    },
    {
        "id": 94509,
        "affiliate_id": 100508,
        "deal_id": 94509,
        "deal_original_id": 94509,
        "deal_parent_original_id": 93195,
        "deal_group_name": null,
        "match_brand_ids": [
            -1
        ],
        "match_af_product_ids": [
            -1
        ],
        "match_countries": [
            "AX"
        ],
        "match_source_ids": [],
        "match_campaign_ids": [
            -1
        ],
        "match_date_from": null,
        "match_date_till": null,
        "cpa_tiers_enabled": true,
        "cpa_tiers_structure": [
            {
                "step": 1,
                "amount": 2
            },
            {
                "step": 3,
                "amount": 4
            },
            {
                "step": 5,
                "amount": 6
            }
        ],
        "rev_share_tiers_enabled": 0,
        "rev_share_tiers_structure": [],
        "cpa_amount": 5,
        "rev_share_percentage": null,
        "rev_cap_amount": null,
        "cpl_amount": null,
        "qua_cpa_net_deposit": null,
        "qua_cpa_volume": null,
        "qua_cpa_activity_count": null,
        "qua_cpa_ftd": null,
        "qua_cpa_deposit": null,
        "qua_cpl_volume": null,
        "qua_rev_on_cpa_amount": null,
        "deal_type_id": 2,
        "is_default": false,
        "create_date": "2023-08-06T08:29:50.555Z",
        "close_date": null,
        "create_by": 1,
        "is_latest": true,
        "cpl_users_count": "0",
        "cpa_users_count": "0",
        "rev_users_count": "0",
        "level_id": 2,
        "match_readable_brands": "Any brand",
        "match_readable_countries": "AX",
        "match_readable_other": "",
        "cpa_tier_step_1": 1,
        "cpa_tier_amount_1": 2,
        "cpa_tier_step_2": 3,
        "cpa_tier_amount_2": 4,
        "cpa_tier_step_3": 5,
        "cpa_tier_amount_3": 6
    }
]

If you are interested only in the root level deals, you will need to take only deals with level_id: 1

Last updated