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.

AttributesTypeDescription
idinteger

Unique identifier of the referral credit instance.

user_idinteger

Unique identifier of the referred user who spent money on Webshare.

modestring

Indicates whether the referral credit is in payout or credit mode. This mode cannot be changed.

amountdecimal

Amount earned in USD.

statusstring

Status can be pending, available or reverted. A credit becomes available after ReferralConfig.referral_payment_pending_days period.

referral_channelinteger

ID of the referral channel (coupon code) that produced this credit. null for credits earned through a referral link rather than a coupon code.

referral_channel_codestring

Code of the referral channel that produced this credit. null for credits earned through a referral link rather than a coupon code.

created_atdatetime

The timestamp of when this instance was created.

updated_atdatetime

The timestamp when this instance was last updated.

reverted_atdatetime

The timestamp when this credit was reverted. Is null if the status is not reverted.

In JSON format

referral_credit.json
{
  "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

ParameterTypeDescription
modestring

Filter by payout or credits.

statusstring

Filter by pending, available or reverted.

referral_channelinteger

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/
example.py
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:

response.json
{
  "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.

ParameterTypeDescription
IDinteger

Unique identifier of the referral credit instance.

Request & Response

GET https://proxy.webshare.io/api/v2/referral/credit/<ID>/
example.py
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:

response.json
{
  "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
}