Files
sdk/docs/BillingAPI.md

106 KiB

\BillingAPI

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

Method HTTP request Description
AssignSeats Put /v1/billing/subscriptions/{id}/seats Assign a team's seats
CancelSubscription Post /v1/billing/subscriptions/{id}/cancel End a subscription
CollectInvoice Post /v1/billing/invoices/{id}/collect Collect an issued invoice from credits, balance, then card
DeleteBillingAlertsById Delete /v1/billing/alerts/{id} Removes one of the caller's spend caps and answers 204.
DeleteBillingMethodsById Delete /v1/billing/methods/{id} Removes one card or account the caller has saved.
DeleteBillingPortalMethodsById Delete /v1/billing/portal/methods/{id} Removes one card or account the caller has saved, at the address a hosted checkout reaches it by.
GetBillingAccounts Get /v1/billing/accounts Answers the caller's billing accounts: the org itself, its currency, when it was opened, and the caller's own standing in it.
GetBillingAccountsByIdMembers Get /v1/billing/accounts/{id}/members Answers one billing account's roster.
GetBillingAlerts Get /v1/billing/alerts Lists this org's spend caps: the ceiling, its scope, whether it enforces, and how much of it has been spent this period.
GetBillingAlertsAuthorize Get /v1/billing/alerts/authorize Answers whether one proposed spend fits inside this org's caps.
GetBillingBalance Get /v1/billing/balance Prepaid credit the caller's org can still spend
GetBillingCreditBalance Get /v1/billing/credit-balance Answers what the caller can spend right now, one entry per currency.
GetBillingCreditBalanceBreakdown Get /v1/billing/credit-balance/breakdown Answers that same spendable credit split by grant tag, with the earliest expiry under each and the total across all of them.
GetBillingCredits Get /v1/billing/credits Lists the caller's credit grants — every one of them, spent and lapsed and voided included.
GetBillingCryptoDepositById Get /v1/billing/crypto/deposit/{id} Reads one of the caller's own deposit intents back — pending, confirming, or succeeded.
GetBillingCryptoGateway Get /v1/billing/crypto/gateway Answers the terms to sign a USDC top-up against, for an agent or a person paying from a wallet: the treasury to pay, the networks and USDC contracts, the EIP-712 domain and types, the limits, and a nonce issued to the caller.
GetBillingCryptoGatewayById Get /v1/billing/crypto/gateway/{id} Reads one of the caller's own USDC top-ups back: pending, accepted (credited or deferred), settled, failed or refused.
GetBillingCryptoOptions Get /v1/billing/crypto/options Answers which chains and tokens the crypto rail accepts — what an asset picker renders — and the pairs themselves in assets: a chain and a token each on offer are not a pair on offer.
GetBillingInvoices Get /v1/billing/invoices Lists the caller's invoices, newest first, with the count beside them.
GetBillingInvoicesByIdPdf Get /v1/billing/invoices/{id}/pdf Download one invoice as a PDF
GetBillingInvoicesHostedByLink Get /v1/billing/invoices/hosted/{link} Is the order invoice a link shows, read on the brand of the host it is asked on: a link read on another brand's host is a miss.
GetBillingInvoicesHostedByLinkPdf Get /v1/billing/invoices/hosted/{link}/pdf Is the order invoice a link shows, as a PDF to print or save.
GetBillingLedger Get /v1/billing/ledger Answers the org's own postings inside `range=`, each as a signed entry: a DEPOSIT CREDITS the wallet (positive, account `credits:<org>`), a HOLD sets money aside for a payment agreed and not yet made (negative, account `held:<org>`) and its return gives it back (positive), and every other posting DEBITS it (negative, account `usage:<org>`), described by its notes or its tags.
GetBillingMethods Get /v1/billing/methods Cards and accounts on file for the caller
GetBillingPayouts Get /v1/billing/payouts Answers the org's outbound payouts, newest first — amount, destination, status, and the failure reason where one applies.
GetBillingPlans Get /v1/billing/plans The plan catalog, priced with whatever offer is in force
GetBillingPortalMethods Get /v1/billing/portal/methods Cards and accounts on file for the caller
GetBillingRecharge Get /v1/billing/recharge Reads the auto-reload rule of the wallet the caller pays from — the org's own account, or a person's wallet in the signup org: top that balance up by `amountCents` whenever it falls below `thresholdCents`, charging that payer's card on file off-session, at most `perDay` times in a UTC day (0 is no daily limit, which the payer's plan sets).
GetBillingSettings Get /v1/billing/settings Answers the PUBLIC half of this org's processor configuration — the ids a browser needs to tokenize a card, and the environment it must tokenize against.
GetBillingSubscriptions Get /v1/billing/subscriptions Lists the plans the caller may see, with the count beside them.
GetBillingTier Get /v1/billing/tier Answers which tier the caller is on, what it allows, and what is left to spend.
GetBillingTransactions Get /v1/billing/transactions Answers one page of the caller's own ledger, newest first: what moved, how much, when, and what it was tagged with.
GetBillingTransactionsById Get /v1/billing/transactions/{id} Reads one ledger entry by its id.
GetBillingUsage Get /v1/billing/usage Every billed call the caller's org made, attributed to a product
GetBillingUsageAccounts Get /v1/billing/usage/accounts Answers per-account totals for the linked provider accounts the gateway ROUTED this caller's traffic through — requests, prompt and completion tokens, recorded cost — plus their honest sum.
GetBillingUsageRollup Get /v1/billing/usage/rollup Answers the caller's month: what their plan includes, what has been consumed against it, and the wallet beside it.
GetBillingWire Get /v1/billing/wire Answers where to send a wire top-up: the receiving bank details, with the caller's own payment reference.
GetInvoice Get /v1/billing/invoices/{id} Read one invoice
IssueInvoice Post /v1/billing/invoices/{id}/issue Issue a draft invoice, making it collectible
PatchBillingAlertsById Patch /v1/billing/alerts/{id} Changes one spend cap: raise or lower the ceiling, flip enforcement, retune the rate limit.
PostBillingAlerts Post /v1/billing/alerts Opens a spend cap on the caller's own org.
PostBillingCryptoDeposit Post /v1/billing/crypto/deposit Issues a deposit address the caller can send crypto to, on the asset they ask for.
PostBillingCryptoGateway Post /v1/billing/crypto/gateway Takes a signed USDC payment from the caller's Circle Gateway balance to the treasury, and answers what became of it.
PostBillingMethods Post /v1/billing/methods Save a card or account for the caller
PostBillingMode Post /v1/billing/mode Moves this org between sandbox money and real money.
PostBillingPaypalOrder Post /v1/billing/paypal/order Opens a server-priced PayPal REST v2 order for either a bounded credit top-up (intent CAPTURE) or a plan purchase's first period (intent AUTHORIZE).
PostBillingPortalMethods Post /v1/billing/portal/methods Save a card or account for the caller
PostBillingRechargeRunAll Post /v1/billing/recharge/run-all Sweeps every org's auto-recharge and answers what it did.
PostBillingSubscribeCard Post /v1/billing/subscribe/card Buy a plan with a card
PostBillingSubscribeInvoice Post /v1/billing/subscribe/invoice Order a plan by invoice, paid by wire
PostBillingTopup Post /v1/billing/topup Charges a card the caller already saved and credits the balance.
PostBillingTopupToken Post /v1/billing/topup/token Charges a single-use card token and credits the caller's balance.
PostBillingUsage Post /v1/billing/usage Debits one act an application metered to the org it acts for, and answers the receipt.
PutBillingRecharge Put /v1/billing/recharge Sets the auto-reload rule of the wallet the caller pays from, and answers with the rule as stored.
RaiseInvoice Post /v1/billing/invoices Raise a draft invoice against a customer
ReactivateSubscription Post /v1/billing/subscriptions/{id}/reactivate Put a canceled subscription back on its plan
ResizeSubscription Post /v1/billing/subscriptions/{id}/resize Change a team's seats
VoidInvoice Post /v1/billing/invoices/{id}/void Void a draft or issued invoice

