Categorygithub.com/maxio-com/ab-golang-sdk
modulepackage
0.5.0
Repository: https://github.com/maxio-com/ab-golang-sdk.git
Documentation: pkg.go.dev

# README

Getting Started with Maxio Advanced Billing

Introduction

Maxio Advanced Billing (formerly Chargify) provides an HTTP-based API that conforms to the principles of REST. One of the many reasons to use Advanced Billing is the immense feature set and surrounding community client libraries. The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for Merchants who require it.

Steps to make your first Maxio Advanced Billing API call

  1. Sign-up or log-in to your test site account.
  2. Setup and configure authentication credentials.
  3. Submit your API request and try it out.
  4. Verify results through response.
  5. Test our integrations.

We strongly suggest exploring the developer portal, our integrations and the API guide, as well as the entire set of application-based documentation to aid in your discovery of the product.

Example

The following example uses the curl command-line tool to execute API requests.

Request

curl -u <api_key>:x -H Accept:application/json -H Content-Type:application/json https://acme.chargify.com/subscriptions.json

Requirements

The SDK requires Go version 1.18 or above.

Installation

The following section explains how to use the advancedbilling library in a new project.

1. Install the Package

To use the package in your application, you can install the package from pkg.go.dev using the following command:

$ go get github.com/maxio-com/[email protected]

You can also view the package at: https://pkg.go.dev/github.com/maxio-com/[email protected]

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

ParameterTypeDescription
sitestringThe subdomain for your Advanced Billing site.
Default: "subdomain"
environmentEnvironmentThe API environment.
Default: Environment.US
httpConfigurationHttpConfigurationConfigurable http client options like timeout and retries.
basicAuthCredentialsBasicAuthCredentialsThe Credentials Setter for Basic Authentication

The API client can be initialized as follows:

client := advancedbilling.NewClient(
    advancedbilling.CreateConfiguration(
        advancedbilling.WithHttpConfiguration(
            advancedbilling.CreateHttpConfiguration(
                advancedbilling.WithTimeout(120),
            ),
        ),
        advancedbilling.WithEnvironment(advancedbilling.US),
        advancedbilling.WithBasicAuthCredentials(
            advancedbilling.NewBasicAuthCredentials(
                "BasicAuthUserName",
                "BasicAuthPassword",
            ),
        ),
        advancedbilling.WithSite("subdomain"),
    ),
)

Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

Fields

NameDescription
USDefault Default Advanced Billing environment hosted in US. Valid for the majority of our customers.
EUAdvanced Billing environment hosted in EU. Use only when you requested EU hosting for your AB account.

Authorization

This API uses the following authentication schemes.

List of APIs

Classes Documentation

# Packages

Package advancedbilling This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
Package advancedbilling This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).

# Functions

