Appearance
Affiliates API
SaaS edition only. The affiliate program — people share a referral link and earn a share of what the accounts they bring pay; administrators pay them by bank transfer each month and attach the proof.
All paths are relative to https://your-site.com/api/v1. Send Authorization: Bearer <token> and Accept: application/json; see authentication and errors.
| Method | Path | What it does |
|---|---|---|
| GET | /affiliate | The program's terms and, once joined, your link and earnings |
| POST | /affiliate | Join the affiliate program |
| PUT | /affiliate/bank | The bank account your payouts go to |
| GET | /affiliate-payouts/{payout}/proof | Download the proof of a payout (the affiliate paid, or administrators) |
| GET | /admin/affiliates | Every affiliate with their earnings (administrators) |
| GET | /admin/affiliates/{affiliate} | One affiliate in detail, with bank details (administrators) |
| PATCH | /admin/affiliates/{affiliate} | An affiliate's own rate or status (administrators) |
| POST | /admin/affiliates/{affiliate}/payouts | Record a bank transfer to an affiliate (administrators) |
| POST | /admin/affiliate-payouts/{payout}/proof | Attach or replace the proof of a payout (administrators) |
| DELETE | /admin/affiliate-payouts/{payout} | Undo a payout recorded by mistake (administrators) |
| POST | /admin/affiliate-commissions/{commission}/void | Void a commission whose payment was refunded, or count it again (administrators) |
GET /affiliate
The program's terms and, once joined, your link and earnings
program: enabled, percent, months (0: as long as they pay), cookie_days, hold_days, minimum_payout, currency. affiliate: null before joining; else code, link, percent, status, clicks, signups, paying, pending/due/paid amounts per currency, months (earned per month), payouts (with proof links), commissions, bank.
Responses
- 200 — data:
bash
curl -X GET "https://your-site.com/api/v1/affiliate" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"POST /affiliate
Join the affiliate program
Responses
- 200 — Already in the program (the same link).
- 201 — data: the affiliate, with the new referral link.
- 403 — The program is closed.
bash
curl -X POST "https://your-site.com/api/v1/affiliate" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"PUT /affiliate/bank
The bank account your payouts go to
Kept encrypted; seen by you and the installation's administrators.
Request body
application/json, required
| Field | Type | Required | Description |
|---|---|---|---|
holder | string | yes | At most 120 characters. |
bank | string | yes | At most 120 characters. |
account | string | yes | IBAN or account number. At most 64 characters. |
swift | string, nullable | 8 or 11 letters and digits. | |
country | string, nullable | At most 60 characters. | |
notes | string, nullable | At most 500 characters. |
Responses
- 200 — data: the affiliate.
- 404 — Not in the program yet.
- 422 —
bash
curl -X PUT "https://your-site.com/api/v1/affiliate/bank" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"holder":"text","bank":"text","account":"text","swift":"text","country":"text","notes":"text"}'GET /affiliate-payouts/{payout}/proof
Download the proof of a payout (the affiliate paid, or administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
payout | path | integer | yes |
Responses
- 200 — The file (PDF or image).
- 404 — No such payout of yours, or no proof attached.
bash
curl -X GET "https://your-site.com/api/v1/affiliate-payouts/{payout}/proof" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"GET /admin/affiliates
Every affiliate with their earnings (administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
month | query | string | The month whose earnings are shown (YYYY-MM, default this month). | |
q | query | string | Name, email or referral code. At most 100 characters. |
Responses
- 200 — data: affiliates (user, code, percent, custom_percent, status, clicks, signups, paying, month, pending, due, paid, bank, ready); meta: month, program, month_total, due_total, ready.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 422 —
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | ||
data[].id | integer | ||
data[].code | string | ||
data[].percent | integer | ||
data[].month | object[] | ||
data[].month[].currency | string | ||
data[].month[].cents | integer | ||
data[].due | object[] | ||
data[].due[].currency | string | ||
data[].due[].cents | integer | ||
data[].ready | boolean | ||
meta | object |
bash
curl -X GET "https://your-site.com/api/v1/admin/affiliates" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"GET /admin/affiliates/{affiliate}
One affiliate in detail, with bank details (administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
affiliate | path | integer | yes |
Responses
- 200 — data: the affiliate, its user, commissions (with the referred accounts' names) and payouts.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 404 — Missing, or another account's.
bash
curl -X GET "https://your-site.com/api/v1/admin/affiliates/{affiliate}" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"PATCH /admin/affiliates/{affiliate}
An affiliate's own rate or status (administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
affiliate | path | integer | yes |
Request body
application/json, required
| Field | Type | Required | Description |
|---|---|---|---|
commission_percent | integer, nullable | null: the program's rate. Applies to new payments. Minimum 1. Maximum 90. | |
status | string | One of: active, suspended. |
Responses
- 200 — data: the affiliate.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 422 —
bash
curl -X PATCH "https://your-site.com/api/v1/admin/affiliates/{affiliate}" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"commission_percent":1,"status":"active"}'POST /admin/affiliates/{affiliate}/payouts
Record a bank transfer to an affiliate (administrators)
Pays every due commission in the currency; the affiliate is told by email. Needs their bank details.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
affiliate | path | integer | yes |
Request body
multipart/form-data, required
| Field | Type | Required | Description |
|---|---|---|---|
currency | string | yes | At least 3 characters. At most 3 characters. |
reference | string | At most 120 characters. | |
note | string | At most 500 characters. | |
paid_on | string (date) | Today or earlier (default today). | |
proof | string (binary) | PDF, PNG, JPG or WebP, up to 10 MB. |
Responses
- 201 — data: the payout.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 422 — No bank details, or nothing due in the currency.
bash
curl -X POST "https://your-site.com/api/v1/admin/affiliates/{affiliate}/payouts" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json" \
-F "currency=…" \
-F "reference=…" \
-F "note=…" \
-F "paid_on=…"POST /admin/affiliate-payouts/{payout}/proof
Attach or replace the proof of a payout (administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
payout | path | integer | yes |
Request body
multipart/form-data, required
| Field | Type | Required | Description |
|---|---|---|---|
proof | string (binary) | yes |
Responses
- 200 — data: the payout.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 422 —
bash
curl -X POST "https://your-site.com/api/v1/admin/affiliate-payouts/{payout}/proof" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json" \
-F "proof=…"DELETE /admin/affiliate-payouts/{payout}
Undo a payout recorded by mistake (administrators)
Its commissions are due again and the proof is deleted.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
payout | path | integer | yes |
Responses
- 204 — Undone.
- 403 — Not allowed (not an administrator, or outside the token's abilities).
bash
curl -X DELETE "https://your-site.com/api/v1/admin/affiliate-payouts/{payout}" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json"POST /admin/affiliate-commissions/{commission}/void
Void a commission whose payment was refunded, or count it again (administrators)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
commission | path | integer | yes |
Request body
application/json, required
| Field | Type | Required | Description |
|---|---|---|---|
void | boolean | yes |
Responses
- 200 — data:
- 403 — Not allowed (not an administrator, or outside the token's abilities).
- 422 — The commission was paid already.
bash
curl -X POST "https://your-site.com/api/v1/admin/affiliate-commissions/{commission}/void" \
-H "Authorization: Bearer $REPLORA_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"void":true}'