βͺοΈMore API methods
Working with affiliates' profiles
Get a list of all affiliates
The HTTP GET method can be used to get a list of all affiliates in the system.
curl --location --globoff 'https://boapi.smartico.ai/api/af2_aff_op' \
--header 'authorization: your-private-api-key'
You can filter the results with the filter URL parameter. It is a JSON object with these optional fields:
//Filter by affiliate status
"aff_status_id": number[];
//Set true to skip the balance calculation, false (default) to include it
"without_money": boolean;
//Search text in the affiliate name, username, email, contacts, company, external ID and more. Use `@` prefix to search by ID, e.g. `@123`
"q": string;
//Filter by the ID of the affiliate in your system
"ext_affiliate_id": string;
//Filter by the parent affiliate
"parent_affiliate_id": number;Example of a filtered request:
Example of response:
The field "default_deal_info" represents basic details of the latest version of the default deal for each affiliate. The deal_type_id field represents a bit mask of the deal type, as defined below
The field extra_role_ids represents permissions to the additional measurements that are visible for the affiliate or access to the "Registrations report". In the BackOffice, these are the Additional permissions of the affiliate. Possible values are:

Possible statuses of affiliate: aff_status_id
Update affiliate details
You should do a PUT API call with the ID of the Affiliate that you want to update in the URL.
You can include only fields that you want to update, e.g. example of updating just the first name of the affiliate
Full list of supported properties
Possible payment methods (payment_method_id)
Possible payment method details (payment_method_details). Fields marked with ? are optional; the others are required in the BackOffice.
Build a tracking link for an affiliate
The operator can use the HTTP POST method to build a tracking link for specific affiliate_id and specific destination link_id.
The API key is the same as described here
Example of response:
The tracking link is in url.
The same parameters always return the same link.
Required parameters:
affiliate_id- The affiliate the link is for. It must be one of the affiliates you can see. An affiliate who calls it gets their own ID, whatever they send.link_id- The destination link to build the tracking link for. It must belong to one of your brands.
Optional parameters:
asset_id- A media asset (banner, HTML) to attach. The response then returns the asset's content.deal_group_id- Ties the link to one specific deal. It must be a deal of that same affiliate.campaign_id- A number uses an existing campaign. Text creates a new campaign with that name and uses it.source_id- A free-text source tag. It is also saved in the affiliate's list of sources.hide_campaign_n_source-false(default) puts campaign and source in the link as visible parameters.truekeeps them out of the link and stores them on the tracking link instead.afps- Extra parameters added to the end of the link as-is, for exampleafp=abc&afp2=xyz. Write it as a ready query string without the leading?.custom_slug- A friendly name for the link, used instead of the random code. It is set only if the link has no slug yet. An existing slug is kept, and a slug already used elsewhere is rejected.
Get available destination links
The operator can use the HTTP GET method to get a list of destination links.
The API key is the same as described here
Example of response:
Manage pixel definitions (postbacks)
The operator can use the API to manage pixel definitions for the affiliate: HTTP GET to read them, POST to create and PUT to update.
The API key is the same as described here.
To get a list of pixel definitions for the specific affiliate:
Example of response:
To create a new pixel definition
Set deal_id to the ID of one of the affiliate's deals, or to -1 to trigger the pixel for all deals of the affiliate. -1 is also used when you do not pass deal_id.
For pixel_type_id 7 and 8, send "pixel": "" and pass these fields instead of a URL:
7 (FB/Instagram API):
meta_pixel_idandmeta_access_token8 (TikTok API):
meta_pixel_codeandmeta_access_token
To update existing pixel definition (pay attention that the ID of the definition should be passed in the URL, 2888 in our example). The ID column of the Pixel Definitions tab in the affiliate profile shows it.

Manage promo codes
The operator can use the HTTP API to manage promo codes for affiliates. The API key is the same as described here.
Get a list of promo codes
Use the HTTP GET method to get a list of promo codes.
You can filter the results with the filter URL parameter. It is a JSON object with these optional fields:
Example of a filtered request:
Example of response:
Get a single promo code by ID
Use the HTTP GET method with the promo code ID in the URL:
The response will contain a single promo code object with the same structure as described above.
Create a new promo code
Use the HTTP POST method to create a new promo code.
Full list of request body fields below:
Important to know:
The following fields are mandatory: "promocode", "affiliate_id", "description_public", "start_date". If "status" is not passed, the promo code is active. "description_public" represents Notes for Affiliate field in Promocode builder in TAP Back Office
The "promocode" must be unique. Upper and lower case letters count as the same. If a promo code with the same name already exists, the API will return an error:
"The promocode with this name already exists. Please use a different promocode.""start_date" and "end_date" cannot be in the past, and "end_date" cannot be earlier than "start_date". Otherwise the API returns an error, for example
"Start date cannot be in the past"or"End date cannot be earlier than Start date".The "deal_id" must be a valid deal for the specified "affiliate_id" . If the deal does not belong to the affiliate, the API will return an error:
"Invalid deal for selected affiliate". If no "deal_id" is passed, the deal assigned to the promocode will be the home deal of the affiliate.
Update an existing promo code
Use the HTTP PUT method with the promo code ID in the URL.
You only need to include the fields you want to update. To change affiliate_id or deal_id, pass both of them in the same request.
Full list of supported properties:
Example of an API call for deactivation of promo code:
Last updated
Was this helpful?