AssignSeats

BillingSubscription AssignSeats(ctx, id).BillingAssignment(billingAssignment).Execute()

Assign a team's seats

Example

package main

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

func main() {
	id := "id_example" // string | 
	billingAssignment := *openapiclient.NewBillingAssignment() // BillingAssignment | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

billingAssignment | BillingAssignment | |

Return type

BillingSubscription

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]

CancelSubscription

BillingSubscription CancelSubscription(ctx, id).BillingSubscriptionAct(billingSubscriptionAct).Execute()

End a subscription

Example

package main

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

func main() {
	id := "id_example" // string | ID is the subscription, from the path.
	billingSubscriptionAct := *openapiclient.NewBillingSubscriptionAct() // BillingSubscriptionAct | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the subscription, from the path.

Other Parameters

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

Name Type Description Notes

billingSubscriptionAct | BillingSubscriptionAct | |

Return type

BillingSubscription

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]

CollectInvoice

BillingCollected CollectInvoice(ctx, id).BillingInvoiceRef(billingInvoiceRef).Execute()

Collect an issued invoice from credits, balance, then card

Example

package main

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

func main() {
	id := "id_example" // string | ID is the invoice id.
	billingInvoiceRef := *openapiclient.NewBillingInvoiceRef() // BillingInvoiceRef | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the invoice id.

Other Parameters

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

Name Type Description Notes

billingInvoiceRef | BillingInvoiceRef | |

Return type

BillingCollected

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]

