Files
sdk/docs/AffiliateAPI.md

19 KiB

\AffiliateAPI

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

Method HTTP request Description
GetAffiliate Get /v1/affiliate Answers the caller org's OWN affiliate standing: status, referral code and share link, commission rate, how many orgs it has referred, and its lifetime accrued, still-pending and already-paid commission in integer cents, with its payout history.
GetAffiliateLeaderboard Get /v1/affiliate/leaderboard Answers the top affiliates by lifetime accrued commission, shown by OPT-IN HANDLE with aggregate figures only, plus the caller's own exact rank.
GetAffiliateMe Get /v1/affiliate/me Answers the richer self-view: the same lifetime accrued, pending and paid commission and payout history, plus the caller's downline broken out by upline LEVEL — direct, second, third — each with the rate paid at that level and how many orgs sit there.
GetAffiliateMeEarnings Get /v1/affiliate/me/earnings Answers the caller's own commission ledger: per period, the margin it earned against and the commission taken from that margin; and per referred org, that referral's aggregate contribution.
GetAffiliateMeLinks Get /v1/affiliate/me/links Answers the caller's share links, each with its URL and its funnel: clicks tracked, signups — orgs attributed with that code — and conversions, meaning how many of those signups have actually produced commission.
PostAffiliateApply Post /v1/affiliate/apply Enrolls the caller's OWN org as an affiliate at status `applied`, optionally requesting a vanity code, and answers the record — 201 on the first apply, 200 with `created:false` afterwards.
PostAffiliateAttribute Post /v1/affiliate/attribute Records the first-touch edge every later commission is computed from: the caller's org was referred by the affiliate that owns this code.
PostAffiliateClick Post /v1/affiliate/click Counts a click on a share link.
PostAffiliateMeHandle Post /v1/affiliate/me/handle Sets the caller's public leaderboard display name, or clears it.
PostAffiliateMeLinks Post /v1/affiliate/me/links Mints a new share link for the caller's own affiliate and answers it with its full URL, 201.

GetAffiliate

AffiliateAffiliateStanding GetAffiliate(ctx).Execute()

