Skip to content

Latest commit

 

History

History
1391 lines (906 loc) · 36.8 KB

BillingApi.md

File metadata and controls

1391 lines (906 loc) · 36.8 KB

\BillingApi

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
CancelSubscription Delete /billing/subscriptions/{subscriptionID}/ Cancel subscription
CreatePaymentMethodStripeSetupIntent Post /billing/payment-methods/stripe/setup-intents/ Create stripe's setup intent for add new payment method.
CreateSubscription Post /billing/subscriptions/ Create subscription
DeletePaymentMethod Delete /billing/payment-methods/{paymentMethodID}/ Delete payment method
GetBillingAccount Get /billing/account/ Billing account info
GetBillingBundle Get /billing/bundles/{bundleID}/ Bundle info
GetBillingPaymentOption Get /billing/payment-options/{paymentOptionID}/ Payment option info
GetBillingProduct Get /billing/products/{productID}/ Product info
GetPaymentMethod Get /billing/payment-methods/{paymentMethodID}/ Payment method info
GetSubscription Get /billing/subscriptions/{subscriptionID}/ Subscription info
GetSubscriptionItem Get /billing/subscription-items/{subscriptionItemID}/ Subscription item info
ListBillingBundles Get /billing/bundles/ Billing bundles list
ListBillingFeatures Get /billing/features/ Billing feature list
ListBillingPaymentOptions Get /billing/payment-options/ Billing payment option list
ListBillingProducts Get /billing/products/ Billing products list
ListPaymentMethods Get /billing/payment-methods/ Payment method list
ListSubscriptionItems Get /billing/subscription-items/ Subscription items list
ListSubscriptions Get /billing/subscriptions/ Billing subscriptions list
ReactivateSubscription Post /billing/subscriptions/{subscriptionID}/reactivate/ Reactivate subscription
UpdateBillingAccount Patch /billing/account/ Update billing account
UpdateSubscriptionItem Patch /billing/subscription-items/{subscriptionItemID}/ Update subscription item

CancelSubscription

CancelSubscription(ctx, subscriptionID).Execute()

Cancel subscription

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscriptionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BillingApi.CancelSubscription(context.Background(), subscriptionID).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)
    }
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

CreatePaymentMethodStripeSetupIntent

StripeSetupIntent CreatePaymentMethodStripeSetupIntent(ctx).CreateStripeSetupIntentRequest(createStripeSetupIntentRequest).Execute()

Create stripe's setup intent for add new payment method.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    createStripeSetupIntentRequest := *openapiclient.NewCreateStripeSetupIntentRequest() // CreateStripeSetupIntentRequest |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createStripeSetupIntentRequest CreateStripeSetupIntentRequest

Return type

StripeSetupIntent

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

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

CreateSubscription

Subscription CreateSubscription(ctx).Subscription(subscription).Execute()

Create subscription

Example

package main

import (
    "context"
    "fmt"
    "os"
    "time"
    openapiclient "./openapi"
)

func main() {
    subscription := *openapiclient.NewSubscription("Id_example", time.Now(), time.Now(), time.Now(), openapiclient.SubscriptionStatus("unknown")) // Subscription |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
subscription Subscription

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

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

DeletePaymentMethod

DeletePaymentMethod(ctx, paymentMethodID).Execute()

Delete payment method

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    paymentMethodID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BillingApi.DeletePaymentMethod(context.Background(), paymentMethodID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BillingApi.DeletePaymentMethod``: %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.
paymentMethodID string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

GetBillingAccount

BillingAccount GetBillingAccount(ctx).Execute()

Billing account info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BillingAccount

Authorization

bearerAuth

HTTP request headers

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

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

GetBillingBundle

Bundle GetBillingBundle(ctx, bundleID).Execute()

Bundle info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    bundleID := "bundleID_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Bundle

Authorization

bearerAuth

HTTP request headers

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

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

GetBillingPaymentOption

PaymentOption GetBillingPaymentOption(ctx, paymentOptionID).Execute()

Payment option info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    paymentOptionID := "paymentOptionID_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

PaymentOption

Authorization

bearerAuth

HTTP request headers

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

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

GetBillingProduct

Product GetBillingProduct(ctx, productID).Execute()

Product info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    productID := "productID_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Product

Authorization

bearerAuth

HTTP request headers

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

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

GetPaymentMethod

PaymentMethod GetPaymentMethod(ctx, paymentMethodID).Execute()

Payment method info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    paymentMethodID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

PaymentMethod

Authorization

bearerAuth

HTTP request headers

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

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

GetSubscription

Subscription GetSubscription(ctx, subscriptionID).Execute()

Subscription info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscriptionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

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

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

GetSubscriptionItem

SubscriptionItem GetSubscriptionItem(ctx, subscriptionItemID).Execute()

Subscription item info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscriptionItemID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

SubscriptionItem

Authorization

bearerAuth

HTTP request headers

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

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

ListBillingBundles

[]Bundle ListBillingBundles(ctx).Execute()

Billing bundles list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]Bundle

Authorization

bearerAuth

HTTP request headers

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

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

ListBillingFeatures

[]BillingFeature ListBillingFeatures(ctx).Execute()

Billing feature list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]BillingFeature