DeleteBillingAlertsById

DeleteBillingAlertsById(ctx, id).Execute()

Removes one of the caller's spend caps and answers 204.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the cap to remove, from the path.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.DeleteBillingAlertsById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.DeleteBillingAlertsById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the cap to remove, from the path.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

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

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

DeleteBillingMethodsById

BillingDetachment DeleteBillingMethodsById(ctx, id).Execute()

Removes one card or account the caller has saved.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the saved method to detach, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the saved method to detach, from the path.

Other Parameters

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

Name Type Description Notes

Return type

BillingDetachment

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]

DeleteBillingPortalMethodsById

BillingDetachment DeleteBillingPortalMethodsById(ctx, id).Execute()

Removes one card or account the caller has saved, at the address a hosted checkout reaches it by.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the saved method to detach, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the saved method to detach, from the path.

Other Parameters

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

Name Type Description Notes

Return type

BillingDetachment

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]

GetBillingAccounts

[]BillingBillingAccount GetBillingAccounts(ctx).Execute()

Answers the caller's billing accounts: the org itself, its currency, when it was opened, and the caller's own standing in it.

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.BillingAPI.GetBillingAccounts(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingAccounts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingAccounts`: []BillingBillingAccount
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingAccounts`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]BillingBillingAccount

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]

GetBillingAccountsByIdMembers

[]BillingHolder GetBillingAccountsByIdMembers(ctx, id).Execute()

Answers one billing account's roster.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the billing account id, which for this store is the org's own id.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the billing account id, which for this store is the org's own id.

Other Parameters

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

Name Type Description Notes

Return type

[]BillingHolder

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]

GetBillingAlerts

[]BillingAlert GetBillingAlerts(ctx).Execute()

Lists this org's spend caps: the ceiling, its scope, whether it enforces, and how much of it has been spent this period.

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.BillingAPI.GetBillingAlerts(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingAlerts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingAlerts`: []BillingAlert
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingAlerts`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]BillingAlert

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]

GetBillingAlertsAuthorize

BillingCapVerdict GetBillingAlertsAuthorize(ctx).Project(project).Service(service).Amount(amount).Pv(pv).Execute()

Answers whether one proposed spend fits inside this org's caps.

Example

package main

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

