▪️Balance and Payment API

This document describes the API for the Operator to get the current balance for affiliates and make payments.

The Smartico Affiliation module provides API to get the current balance of the affiliates and make payments. API is provided as a REST over HTTP and uses SSL for data protection.

Getting balances for all affiliates

Operator API is similar to the Affiliate API.

Example of the API call using CURL:

curl --location --request GET 'https://boapi.smartico.ai/api/af2_balance_op?above_threshold=true' \
--header 'Authorization: cc1a4c56-44de-11ed-a835-04d6e06175364b-2354'

The parameter above_threshold, when set to true, will filter only affiliates that have a positive balance (or balance above the threshold set on the operation level). You can also pass affiliate_id as the parameter to get results only for a specific affiliate

The API is returning a list of affiliates with details for each one. The most important parameters are:

  • affiliate_id

  • balance - the current, not paid commission for this affiliate

  • commissions_total - total lifetime commission earned by the affiliate

  • payments - already paid amount

  • threshold - the minimal amount in the operator currency that the operator is going to pay to the affiliate (above_threshold parameter is using this value for the filter)

Example of full response

[
    {
        "id": 35427,
        "affiliate_id": 35427,
        "affiliate_name": "Master",
        "payment_method_details": {
            "bank_name": "ggg",
            "beneficary": "gggg",
            "swift_code": "g",
            "back_country": "ggg",
            "erc20_wallet": "11111",
            "paypal_email": "1223564",
            "trc20_wallet": "12345",
            "account_number": "ggg"
        },
        "aff_status_id": 2,
        "payments": 482375.82,
        "last_payment_date": "2024-02-26T12:36:48.147Z",
        "adjustments": 10440.71052180003,
        "cpl_fee": 0,
        "cpa_fee": 216349,
        "rev_share_fee": 295535.57972609997,
        "sub_affiliate_fee": 0,
        "deposit_amount": 3510143.7671,
        "ftd_amount": 85595.6949,
        "deposit_count": 27908,
        "ftd_count": 47404,
        "registrations_count": 28670,
        "payment_method_id": 4,
        "payment_method_name": "PayPal",
        "auto_payment_enabled": null,
        "manager_id": 56427,
        "treshold": 300,
        "not_processed_payment_amount": 1,
        "create_date": "2022-03-10T18:44:52.983Z",
        "commissions_total": 511884.57972609997,
        "balance": 39949.47024789999,
        "operator_currency": "EUR",
        "user_id": 56427,
        "manager": "luana@smartico",
        "manager_contacts": {
            "phone": "",
            "email": "support@smartico.ai",
            "skype": "some",
            "telegram": "",
            "fb": "",
            "vk": "",
            "discord": null,
            "whatsapp": null,
            "first_name": "Luana",
            "last_name": "T"
        }
    },
    {
        "id": 217628,
        "affiliate_id": 217628,
        "affiliate_name": "Sevginar test",
        "payment_method_details": {
            "ana": "aaa",
            "istpay_cpf": "1234567",
            "pay4fun_cpf": "1234567",
            "trc20_wallet": "123456",
            "netteller_vat": "12233112",
            "netteller_email": "support@smartico.ai",
            "netteller_account_number": "123123"
        },
        "aff_status_id": 2,
        "payments": 20,
        "last_payment_date": "2024-03-28T13:58:23.826Z",
        "adjustments": 20,
        "cpl_fee": 0,
        "cpa_fee": 30,
        "rev_share_fee": 5496.5585835,
        "sub_affiliate_fee": 0,
        "deposit_amount": 69.9572,
        "ftd_amount": 34.9786,
        "deposit_count": 2,
        "ftd_count": 1,
        "registrations_count": 1,
        "payment_method_id": 2,
        "payment_method_name": "Neteller",
        "auto_payment_enabled": null,
        "manager_id": 99327,
        "treshold": 0,
        "not_processed_payment_amount": 1,
        "create_date": "2024-01-16T08:59:13.062Z",
        "commissions_total": 5526.5585835,
        "balance": 5526.5585835,
        "operator_currency": "EUR",
        "user_id": 99327,
        "manager": "support@smartico",
        "manager_contacts": {
            "phone": "",
            "email": "support@smartico.ai",
            "skype": "",
            "telegram": "",
            "fb": "",
            "vk": "",
            "discord": "",
            "whatsapp": null,
            "first_name": "Priscila",
            "last_name": "C"
        }
    }
]

Making the payment through the API

Example of the request with the CURL

curl --location --request POST 'https://boapi.smartico.ai/api/af2_payments_op' \
--header 'Authorization: cc1a4c56-44de-11ed-a835-04d6e06175364b-2354' \
--header 'Content-Type: application/json' \
--data-raw '{
    "affiliate_id": 35426,
    "amount": 1,
    "send_mail_to_aff": false,
    "operator_comments": "Here are internal comments that will be NOT visible for the affiliate",
    "payment_details": "Here are public comments that will be visible for the affiliate"
}'

Passed parameters:

  • amount - is the amount in the operator currency

  • send_mail_to_aff - if set to 'true', will trigger automatic mail to the affiliate that payment is made (mail template & operational campaign need to be set up in the Smartico BackOffice)

  • optionally can be passed 2 parameters - period_from & period_to as a UNIX second from the epoch, indicating the period for the payment

Example of response

{
    "id": 15561,
    "payment_id": 15561,
    "amount": 1,
    "affiliate_id": 35426,
    "payment_details": "Here are public comments that will be visible for the affiliate",
    "create_by": 1,
    "create_date": "2022-11-23T13:17:08.637Z",
    "period_from": "2022-11-23T13:17:08.397Z",
    "period_to": "2022-11-23T13:17:08.397Z",
    "operator_comments": "Here are internal comments that will be NOT visible for the affiliate",
    "payment_date": "2022-11-23T13:17:08.397Z",
    "payment_status_id": 4,
    "operator_currency": "EUR",
    "affiliate_name": "mattfff",
    "payment_method_id": 0,
    "payment_method_details": {},
    "username": "gik",
    "payment_status_name": "Paid",
    "manager_id": 2342,
    "payment_name": "mattfff - 1 EUR"
}

Last updated