Authorization

bearerAuth, wireguardAuth

HTTP request headers

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

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

ListBillingPaymentOptions

[]PaymentOption ListBillingPaymentOptions(ctx).Execute()

Billing payment option list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]PaymentOption

Authorization

bearerAuth

HTTP request headers

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

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

ListBillingProducts

[]Product ListBillingProducts(ctx).Execute()

Billing products list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]Product

Authorization

bearerAuth

HTTP request headers

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

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

ListPaymentMethods

[]PaymentMethod ListPaymentMethods(ctx).Execute()

Payment method list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]PaymentMethod

Authorization

bearerAuth

HTTP request headers

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

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

ListSubscriptionItems

[]SubscriptionItem ListSubscriptionItems(ctx).Subscription(subscription).PerPage(perPage).Page(page).Execute()

Subscription items list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscription := "subscription_example" // string |  (optional)
    perPage := int32(56) // int32 |  (optional)
    page := int32(56) // int32 |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BillingApi.ListSubscriptionItems(context.Background()).Subscription(subscription).PerPage(perPage).Page(page).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BillingApi.ListSubscriptionItems``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListSubscriptionItems`: []SubscriptionItem
    fmt.Fprintf(os.Stdout, "Response from `BillingApi.ListSubscriptionItems`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
subscription string
perPage int32
page int32

Return type

[]SubscriptionItem

Authorization

bearerAuth

HTTP request headers

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

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

ListSubscriptions

[]Subscription ListSubscriptions(ctx).Product(product).PerPage(perPage).Page(page).Execute()

Billing subscriptions list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    product := "product_example" // string |  (optional)
    perPage := int32(56) // int32 |  (optional)
    page := int32(56) // int32 |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BillingApi.ListSubscriptions(context.Background()).Product(product).PerPage(perPage).Page(page).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BillingApi.ListSubscriptions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListSubscriptions`: []Subscription
    fmt.Fprintf(os.Stdout, "Response from `BillingApi.ListSubscriptions`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
product string
perPage int32
page int32

Return type

[]Subscription

Authorization

bearerAuth

HTTP request headers

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

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

ReactivateSubscription

Subscription ReactivateSubscription(ctx, subscriptionID).Execute()

Reactivate subscription

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscriptionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BillingApi.ReactivateSubscription(context.Background(), subscriptionID).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`: Subscription
    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.
subscriptionID string

Other Parameters

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

Name Type Description Notes

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

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

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

UpdateBillingAccount

BillingAccount UpdateBillingAccount(ctx).BillingAccount(billingAccount).Execute()

Update billing account

Example

package main

import (
    "context"
    "fmt"
    "os"
    "time"
    openapiclient "./openapi"
)

func main() {
    billingAccount := *openapiclient.NewBillingAccount("Id_example", *openapiclient.NewPaymentMethod("Id_example", openapiclient.PaymentMethodType("card"), time.Now()), "DefaultPaymentMethodId_example") // BillingAccount | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
billingAccount BillingAccount

Return type

BillingAccount

Authorization

bearerAuth

HTTP request headers

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

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

UpdateSubscriptionItem

SubscriptionItem UpdateSubscriptionItem(ctx, subscriptionItemID).SubscriptionItem(subscriptionItem).Execute()

Update subscription item

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subscriptionItemID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    subscriptionItem := *openapiclient.NewSubscriptionItem("Id_example", *openapiclient.NewPrice("Id_example", "Currency_example", float64(123)), "PriceId_example", int32(123)) // SubscriptionItem | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

subscriptionItem | SubscriptionItem | |

Return type

SubscriptionItem

Authorization

bearerAuth

HTTP request headers

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

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