Referral Credits
The referral credit object
Each time a referral spends money on Webshare, the user may earn referral credits. Each credit is tracked by the referral credit object.
| Attributes | Type | Description |
|---|---|---|
id | integer | Unique identifier of the referral credit instance. |
user_id | integer | Unique identifier of the referred user who spent money on Webshare. |
mode | string | Indicates whether the referral credit is in |
amount | decimal | Amount earned in USD. |
status | string | Status can be |
referral_channel | integer | ID of the referral channel (coupon code) that produced this credit. |
referral_channel_code | string | Code of the referral channel that produced this credit. |
created_at | datetime | The timestamp of when this instance was created. |
updated_at | datetime | The timestamp when this instance was last updated. |
reverted_at | datetime | The timestamp when this credit was reverted. Is |
In JSON format
{
"id": 1,
"user_id": 6124,
"mode": "credits",
"amount": 2.50,
"status": "pending",
"referral_channel": null,
"referral_channel_code": null,
"created_at": "2022-06-14T11:58:10.246406-07:00",
"updated_at": "2022-06-14T11:58:10.246406-07:00",
"reverted_at": null
}List referral credits
This endpoint returns the referral credits in paginated format.
Filters
| Parameter | Type | Description |
|---|---|---|
mode | string | Filter by |
status | string | Filter by |
referral_channel | integer | Filter by the ID of a referral channel you own. Pass an empty value to match credits with no associated channel. |
Results can also be ordered with the ordering parameter. Supported fields are
id, mode, amount, status, created_at, updated_at and reverted_at.
Prefix with - for descending order, e.g. ?ordering=-created_at.
Request & Response
GET https://proxy.webshare.io/api/v2/referral/credit/import requests
response = requests.get(
"https://proxy.webshare.io/api/v2/referral/credit/",
headers={"Authorization": "Token APIKEY"}
)
response.json()The commands above return JSON structured like this:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"user_id": 6124,
"mode": "credits",
"amount": 2.50,
"status": "pending",
"referral_channel": 1,
"referral_channel_code": "SUMMER20",
"created_at": "2022-06-14T11:58:10.246406-07:00",
"updated_at": "2022-06-14T11:58:10.246406-07:00",
"reverted_at": null
},
...
]
}Get referral credit
This endpoint lets you retrieve a referral credit.
| Parameter | Type | Description |
|---|---|---|
ID | integer | Unique identifier of the referral credit instance. |
Request & Response
GET https://proxy.webshare.io/api/v2/referral/credit/<ID>/import requests
response = requests.get(
"https://proxy.webshare.io/api/v2/referral/credit/{ID}/",
headers={"Authorization": "Token APIKEY"}
)
response.json()The commands above return JSON structured like this:
{
"id": 1,
"user_id": 6124,
"mode": "credits",
"amount": 2.50,
"status": "pending",
"referral_channel": null,
"referral_channel_code": null,
"created_at": "2022-06-14T11:58:10.246406-07:00",
"updated_at": "2022-06-14T11:58:10.246406-07:00",
"reverted_at": null
}