Files
sdk/docs/AffiliateApi.md
zeekayandHanzo Dev b55332704a feat: Hanzo Cloud SDK for Kotlin (generated from OpenAPI v8.0.0)
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and
Android. Generated with openapi-generator kotlin (library=jvm-okhttp4,
useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-25 07:10:32 -07:00

5.4 KiB

AffiliateApi

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
affiliatesApplyAffiliate POST /v1/affiliates/apply Apply to the affiliate program
affiliatesAttributeAffiliate POST /v1/affiliates/attribute Record affiliate attribution
affiliatesGetMyAffiliate GET /v1/affiliates Get my affiliate status

affiliatesApplyAffiliate

AffiliatesApplyResponse affiliatesApplyAffiliate(affiliatesApplyRequest)

Apply to the affiliate program

Enrolls the caller org as an affiliate at `status=applied`. Idempotent (one affiliate per org, first apply wins). A malformed vanity code is refused. Returns `201` on first creation, `200` if the org was already enrolled.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = AffiliateApi()
val affiliatesApplyRequest : AffiliatesApplyRequest =  // AffiliatesApplyRequest | 
try {
    val result : AffiliatesApplyResponse = apiInstance.affiliatesApplyAffiliate(affiliatesApplyRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AffiliateApi#affiliatesApplyAffiliate")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AffiliateApi#affiliatesApplyAffiliate")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
affiliatesApplyRequest AffiliatesApplyRequest [optional]

Return type

AffiliatesApplyResponse

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

affiliatesAttributeAffiliate

AffiliatesAttributeResponse affiliatesAttributeAffiliate(affiliatesAttributeRequest)

Record affiliate attribution

Records an affiliate↔referred-org edge. The REFERRED org is the validated caller (never client-supplied); the affiliate is resolved from `code` (approved affiliates only). Idempotent (one per referred org, first-touch wins); self-attribution is blocked; an unknown code is rejected. Returns `201` on first attribution, `200` if already attributed.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = AffiliateApi()
val affiliatesAttributeRequest : AffiliatesAttributeRequest =  // AffiliatesAttributeRequest | 
try {
    val result : AffiliatesAttributeResponse = apiInstance.affiliatesAttributeAffiliate(affiliatesAttributeRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AffiliateApi#affiliatesAttributeAffiliate")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AffiliateApi#affiliatesAttributeAffiliate")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
affiliatesAttributeRequest AffiliatesAttributeRequest

Return type

AffiliatesAttributeResponse

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

affiliatesGetMyAffiliate

AffiliatesGetMyAffiliate200Response affiliatesGetMyAffiliate()

Get my affiliate status

Returns the caller org's affiliate dashboard. If the org is not enrolled, returns an honest &quot;not enrolled&quot; shape (`isAffiliate: false`) so the console can show the apply form. For an APPROVED affiliate it also opportunistically runs the accrual sweep over the org's own referred orgs (bounded, best-effort), so the dashboard is self-updating.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = AffiliateApi()
try {
    val result : AffiliatesGetMyAffiliate200Response = apiInstance.affiliatesGetMyAffiliate()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling AffiliateApi#affiliatesGetMyAffiliate")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling AffiliateApi#affiliatesGetMyAffiliate")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

AffiliatesGetMyAffiliate200Response

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json