Affiliates¶
2 endpoints. Authentication, errors, paging and rate limits are described once, in the API overview.
| Action | Method | Description |
|---|---|---|
affiliateactivate |
POST | Make a client an affiliate |
getaffiliates |
GET | List affiliates |
affiliateactivate¶
Make a client an affiliate.
POST /api/v1/affiliateactivate
Permission: manage_affiliates
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
clientid |
integer | yes | The client. |
Response
| Field | Description |
|---|---|
result |
success |
affiliateid |
integer |
Errors
| Status | When |
|---|---|
| 404 | No such client. |
Note
Makes the client an affiliate on 10 percent commission; an affiliate already is left as it is.
Example
curl -X POST https://example.com/api/v1/affiliateactivate \
-H "X-API-Key: $PNLCS_IDENTIFIER" \
-H "X-API-Secret: $PNLCS_SECRET" \
--data-urlencode "clientid=1"
getaffiliates¶
List affiliates.
GET /api/v1/getaffiliates
Permission: manage_affiliates
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limitstart |
integer | no | Where the page starts. Default 0. |
limitnum |
integer | no | Page size, 1 to 250. Default 25. |
Response
| Field | Description |
|---|---|
result |
success |
totalresults |
integer: rows matching the filters |
startnumber |
integer: where this page starts |
numreturned |
integer: rows on this page |
data |
array: the rows |
Note
Each affiliate carries its client.
Example