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.
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)
curl--location--requestPOST'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"}