Aller au contenu

API console: affiliate

Cette page est générée à partir de server/api/openapi.yaml. Son contenu est en anglais ; ne la modifiez pas à la main.

Referral programme. Handlers: internal/console/affiliate.

Referral code and commission totals

operationId affiliateSummary · auth: orgSession

Status Meaning Body
200 OK application/json AffiliateSummary
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — AffiliateSummary

  • enabled (boolean, required) — False when the programme is switched off.
  • code (string, required)
  • link (string, required) — Sign-up link carrying the code.
  • rate_ppm (integer, required) — Effective commission rate on referred top-ups.
  • pending_nano (string, required, pattern: ”^-?[0-9]+$”) — Inside the hold period. (Nano-USD, integer string.)
  • available_nano (string, required, pattern: ”^-?[0-9]+$”) — Can be converted into balance. (Nano-USD, integer string.)
  • converted_nano (string, required, pattern: ”^-?[0-9]+$”) — Lifetime total converted. (Nano-USD, integer string.)
  • clawback_nano (string, required, pattern: ”^-?[0-9]+$”) — Owed back after reversals; netted against future commission. (Nano-USD, integer string.)
  • referrals (integer, required)
  • min_convert_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
  • hold_days (integer, required)

List referred accounts

operationId affiliateListReferrals · auth: orgSession

Parameter In Type Required Description
cursor query string no Opaque cursor from a previous page’s next_cursor.
limit query integer<int32> no (minimum: 1, maximum: 200, default: 50)
Status Meaning Body
200 OK application/json ReferralPage
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — ReferralPage

  • data (array of Referral, required)
    • id (string, required)
    • referred_label (string, required) — Masked, e.g. a***@example.com.
    • earned_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
    • created_at (string, required)
  • next_cursor (string, required, nullable) — Pass as cursor to fetch the next page; null on the last page.
  • has_more (boolean, required)

List commissions

operationId affiliateListCommissions · auth: orgSession

Parameter In Type Required Description
cursor query string no Opaque cursor from a previous page’s next_cursor.
limit query integer<int32> no (minimum: 1, maximum: 200, default: 50)
Status Meaning Body
200 OK application/json CommissionPage
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CommissionPage

  • data (array of Commission, required)
    • id (string, required)
    • order_id (string, required)
    • base_cents (integer, required)
    • rate_ppm (integer, required)
    • amount_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
    • reversed_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
    • converted_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
    • status (CommissionStatus, required)
    • available_at (string, required)
    • converted_at (string, required, nullable)
    • created_at (string, required)
  • next_cursor (string, required, nullable) — Pass as cursor to fetch the next page; null on the last page.
  • has_more (boolean, required)

Convert available commission into balance

operationId affiliateConvert · auth: orgSession · requires a verified email

Request body (required) application/json — ConvertCommissionRequest

  • amount_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
Status Meaning Body
200 OK application/json CommissionConversion
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CommissionConversion

  • id (string, required)
  • amount_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
  • grant_id (string, required)
  • balance (Balance, required) — Balance of an organisation. spendable = credits - debt.
    • credits_nano (string, required, pattern: ”^-?[0-9]+$”) — Sum of the remaining credits of all grants. (Nano-USD, integer string.)
    • debt_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
    • spendable_nano (string, required, pattern: ”^-?[0-9]+$”) — Negative when in debt. (Nano-USD, integer string.)
    • version (integer, required) — Increases with every balance change.
    • frozen (boolean, required)
    • breakdown (CreditBreakdown) — credits_nano of the balance split by origin; purchased + bonus + subscription = credits_nano. purchased: paid top-ups (grant kind topup). bonus: signup bonus, redeem codes, promotional and admin credits and converted commission (kinds promo and affiliate). subscription: plan credits (kind subscription). Returned by GET /api/v1/billing/balance only.
      • purchased (CreditBucket, required)
        • remaining_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
        • next_expires_at (string, required, nullable) — Earliest expiry among the bucket’s grants that still hold credits; null when none expires.
        • next_expiring_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
      • bonus (CreditBucket, required)
        • remaining_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
        • next_expires_at (string, required, nullable) — Earliest expiry among the bucket’s grants that still hold credits; null when none expires.
        • next_expiring_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
      • subscription (CreditBucket, required)
        • remaining_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
        • next_expires_at (string, required, nullable) — Earliest expiry among the bucket’s grants that still hold credits; null when none expires.
        • next_expiring_nano (NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.
  • created_at (string, required)