func main() {
	project := "project_example" // string | Project narrows the verdict to one project's caps. Empty is the org-wide row. (optional)
	service := "service_example" // string | Service narrows it to one service's caps. Empty is every service. (optional)
	amount := "amount_example" // string | Amount is the proposed spend in cents. (optional)
	pv := "pv_example" // string | PV is \"1\" when the caller ESTABLISHED the project rather than merely carrying a claim of one. An unproven project may not deny traffic. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.BillingAPI.GetBillingAlertsAuthorize(context.Background()).Project(project).Service(service).Amount(amount).Pv(pv).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingAlertsAuthorize``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingAlertsAuthorize`: BillingCapVerdict
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingAlertsAuthorize`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
project string Project narrows the verdict to one project's caps. Empty is the org-wide row.
service string Service narrows it to one service's caps. Empty is every service.
amount string Amount is the proposed spend in cents.
pv string PV is &quot;1&quot; when the caller ESTABLISHED the project rather than merely carrying a claim of one. An unproven project may not deny traffic.

Return type

BillingCapVerdict

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]

GetBillingBalance

GetBillingBalance(ctx).Execute()

Prepaid credit the caller's org can still spend

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingBalance(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingBalance``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingCreditBalance

BillingCreditBalance GetBillingCreditBalance(ctx).Execute()

Answers what the caller can spend right now, one entry per currency.

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.BillingAPI.GetBillingCreditBalance(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingCreditBalance``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingCreditBalance`: BillingCreditBalance
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingCreditBalance`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingCreditBalance

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]

GetBillingCreditBalanceBreakdown

interface{} GetBillingCreditBalanceBreakdown(ctx).Execute()

Answers that same spendable credit split by grant tag, with the earliest expiry under each and the total across all of them.

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.BillingAPI.GetBillingCreditBalanceBreakdown(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingCreditBalanceBreakdown``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingCreditBalanceBreakdown`: interface{}
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingCreditBalanceBreakdown`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

interface{}

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]

GetBillingCredits

BillingCreditGrants GetBillingCredits(ctx).Execute()

Lists the caller's credit grants — every one of them, spent and lapsed and voided included.

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.BillingAPI.GetBillingCredits(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingCredits``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingCredits`: BillingCreditGrants
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingCredits`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingCreditGrants

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]

GetBillingCryptoDepositById

BillingCryptoDeposit GetBillingCryptoDepositById(ctx, id).Execute()

Reads one of the caller's own deposit intents back — pending, confirming, or succeeded.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the deposit intent id.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the deposit intent id.

Other Parameters

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

Name Type Description Notes

Return type

BillingCryptoDeposit

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]

GetBillingCryptoGateway

BillingGatewayTerms GetBillingCryptoGateway(ctx).Execute()

Answers the terms to sign a USDC top-up against, for an agent or a person paying from a wallet: the treasury to pay, the networks and USDC contracts, the EIP-712 domain and types, the limits, and a nonce issued to the caller.

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.BillingAPI.GetBillingCryptoGateway(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingCryptoGateway``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingCryptoGateway`: BillingGatewayTerms
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingCryptoGateway`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingGatewayTerms

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]

GetBillingCryptoGatewayById

BillingGatewayPayment GetBillingCryptoGatewayById(ctx, id).Execute()

Reads one of the caller's own USDC top-ups back: pending, accepted (credited or deferred), settled, failed or refused.

Example

package main

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

func main() {
	id := "id_example" // string | ID is the top-up's id, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the top-up's id, from the path.

Other Parameters

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

Name Type Description Notes

Return type

BillingGatewayPayment

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]

GetBillingCryptoOptions

BillingCryptoOptions GetBillingCryptoOptions(ctx).Execute()

Answers which chains and tokens the crypto rail accepts — what an asset picker renders — and the pairs themselves in assets: a chain and a token each on offer are not a pair on offer.

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.BillingAPI.GetBillingCryptoOptions(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingCryptoOptions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingCryptoOptions`: BillingCryptoOptions
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingCryptoOptions`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingCryptoOptions

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]

GetBillingInvoices

BillingInvoices GetBillingInvoices(ctx).Subject(subject).Status(status).SubscriptionId(subscriptionId).Limit(limit).Cursor(cursor).Execute()

Lists the caller's invoices, newest first, with the count beside them.

Example

package main

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

func main() {
	subject := "subject_example" // string |  (optional)
	status := "status_example" // string |  (optional)
	subscriptionId := "subscriptionId_example" // string |  (optional)
	limit := int64(789) // int64 |  (optional)
	cursor := "cursor_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.BillingAPI.GetBillingInvoices(context.Background()).Subject(subject).Status(status).SubscriptionId(subscriptionId).Limit(limit).Cursor(cursor).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingInvoices``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingInvoices`: BillingInvoices
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingInvoices`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
subject string
status string
subscriptionId string
limit int64
cursor string

Return type

BillingInvoices

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]

GetBillingInvoicesByIdPdf

GetBillingInvoicesByIdPdf(ctx, id).Execute()

Download one invoice as a PDF

Example

package main

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

func main() {
	id := "id_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingInvoicesByIdPdf(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingInvoicesByIdPdf``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingInvoicesHostedByLink(ctx, link).Execute()

Is the order invoice a link shows, read on the brand of the host it is asked on: a link read on another brand's host is a miss.

Example

package main

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

func main() {
	link := "link_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingInvoicesHostedByLink(context.Background(), link).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingInvoicesHostedByLink``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
link string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingInvoicesHostedByLinkPdf

GetBillingInvoicesHostedByLinkPdf(ctx, link).Execute()

Is the order invoice a link shows, as a PDF to print or save.

Example

package main

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

func main() {
	link := "link_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingInvoicesHostedByLinkPdf(context.Background(), link).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingInvoicesHostedByLinkPdf``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
link string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingLedger

[]BillingFinanceLedgerEntry GetBillingLedger(ctx).Range_(range_).Execute()

Answers the org's own postings inside range=, each as a signed entry: a DEPOSIT CREDITS the wallet (positive, account credits:<org>), a HOLD sets money aside for a payment agreed and not yet made (negative, account held:<org>) and its return gives it back (positive), and every other posting DEBITS it (negative, account usage:<org>), described by its notes or its tags.

Example

package main

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

func main() {
	range_ := "30d" // string | Range is the window: 24h, 7d, 30d or 90d. Anything else — including absent — is 30d, so a typo silently widens the window to a month rather than failing. (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
range_ string Range is the window: 24h, 7d, 30d or 90d. Anything else — including absent — is 30d, so a typo silently widens the window to a month rather than failing.

Return type

[]BillingFinanceLedgerEntry

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]

GetBillingMethods

GetBillingMethods(ctx).Execute()

Cards and accounts on file for the caller

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingMethods(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingMethods``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingPayouts

[]BillingPayout GetBillingPayouts(ctx).Execute()

Answers the org's outbound payouts, newest first — amount, destination, status, and the failure reason where one applies.

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.BillingAPI.GetBillingPayouts(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingPayouts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingPayouts`: []BillingPayout
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingPayouts`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]BillingPayout

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]

GetBillingPlans

GetBillingPlans(ctx).Execute()

The plan catalog, priced with whatever offer is in force

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingPlans(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingPlans``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingPortalMethods

GetBillingPortalMethods(ctx).Execute()

Cards and accounts on file for the caller

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingPortalMethods(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingPortalMethods``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingRecharge

BillingAutoRecharge GetBillingRecharge(ctx).Execute()

Reads the auto-reload rule of the wallet the caller pays from — the org's own account, or a person's wallet in the signup org: top that balance up by amountCents whenever it falls below thresholdCents, charging that payer's card on file off-session, at most perDay times in a UTC day (0 is no daily limit, which the payer's plan sets).

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.BillingAPI.GetBillingRecharge(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingRecharge``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingRecharge`: BillingAutoRecharge
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingRecharge`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingAutoRecharge

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]

GetBillingSettings

BillingPaymentConfig GetBillingSettings(ctx).Execute()

Answers the PUBLIC half of this org's processor configuration — the ids a browser needs to tokenize a card, and the environment it must tokenize against.

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.BillingAPI.GetBillingSettings(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingSettings``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingSettings`: BillingPaymentConfig
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingSettings`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingPaymentConfig

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]

GetBillingSubscriptions

BillingSubscriptions GetBillingSubscriptions(ctx).Execute()

Lists the plans the caller may see, with the count beside them.

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.BillingAPI.GetBillingSubscriptions(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingSubscriptions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingSubscriptions`: BillingSubscriptions
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingSubscriptions`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingSubscriptions

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]

GetBillingTier

BillingTier GetBillingTier(ctx).Execute()

Answers which tier the caller is on, what it allows, and what is left to spend.

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.BillingAPI.GetBillingTier(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingTier``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingTier`: BillingTier
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingTier`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingTier

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]

GetBillingTransactions

BillingTransactions GetBillingTransactions(ctx).Currency(currency).Limit(limit).Offset(offset).Execute()

Answers one page of the caller's own ledger, newest first: what moved, how much, when, and what it was tagged with.

Example

package main

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

func main() {
	currency := "currency_example" // string | Currency filters to one currency. Empty reads every currency. (optional)
	limit := "limit_example" // string | Limit is the page size; absent or non-positive takes the default 100. (optional)
	offset := "offset_example" // string | Offset is how far into the history the page starts. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.BillingAPI.GetBillingTransactions(context.Background()).Currency(currency).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingTransactions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingTransactions`: BillingTransactions
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingTransactions`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
currency string Currency filters to one currency. Empty reads every currency.
limit string Limit is the page size; absent or non-positive takes the default 100.
offset string Offset is how far into the history the page starts.

Return type

BillingTransactions

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]

GetBillingTransactionsById

BillingTransaction GetBillingTransactionsById(ctx, id).Execute()

Reads one ledger entry by its id.

Example

package main

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

func main() {
	id := "id_example" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

Return type

BillingTransaction

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]

GetBillingUsage

GetBillingUsage(ctx).Execute()

Every billed call the caller's org made, attributed to a product

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.GetBillingUsage(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingUsage``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetBillingUsageAccounts

BillingAccounts GetBillingUsageAccounts(ctx).Execute()

Answers per-account totals for the linked provider accounts the gateway ROUTED this caller's traffic through — requests, prompt and completion tokens, recorded cost — plus their honest sum.

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.BillingAPI.GetBillingUsageAccounts(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingUsageAccounts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingUsageAccounts`: BillingAccounts
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingUsageAccounts`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingAccounts

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]

GetBillingUsageRollup

BillingRollup GetBillingUsageRollup(ctx).Execute()

Answers the caller's month: what their plan includes, what has been consumed against it, and the wallet beside it.

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.BillingAPI.GetBillingUsageRollup(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingUsageRollup``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingUsageRollup`: BillingRollup
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingUsageRollup`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingRollup

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]

GetBillingWire

BillingWireInstructions GetBillingWire(ctx).Execute()

Answers where to send a wire top-up: the receiving bank details, with the caller's own payment reference.

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.BillingAPI.GetBillingWire(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.GetBillingWire``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetBillingWire`: BillingWireInstructions
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.GetBillingWire`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingWireInstructions

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]

GetInvoice

BillingInvoice GetInvoice(ctx, id).Brand(brand).Execute()

Read one invoice

Example

package main

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

func main() {
	id := "id_example" // string | ID is the invoice id.
	brand := "brand_example" // string | Brand is the brand that bills (hanzo, lux, zoo, pars), whose mark and address a rendered invoice carries. The edge sets it from the caller's issuer; empty is Hanzo. (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the invoice id.

Other Parameters

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

Name Type Description Notes

brand | string | Brand is the brand that bills (hanzo, lux, zoo, pars), whose mark and address a rendered invoice carries. The edge sets it from the caller's issuer; empty is Hanzo. |

Return type

BillingInvoice

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]

IssueInvoice

BillingInvoice IssueInvoice(ctx, id).BillingInvoiceRef(billingInvoiceRef).Execute()

Issue a draft invoice, making it collectible

Example

package main

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

func main() {
	id := "id_example" // string | ID is the invoice id.
	billingInvoiceRef := *openapiclient.NewBillingInvoiceRef() // BillingInvoiceRef | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the invoice id.

Other Parameters

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

Name Type Description Notes

billingInvoiceRef | BillingInvoiceRef | |

Return type

BillingInvoice

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]

PatchBillingAlertsById

BillingAlert PatchBillingAlertsById(ctx, id).BillingAlertPatch(billingAlertPatch).Execute()

Changes one spend cap: raise or lower the ceiling, flip enforcement, retune the rate limit.

Example

package main

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

func main() {
	id := "id_example" // string | 
	billingAlertPatch := *openapiclient.NewBillingAlertPatch() // BillingAlertPatch | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

billingAlertPatch | BillingAlertPatch | |

Return type

BillingAlert

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]

PostBillingAlerts

BillingAlert PostBillingAlerts(ctx).BillingAlertSpec(billingAlertSpec).Execute()

Opens a spend cap on the caller's own org.

Example

package main

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

func main() {
	billingAlertSpec := *openapiclient.NewBillingAlertSpec() // BillingAlertSpec | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingAlertSpec BillingAlertSpec

Return type

BillingAlert

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]

PostBillingCryptoDeposit

BillingCryptoDeposit PostBillingCryptoDeposit(ctx).BillingCryptoAsset(billingCryptoAsset).Execute()

Issues a deposit address the caller can send crypto to, on the asset they ask for.

Example

package main

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

func main() {
	billingCryptoAsset := *openapiclient.NewBillingCryptoAsset() // BillingCryptoAsset | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingCryptoAsset BillingCryptoAsset

Return type

BillingCryptoDeposit

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]

PostBillingCryptoGateway

BillingGatewayPayment PostBillingCryptoGateway(ctx).BillingSignedPayment(billingSignedPayment).Execute()

Takes a signed USDC payment from the caller's Circle Gateway balance to the treasury, and answers what became of it.

Example

package main

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

func main() {
	billingSignedPayment := *openapiclient.NewBillingSignedPayment() // BillingSignedPayment | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingSignedPayment BillingSignedPayment

Return type

BillingGatewayPayment

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]

PostBillingMethods

PostBillingMethods(ctx).Execute()

Save a card or account for the caller

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.PostBillingMethods(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.PostBillingMethods``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

PostBillingMode

BillingMode PostBillingMode(ctx).BillingModeIn(billingModeIn).Execute()

Moves this org between sandbox money and real money.

Example

package main

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

func main() {
	billingModeIn := *openapiclient.NewBillingModeIn() // BillingModeIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingModeIn BillingModeIn

Return type

BillingMode

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]

PostBillingPaypalOrder

BillingPayPalOrderOut PostBillingPaypalOrder(ctx).BillingPaypalOrderIn(billingPaypalOrderIn).XIdempotencyKey(xIdempotencyKey).Execute()

Opens a server-priced PayPal REST v2 order for either a bounded credit top-up (intent CAPTURE) or a plan purchase's first period (intent AUTHORIZE).

Example

package main

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

func main() {
	billingPaypalOrderIn := *openapiclient.NewBillingPaypalOrderIn() // BillingPaypalOrderIn | 
	xIdempotencyKey := "xIdempotencyKey_example" // string |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingPaypalOrderIn BillingPaypalOrderIn
xIdempotencyKey string

Return type

BillingPayPalOrderOut

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]

PostBillingPortalMethods

PostBillingPortalMethods(ctx).Execute()

Save a card or account for the caller

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.PostBillingPortalMethods(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.PostBillingPortalMethods``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

PostBillingRechargeRunAll

BillingRecharge PostBillingRechargeRunAll(ctx).Execute()

Sweeps every org's auto-recharge and answers what it did.

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.BillingAPI.PostBillingRechargeRunAll(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.PostBillingRechargeRunAll``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostBillingRechargeRunAll`: BillingRecharge
	fmt.Fprintf(os.Stdout, "Response from `BillingAPI.PostBillingRechargeRunAll`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingRecharge

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]

PostBillingSubscribeCard

PostBillingSubscribeCard(ctx).Execute()

Buy a plan with a card

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.PostBillingSubscribeCard(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.PostBillingSubscribeCard``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

PostBillingSubscribeInvoice

PostBillingSubscribeInvoice(ctx).Execute()

Order a plan by invoice, paid by wire

Example

package main

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

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.BillingAPI.PostBillingSubscribeInvoice(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `BillingAPI.PostBillingSubscribeInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

PostBillingTopup

BillingCharged PostBillingTopup(ctx).BillingTopupIn(billingTopupIn).XIdempotencyKey(xIdempotencyKey).Execute()

Charges a card the caller already saved and credits the balance.

Example

package main

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

func main() {
	billingTopupIn := *openapiclient.NewBillingTopupIn() // BillingTopupIn | 
	xIdempotencyKey := "xIdempotencyKey_example" // string |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingTopupIn BillingTopupIn
xIdempotencyKey string

Return type

BillingCharged

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]

PostBillingTopupToken

BillingCharged PostBillingTopupToken(ctx).BillingTopupIn(billingTopupIn).XIdempotencyKey(xIdempotencyKey).Execute()

Charges a single-use card token and credits the caller's balance.

Example

package main

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

func main() {
	billingTopupIn := *openapiclient.NewBillingTopupIn() // BillingTopupIn | 
	xIdempotencyKey := "xIdempotencyKey_example" // string |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingTopupIn BillingTopupIn
xIdempotencyKey string

Return type

BillingCharged

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]

PostBillingUsage

BillingUsageReceipt PostBillingUsage(ctx).BillingUsageReport(billingUsageReport).Execute()

Debits one act an application metered to the org it acts for, and answers the receipt.

Example

package main

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

func main() {
	billingUsageReport := *openapiclient.NewBillingUsageReport() // BillingUsageReport | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingUsageReport BillingUsageReport

Return type

BillingUsageReceipt

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]

PutBillingRecharge

BillingAutoRecharge PutBillingRecharge(ctx).BillingAutoRechargeEdit(billingAutoRechargeEdit).Execute()

Sets the auto-reload rule of the wallet the caller pays from, and answers with the rule as stored.

Example

package main

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

func main() {
	billingAutoRechargeEdit := *openapiclient.NewBillingAutoRechargeEdit() // BillingAutoRechargeEdit | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingAutoRechargeEdit BillingAutoRechargeEdit

Return type

BillingAutoRecharge

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]

RaiseInvoice

BillingInvoice RaiseInvoice(ctx).BillingRaiseIn(billingRaiseIn).Execute()

Raise a draft invoice against a customer

Example

package main

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

func main() {
	billingRaiseIn := *openapiclient.NewBillingRaiseIn() // BillingRaiseIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingRaiseIn BillingRaiseIn

Return type

BillingInvoice

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]

ReactivateSubscription

BillingSubscription ReactivateSubscription(ctx, id).BillingSubscriptionAct(billingSubscriptionAct).Execute()

Put a canceled subscription back on its plan

Example

package main

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

func main() {
	id := "id_example" // string | ID is the subscription, from the path.
	billingSubscriptionAct := *openapiclient.NewBillingSubscriptionAct() // BillingSubscriptionAct | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the subscription, from the path.

Other Parameters

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

Name Type Description Notes

billingSubscriptionAct | BillingSubscriptionAct | |

Return type

BillingSubscription

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]

ResizeSubscription

BillingSubscription ResizeSubscription(ctx, id).BillingResize(billingResize).Execute()

Change a team's seats

Example

package main

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

func main() {
	id := "id_example" // string | 
	billingResize := *openapiclient.NewBillingResize() // BillingResize | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

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

Name Type Description Notes

billingResize | BillingResize | |

Return type

BillingSubscription

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]

VoidInvoice

BillingInvoice VoidInvoice(ctx, id).BillingInvoiceRef(billingInvoiceRef).Execute()

Void a draft or issued invoice

Example

package main

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

func main() {
	id := "id_example" // string | ID is the invoice id.
	billingInvoiceRef := *openapiclient.NewBillingInvoiceRef() // BillingInvoiceRef | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the invoice id.

Other Parameters

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

Name Type Description Notes

billingInvoiceRef | BillingInvoiceRef | |

Return type

BillingInvoice

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]