You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/promoter.rst
+125-4Lines changed: 125 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ Promoter Logic
2
2
==============
3
3
4
4
5
-
1. Promoter Creation
5
+
Promoter Creation
6
6
--------------------
7
7
8
8
A promoter is created by associating a `User` with a referral token and referral link. Promoters are responsible for sending out referral links, tracking referrals, and earning commissions.
@@ -37,7 +37,26 @@ Example response:
37
37
"commissionRate": 15.0
38
38
}
39
39
40
-
2. Setting the Payout Method
40
+
41
+
Get Referral Link
42
+
-----------------------------
43
+
Promoters can retrieve their unique referral link, which they can share with others to invite referrals.
44
+
45
+
.. code-block:: bash
46
+
47
+
GET http://localhost:8000/referrals/get-referral-link
Promoters can set their preferred payout method using the following API action:
@@ -81,7 +100,7 @@ Example response:
81
100
82
101
The promoter’s payout method is used when processing their earnings.
83
102
84
-
3. Tracking Referrals and Earnings
103
+
Tracking Referrals and Earnings
85
104
-----------------------------------
86
105
87
106
Once a promoter is created, they can start sharing their referral link. The system tracks clicks on the referral link and the earnings generated from those referrals. Promoters can retrieve their recent earnings and view a breakdown of their performance over the last 7 days.
@@ -131,7 +150,7 @@ Example response:
131
150
132
151
The response contains a list of the last 7 days, with each day showing the corresponding earnings value. Even if no earnings occurred on a particular day, it is still represented with a value of `0`. The earnings are grouped by the day of the week when they were created.
133
152
134
-
4. Incrementing Link Clicks
153
+
Incrementing Link Clicks
135
154
----------------------------
136
155
137
156
Every time a referral link is clicked, the system can increment the count of link clicks for the promoter. This can be done via the following API action:
Promoters can retrieve a history of their payouts, including details such as the payout amount and the date it was processed.
215
+
216
+
.. code-block:: bash
217
+
218
+
GET http://localhost:8000/referrals/payouts
219
+
Accept: application/json
220
+
Authorization: Bearer your_token
221
+
222
+
Example response:
223
+
224
+
.. code-block:: json
225
+
226
+
[
227
+
{
228
+
"id": 1,
229
+
"created": "2024-08-30T10:00:00Z",
230
+
"amount": 100
231
+
},
232
+
{
233
+
"id": 2,
234
+
"created": "2024-08-25T15:30:00Z",
235
+
"amount": 50
236
+
}
237
+
]
238
+
239
+
This endpoint returns a list of payouts made to the authenticated promoter. Each payout includes the payout ID, the date and time when the payout was created, and the payout amount.
240
+
241
+
Set Minimum Withdrawal Balance
242
+
---------------------------------
243
+
244
+
Promoters can set a custom minimum withdrawal balance. This balance determines the minimum amount the promoter needs to accumulate before they can request a payout.
0 commit comments