CreateConfiguration creates a new Configuration with the provided options.
CreateConfigurationFromEnvironment creates a new Configuration with default settings.
CreateHttpConfiguration creates a new HttpConfiguration with the provided options.
CreateRetryConfiguration creates a new RetryConfiguration with the provided options.
DefaultConfiguration returns the default Configuration.
DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests.
DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests.
NewAdvanceInvoiceController creates a new instance of AdvanceInvoiceController.
NewAPIExportsController creates a new instance of APIExportsController.
NewBaseController creates a new instance of baseController.
NewBasicAuthCredentials creates a new instance of BasicAuthCredentials with provided parameters.
NewBillingPortalController creates a new instance of BillingPortalController.
NewClient is the constructor for creating a new client instance.
NewComponentPricePointsController creates a new instance of ComponentPricePointsController.
NewComponentsController creates a new instance of ComponentsController.
NewCouponsController creates a new instance of CouponsController.
NewCustomersController creates a new instance of CustomersController.
NewCustomFieldsController creates a new instance of CustomFieldsController.
NewEventsBasedBillingSegmentsController creates a new instance of EventsBasedBillingSegmentsController.
NewEventsController creates a new instance of EventsController.
NewInsightsController creates a new instance of InsightsController.
NewInvoicesController creates a new instance of InvoicesController.
NewOffersController creates a new instance of OffersController.
NewPaymentProfilesController creates a new instance of PaymentProfilesController.
NewProductFamiliesController creates a new instance of ProductFamiliesController.
NewProductPricePointsController creates a new instance of ProductPricePointsController.
NewProductsController creates a new instance of ProductsController.
NewProformaInvoicesController creates a new instance of ProformaInvoicesController.
NewReasonCodesController creates a new instance of ReasonCodesController.
NewReferralCodesController creates a new instance of ReferralCodesController.
NewSalesCommissionsController creates a new instance of SalesCommissionsController.
NewSitesController creates a new instance of SitesController.
NewSubscriptionComponentsController creates a new instance of SubscriptionComponentsController.
NewSubscriptionGroupInvoiceAccountController creates a new instance of SubscriptionGroupInvoiceAccountController.
NewSubscriptionGroupsController creates a new instance of SubscriptionGroupsController.
NewSubscriptionGroupStatusController creates a new instance of SubscriptionGroupStatusController.
NewSubscriptionInvoiceAccountController creates a new instance of SubscriptionInvoiceAccountController.
NewSubscriptionNotesController creates a new instance of SubscriptionNotesController.
NewSubscriptionProductsController creates a new instance of SubscriptionProductsController.
NewSubscriptionsController creates a new instance of SubscriptionsController.
NewSubscriptionStatusController creates a new instance of SubscriptionStatusController.
NewWebhooksController creates a new instance of WebhooksController.
WithBasicAuthCredentials is an option that sets the BasicAuthCredentials in the Configuration.
WithEnvironment is an option that sets the Environment in the Configuration.
WithHttpConfiguration is an option that sets the HttpConfiguration in the Configuration.
WithSite is an option that sets the Site in the Configuration.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

NewAndAuth creates a new AndAuth.
NewAuth creates a new Auth.
NewHttpConfiguration creates a new HttpConfiguration.
NewOrAuth creates a new OrAuth.
NewRetryConfiguration creates a new RetryConfiguration.
WithBackoffFactor sets the BackoffFactor.
WithHttpMethodsToRetry sets the HttpMethodsToRetry.
WithHttpStatusCodesToRetry sets the HttpStatusCodesToRetry.
WithMaximumRetryWaitTime sets the MaximumRetryWaitTime.
WithMaxRetryAttempts sets the MaxRetryAttempts.
WithRetryConfiguration sets the RetryConfiguration.
WithRetryInterval sets the RetryInterval.
WithRetryOnTimeout sets the RetryOnTimeout.
WithTimeout sets the Timeout.
WithTransport sets the Transport.

# Structs

