Skip to content

Rewards

SDK Reference · Resource

Rewards

Inspect and claim account rewards.

method

list()

List account rewards

Returns referral and campaign rewards earned by the authenticated account, ordered from newest to oldest.

Signature

Promiseclient.rewards.list(options: RewardsListOptions = {}): Promise<RewardsListResponse>

Parameters

NameTypeRequirementDescription
levelstringOptional* `standard` - Standard * `silver` - Silver * `gold` - Gold * `diamond` - Diamond
limitnumberOptionalNumber of results to return per page.
offsetnumberOptionalThe initial index from which to return the results.
orderingstringOptionalWhich field to use when ordering the results.
userEmailstringOptional—
userIdstringOptional—
acceptLanguagestringOptionalPreferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English.

Example

const result = await client.rewards.list();

Returns

PaginatedRewardList

The operation completed successfully.

typePaginatedRewardList4fields
count
number
Required
—
next
string
Optional
—
previous
string
Optional
—
results
Reward[]
Required
—
typeReward8fields
id
string
Optional
—
email
string
Required
—
created
string
Required
—
balance
number
Optional
—
data
number
Optional
The amount of data in bytes.
status
RewardStatusEnum
Optional
After changing invoice status to PAID, the invoice will be processed and user package created in case none exists. If you need to cancel the invoice, make sure to subtract data from the user package after changing the invoice status. Changing the status from PAID to any other will not affect the user package's data or proxies. * `pending` - Pending * `paid` - Paid * `review` - Review * `cancelled` - Cancelled
enumRewardStatusEnum0fields

* `pending` - Pending * `paid` - Paid * `review` - Review * `cancelled` - Cancelled

No fields.

description
string
Optional
Description of the reward, used to include payout details.
level
LevelEnum
Optional
—
enumLevelEnum0fields

* `standard` - Standard * `silver` - Silver * `gold` - Gold * `diamond` - Diamond

No fields.

Throws

ApiError

Normalized API, transport, and response processing failure.

  • kind: "validation"The request arguments or business rules are invalid.
  • kind: "authentication"Authentication credentials are missing, expired, or invalid.
  • kind: "permission"The authenticated account cannot perform this operation.
  • kind: "network"The request could not reach ProxyRequest.
  • kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
  • client.rewards.listWithResponse(options): Promise<ApiResponse<RewardsListResponse>>

    Returns response status, headers, ETag and idempotency metadata with the decoded data.

method

claim()

Claim available rewards

Moves an eligible reward balance or data reward into the customer account. Minimum claim thresholds and reward state are validated.

Signature

Promiseclient.rewards.claim(options: RewardsClaimOptions): Promise<RewardsClaimResponse>

Parameters

NameTypeRequirementDescription
acceptLanguagestringOptionalPreferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English.
bodyRewardClaimRequestRequestRequired—

Example

const result = await client.rewards.claim({
body: {
"type": "{type}"
}
});

Returns

void

No response body

Throws

ApiError

Normalized API, transport, and response processing failure.

  • kind: "validation"The request arguments or business rules are invalid.
  • kind: "authentication"Authentication credentials are missing, expired, or invalid.
  • kind: "permission"The authenticated account cannot perform this operation.
  • kind: "network"The request could not reach ProxyRequest.
  • kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
  • client.rewards.claimWithResponse(options): Promise<ApiResponse<RewardsClaimResponse>>

    Returns response status, headers, ETag and idempotency metadata with the decoded data.