Answers the caller org's OWN affiliate standing: status, referral code and share link, commission rate, how many orgs it has referred, and its lifetime accrued, still-pending and already-paid commission in integer cents, with its payout history.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.GetAffiliate(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.GetAffiliate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAffiliate`: AffiliateAffiliateStanding
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.GetAffiliate`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAffiliateRequest struct via the builder pattern

Return type

AffiliateAffiliateStanding

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAffiliateLeaderboard

AffiliateAffiliateBoard GetAffiliateLeaderboard(ctx).Execute()

Answers the top affiliates by lifetime accrued commission, shown by OPT-IN HANDLE with aggregate figures only, plus the caller's own exact rank.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.GetAffiliateLeaderboard(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.GetAffiliateLeaderboard``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAffiliateLeaderboard`: AffiliateAffiliateBoard
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.GetAffiliateLeaderboard`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAffiliateLeaderboardRequest struct via the builder pattern

Return type

AffiliateAffiliateBoard

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAffiliateMe

AffiliateAffiliateSelf GetAffiliateMe(ctx).Execute()

Answers the richer self-view: the same lifetime accrued, pending and paid commission and payout history, plus the caller's downline broken out by upline LEVEL — direct, second, third — each with the rate paid at that level and how many orgs sit there.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.GetAffiliateMe(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.GetAffiliateMe``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAffiliateMe`: AffiliateAffiliateSelf
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.GetAffiliateMe`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAffiliateMeRequest struct via the builder pattern

Return type

AffiliateAffiliateSelf

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAffiliateMeEarnings

AffiliateAffiliateEarnings GetAffiliateMeEarnings(ctx).Execute()

Answers the caller's own commission ledger: per period, the margin it earned against and the commission taken from that margin; and per referred org, that referral's aggregate contribution.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.GetAffiliateMeEarnings(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.GetAffiliateMeEarnings``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAffiliateMeEarnings`: AffiliateAffiliateEarnings
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.GetAffiliateMeEarnings`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAffiliateMeEarningsRequest struct via the builder pattern

Return type

AffiliateAffiliateEarnings

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AffiliateAffiliateLinks GetAffiliateMeLinks(ctx).Execute()

Answers the caller's share links, each with its URL and its funnel: clicks tracked, signups — orgs attributed with that code — and conversions, meaning how many of those signups have actually produced commission.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.GetAffiliateMeLinks(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.GetAffiliateMeLinks``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAffiliateMeLinks`: AffiliateAffiliateLinks
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.GetAffiliateMeLinks`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAffiliateMeLinksRequest struct via the builder pattern

Return type

AffiliateAffiliateLinks

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAffiliateApply

AffiliateApplication PostAffiliateApply(ctx).AffiliateApplyRequest(affiliateApplyRequest).Execute()

Enrolls the caller's OWN org as an affiliate at status applied, optionally requesting a vanity code, and answers the record — 201 on the first apply, 200 with created:false afterwards.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	affiliateApplyRequest := *openapiclient.NewAffiliateApplyRequest() // AffiliateApplyRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.PostAffiliateApply(context.Background()).AffiliateApplyRequest(affiliateApplyRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.PostAffiliateApply``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostAffiliateApply`: AffiliateApplication
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.PostAffiliateApply`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAffiliateApplyRequest struct via the builder pattern

Name Type Description Notes
affiliateApplyRequest AffiliateApplyRequest

Return type

AffiliateApplication

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAffiliateAttribute

AffiliateAttribution PostAffiliateAttribute(ctx).AffiliateAttributeRequest(affiliateAttributeRequest).Execute()

Records the first-touch edge every later commission is computed from: the caller's org was referred by the affiliate that owns this code.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	affiliateAttributeRequest := *openapiclient.NewAffiliateAttributeRequest() // AffiliateAttributeRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.PostAffiliateAttribute(context.Background()).AffiliateAttributeRequest(affiliateAttributeRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.PostAffiliateAttribute``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostAffiliateAttribute`: AffiliateAttribution
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.PostAffiliateAttribute`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAffiliateAttributeRequest struct via the builder pattern

Name Type Description Notes
affiliateAttributeRequest AffiliateAttributeRequest

Return type

AffiliateAttribution

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAffiliateClick

AffiliateClickCount PostAffiliateClick(ctx).AffiliateClickRequest(affiliateClickRequest).Execute()

Counts a click on a share link.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	affiliateClickRequest := *openapiclient.NewAffiliateClickRequest() // AffiliateClickRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.PostAffiliateClick(context.Background()).AffiliateClickRequest(affiliateClickRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.PostAffiliateClick``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostAffiliateClick`: AffiliateClickCount
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.PostAffiliateClick`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAffiliateClickRequest struct via the builder pattern

Name Type Description Notes
affiliateClickRequest AffiliateClickRequest

Return type

AffiliateClickCount

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAffiliateMeHandle

AffiliateHandleSet PostAffiliateMeHandle(ctx).AffiliateHandleRequest(affiliateHandleRequest).Execute()

Sets the caller's public leaderboard display name, or clears it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	affiliateHandleRequest := *openapiclient.NewAffiliateHandleRequest() // AffiliateHandleRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.PostAffiliateMeHandle(context.Background()).AffiliateHandleRequest(affiliateHandleRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.PostAffiliateMeHandle``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostAffiliateMeHandle`: AffiliateHandleSet
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.PostAffiliateMeHandle`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAffiliateMeHandleRequest struct via the builder pattern

Name Type Description Notes
affiliateHandleRequest AffiliateHandleRequest

Return type

AffiliateHandleSet

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AffiliateLinkMint PostAffiliateMeLinks(ctx).AffiliateCreateLinkRequest(affiliateCreateLinkRequest).Execute()

Mints a new share link for the caller's own affiliate and answers it with its full URL, 201.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	affiliateCreateLinkRequest := *openapiclient.NewAffiliateCreateLinkRequest() // AffiliateCreateLinkRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AffiliateAPI.PostAffiliateMeLinks(context.Background()).AffiliateCreateLinkRequest(affiliateCreateLinkRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AffiliateAPI.PostAffiliateMeLinks``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostAffiliateMeLinks`: AffiliateLinkMint
	fmt.Fprintf(os.Stdout, "Response from `AffiliateAPI.PostAffiliateMeLinks`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAffiliateMeLinksRequest struct via the builder pattern

Name Type Description Notes
affiliateCreateLinkRequest AffiliateCreateLinkRequest

Return type

AffiliateLinkMint

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]