AdvanceInvoiceController represents a controller struct.
APIExportsController represents a controller struct.
BasicAuthCredentials represents the credentials required for `BasicAuth` authentication.
BillingPortalController represents a controller struct.
ComponentPricePointsController represents a controller struct.
ComponentsController represents a controller struct.
Configuration holds configuration settings.
CouponsController represents a controller struct.
CustomersController represents a controller struct.
CustomFieldsController represents a controller struct.
EventsBasedBillingSegmentsController represents a controller struct.
EventsController represents a controller struct.
InsightsController represents a controller struct.
InvoicesController represents a controller struct.
ListAllComponentPricePointsInput represents the input of the ListAllComponentPricePoints endpoint.
ListAllProductPricePointsInput represents the input of the ListAllProductPricePoints endpoint.
ListChargifyJsPublicKeysInput represents the input of the ListChargifyJsPublicKeys endpoint.
ListComponentPricePointsInput represents the input of the ListComponentPricePoints endpoint.
ListComponentsForProductFamilyInput represents the input of the ListComponentsForProductFamily endpoint.
ListComponentsInput represents the input of the ListComponents endpoint.
ListConsolidatedInvoiceSegmentsInput represents the input of the ListConsolidatedInvoiceSegments endpoint.
ListCouponsForProductFamilyInput represents the input of the ListCouponsForProductFamily endpoint.
ListCouponsInput represents the input of the ListCoupons endpoint.
ListCouponSubcodesInput represents the input of the ListCouponSubcodes endpoint.
ListCreditNotesInput represents the input of the ListCreditNotes endpoint.
ListCustomersInput represents the input of the ListCustomers endpoint.
ListEventsInput represents the input of the ListEvents endpoint.
ListExportedInvoicesInput represents the input of the ListExportedInvoices endpoint.
ListExportedProformaInvoicesInput represents the input of the ListExportedProformaInvoices endpoint.
ListExportedSubscriptionsInput represents the input of the ListExportedSubscriptions endpoint.
ListInvoiceEventsInput represents the input of the ListInvoiceEvents endpoint.
ListInvoicesInput represents the input of the ListInvoices endpoint.
ListMetadataForResourceTypeInput represents the input of the ListMetadataForResourceType endpoint.
ListMetadataInput represents the input of the ListMetadata endpoint.
ListMetafieldsInput represents the input of the ListMetafields endpoint.
ListMrrMovementsInput represents the input of the ListMrrMovements endpoint.
ListMrrPerSubscriptionInput represents the input of the ListMrrPerSubscription endpoint.
ListOffersInput represents the input of the ListOffers endpoint.
ListPaymentProfilesInput represents the input of the ListPaymentProfiles endpoint.
ListPrepaymentsForSubscriptionGroupInput represents the input of the ListPrepaymentsForSubscriptionGroup endpoint.
ListPrepaymentsInput represents the input of the ListPrepayments endpoint.
ListProductFamiliesInput represents the input of the ListProductFamilies endpoint.
ListProductPricePointsInput represents the input of the ListProductPricePoints endpoint.
ListProductsForProductFamilyInput represents the input of the ListProductsForProductFamily endpoint.
ListProductsInput represents the input of the ListProducts endpoint.
ListProformaInvoicesInput represents the input of the ListProformaInvoices endpoint.
ListReasonCodesInput represents the input of the ListReasonCodes endpoint.
ListSalesCommissionSettingsInput represents the input of the ListSalesCommissionSettings endpoint.
ListSalesRepsInput represents the input of the ListSalesReps endpoint.
ListSegmentsForPricePointInput represents the input of the ListSegmentsForPricePoint endpoint.
ListSubscriptionComponentsForSiteInput represents the input of the ListSubscriptionComponentsForSite endpoint.
ListSubscriptionComponentsInput represents the input of the ListSubscriptionComponents endpoint.
ListSubscriptionEventsInput represents the input of the ListSubscriptionEvents endpoint.
ListSubscriptionGroupProformaInvoicesInput represents the input of the ListSubscriptionGroupProformaInvoices endpoint.
ListSubscriptionGroupsInput represents the input of the ListSubscriptionGroups endpoint.
ListSubscriptionNotesInput represents the input of the ListSubscriptionNotes endpoint.
ListSubscriptionsInput represents the input of the ListSubscriptions endpoint.
ListUsagesInput represents the input of the ListUsages endpoint.
ListWebhooksInput represents the input of the ListWebhooks endpoint.
OffersController represents a controller struct.
PaymentProfilesController represents a controller struct.
ProductFamiliesController represents a controller struct.
ProductPricePointsController represents a controller struct.
ProductsController represents a controller struct.
ProformaInvoicesController represents a controller struct.
ReadEventsCountInput represents the input of the ReadEventsCount endpoint.
ReasonCodesController represents a controller struct.
ReferralCodesController represents a controller struct.
SalesCommissionsController represents a controller struct.
SitesController represents a controller struct.
SubscriptionComponentsController represents a controller struct.
SubscriptionGroupInvoiceAccountController represents a controller struct.
SubscriptionGroupsController represents a controller struct.
SubscriptionGroupStatusController represents a controller struct.
SubscriptionInvoiceAccountController represents a controller struct.
SubscriptionNotesController represents a controller struct.
SubscriptionProductsController represents a controller struct.
SubscriptionsController represents a controller struct.
SubscriptionStatusController represents a controller struct.
WebhooksController represents a controller struct.

# Interfaces

Client is an interface representing the main client for accessing configuration and controllers.

# Type aliases

ConfigurationOptions represents a function type that can be used to apply options to the Configuration struct.
Environment represents available environments.
HttpConfiguration holds the configuration options for the client.
HttpConfigurationOptions is a function type that modifies the HttpConfiguration.
RetryConfiguration holds the configuration options for the client.
RetryConfigurationOptions is a function type that modifies the RetryConfiguration.
Server represents available servers.