recurly

package module
v3.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 19 Imported by: 0

README

Recurly

Contributor Covenant

This repository houses the official Go library for Recurly's V3 API.

Documentation for the HTTP API and example code can be found on our Developer Hub.

Getting Started

Installing

Install using go get:

go get -u github.com/recurly/recurly-client-go/v3

import with:

import (
    "github.com/recurly/recurly-client-go/v3"
)
Creating a client

A client represents a connection to the Recurly API. Every call to the server exists as a method on this struct. To initialize, you only need the private API key which can be obtained on the API Credentials Page.

client := recurly.NewClient("<apikey>")
Operations

Every operation that can be performed against the API has a corresponding method in the Client struct. The client_operations.go file implements these operations. This file also provides descriptions for each method and their returns. For example, to use the get_account endpoint, the GetAccount method can be called, as seen below. GetAccount() is used to fetch an account; it returns a pointer to the Account struct.

account, err := client.GetAccount(accountID)
if e, ok := err.(*recurly.Error); ok {
  if e.Type == recurly.ErrorTypeNotFound {
    fmt.Printf("Resource not found: %v", e)
    return nil, err
  }
  fmt.Printf("Unexpected Recurly error: %v", e)
  return nil, err
}
fmt.Printf("Fetched Account: %s", account.Id)
Creating Resources

Every Create method on the client takes a specific Request type to form the request.

accountReq := &recurly.AccountCreate{
  Code:      recurly.String("accountcode123"),
  FirstName: recurly.String("Isaac"),
  LastName:  recurly.String("Du Monde"),
  Email:     recurly.String("isaac@example.com"),
  BillingInfo: &recurly.BillingInfoCreate{
    FirstName: recurly.String("Isaac"),
    LastName:  recurly.String("Du Monde"),
    Address: &recurly.AddressCreate{
      Phone:      recurly.String("415-555-5555"),
      Street1:    recurly.String("400 Alabama St."),
      City:       recurly.String("San Francisco"),
      PostalCode: recurly.String("94110"),
      Country:    recurly.String("US"),
      Region:     recurly.String("CA"),
    },
    Number: recurly.String("4111111111111111"),
    Month:  recurly.String("12"),
    Year:   recurly.String("22"),
    Cvv:    recurly.String("123"),
  },
}

account, err := client.CreateAccount(accountReq)
if e, ok := err.(*recurly.Error); ok {
  if e.Type == recurly.ErrorTypeValidation {
    fmt.Printf("Failed validation: %v", e)
    return nil, err
  }
  fmt.Printf("Unexpected Recurly error: %v", e)
  return nil, err
}
fmt.Printf("Created Account: %s", account.Id)
Pagination

Pagination is accomplished via the *List types defined in [resources.go]. For example, AccountList allows you to paginate Account objects. All List* methods on the Client return pagers (pointers to these list types).

These list operations accept parameters for sorting and filtering the results (e.g. Ids, Limit, Sort, Order). Each list operation accepts its own parameters type. For example, ListAccounts() accepts a ListAccountsParams object. These types can be found in Client operations.

listParams := &recurly.ListAccountsParams{
    Sort:  recurly.String("created_at"),
    Order: recurly.String("desc"),
    Limit: recurly.Int(200),
}

accounts := client.ListAccounts(listParams)

Fetch() fetches the next page of resources and puts them in the Data array. After fetching the last page, HasMore will be false.

for accounts.HasMore {
    err := accounts.Fetch()
    if err != nil {
        fmt.Printf("Failed to retrieve next page: %v", err)
        break
    }
    for i, account := range accounts.Data {
        fmt.Printf("Account %3d: %s, %s\n",
            i,
            account.Id,
            account.Code,
        )
    }
}
Counting Resources

Count() can effeciently fetch the number of records that would be returned by the pager. It does this by calling HEAD on the endpoint and parsing and returning the Recurly-Total-Records header. It will respect any filtering parameters you give it:

listParams := &recurly.ListAccountsParams{
    Subscriber: recurly.Bool(true)
}
accounts := client.ListAccounts(listParams)
count, err := accounts.Count()
if err != nil {
    fmt.Printf("Request failed: %v", err)
    return nil, err
}
fmt.Printf("Number of subscribers: %v", *count)
Error Handling

Errors are configured in error.go. Common scenarios in which errors occur may involve "not found" or "validation" errors, which are included among the examples below. A complete list of error types can be found in error.go. You can use the list to customize your case statements.

account, err := client.CreateAccount(accountReq)
if e, ok := err.(*recurly.Error); ok {
  switch e.Type {
  case recurly.ErrorTypeValidation:
    fmt.Printf("Failed validation: %v", e)
    // You can dig into the individual parameters if needed
    for _, p := range e.Params {
      fmt.Printf("JSON key %v was invalid because %v", p.Property, p.Message)
    }
    return nil, err
  case recurly.ErrorTypeNotFound:
    fmt.Printf("Resource not found: %v", e)
    return nil, err
  case recurly.ErrorTypeTransaction:
    fmt.Printf("Transaction Error: %v", e)
    return nil, err
  case recurly.ErrorTypeInvalidToken:
    fmt.Printf("Invalid Token: %v", e)
    return nil, err
  case recurly.ErrorTypeTimeout:
    fmt.Printf("Timeout: %v", e)
    return nil, err
  // If an error occurs that is not covered by a case statement,
  // we can alert the user to a generic error from the API
  default:
    fmt.Printf("Unexpected Recurly error: %v", e)
    return nil, err
  }
}
fmt.Printf("Created Account: %s", account.Id)
HTTP Metadata

Sometimes you might want additional information about the underlying HTTP request and response. Instead of returning this information directly and forcing the programmer to handle it, we inject this metadata into the top level resource that was returned. You can access the response by calling GetResponse() on anything that implements the Resource interface. This includes the resource objects that are returned from operations, as well as Recurly errors.

Warning: Be careful logging or rendering ResponseMetadata objects as they may contain PII or sensitive data.

On a Resource
account, err := client.GetAccount(accountID)
if err != nil {
  return nil, err
}

// GetResponse() returns a *ResponseMetadata object
resp := account.GetResponse()
fmt.Println(resp.Request.ID)          // "58ac04b9d9218319-ATL"
fmt.Println(resp.StatusCode)          // 201
fmt.Println(resp.Request.Method)      // "POST"
fmt.Println(resp.Request.URL)         // "https://v3.recurly.com/accounts"
fmt.Println(resp.RateLimit.Limit)     // 2000
fmt.Println(resp.RateLimit.Remaining) // 1999
On an Error

It can be helpful to inspect the metadata on errors for logging purposes. Having the Request-Id on hand will help our support staff diagnose potential problems quickly.

account, err := client.CreateAccount(accountReq)
if e, ok := err.(*recurly.Error); ok {
  resp := e.GetResponse()
  fmt.Println("Unexpected Error. Request Id: {}", resp.Request.ID)
  return nil, err
}
On any Resource

Both resources and errors implement the Resource interface. This allows you to extract metadata from either in a generic way:

func LogRateLimit(resource *recurly.Resource) {
  fmt.Println("Requests Remaining: {}", resource.GetResponse().RateLimit.Remaining)
}
account, err := client.CreateAccount(accountReq)
if e, ok := err.(*recurly.Error); ok {
  LogRateLimit(e)
  return nil, err
}

LogRateLimit(account)

Contributing

Please see our Contributing Guide.

Documentation

Overview

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.

Index

Constants

View Source
const (
	ErrorClassServer = ErrorClass("server")
	ErrorClassClient = ErrorClass("client")

	ErrorTypeUnknown = ErrorType("unknown")

	TransactionErrorCategorySoft          = TransactionErrorCategory("soft")
	TransactionErrorCategoryFraud         = TransactionErrorCategory("fraud")
	TransactionErrorCategoryHard          = TransactionErrorCategory("hard")
	TransactionErrorCategoryCommunication = TransactionErrorCategory("communication")
	TransactionErrorCategoryUnknown       = TransactionErrorCategory("unknown")
)
View Source
const (
	ErrorTypeResponse                = ErrorType("response_error")
	ErrorTypeServer                  = ErrorType("server_error")
	ErrorTypeInternalServer          = ErrorType("internal_server_error")
	ErrorTypeServiceNotAvailable     = ErrorType("service_not_available")
	ErrorTypeTaxService              = ErrorType("tax_service_error")
	ErrorTypeBadGateway              = ErrorType("bad_gateway")
	ErrorTypeServiceUnavailable      = ErrorType("service_unavailable")
	ErrorTypeTimeout                 = ErrorType("timeout")
	ErrorTypeRedirection             = ErrorType("redirection")
	ErrorTypeNotModified             = ErrorType("not_modified")
	ErrorTypeClient                  = ErrorType("client_error")
	ErrorTypeBadRequest              = ErrorType("bad_request")
	ErrorTypeInvalidContentType      = ErrorType("invalid_content_type")
	ErrorTypeUnauthorized            = ErrorType("unauthorized")
	ErrorTypePaymentRequired         = ErrorType("payment_required")
	ErrorTypeForbidden               = ErrorType("forbidden")
	ErrorTypeInvalidApiKey           = ErrorType("invalid_api_key")
	ErrorTypeInvalidPermissions      = ErrorType("invalid_permissions")
	ErrorTypeNotFound                = ErrorType("not_found")
	ErrorTypeNotAcceptable           = ErrorType("not_acceptable")
	ErrorTypeUnknownApiVersion       = ErrorType("unknown_api_version")
	ErrorTypeUnavailableInApiVersion = ErrorType("unavailable_in_api_version")
	ErrorTypeInvalidApiVersion       = ErrorType("invalid_api_version")
	ErrorTypePreconditionFailed      = ErrorType("precondition_failed")
	ErrorTypeUnprocessableEntity     = ErrorType("unprocessable_entity")
	ErrorTypeValidation              = ErrorType("validation")
	ErrorTypeMissingFeature          = ErrorType("missing_feature")
	ErrorTypeTransaction             = ErrorType("transaction")
	ErrorTypeSimultaneousRequest     = ErrorType("simultaneous_request")
	ErrorTypeImmutableSubscription   = ErrorType("immutable_subscription")
	ErrorTypeInvalidToken            = ErrorType("invalid_token")
	ErrorTypeTooManyRequests         = ErrorType("too_many_requests")
	ErrorTypeRateLimited             = ErrorType("rate_limited")
)
View Source
const (
	// ListAscending sorts results in ascending order. When sorting by UpdatedAt, you really only
	// want to return results in ascending order.
	ListAscending ListOrder = "asc"
	// ListDescending sorts results in descending order
	ListDescending ListOrder = "desc"

	// SortDefault sorts results by their default field
	SortDefault SortField = ""
	// SortCreatedAt sorts results by their created_at datetime
	SortCreatedAt SortField = "created_at"
	// SortUpdatedAt sorts results by their updated_at datetime. This should only be used with ListAscending.
	SortUpdatedAt SortField = "updated_at"
)
View Source
const (
	// APIVersion is the current Recurly API Version
	APIVersion = "v2019-10-10"
)

Variables

View Source
var (
	// APIKey contains the Recurly API key used for authenticating globally.
	// A new client will use this value unless the API Key is explicitly set
	// whe ncreating the client.
	APIKey string

	// APIHost is the base URL for Recurly API v3
	APIHost = "https://v3.recurly.com"
)

Functions

func Bool

func Bool(v bool) *bool

func BuildURL added in v3.12.0

func BuildURL(requestURL string, genericParams GenericParams) string

Append URL parameters

func Float

func Float(v float64) *float64

func Int

func Int(v int) *int

func String

func String(v string) *string

func StringSlice

func StringSlice(v []string) []*string

func Time

func Time(v time.Time) *time.Time

Types

type Account

type Account struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Accounts can be either active or inactive.
	State string `json:"state,omitempty"`

	// The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: `https://{subdomain}.recurly.com/account/{hosted_login_token}`.
	HostedLoginToken string `json:"hosted_login_token,omitempty"`

	// The shipping addresses on the account.
	ShippingAddresses []ShippingAddress `json:"shipping_addresses,omitempty"`

	// Indicates if the account has a subscription that is either active, canceled, future, or paused.
	HasLiveSubscription bool `json:"has_live_subscription,omitempty"`

	// Indicates if the account has an active subscription.
	HasActiveSubscription bool `json:"has_active_subscription,omitempty"`

	// Indicates if the account has a future subscription.
	HasFutureSubscription bool `json:"has_future_subscription,omitempty"`

	// Indicates if the account has a canceled subscription.
	HasCanceledSubscription bool `json:"has_canceled_subscription,omitempty"`

	// Indicates if the account has a paused subscription.
	HasPausedSubscription bool `json:"has_paused_subscription,omitempty"`

	// Indicates if the account has a past due invoice.
	HasPastDueInvoice bool `json:"has_past_due_invoice,omitempty"`

	// When the account was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the account was last changed.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// If present, when the account was last marked inactive.
	DeletedAt time.Time `json:"deleted_at,omitempty"`

	// The unique identifier of the account. This cannot be changed once the account is created.
	Code string `json:"code,omitempty"`

	// A secondary value for the account.
	Username string `json:"username,omitempty"`

	// The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
	Email string `json:"email,omitempty"`

	// Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
	PreferredLocale string `json:"preferred_locale,omitempty"`

	// The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer.
	PreferredTimeZone string `json:"preferred_time_zone,omitempty"`

	// Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
	CcEmails string `json:"cc_emails,omitempty"`

	FirstName string `json:"first_name,omitempty"`

	LastName string `json:"last_name,omitempty"`

	Company string `json:"company,omitempty"`

	// The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
	VatNumber string `json:"vat_number,omitempty"`

	// The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
	TaxExempt bool `json:"tax_exempt,omitempty"`

	// The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
	ExemptionCertificate string `json:"exemption_certificate,omitempty"`

	// The UUID of the parent account associated with this account.
	ParentAccountId string `json:"parent_account_id,omitempty"`

	// An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
	BillTo string `json:"bill_to,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId string `json:"dunning_campaign_id,omitempty"`

	Address Address `json:"address,omitempty"`

	BillingInfo BillingInfo `json:"billing_info,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
	EntityUseCode string `json:"entity_use_code,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) GetResponse

func (resource *Account) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountAcquisition

type AccountAcquisition struct {

	// Account balance
	Cost AccountAcquisitionCost `json:"cost,omitempty"`

	// The channel through which the account was acquired.
	Channel string `json:"channel,omitempty"`

	// An arbitrary subchannel string representing a distinction/subcategory within a broader channel.
	Subchannel string `json:"subchannel,omitempty"`

	// An arbitrary identifier for the marketing campaign that led to the acquisition of this account.
	Campaign string `json:"campaign,omitempty"`

	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// When the account acquisition data was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the account acquisition data was last changed.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountAcquisition) GetResponse

func (resource *AccountAcquisition) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountAcquisitionCost

type AccountAcquisitionCost struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// The amount of the corresponding currency used to acquire the account.
	Amount float64 `json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountAcquisitionCost) GetResponse

func (resource *AccountAcquisitionCost) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountAcquisitionCostCreate

type AccountAcquisitionCostCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// The amount of the corresponding currency used to acquire the account.
	Amount *float64 `json:"amount,omitempty"`
}

type AccountAcquisitionCostList

type AccountAcquisitionCostList struct {
	HasMore bool
	Data    []AccountAcquisitionCost
	// contains filtered or unexported fields
}

AccountAcquisitionCostList allows you to paginate AccountAcquisitionCost objects

func NewAccountAcquisitionCostList added in v3.6.0

func NewAccountAcquisitionCostList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountAcquisitionCostList

func (*AccountAcquisitionCostList) Count

func (list *AccountAcquisitionCostList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountAcquisitionCostList) CountWithContext added in v3.12.0

func (list *AccountAcquisitionCostList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountAcquisitionCostList) Fetch

func (list *AccountAcquisitionCostList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountAcquisitionCostList) FetchWithContext added in v3.12.0

func (list *AccountAcquisitionCostList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountAcquisitionList

type AccountAcquisitionList struct {
	HasMore bool
	Data    []AccountAcquisition
	// contains filtered or unexported fields
}

AccountAcquisitionList allows you to paginate AccountAcquisition objects

func NewAccountAcquisitionList added in v3.6.0

func NewAccountAcquisitionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountAcquisitionList

func (*AccountAcquisitionList) Count

func (list *AccountAcquisitionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountAcquisitionList) CountWithContext added in v3.12.0

func (list *AccountAcquisitionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountAcquisitionList) Fetch

func (list *AccountAcquisitionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountAcquisitionList) FetchWithContext added in v3.12.0

func (list *AccountAcquisitionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountAcquisitionUpdatable

type AccountAcquisitionUpdatable struct {
	Params `json:"-"`

	// Account balance
	Cost *AccountAcquisitionCostCreate `json:"cost,omitempty"`

	// The channel through which the account was acquired.
	Channel *string `json:"channel,omitempty"`

	// An arbitrary subchannel string representing a distinction/subcategory within a broader channel.
	Subchannel *string `json:"subchannel,omitempty"`

	// An arbitrary identifier for the marketing campaign that led to the acquisition of this account.
	Campaign *string `json:"campaign,omitempty"`
}

type AccountBalance

type AccountBalance struct {

	// Object type
	Object string `json:"object,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	PastDue bool `json:"past_due,omitempty"`

	Balances []AccountBalanceAmount `json:"balances,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountBalance) GetResponse

func (resource *AccountBalance) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountBalanceAmount

type AccountBalanceAmount struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Total amount the account is past due.
	Amount float64 `json:"amount,omitempty"`

	// Total amount for the prepayment credit invoices in a `processing` state on the account.
	ProcessingPrepaymentAmount float64 `json:"processing_prepayment_amount,omitempty"`

	// Total amount of the open balances on credit invoices for the account.
	AvailableCreditAmount float64 `json:"available_credit_amount,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountBalanceAmount) GetResponse

func (resource *AccountBalanceAmount) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountBalanceAmountList

type AccountBalanceAmountList struct {
	HasMore bool
	Data    []AccountBalanceAmount
	// contains filtered or unexported fields
}

AccountBalanceAmountList allows you to paginate AccountBalanceAmount objects

func NewAccountBalanceAmountList added in v3.6.0

func NewAccountBalanceAmountList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountBalanceAmountList

func (*AccountBalanceAmountList) Count

func (list *AccountBalanceAmountList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountBalanceAmountList) CountWithContext added in v3.12.0

func (list *AccountBalanceAmountList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountBalanceAmountList) Fetch

func (list *AccountBalanceAmountList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountBalanceAmountList) FetchWithContext added in v3.12.0

func (list *AccountBalanceAmountList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountBalanceList

type AccountBalanceList struct {
	HasMore bool
	Data    []AccountBalance
	// contains filtered or unexported fields
}

AccountBalanceList allows you to paginate AccountBalance objects

func NewAccountBalanceList added in v3.6.0

func NewAccountBalanceList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountBalanceList

func (*AccountBalanceList) Count

func (list *AccountBalanceList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountBalanceList) CountWithContext added in v3.12.0

func (list *AccountBalanceList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountBalanceList) Fetch

func (list *AccountBalanceList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountBalanceList) FetchWithContext added in v3.12.0

func (list *AccountBalanceList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountCreate

type AccountCreate struct {
	Params `json:"-"`

	// The unique identifier of the account. This cannot be changed once the account is created.
	Code *string `json:"code,omitempty"`

	Acquisition *AccountAcquisitionUpdatable `json:"acquisition,omitempty"`

	ShippingAddresses []ShippingAddressCreate `json:"shipping_addresses,omitempty"`

	// A secondary value for the account.
	Username *string `json:"username,omitempty"`

	// The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
	Email *string `json:"email,omitempty"`

	// Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
	PreferredLocale *string `json:"preferred_locale,omitempty"`

	// Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
	PreferredTimeZone *string `json:"preferred_time_zone,omitempty"`

	// Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
	CcEmails *string `json:"cc_emails,omitempty"`

	FirstName *string `json:"first_name,omitempty"`

	LastName *string `json:"last_name,omitempty"`

	Company *string `json:"company,omitempty"`

	// The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
	VatNumber *string `json:"vat_number,omitempty"`

	// The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
	ExemptionCertificate *string `json:"exemption_certificate,omitempty"`

	// The account code of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountCode *string `json:"parent_account_code,omitempty"`

	// The UUID of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountId *string `json:"parent_account_id,omitempty"`

	// An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
	BillTo *string `json:"bill_to,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId *string `json:"dunning_campaign_id,omitempty"`

	Address *AddressCreate `json:"address,omitempty"`

	BillingInfo *BillingInfoCreate `json:"billing_info,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
	EntityUseCode *string `json:"entity_use_code,omitempty"`
}

type AccountList

type AccountList struct {
	HasMore bool
	Data    []Account
	// contains filtered or unexported fields
}

AccountList allows you to paginate Account objects

func NewAccountList added in v3.6.0

func NewAccountList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountList

func (*AccountList) Count

func (list *AccountList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountList) CountWithContext added in v3.12.0

func (list *AccountList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountList) Fetch

func (list *AccountList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountList) FetchWithContext added in v3.12.0

func (list *AccountList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountMini

type AccountMini struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The unique identifier of the account.
	Code string `json:"code,omitempty"`

	// The email address used for communicating with this customer.
	Email string `json:"email,omitempty"`

	FirstName string `json:"first_name,omitempty"`

	LastName string `json:"last_name,omitempty"`

	Company string `json:"company,omitempty"`

	ParentAccountId string `json:"parent_account_id,omitempty"`

	BillTo string `json:"bill_to,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId string `json:"dunning_campaign_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountMini) GetResponse

func (resource *AccountMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountMiniList

type AccountMiniList struct {
	HasMore bool
	Data    []AccountMini
	// contains filtered or unexported fields
}

AccountMiniList allows you to paginate AccountMini objects

func NewAccountMiniList added in v3.6.0

func NewAccountMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountMiniList

func (*AccountMiniList) Count

func (list *AccountMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountMiniList) CountWithContext added in v3.12.0

func (list *AccountMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountMiniList) Fetch

func (list *AccountMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountMiniList) FetchWithContext added in v3.12.0

func (list *AccountMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountNote

type AccountNote struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	AccountId string `json:"account_id,omitempty"`

	User User `json:"user,omitempty"`

	Message string `json:"message,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountNote) GetResponse

func (resource *AccountNote) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AccountNoteList

type AccountNoteList struct {
	HasMore bool
	Data    []AccountNote
	// contains filtered or unexported fields
}

AccountNoteList allows you to paginate AccountNote objects

func NewAccountNoteList added in v3.6.0

func NewAccountNoteList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AccountNoteList

func (*AccountNoteList) Count

func (list *AccountNoteList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountNoteList) CountWithContext added in v3.12.0

func (list *AccountNoteList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AccountNoteList) Fetch

func (list *AccountNoteList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AccountNoteList) FetchWithContext added in v3.12.0

func (list *AccountNoteList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AccountPurchase

type AccountPurchase struct {
	Params `json:"-"`

	// Optional, but if present allows an existing account to be used and updated as part of the purchase.
	Id *string `json:"id,omitempty"`

	// The unique identifier of the account. This cannot be changed once the account is created.
	Code *string `json:"code,omitempty"`

	Acquisition *AccountAcquisitionUpdatable `json:"acquisition,omitempty"`

	// A secondary value for the account.
	Username *string `json:"username,omitempty"`

	// The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
	Email *string `json:"email,omitempty"`

	// Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
	PreferredLocale *string `json:"preferred_locale,omitempty"`

	// Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
	PreferredTimeZone *string `json:"preferred_time_zone,omitempty"`

	// Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
	CcEmails *string `json:"cc_emails,omitempty"`

	FirstName *string `json:"first_name,omitempty"`

	LastName *string `json:"last_name,omitempty"`

	Company *string `json:"company,omitempty"`

	// The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
	VatNumber *string `json:"vat_number,omitempty"`

	// The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
	ExemptionCertificate *string `json:"exemption_certificate,omitempty"`

	// The account code of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountCode *string `json:"parent_account_code,omitempty"`

	// The UUID of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountId *string `json:"parent_account_id,omitempty"`

	// An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
	BillTo *string `json:"bill_to,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId *string `json:"dunning_campaign_id,omitempty"`

	Address *AddressCreate `json:"address,omitempty"`

	BillingInfo *BillingInfoCreate `json:"billing_info,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
	EntityUseCode *string `json:"entity_use_code,omitempty"`
}

type AccountUpdate

type AccountUpdate struct {
	Params `json:"-"`

	// A secondary value for the account.
	Username *string `json:"username,omitempty"`

	// The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
	Email *string `json:"email,omitempty"`

	// Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
	PreferredLocale *string `json:"preferred_locale,omitempty"`

	// Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
	PreferredTimeZone *string `json:"preferred_time_zone,omitempty"`

	// Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
	CcEmails *string `json:"cc_emails,omitempty"`

	FirstName *string `json:"first_name,omitempty"`

	LastName *string `json:"last_name,omitempty"`

	Company *string `json:"company,omitempty"`

	// The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
	VatNumber *string `json:"vat_number,omitempty"`

	// The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
	ExemptionCertificate *string `json:"exemption_certificate,omitempty"`

	// The account code of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountCode *string `json:"parent_account_code,omitempty"`

	// The UUID of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
	ParentAccountId *string `json:"parent_account_id,omitempty"`

	// An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
	BillTo *string `json:"bill_to,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId *string `json:"dunning_campaign_id,omitempty"`

	Address *AddressCreate `json:"address,omitempty"`

	BillingInfo *BillingInfoCreate `json:"billing_info,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
	EntityUseCode *string `json:"entity_use_code,omitempty"`
}

type AddOn

type AddOn struct {

	// Add-on ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Plan ID
	PlanId string `json:"plan_id,omitempty"`

	// The unique identifier for the add-on within its plan.
	Code string `json:"code,omitempty"`

	// Add-ons can be either active or inactive.
	State string `json:"state,omitempty"`

	// Describes your add-on and will appear in subscribers' invoices.
	Name string `json:"name,omitempty"`

	// Whether the add-on type is fixed, or usage-based.
	AddOnType string `json:"add_on_type,omitempty"`

	// Type of usage, returns usage type if `add_on_type` is `usage`.
	UsageType string `json:"usage_type,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
	UsagePercentage float64 `json:"usage_percentage,omitempty"`

	// System-generated unique identifier for an measured unit associated with the add-on.
	MeasuredUnitId string `json:"measured_unit_id,omitempty"`

	// Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
	AccountingCode string `json:"accounting_code,omitempty"`

	// When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode string `json:"tax_code,omitempty"`

	// Determines if the quantity field is displayed on the hosted pages for the add-on.
	DisplayQuantity bool `json:"display_quantity,omitempty"`

	// Default quantity for the hosted pages.
	DefaultQuantity int `json:"default_quantity,omitempty"`

	// Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
	Optional bool `json:"optional,omitempty"`

	// Add-on pricing
	Currencies []AddOnPricing `json:"currencies,omitempty"`

	// Just the important parts.
	Item ItemMini `json:"item,omitempty"`

	// The type of tiering used by the Add-on.
	TierType string `json:"tier_type,omitempty"`

	// Tiers
	Tiers []Tier `json:"tiers,omitempty"`

	// Optional, stock keeping unit to link the item to other inventory systems.
	ExternalSku string `json:"external_sku,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*AddOn) GetResponse

func (resource *AddOn) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AddOnCreate

type AddOnCreate struct {
	Params `json:"-"`

	// Unique code to identify an item. Avaliable when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
	ItemCode *string `json:"item_code,omitempty"`

	// System-generated unique identifier for an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
	ItemId *string `json:"item_id,omitempty"`

	// The unique identifier for the add-on within its plan. If `item_code`/`item_id` is part of the request then `code` must be absent. If `item_code`/`item_id` is not present `code` is required.
	Code *string `json:"code,omitempty"`

	// Describes your add-on and will appear in subscribers' invoices. If `item_code`/`item_id` is part of the request then `name` must be absent. If `item_code`/`item_id` is not present `name` is required.
	Name *string `json:"name,omitempty"`

	// Whether the add-on type is fixed, or usage-based.
	AddOnType *string `json:"add_on_type,omitempty"`

	// Type of usage, required if `add_on_type` is `usage`. See our
	// [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html)
	// for an overview of how to configure usage add-ons.
	UsageType *string `json:"usage_type,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers.
	UsagePercentage *float64 `json:"usage_percentage,omitempty"`

	// System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
	MeasuredUnitId *string `json:"measured_unit_id,omitempty"`

	// Name of a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
	MeasuredUnitName *string `json:"measured_unit_name,omitempty"`

	// Plan ID
	PlanId *string `json:"plan_id,omitempty"`

	// Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Determines if the quantity field is displayed on the hosted pages for the add-on.
	DisplayQuantity *bool `json:"display_quantity,omitempty"`

	// Default quantity for the hosted pages.
	DefaultQuantity *int `json:"default_quantity,omitempty"`

	// Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
	Optional *bool `json:"optional,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_transaction_type` must be absent.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_service_type` must be absent.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If `item_code`/`item_id` is part of the request then `tax_code` must be absent.
	TaxCode *string `json:"tax_code,omitempty"`

	// * If `item_code`/`item_id` is part of the request and the item
	// has a default currency then `currencies` is optional. If the item does
	// not have a default currency, then `currencies` is required. If `item_code`/`item_id`
	// is not present `currencies` is required.
	// * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`,
	// then `currencies` must be absent.
	// * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
	Currencies []AddOnPricingCreate `json:"currencies,omitempty"`

	// The pricing model for the add-on.  For more information,
	// [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See
	// our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview
	// of how to configure quantity-based pricing models.
	TierType *string `json:"tier_type,omitempty"`

	// If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
	// must include one to many tiers with `ending_quantity` and `unit_amount` for
	// the desired `currencies`. There must be one tier with an `ending_quantity` of
	// 999999999 which is the default if not provided.
	Tiers []TierCreate `json:"tiers,omitempty"`
}

type AddOnList

type AddOnList struct {
	HasMore bool
	Data    []AddOn
	// contains filtered or unexported fields
}

AddOnList allows you to paginate AddOn objects

func NewAddOnList added in v3.6.0

func NewAddOnList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AddOnList

func (*AddOnList) Count

func (list *AddOnList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnList) CountWithContext added in v3.12.0

func (list *AddOnList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnList) Fetch

func (list *AddOnList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AddOnList) FetchWithContext added in v3.12.0

func (list *AddOnList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AddOnMini

type AddOnMini struct {

	// Add-on ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The unique identifier for the add-on within its plan.
	Code string `json:"code,omitempty"`

	// Describes your add-on and will appear in subscribers' invoices.
	Name string `json:"name,omitempty"`

	// Whether the add-on type is fixed, or usage-based.
	AddOnType string `json:"add_on_type,omitempty"`

	// Type of usage, returns usage type if `add_on_type` is `usage`.
	UsageType string `json:"usage_type,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
	UsagePercentage float64 `json:"usage_percentage,omitempty"`

	// System-generated unique identifier for an measured unit associated with the add-on.
	MeasuredUnitId string `json:"measured_unit_id,omitempty"`

	// Item ID
	ItemId string `json:"item_id,omitempty"`

	// Optional, stock keeping unit to link the item to other inventory systems.
	ExternalSku string `json:"external_sku,omitempty"`

	// Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
	AccountingCode string `json:"accounting_code,omitempty"`
	// contains filtered or unexported fields
}

func (*AddOnMini) GetResponse

func (resource *AddOnMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AddOnMiniList

type AddOnMiniList struct {
	HasMore bool
	Data    []AddOnMini
	// contains filtered or unexported fields
}

AddOnMiniList allows you to paginate AddOnMini objects

func NewAddOnMiniList added in v3.6.0

func NewAddOnMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AddOnMiniList

func (*AddOnMiniList) Count

func (list *AddOnMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnMiniList) CountWithContext added in v3.12.0

func (list *AddOnMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnMiniList) Fetch

func (list *AddOnMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AddOnMiniList) FetchWithContext added in v3.12.0

func (list *AddOnMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AddOnPricing

type AddOnPricing struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Unit price
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`
	// contains filtered or unexported fields
}

func (*AddOnPricing) GetResponse

func (resource *AddOnPricing) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AddOnPricingCreate

type AddOnPricingCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Unit price
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`
}

type AddOnPricingList

type AddOnPricingList struct {
	HasMore bool
	Data    []AddOnPricing
	// contains filtered or unexported fields
}

AddOnPricingList allows you to paginate AddOnPricing objects

func NewAddOnPricingList added in v3.6.0

func NewAddOnPricingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AddOnPricingList

func (*AddOnPricingList) Count

func (list *AddOnPricingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnPricingList) CountWithContext added in v3.12.0

func (list *AddOnPricingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddOnPricingList) Fetch

func (list *AddOnPricingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AddOnPricingList) FetchWithContext added in v3.12.0

func (list *AddOnPricingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type AddOnUpdate

type AddOnUpdate struct {
	Params `json:"-"`

	// Add-on ID
	Id *string `json:"id,omitempty"`

	// The unique identifier for the add-on within its plan. If an `Item` is associated to the `AddOn` then `code` must be absent.
	Code *string `json:"code,omitempty"`

	// Describes your add-on and will appear in subscribers' invoices. If an `Item` is associated to the `AddOn` then `name` must be absent.
	Name *string `json:"name,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers.
	UsagePercentage *float64 `json:"usage_percentage,omitempty"`

	// System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
	MeasuredUnitId *string `json:"measured_unit_id,omitempty"`

	// Name of a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
	MeasuredUnitName *string `json:"measured_unit_name,omitempty"`

	// Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If an `Item` is associated to the `AddOn` then `accounting code` must be absent.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// When this add-on is invoiced, the line item will use this revenue schedule. If an `Item` is associated to the `AddOn` then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_transaction_type` must be absent.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_service_type` must be absent.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If an `Item` is associated to the `AddOn` then `tax code` must be absent.
	TaxCode *string `json:"tax_code,omitempty"`

	// Determines if the quantity field is displayed on the hosted pages for the add-on.
	DisplayQuantity *bool `json:"display_quantity,omitempty"`

	// Default quantity for the hosted pages.
	DefaultQuantity *int `json:"default_quantity,omitempty"`

	// Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
	Optional *bool `json:"optional,omitempty"`

	// If the add-on's `tier_type` is `tiered`, `volume` or `stairstep`,
	// then `currencies` must be absent. Must also be absent if `add_on_type` is
	// `usage` and `usage_type` is `percentage`.
	Currencies []AddOnPricingCreate `json:"currencies,omitempty"`

	// If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
	// must include one to many tiers with `ending_quantity` and `unit_amount` for
	// the desired `currencies`. There must be one tier with an `ending_quantity` of
	// 999999999 which is the default if not provided.
	Tiers []TierCreate `json:"tiers,omitempty"`
}

type Address

type Address struct {

	// First name
	FirstName string `json:"first_name,omitempty"`

	// Last name
	LastName string `json:"last_name,omitempty"`

	// Phone number
	Phone string `json:"phone,omitempty"`

	// Street 1
	Street1 string `json:"street1,omitempty"`

	// Street 2
	Street2 string `json:"street2,omitempty"`

	// City
	City string `json:"city,omitempty"`

	// State or province.
	Region string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode string `json:"geo_code,omitempty"`
	// contains filtered or unexported fields
}

func (*Address) GetResponse

func (resource *Address) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type AddressCreate

type AddressCreate struct {
	Params `json:"-"`

	// First name
	FirstName *string `json:"first_name,omitempty"`

	// Last name
	LastName *string `json:"last_name,omitempty"`

	// Phone number
	Phone *string `json:"phone,omitempty"`

	// Street 1
	Street1 *string `json:"street1,omitempty"`

	// Street 2
	Street2 *string `json:"street2,omitempty"`

	// City
	City *string `json:"city,omitempty"`

	// State or province.
	Region *string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode *string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country *string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode *string `json:"geo_code,omitempty"`
}

type AddressList

type AddressList struct {
	HasMore bool
	Data    []Address
	// contains filtered or unexported fields
}

AddressList allows you to paginate Address objects

func NewAddressList added in v3.6.0

func NewAddressList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *AddressList

func (*AddressList) Count

func (list *AddressList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddressList) CountWithContext added in v3.12.0

func (list *AddressList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*AddressList) Fetch

func (list *AddressList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*AddressList) FetchWithContext added in v3.12.0

func (list *AddressList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type BillingInfo

type BillingInfo struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	AccountId string `json:"account_id,omitempty"`

	FirstName string `json:"first_name,omitempty"`

	LastName string `json:"last_name,omitempty"`

	Company string `json:"company,omitempty"`

	Address Address `json:"address,omitempty"`

	// Customer's VAT number (to avoid having the VAT applied). This is only used for automatically collected invoices.
	VatNumber string `json:"vat_number,omitempty"`

	Valid bool `json:"valid,omitempty"`

	PaymentMethod PaymentMethod `json:"payment_method,omitempty"`

	// Most recent fraud result.
	Fraud FraudInfo `json:"fraud,omitempty"`

	// The `primary_payment_method` field is used to indicate the primary billing info on the account. The first billing info created on an account will always become primary. This payment method will be used
	PrimaryPaymentMethod bool `json:"primary_payment_method,omitempty"`

	// The `backup_payment_method` field is used to indicate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined.
	BackupPaymentMethod bool `json:"backup_payment_method,omitempty"`

	// When the billing information was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the billing information was last changed.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	UpdatedBy BillingInfoUpdatedBy `json:"updated_by,omitempty"`
	// contains filtered or unexported fields
}

func (*BillingInfo) GetResponse

func (resource *BillingInfo) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type BillingInfoCreate

type BillingInfoCreate struct {
	Params `json:"-"`

	// A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token).
	TokenId *string `json:"token_id,omitempty"`

	// First name
	FirstName *string `json:"first_name,omitempty"`

	// Last name
	LastName *string `json:"last_name,omitempty"`

	// Company name
	Company *string `json:"company,omitempty"`

	Address *AddressCreate `json:"address,omitempty"`

	// Credit card number, spaces and dashes are accepted.
	Number *string `json:"number,omitempty"`

	// Expiration month
	Month *string `json:"month,omitempty"`

	// Expiration year
	Year *string `json:"year,omitempty"`

	// *STRONGLY RECOMMENDED*
	Cvv *string `json:"cvv,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// VAT number
	VatNumber *string `json:"vat_number,omitempty"`

	// *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information.
	IpAddress *string `json:"ip_address,omitempty"`

	// A token used in place of a credit card in order to perform transactions. Must be used in conjunction with `gateway_code`.
	GatewayToken *string `json:"gateway_token,omitempty"`

	// An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`.
	GatewayCode *string `json:"gateway_code,omitempty"`

	// Additional attributes to send to the gateway.
	GatewayAttributes *GatewayAttributesCreate `json:"gateway_attributes,omitempty"`

	// Represents the card network preference associated with the billing info for dual badged cards. Must be a supported card network.
	CardNetworkPreference *string `json:"card_network_preference,omitempty"`

	// Amazon billing agreement ID
	AmazonBillingAgreementId *string `json:"amazon_billing_agreement_id,omitempty"`

	// PayPal billing agreement ID
	PaypalBillingAgreementId *string `json:"paypal_billing_agreement_id,omitempty"`

	// Roku's CIB if billing through Roku
	RokuBillingAgreementId *string `json:"roku_billing_agreement_id,omitempty"`

	// Fraud Session ID
	FraudSessionId *string `json:"fraud_session_id,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	// A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
	ThreeDSecureActionResultTokenId *string `json:"three_d_secure_action_result_token_id,omitempty"`

	// The International Bank Account Number, up to 34 alphanumeric characters comprising a country code; two check digits; and a number that includes the domestic bank account number, branch identifier, and potential routing information. (SEPA only)
	Iban *string `json:"iban,omitempty"`

	// The name associated with the bank account (ACH, SEPA, Bacs only)
	NameOnAccount *string `json:"name_on_account,omitempty"`

	// The bank account number. (ACH, Bacs only)
	AccountNumber *string `json:"account_number,omitempty"`

	// The bank's rounting number. (ACH only)
	RoutingNumber *string `json:"routing_number,omitempty"`

	// Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
	SortCode *string `json:"sort_code,omitempty"`

	// The payment method type for a non-credit card based billing info. `bacs` and `becs` are the only accepted values.
	Type *string `json:"type,omitempty"`

	// The bank account type. (ACH only)
	AccountType *string `json:"account_type,omitempty"`

	// Tax identifier is required if adding a billing info that is a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents.
	TaxIdentifier *string `json:"tax_identifier,omitempty"`

	// this field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil.
	TaxIdentifierType *string `json:"tax_identifier_type,omitempty"`

	// The `primary_payment_method` field is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` with a value of `true`. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
	PrimaryPaymentMethod *bool `json:"primary_payment_method,omitempty"`

	// The `backup_payment_method` field is used to designate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined. All payment methods, including the billing info marked `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, if a user sets a different payment method as a backup, the existing backup will no longer be marked as such.
	BackupPaymentMethod *bool `json:"backup_payment_method,omitempty"`
}

type BillingInfoList

type BillingInfoList struct {
	HasMore bool
	Data    []BillingInfo
	// contains filtered or unexported fields
}

BillingInfoList allows you to paginate BillingInfo objects

func NewBillingInfoList added in v3.6.0

func NewBillingInfoList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *BillingInfoList

func (*BillingInfoList) Count

func (list *BillingInfoList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*BillingInfoList) CountWithContext added in v3.12.0

func (list *BillingInfoList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*BillingInfoList) Fetch

func (list *BillingInfoList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*BillingInfoList) FetchWithContext added in v3.12.0

func (list *BillingInfoList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type BillingInfoUpdatedBy

type BillingInfoUpdatedBy struct {

	// Customer's IP address when updating their billing information.
	Ip string `json:"ip,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code matching the origin IP address, if known by Recurly.
	Country string `json:"country,omitempty"`
	// contains filtered or unexported fields
}

func (*BillingInfoUpdatedBy) GetResponse

func (resource *BillingInfoUpdatedBy) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type BillingInfoUpdatedByList

type BillingInfoUpdatedByList struct {
	HasMore bool
	Data    []BillingInfoUpdatedBy
	// contains filtered or unexported fields
}

BillingInfoUpdatedByList allows you to paginate BillingInfoUpdatedBy objects

func NewBillingInfoUpdatedByList added in v3.6.0

func NewBillingInfoUpdatedByList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *BillingInfoUpdatedByList

func (*BillingInfoUpdatedByList) Count

func (list *BillingInfoUpdatedByList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*BillingInfoUpdatedByList) CountWithContext added in v3.12.0

func (list *BillingInfoUpdatedByList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*BillingInfoUpdatedByList) Fetch

func (list *BillingInfoUpdatedByList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*BillingInfoUpdatedByList) FetchWithContext added in v3.12.0

func (list *BillingInfoUpdatedByList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type BillingInfoVerify added in v3.14.0

type BillingInfoVerify struct {
	Params `json:"-"`

	// An identifier for a specific payment gateway.
	GatewayCode *string `json:"gateway_code,omitempty"`
}

type BinaryFile

type BinaryFile struct {
	Data string `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*BinaryFile) GetResponse

func (resource *BinaryFile) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type BinaryFileList

type BinaryFileList struct {
	HasMore bool
	Data    []BinaryFile
	// contains filtered or unexported fields
}

BinaryFileList allows you to paginate BinaryFile objects

func NewBinaryFileList added in v3.6.0

func NewBinaryFileList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *BinaryFileList

func (*BinaryFileList) Count

func (list *BinaryFileList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*BinaryFileList) CountWithContext added in v3.12.0

func (list *BinaryFileList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*BinaryFileList) Fetch

func (list *BinaryFileList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*BinaryFileList) FetchWithContext added in v3.12.0

func (list *BinaryFileList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CancelSubscriptionParams

type CancelSubscriptionParams struct {
	Params

	// Body - The body of the request.
	Body *SubscriptionCancel
}

func (*CancelSubscriptionParams) URLParams added in v3.12.0

func (list *CancelSubscriptionParams) URLParams() []KeyValue

type Client

type Client struct {
	Log        *Logger
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client submits API requests to Recurly

func NewClient

func NewClient(apiKey string) *Client

NewClient returns a new API Client using the given APIKey

func (*Client) ApplyCreditBalance added in v3.18.0

func (c *Client) ApplyCreditBalance(invoiceId string, opts ...Option) (*Invoice, error)

ApplyCreditBalance wraps ApplyCreditBalanceWithContext using the background context

func (*Client) ApplyCreditBalanceWithContext added in v3.18.0

func (c *Client) ApplyCreditBalanceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

ApplyCreditBalanceWithContext Apply available credit to a pending or past due charge invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/apply_credit_balance

Returns: The updated invoice.

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, path string, body GenericParams, queryParams GenericParams, requestOptions OptionsApplier, v interface{}) error

Call sends a request to Recurly and parses the JSON response for the expected response type. The RequestOptions have been added to replace the common features of the Params struct (which is returned by genericParams.toParams()) to seperate concerns with payload/URL params from configurations of the HTTP request (RequestOptions).

func (*Client) CancelSubscription

func (c *Client) CancelSubscription(subscriptionId string, params *CancelSubscriptionParams, opts ...Option) (*Subscription, error)

CancelSubscription wraps CancelSubscriptionWithContext using the background context

func (*Client) CancelSubscriptionWithContext added in v3.12.0

func (c *Client) CancelSubscriptionWithContext(ctx context.Context, subscriptionId string, params *CancelSubscriptionParams, opts ...Option) (*Subscription, error)

CancelSubscriptionWithContext Cancel a subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/cancel_subscription

Returns: A canceled or failed subscription.

func (*Client) CollectInvoice

func (c *Client) CollectInvoice(invoiceId string, params *CollectInvoiceParams, opts ...Option) (*Invoice, error)

CollectInvoice wraps CollectInvoiceWithContext using the background context

func (*Client) CollectInvoiceWithContext added in v3.12.0

func (c *Client) CollectInvoiceWithContext(ctx context.Context, invoiceId string, params *CollectInvoiceParams, opts ...Option) (*Invoice, error)

CollectInvoiceWithContext Collect a pending or past due, automatic invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/collect_invoice

Returns: The updated invoice.

func (*Client) ConvertTrial

func (c *Client) ConvertTrial(subscriptionId string, opts ...Option) (*Subscription, error)

ConvertTrial wraps ConvertTrialWithContext using the background context

func (*Client) ConvertTrialWithContext added in v3.12.0

func (c *Client) ConvertTrialWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

ConvertTrialWithContext Convert trial subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/convert_trial

Returns: A subscription.

func (*Client) CreateAccount

func (c *Client) CreateAccount(body *AccountCreate, opts ...Option) (*Account, error)

CreateAccount wraps CreateAccountWithContext using the background context

func (*Client) CreateAccountWithContext added in v3.12.0

func (c *Client) CreateAccountWithContext(ctx context.Context, body *AccountCreate, opts ...Option) (*Account, error)

CreateAccountWithContext Create an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_account

Returns: An account.

func (*Client) CreateBillingInfo added in v3.10.0

func (c *Client) CreateBillingInfo(accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

CreateBillingInfo wraps CreateBillingInfoWithContext using the background context

func (*Client) CreateBillingInfoWithContext added in v3.12.0

func (c *Client) CreateBillingInfoWithContext(ctx context.Context, accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

CreateBillingInfoWithContext Add new billing information on an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_billing_info

Returns: Updated billing information.

func (*Client) CreateCoupon

func (c *Client) CreateCoupon(body *CouponCreate, opts ...Option) (*Coupon, error)

CreateCoupon wraps CreateCouponWithContext using the background context

func (*Client) CreateCouponRedemption

func (c *Client) CreateCouponRedemption(accountId string, body *CouponRedemptionCreate, opts ...Option) (*CouponRedemption, error)

CreateCouponRedemption wraps CreateCouponRedemptionWithContext using the background context

func (*Client) CreateCouponRedemptionWithContext added in v3.12.0

func (c *Client) CreateCouponRedemptionWithContext(ctx context.Context, accountId string, body *CouponRedemptionCreate, opts ...Option) (*CouponRedemption, error)

CreateCouponRedemptionWithContext Generate an active coupon redemption on an account or subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_coupon_redemption

Returns: Returns the new coupon redemption.

func (*Client) CreateCouponWithContext added in v3.12.0

func (c *Client) CreateCouponWithContext(ctx context.Context, body *CouponCreate, opts ...Option) (*Coupon, error)

CreateCouponWithContext Create a new coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_coupon

Returns: A new coupon.

func (*Client) CreateInvoice

func (c *Client) CreateInvoice(accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

CreateInvoice wraps CreateInvoiceWithContext using the background context

func (*Client) CreateInvoiceWithContext added in v3.12.0

func (c *Client) CreateInvoiceWithContext(ctx context.Context, accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

CreateInvoiceWithContext Create an invoice for pending line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_invoice

Returns: Returns the new invoices.

func (*Client) CreateItem

func (c *Client) CreateItem(body *ItemCreate, opts ...Option) (*Item, error)

CreateItem wraps CreateItemWithContext using the background context

func (*Client) CreateItemWithContext added in v3.12.0

func (c *Client) CreateItemWithContext(ctx context.Context, body *ItemCreate, opts ...Option) (*Item, error)

CreateItemWithContext Create a new item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_item

Returns: A new item.

func (*Client) CreateLineItem

func (c *Client) CreateLineItem(accountId string, body *LineItemCreate, opts ...Option) (*LineItem, error)

CreateLineItem wraps CreateLineItemWithContext using the background context

func (*Client) CreateLineItemWithContext added in v3.12.0

func (c *Client) CreateLineItemWithContext(ctx context.Context, accountId string, body *LineItemCreate, opts ...Option) (*LineItem, error)

CreateLineItemWithContext Create a new line item for the account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_line_item

Returns: Returns the new line item.

func (*Client) CreateMeasuredUnit added in v3.5.0

func (c *Client) CreateMeasuredUnit(body *MeasuredUnitCreate, opts ...Option) (*MeasuredUnit, error)

CreateMeasuredUnit wraps CreateMeasuredUnitWithContext using the background context

func (*Client) CreateMeasuredUnitWithContext added in v3.12.0

func (c *Client) CreateMeasuredUnitWithContext(ctx context.Context, body *MeasuredUnitCreate, opts ...Option) (*MeasuredUnit, error)

CreateMeasuredUnitWithContext Create a new measured unit

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_measured_unit

Returns: A new measured unit.

func (*Client) CreatePlan

func (c *Client) CreatePlan(body *PlanCreate, opts ...Option) (*Plan, error)

CreatePlan wraps CreatePlanWithContext using the background context

func (*Client) CreatePlanAddOn

func (c *Client) CreatePlanAddOn(planId string, body *AddOnCreate, opts ...Option) (*AddOn, error)

CreatePlanAddOn wraps CreatePlanAddOnWithContext using the background context

func (*Client) CreatePlanAddOnWithContext added in v3.12.0

func (c *Client) CreatePlanAddOnWithContext(ctx context.Context, planId string, body *AddOnCreate, opts ...Option) (*AddOn, error)

CreatePlanAddOnWithContext Create an add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_plan_add_on

Returns: An add-on.

func (*Client) CreatePlanWithContext added in v3.12.0

func (c *Client) CreatePlanWithContext(ctx context.Context, body *PlanCreate, opts ...Option) (*Plan, error)

CreatePlanWithContext Create a plan

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_plan

Returns: A plan.

func (*Client) CreatePurchase

func (c *Client) CreatePurchase(body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

CreatePurchase wraps CreatePurchaseWithContext using the background context

func (*Client) CreatePurchaseWithContext added in v3.12.0

func (c *Client) CreatePurchaseWithContext(ctx context.Context, body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

CreatePurchaseWithContext Create a new purchase

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_purchase

Returns: Returns the new invoices

func (*Client) CreateShippingAddress

func (c *Client) CreateShippingAddress(accountId string, body *ShippingAddressCreate, opts ...Option) (*ShippingAddress, error)

CreateShippingAddress wraps CreateShippingAddressWithContext using the background context

func (*Client) CreateShippingAddressWithContext added in v3.12.0

func (c *Client) CreateShippingAddressWithContext(ctx context.Context, accountId string, body *ShippingAddressCreate, opts ...Option) (*ShippingAddress, error)

CreateShippingAddressWithContext Create a new shipping address for the account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_address

Returns: Returns the new shipping address.

func (*Client) CreateShippingMethod added in v3.2.0

func (c *Client) CreateShippingMethod(body *ShippingMethodCreate, opts ...Option) (*ShippingMethod, error)

CreateShippingMethod wraps CreateShippingMethodWithContext using the background context

func (*Client) CreateShippingMethodWithContext added in v3.12.0

func (c *Client) CreateShippingMethodWithContext(ctx context.Context, body *ShippingMethodCreate, opts ...Option) (*ShippingMethod, error)

CreateShippingMethodWithContext Create a new shipping method

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_method

Returns: A new shipping method.

func (*Client) CreateSubscription

func (c *Client) CreateSubscription(body *SubscriptionCreate, opts ...Option) (*Subscription, error)

CreateSubscription wraps CreateSubscriptionWithContext using the background context

func (*Client) CreateSubscriptionChange

func (c *Client) CreateSubscriptionChange(subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChange, error)

CreateSubscriptionChange wraps CreateSubscriptionChangeWithContext using the background context

func (*Client) CreateSubscriptionChangeWithContext added in v3.12.0

func (c *Client) CreateSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChange, error)

CreateSubscriptionChangeWithContext Create a new subscription change

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_subscription_change

Returns: A subscription change.

func (*Client) CreateSubscriptionWithContext added in v3.12.0

func (c *Client) CreateSubscriptionWithContext(ctx context.Context, body *SubscriptionCreate, opts ...Option) (*Subscription, error)

CreateSubscriptionWithContext Create a new subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_subscription

Returns: A subscription.

func (*Client) CreateUsage added in v3.5.0

func (c *Client) CreateUsage(subscriptionId string, addOnId string, body *UsageCreate, opts ...Option) (*Usage, error)

CreateUsage wraps CreateUsageWithContext using the background context

func (*Client) CreateUsageWithContext added in v3.12.0

func (c *Client) CreateUsageWithContext(ctx context.Context, subscriptionId string, addOnId string, body *UsageCreate, opts ...Option) (*Usage, error)

CreateUsageWithContext Log a usage record on this subscription add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/create_usage

Returns: The created usage record.

func (*Client) DeactivateAccount

func (c *Client) DeactivateAccount(accountId string, opts ...Option) (*Account, error)

DeactivateAccount wraps DeactivateAccountWithContext using the background context

func (*Client) DeactivateAccountWithContext added in v3.12.0

func (c *Client) DeactivateAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

DeactivateAccountWithContext Deactivate an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/deactivate_account

Returns: An account.

func (*Client) DeactivateCoupon

func (c *Client) DeactivateCoupon(couponId string, opts ...Option) (*Coupon, error)

DeactivateCoupon wraps DeactivateCouponWithContext using the background context

func (*Client) DeactivateCouponWithContext added in v3.12.0

func (c *Client) DeactivateCouponWithContext(ctx context.Context, couponId string, opts ...Option) (*Coupon, error)

DeactivateCouponWithContext Expire a coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/deactivate_coupon

Returns: The expired Coupon

func (*Client) DeactivateItem

func (c *Client) DeactivateItem(itemId string, opts ...Option) (*Item, error)

DeactivateItem wraps DeactivateItemWithContext using the background context

func (*Client) DeactivateItemWithContext added in v3.12.0

func (c *Client) DeactivateItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

DeactivateItemWithContext Deactivate an item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/deactivate_item

Returns: An item.

func (*Client) DeactivateShippingMethod added in v3.2.0

func (c *Client) DeactivateShippingMethod(shippingMethodId string, opts ...Option) (*ShippingMethod, error)

DeactivateShippingMethod wraps DeactivateShippingMethodWithContext using the background context

func (*Client) DeactivateShippingMethodWithContext added in v3.12.0

func (c *Client) DeactivateShippingMethodWithContext(ctx context.Context, shippingMethodId string, opts ...Option) (*ShippingMethod, error)

DeactivateShippingMethodWithContext Deactivate a shipping method

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/deactivate_shipping_method

Returns: A shipping method.

func (*Client) DeactivateUniqueCouponCode

func (c *Client) DeactivateUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

DeactivateUniqueCouponCode wraps DeactivateUniqueCouponCodeWithContext using the background context

func (*Client) DeactivateUniqueCouponCodeWithContext added in v3.12.0

func (c *Client) DeactivateUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

DeactivateUniqueCouponCodeWithContext Deactivate a unique coupon code

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/deactivate_unique_coupon_code

Returns: A unique coupon code.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) error

Do submits the http.Request to Recurly's API and parses the JSON response

func (*Client) FailInvoice

func (c *Client) FailInvoice(invoiceId string, opts ...Option) (*Invoice, error)

FailInvoice wraps FailInvoiceWithContext using the background context

func (*Client) FailInvoiceWithContext added in v3.12.0

func (c *Client) FailInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

FailInvoiceWithContext Mark an open invoice as failed

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/fail_invoice

Returns: The updated invoice.

func (*Client) GetABillingInfo added in v3.10.0

func (c *Client) GetABillingInfo(accountId string, billingInfoId string, opts ...Option) (*BillingInfo, error)

GetABillingInfo wraps GetABillingInfoWithContext using the background context

func (*Client) GetABillingInfoWithContext added in v3.12.0

func (c *Client) GetABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, opts ...Option) (*BillingInfo, error)

GetABillingInfoWithContext Fetch a billing info

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_a_billing_info

Returns: A billing info.

func (*Client) GetAccount

func (c *Client) GetAccount(accountId string, opts ...Option) (*Account, error)

GetAccount wraps GetAccountWithContext using the background context

func (*Client) GetAccountAcquisition

func (c *Client) GetAccountAcquisition(accountId string, opts ...Option) (*AccountAcquisition, error)

GetAccountAcquisition wraps GetAccountAcquisitionWithContext using the background context

func (*Client) GetAccountAcquisitionWithContext added in v3.12.0

func (c *Client) GetAccountAcquisitionWithContext(ctx context.Context, accountId string, opts ...Option) (*AccountAcquisition, error)

GetAccountAcquisitionWithContext Fetch an account's acquisition data

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_account_acquisition

Returns: An account's acquisition data.

func (*Client) GetAccountBalance

func (c *Client) GetAccountBalance(accountId string, opts ...Option) (*AccountBalance, error)

GetAccountBalance wraps GetAccountBalanceWithContext using the background context

func (*Client) GetAccountBalanceWithContext added in v3.12.0

func (c *Client) GetAccountBalanceWithContext(ctx context.Context, accountId string, opts ...Option) (*AccountBalance, error)

GetAccountBalanceWithContext Fetch an account's balance and past due status

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_account_balance

Returns: An account's balance.

func (*Client) GetAccountNote

func (c *Client) GetAccountNote(accountId string, accountNoteId string, opts ...Option) (*AccountNote, error)

GetAccountNote wraps GetAccountNoteWithContext using the background context

func (*Client) GetAccountNoteWithContext added in v3.12.0

func (c *Client) GetAccountNoteWithContext(ctx context.Context, accountId string, accountNoteId string, opts ...Option) (*AccountNote, error)

GetAccountNoteWithContext Fetch an account note

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_account_note

Returns: An account note.

func (*Client) GetAccountWithContext added in v3.12.0

func (c *Client) GetAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

GetAccountWithContext Fetch an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_account

Returns: An account.

func (*Client) GetActiveCouponRedemption

func (c *Client) GetActiveCouponRedemption(accountId string, opts ...Option) (*CouponRedemption, error)

GetActiveCouponRedemption wraps GetActiveCouponRedemptionWithContext using the background context

func (*Client) GetActiveCouponRedemptionWithContext added in v3.12.0

func (c *Client) GetActiveCouponRedemptionWithContext(ctx context.Context, accountId string, opts ...Option) (*CouponRedemption, error)

GetActiveCouponRedemptionWithContext Fetch the coupon redemption that is active on an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_active_coupon_redemption

Returns: An active coupon redemption on an account.

func (*Client) GetAddOn

func (c *Client) GetAddOn(addOnId string, opts ...Option) (*AddOn, error)

GetAddOn wraps GetAddOnWithContext using the background context

func (*Client) GetAddOnWithContext added in v3.12.0

func (c *Client) GetAddOnWithContext(ctx context.Context, addOnId string, opts ...Option) (*AddOn, error)

GetAddOnWithContext Fetch an add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_add_on

Returns: An add-on.

func (*Client) GetBillingInfo

func (c *Client) GetBillingInfo(accountId string, opts ...Option) (*BillingInfo, error)

GetBillingInfo wraps GetBillingInfoWithContext using the background context

func (*Client) GetBillingInfoWithContext added in v3.12.0

func (c *Client) GetBillingInfoWithContext(ctx context.Context, accountId string, opts ...Option) (*BillingInfo, error)

GetBillingInfoWithContext Fetch an account's billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_billing_info

Returns: An account's billing information.

func (*Client) GetCoupon

func (c *Client) GetCoupon(couponId string, opts ...Option) (*Coupon, error)

GetCoupon wraps GetCouponWithContext using the background context

func (*Client) GetCouponWithContext added in v3.12.0

func (c *Client) GetCouponWithContext(ctx context.Context, couponId string, opts ...Option) (*Coupon, error)

GetCouponWithContext Fetch a coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_coupon

Returns: A coupon.

func (*Client) GetCreditPayment

func (c *Client) GetCreditPayment(creditPaymentId string, opts ...Option) (*CreditPayment, error)

GetCreditPayment wraps GetCreditPaymentWithContext using the background context

func (*Client) GetCreditPaymentWithContext added in v3.12.0

func (c *Client) GetCreditPaymentWithContext(ctx context.Context, creditPaymentId string, opts ...Option) (*CreditPayment, error)

GetCreditPaymentWithContext Fetch a credit payment

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_credit_payment

Returns: A credit payment.

func (*Client) GetCustomFieldDefinition

func (c *Client) GetCustomFieldDefinition(customFieldDefinitionId string, opts ...Option) (*CustomFieldDefinition, error)

GetCustomFieldDefinition wraps GetCustomFieldDefinitionWithContext using the background context

func (*Client) GetCustomFieldDefinitionWithContext added in v3.12.0

func (c *Client) GetCustomFieldDefinitionWithContext(ctx context.Context, customFieldDefinitionId string, opts ...Option) (*CustomFieldDefinition, error)

GetCustomFieldDefinitionWithContext Fetch an custom field definition

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_custom_field_definition

Returns: An custom field definition.

func (*Client) GetDunningCampaign added in v3.14.0

func (c *Client) GetDunningCampaign(dunningCampaignId string, opts ...Option) (*DunningCampaign, error)

GetDunningCampaign wraps GetDunningCampaignWithContext using the background context

func (*Client) GetDunningCampaignWithContext added in v3.14.0

func (c *Client) GetDunningCampaignWithContext(ctx context.Context, dunningCampaignId string, opts ...Option) (*DunningCampaign, error)

GetDunningCampaignWithContext Fetch a dunning campaign

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_dunning_campaign

Returns: Settings for a dunning campaign.

func (*Client) GetExportDates added in v3.8.0

func (c *Client) GetExportDates(opts ...Option) (*ExportDates, error)

GetExportDates wraps GetExportDatesWithContext using the background context

func (*Client) GetExportDatesWithContext added in v3.12.0

func (c *Client) GetExportDatesWithContext(ctx context.Context, opts ...Option) (*ExportDates, error)

GetExportDatesWithContext List the dates that have an available export to download.

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates

Returns: Returns a list of dates.

func (*Client) GetExportFiles added in v3.8.0

func (c *Client) GetExportFiles(exportDate string, opts ...Option) (*ExportFiles, error)

GetExportFiles wraps GetExportFilesWithContext using the background context

func (*Client) GetExportFilesWithContext added in v3.12.0

func (c *Client) GetExportFilesWithContext(ctx context.Context, exportDate string, opts ...Option) (*ExportFiles, error)

GetExportFilesWithContext List of the export files that are available to download.

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_export_files

Returns: Returns a list of export files to download.

func (*Client) GetInvoice

func (c *Client) GetInvoice(invoiceId string, opts ...Option) (*Invoice, error)

GetInvoice wraps GetInvoiceWithContext using the background context

func (*Client) GetInvoiceWithContext added in v3.12.0

func (c *Client) GetInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

GetInvoiceWithContext Fetch an invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_invoice

Returns: An invoice.

func (*Client) GetItem

func (c *Client) GetItem(itemId string, opts ...Option) (*Item, error)

GetItem wraps GetItemWithContext using the background context

func (*Client) GetItemWithContext added in v3.12.0

func (c *Client) GetItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

GetItemWithContext Fetch an item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_item

Returns: An item.

func (*Client) GetLineItem

func (c *Client) GetLineItem(lineItemId string, opts ...Option) (*LineItem, error)

GetLineItem wraps GetLineItemWithContext using the background context

func (*Client) GetLineItemWithContext added in v3.12.0

func (c *Client) GetLineItemWithContext(ctx context.Context, lineItemId string, opts ...Option) (*LineItem, error)

GetLineItemWithContext Fetch a line item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_line_item

Returns: A line item.

func (*Client) GetMeasuredUnit added in v3.5.0

func (c *Client) GetMeasuredUnit(measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

GetMeasuredUnit wraps GetMeasuredUnitWithContext using the background context

func (*Client) GetMeasuredUnitWithContext added in v3.12.0

func (c *Client) GetMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

GetMeasuredUnitWithContext Fetch a measured unit

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_measured_unit

Returns: An item.

func (*Client) GetPlan

func (c *Client) GetPlan(planId string, opts ...Option) (*Plan, error)

GetPlan wraps GetPlanWithContext using the background context

func (*Client) GetPlanAddOn

func (c *Client) GetPlanAddOn(planId string, addOnId string, opts ...Option) (*AddOn, error)

GetPlanAddOn wraps GetPlanAddOnWithContext using the background context

func (*Client) GetPlanAddOnWithContext added in v3.12.0

func (c *Client) GetPlanAddOnWithContext(ctx context.Context, planId string, addOnId string, opts ...Option) (*AddOn, error)

GetPlanAddOnWithContext Fetch a plan's add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_plan_add_on

Returns: An add-on.

func (*Client) GetPlanWithContext added in v3.12.0

func (c *Client) GetPlanWithContext(ctx context.Context, planId string, opts ...Option) (*Plan, error)

GetPlanWithContext Fetch a plan

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_plan

Returns: A plan.

func (*Client) GetPreviewRenewal added in v3.14.0

func (c *Client) GetPreviewRenewal(subscriptionId string, opts ...Option) (*InvoiceCollection, error)

GetPreviewRenewal wraps GetPreviewRenewalWithContext using the background context

func (*Client) GetPreviewRenewalWithContext added in v3.14.0

func (c *Client) GetPreviewRenewalWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*InvoiceCollection, error)

GetPreviewRenewalWithContext Fetch a preview of a subscription's renewal invoice(s)

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_preview_renewal

Returns: A preview of the subscription's renewal invoice(s).

func (*Client) GetShippingAddress

func (c *Client) GetShippingAddress(accountId string, shippingAddressId string, opts ...Option) (*ShippingAddress, error)

GetShippingAddress wraps GetShippingAddressWithContext using the background context

func (*Client) GetShippingAddressWithContext added in v3.12.0

func (c *Client) GetShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, opts ...Option) (*ShippingAddress, error)

GetShippingAddressWithContext Fetch an account's shipping address

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_address

Returns: A shipping address.

func (*Client) GetShippingMethod

func (c *Client) GetShippingMethod(id string, opts ...Option) (*ShippingMethod, error)

GetShippingMethod wraps GetShippingMethodWithContext using the background context

func (*Client) GetShippingMethodWithContext added in v3.12.0

func (c *Client) GetShippingMethodWithContext(ctx context.Context, id string, opts ...Option) (*ShippingMethod, error)

GetShippingMethodWithContext Fetch a shipping method

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_method

Returns: A shipping method.

func (*Client) GetSite

func (c *Client) GetSite(siteId string, opts ...Option) (*Site, error)

GetSite wraps GetSiteWithContext using the background context

func (*Client) GetSiteWithContext added in v3.12.0

func (c *Client) GetSiteWithContext(ctx context.Context, siteId string, opts ...Option) (*Site, error)

GetSiteWithContext Fetch a site

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_site

Returns: A site.

func (*Client) GetSubscription

func (c *Client) GetSubscription(subscriptionId string, opts ...Option) (*Subscription, error)

GetSubscription wraps GetSubscriptionWithContext using the background context

func (*Client) GetSubscriptionChange

func (c *Client) GetSubscriptionChange(subscriptionId string, opts ...Option) (*SubscriptionChange, error)

GetSubscriptionChange wraps GetSubscriptionChangeWithContext using the background context

func (*Client) GetSubscriptionChangeWithContext added in v3.12.0

func (c *Client) GetSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*SubscriptionChange, error)

GetSubscriptionChangeWithContext Fetch a subscription's pending change

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_subscription_change

Returns: A subscription's pending change.

func (*Client) GetSubscriptionWithContext added in v3.12.0

func (c *Client) GetSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

GetSubscriptionWithContext Fetch a subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_subscription

Returns: A subscription.

func (*Client) GetTransaction

func (c *Client) GetTransaction(transactionId string, opts ...Option) (*Transaction, error)

GetTransaction wraps GetTransactionWithContext using the background context

func (*Client) GetTransactionWithContext added in v3.12.0

func (c *Client) GetTransactionWithContext(ctx context.Context, transactionId string, opts ...Option) (*Transaction, error)

GetTransactionWithContext Fetch a transaction

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_transaction

Returns: A transaction.

func (*Client) GetUniqueCouponCode

func (c *Client) GetUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

GetUniqueCouponCode wraps GetUniqueCouponCodeWithContext using the background context

func (*Client) GetUniqueCouponCodeWithContext added in v3.12.0

func (c *Client) GetUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

GetUniqueCouponCodeWithContext Fetch a unique coupon code

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_unique_coupon_code

Returns: A unique coupon code.

func (*Client) GetUsage added in v3.5.0

func (c *Client) GetUsage(usageId string, opts ...Option) (*Usage, error)

GetUsage wraps GetUsageWithContext using the background context

func (*Client) GetUsageWithContext added in v3.12.0

func (c *Client) GetUsageWithContext(ctx context.Context, usageId string, opts ...Option) (*Usage, error)

GetUsageWithContext Get a usage record

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/get_usage

Returns: The usage record.

func (*Client) InterpolatePath

func (c *Client) InterpolatePath(path string, params ...string) (string, error)

InterpolatePath takes an OpenAPI-style path such as "/accounts/{account_id}/shipping_addresses/{shipping_address_id}" and a list of string arguments to fill the template, and it returns the interpolated path

func (*Client) ListAccountAcquisition

func (c *Client) ListAccountAcquisition(params *ListAccountAcquisitionParams, opts ...Option) *AccountAcquisitionList

ListAccountAcquisition List a site's account acquisition data

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_acquisition

Returns: A list of the site's account acquisition data.

func (*Client) ListAccountCouponRedemptions

func (c *Client) ListAccountCouponRedemptions(accountId string, params *ListAccountCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

ListAccountCouponRedemptions List the coupon redemptions for an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_coupon_redemptions

Returns: A list of the the coupon redemptions on an account.

func (*Client) ListAccountCreditPayments

func (c *Client) ListAccountCreditPayments(accountId string, params *ListAccountCreditPaymentsParams, opts ...Option) *CreditPaymentList

ListAccountCreditPayments List an account's credit payments

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_credit_payments

Returns: A list of the account's credit payments.

func (*Client) ListAccountInvoices

func (c *Client) ListAccountInvoices(accountId string, params *ListAccountInvoicesParams, opts ...Option) *InvoiceList

ListAccountInvoices List an account's invoices

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_invoices

Returns: A list of the account's invoices.

func (*Client) ListAccountLineItems

func (c *Client) ListAccountLineItems(accountId string, params *ListAccountLineItemsParams, opts ...Option) *LineItemList

ListAccountLineItems List an account's line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_line_items

Returns: A list of the account's line items.

func (*Client) ListAccountNotes

func (c *Client) ListAccountNotes(accountId string, params *ListAccountNotesParams, opts ...Option) *AccountNoteList

ListAccountNotes List an account's notes

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_notes

Returns: A list of an account's notes.

func (*Client) ListAccountSubscriptions

func (c *Client) ListAccountSubscriptions(accountId string, params *ListAccountSubscriptionsParams, opts ...Option) *SubscriptionList

ListAccountSubscriptions List an account's subscriptions

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_subscriptions

Returns: A list of the account's subscriptions.

func (*Client) ListAccountTransactions

func (c *Client) ListAccountTransactions(accountId string, params *ListAccountTransactionsParams, opts ...Option) *TransactionList

ListAccountTransactions List an account's transactions

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_account_transactions

Returns: A list of the account's transactions.

func (*Client) ListAccounts

func (c *Client) ListAccounts(params *ListAccountsParams, opts ...Option) *AccountList

ListAccounts List a site's accounts

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_accounts

Returns: A list of the site's accounts.

func (*Client) ListAddOns

func (c *Client) ListAddOns(params *ListAddOnsParams, opts ...Option) *AddOnList

ListAddOns List a site's add-ons

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_add_ons

Returns: A list of add-ons.

func (*Client) ListBillingInfos added in v3.10.0

func (c *Client) ListBillingInfos(accountId string, params *ListBillingInfosParams, opts ...Option) *BillingInfoList

ListBillingInfos Get the list of billing information associated with an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_billing_infos

Returns: A list of the the billing information for an account's

func (*Client) ListChildAccounts

func (c *Client) ListChildAccounts(accountId string, params *ListChildAccountsParams, opts ...Option) *AccountList

ListChildAccounts List an account's child accounts

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_child_accounts

Returns: A list of an account's child accounts.

func (*Client) ListCoupons

func (c *Client) ListCoupons(params *ListCouponsParams, opts ...Option) *CouponList

ListCoupons List a site's coupons

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_coupons

Returns: A list of the site's coupons.

func (*Client) ListCreditPayments

func (c *Client) ListCreditPayments(params *ListCreditPaymentsParams, opts ...Option) *CreditPaymentList

ListCreditPayments List a site's credit payments

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_credit_payments

Returns: A list of the site's credit payments.

func (*Client) ListCustomFieldDefinitions

func (c *Client) ListCustomFieldDefinitions(params *ListCustomFieldDefinitionsParams, opts ...Option) *CustomFieldDefinitionList

ListCustomFieldDefinitions List a site's custom field definitions

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_custom_field_definitions

Returns: A list of the site's custom field definitions.

func (*Client) ListDunningCampaigns added in v3.14.0

func (c *Client) ListDunningCampaigns(params *ListDunningCampaignsParams, opts ...Option) *DunningCampaignList

ListDunningCampaigns List the dunning campaigns for a site

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_dunning_campaigns

Returns: A list of the the dunning_campaigns on an account.

func (*Client) ListInvoiceCouponRedemptions

func (c *Client) ListInvoiceCouponRedemptions(invoiceId string, params *ListInvoiceCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

ListInvoiceCouponRedemptions List the coupon redemptions applied to an invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_coupon_redemptions

Returns: A list of the the coupon redemptions associated with the invoice.

func (*Client) ListInvoiceLineItems

func (c *Client) ListInvoiceLineItems(invoiceId string, params *ListInvoiceLineItemsParams, opts ...Option) *LineItemList

ListInvoiceLineItems List an invoice's line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_line_items

Returns: A list of the invoice's line items.

func (*Client) ListInvoices

func (c *Client) ListInvoices(params *ListInvoicesParams, opts ...Option) *InvoiceList

ListInvoices List a site's invoices

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_invoices

Returns: A list of the site's invoices.

func (*Client) ListItems

func (c *Client) ListItems(params *ListItemsParams, opts ...Option) *ItemList

ListItems List a site's items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_items

Returns: A list of the site's items.

func (*Client) ListLineItems

func (c *Client) ListLineItems(params *ListLineItemsParams, opts ...Option) *LineItemList

ListLineItems List a site's line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_line_items

Returns: A list of the site's line items.

func (*Client) ListMeasuredUnit added in v3.5.0

func (c *Client) ListMeasuredUnit(params *ListMeasuredUnitParams, opts ...Option) *MeasuredUnitList

ListMeasuredUnit List a site's measured units

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_measured_unit

Returns: A list of the site's measured units.

func (*Client) ListPlanAddOns

func (c *Client) ListPlanAddOns(planId string, params *ListPlanAddOnsParams, opts ...Option) *AddOnList

ListPlanAddOns List a plan's add-ons

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_plan_add_ons

Returns: A list of add-ons.

func (*Client) ListPlans

func (c *Client) ListPlans(params *ListPlansParams, opts ...Option) *PlanList

ListPlans List a site's plans

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_plans

Returns: A list of plans.

func (*Client) ListRelatedInvoices

func (c *Client) ListRelatedInvoices(invoiceId string, opts ...Option) *InvoiceList

ListRelatedInvoices List an invoice's related credit or charge invoices

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_related_invoices

Returns: A list of the credit or charge invoices associated with the invoice.

func (*Client) ListShippingAddresses

func (c *Client) ListShippingAddresses(accountId string, params *ListShippingAddressesParams, opts ...Option) *ShippingAddressList

ListShippingAddresses Fetch a list of an account's shipping addresses

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_addresses

Returns: A list of an account's shipping addresses.

func (*Client) ListShippingMethods

func (c *Client) ListShippingMethods(params *ListShippingMethodsParams, opts ...Option) *ShippingMethodList

ListShippingMethods List a site's shipping methods

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_methods

Returns: A list of the site's shipping methods.

func (*Client) ListSites

func (c *Client) ListSites(params *ListSitesParams, opts ...Option) *SiteList

ListSites List sites

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_sites

Returns: A list of sites.

func (*Client) ListSubscriptionCouponRedemptions

func (c *Client) ListSubscriptionCouponRedemptions(subscriptionId string, params *ListSubscriptionCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

ListSubscriptionCouponRedemptions List the coupon redemptions for a subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_coupon_redemptions

Returns: A list of the the coupon redemptions on a subscription.

func (*Client) ListSubscriptionInvoices

func (c *Client) ListSubscriptionInvoices(subscriptionId string, params *ListSubscriptionInvoicesParams, opts ...Option) *InvoiceList

ListSubscriptionInvoices List a subscription's invoices

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_invoices

Returns: A list of the subscription's invoices.

func (*Client) ListSubscriptionLineItems

func (c *Client) ListSubscriptionLineItems(subscriptionId string, params *ListSubscriptionLineItemsParams, opts ...Option) *LineItemList

ListSubscriptionLineItems List a subscription's line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_line_items

Returns: A list of the subscription's line items.

func (*Client) ListSubscriptions

func (c *Client) ListSubscriptions(params *ListSubscriptionsParams, opts ...Option) *SubscriptionList

ListSubscriptions List a site's subscriptions

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_subscriptions

Returns: A list of the site's subscriptions.

func (*Client) ListTransactions

func (c *Client) ListTransactions(params *ListTransactionsParams, opts ...Option) *TransactionList

ListTransactions List a site's transactions

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_transactions

Returns: A list of the site's transactions.

func (*Client) ListUniqueCouponCodes

func (c *Client) ListUniqueCouponCodes(couponId string, params *ListUniqueCouponCodesParams, opts ...Option) *UniqueCouponCodeList

ListUniqueCouponCodes List unique coupon codes associated with a bulk coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes

Returns: A list of unique coupon codes that were generated

func (*Client) ListUsage added in v3.5.0

func (c *Client) ListUsage(subscriptionId string, addOnId string, params *ListUsageParams, opts ...Option) *UsageList

ListUsage List a subscription add-on's usage records

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/list_usage

Returns: A list of the subscription add-on's usage records.

func (*Client) MarkInvoiceSuccessful

func (c *Client) MarkInvoiceSuccessful(invoiceId string, opts ...Option) (*Invoice, error)

MarkInvoiceSuccessful wraps MarkInvoiceSuccessfulWithContext using the background context

func (*Client) MarkInvoiceSuccessfulWithContext added in v3.12.0

func (c *Client) MarkInvoiceSuccessfulWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

MarkInvoiceSuccessfulWithContext Mark an open invoice as successful

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/mark_invoice_successful

Returns: The updated invoice.

func (*Client) ModifySubscription

func (c *Client) ModifySubscription(subscriptionId string, body *SubscriptionUpdate, opts ...Option) (*Subscription, error)

ModifySubscription wraps ModifySubscriptionWithContext using the background context

func (*Client) ModifySubscriptionWithContext added in v3.12.0

func (c *Client) ModifySubscriptionWithContext(ctx context.Context, subscriptionId string, body *SubscriptionUpdate, opts ...Option) (*Subscription, error)

ModifySubscriptionWithContext Modify a subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/modify_subscription

Returns: A subscription.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method string, requestURL string, params *Params, requestOptions OptionsApplier) (*http.Request, error)

NewRequest generates an http.Request for the API client to submit to Recurly. The RequestOptions have been added to replace the common features of the Params struct in an attempt to seperate request payload information (Params.Data) from configurations of the HTTP request (RequestOptions).

func (*Client) PauseSubscription

func (c *Client) PauseSubscription(subscriptionId string, body *SubscriptionPause, opts ...Option) (*Subscription, error)

PauseSubscription wraps PauseSubscriptionWithContext using the background context

func (*Client) PauseSubscriptionWithContext added in v3.12.0

func (c *Client) PauseSubscriptionWithContext(ctx context.Context, subscriptionId string, body *SubscriptionPause, opts ...Option) (*Subscription, error)

PauseSubscriptionWithContext Pause subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/pause_subscription

Returns: A subscription.

func (*Client) PreviewInvoice

func (c *Client) PreviewInvoice(accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

PreviewInvoice wraps PreviewInvoiceWithContext using the background context

func (*Client) PreviewInvoiceWithContext added in v3.12.0

func (c *Client) PreviewInvoiceWithContext(ctx context.Context, accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

PreviewInvoiceWithContext Preview new invoice for pending line items

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/preview_invoice

Returns: Returns the invoice previews.

func (*Client) PreviewPurchase

func (c *Client) PreviewPurchase(body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

PreviewPurchase wraps PreviewPurchaseWithContext using the background context

func (*Client) PreviewPurchaseWithContext added in v3.12.0

func (c *Client) PreviewPurchaseWithContext(ctx context.Context, body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

PreviewPurchaseWithContext Preview a new purchase

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/preview_purchase

Returns: Returns preview of the new invoices

func (*Client) PreviewSubscriptionChange added in v3.3.0

func (c *Client) PreviewSubscriptionChange(subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChangePreview, error)

PreviewSubscriptionChange wraps PreviewSubscriptionChangeWithContext using the background context

func (*Client) PreviewSubscriptionChangeWithContext added in v3.12.0

func (c *Client) PreviewSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChangePreview, error)

PreviewSubscriptionChangeWithContext Preview a new subscription change

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/preview_subscription_change

Returns: A subscription change.

func (*Client) PutDunningCampaignBulkUpdate added in v3.14.0

func (c *Client) PutDunningCampaignBulkUpdate(dunningCampaignId string, body *DunningCampaignsBulkUpdate, opts ...Option) (*DunningCampaignsBulkUpdateResponse, error)

PutDunningCampaignBulkUpdate wraps PutDunningCampaignBulkUpdateWithContext using the background context

func (*Client) PutDunningCampaignBulkUpdateWithContext added in v3.14.0

func (c *Client) PutDunningCampaignBulkUpdateWithContext(ctx context.Context, dunningCampaignId string, body *DunningCampaignsBulkUpdate, opts ...Option) (*DunningCampaignsBulkUpdateResponse, error)

PutDunningCampaignBulkUpdateWithContext Assign a dunning campaign to multiple plans

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/put_dunning_campaign_bulk_update

Returns: A list of updated plans.

func (*Client) PutInvoice

func (c *Client) PutInvoice(invoiceId string, body *InvoiceUpdatable, opts ...Option) (*Invoice, error)

PutInvoice wraps PutInvoiceWithContext using the background context

func (*Client) PutInvoiceWithContext added in v3.12.0

func (c *Client) PutInvoiceWithContext(ctx context.Context, invoiceId string, body *InvoiceUpdatable, opts ...Option) (*Invoice, error)

PutInvoiceWithContext Update an invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/put_invoice

Returns: An invoice.

func (*Client) ReactivateAccount

func (c *Client) ReactivateAccount(accountId string, opts ...Option) (*Account, error)

ReactivateAccount wraps ReactivateAccountWithContext using the background context

func (*Client) ReactivateAccountWithContext added in v3.12.0

func (c *Client) ReactivateAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

ReactivateAccountWithContext Reactivate an inactive account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/reactivate_account

Returns: An account.

func (*Client) ReactivateItem

func (c *Client) ReactivateItem(itemId string, opts ...Option) (*Item, error)

ReactivateItem wraps ReactivateItemWithContext using the background context

func (*Client) ReactivateItemWithContext added in v3.12.0

func (c *Client) ReactivateItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

ReactivateItemWithContext Reactivate an inactive item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/reactivate_item

Returns: An item.

func (*Client) ReactivateSubscription

func (c *Client) ReactivateSubscription(subscriptionId string, opts ...Option) (*Subscription, error)

ReactivateSubscription wraps ReactivateSubscriptionWithContext using the background context

func (*Client) ReactivateSubscriptionWithContext added in v3.12.0

func (c *Client) ReactivateSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

ReactivateSubscriptionWithContext Reactivate a canceled subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/reactivate_subscription

Returns: An active subscription.

func (*Client) ReactivateUniqueCouponCode

func (c *Client) ReactivateUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

ReactivateUniqueCouponCode wraps ReactivateUniqueCouponCodeWithContext using the background context

func (*Client) ReactivateUniqueCouponCodeWithContext added in v3.12.0

func (c *Client) ReactivateUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

ReactivateUniqueCouponCodeWithContext Restore a unique coupon code

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/reactivate_unique_coupon_code

Returns: A unique coupon code.

func (*Client) RecordExternalTransaction added in v3.1.0

func (c *Client) RecordExternalTransaction(invoiceId string, body *ExternalTransaction, opts ...Option) (*Transaction, error)

RecordExternalTransaction wraps RecordExternalTransactionWithContext using the background context

func (*Client) RecordExternalTransactionWithContext added in v3.12.0

func (c *Client) RecordExternalTransactionWithContext(ctx context.Context, invoiceId string, body *ExternalTransaction, opts ...Option) (*Transaction, error)

RecordExternalTransactionWithContext Record an external payment for a manual invoices.

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/record_external_transaction

Returns: The recorded transaction.

func (*Client) RefundInvoice

func (c *Client) RefundInvoice(invoiceId string, body *InvoiceRefund, opts ...Option) (*Invoice, error)

RefundInvoice wraps RefundInvoiceWithContext using the background context

func (*Client) RefundInvoiceWithContext added in v3.12.0

func (c *Client) RefundInvoiceWithContext(ctx context.Context, invoiceId string, body *InvoiceRefund, opts ...Option) (*Invoice, error)

RefundInvoiceWithContext Refund an invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/refund_invoice

Returns: Returns the new credit invoice.

func (*Client) RemoveABillingInfo added in v3.10.0

func (c *Client) RemoveABillingInfo(accountId string, billingInfoId string, opts ...Option) (*Empty, error)

RemoveABillingInfo wraps RemoveABillingInfoWithContext using the background context

func (*Client) RemoveABillingInfoWithContext added in v3.12.0

func (c *Client) RemoveABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, opts ...Option) (*Empty, error)

RemoveABillingInfoWithContext Remove an account's billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_a_billing_info

Returns: Billing information deleted

func (*Client) RemoveAccountAcquisition

func (c *Client) RemoveAccountAcquisition(accountId string, opts ...Option) (*Empty, error)

RemoveAccountAcquisition wraps RemoveAccountAcquisitionWithContext using the background context

func (*Client) RemoveAccountAcquisitionWithContext added in v3.12.0

func (c *Client) RemoveAccountAcquisitionWithContext(ctx context.Context, accountId string, opts ...Option) (*Empty, error)

RemoveAccountAcquisitionWithContext Remove an account's acquisition data

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_account_acquisition

Returns: Acquisition data was succesfully deleted.

func (*Client) RemoveBillingInfo

func (c *Client) RemoveBillingInfo(accountId string, opts ...Option) (*Empty, error)

RemoveBillingInfo wraps RemoveBillingInfoWithContext using the background context

func (*Client) RemoveBillingInfoWithContext added in v3.12.0

func (c *Client) RemoveBillingInfoWithContext(ctx context.Context, accountId string, opts ...Option) (*Empty, error)

RemoveBillingInfoWithContext Remove an account's billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_billing_info

Returns: Billing information deleted

func (*Client) RemoveCouponRedemption

func (c *Client) RemoveCouponRedemption(accountId string, opts ...Option) (*CouponRedemption, error)

RemoveCouponRedemption wraps RemoveCouponRedemptionWithContext using the background context

func (*Client) RemoveCouponRedemptionWithContext added in v3.12.0

func (c *Client) RemoveCouponRedemptionWithContext(ctx context.Context, accountId string, opts ...Option) (*CouponRedemption, error)

RemoveCouponRedemptionWithContext Delete the active coupon redemption from an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_coupon_redemption

Returns: Coupon redemption deleted.

func (*Client) RemoveLineItem

func (c *Client) RemoveLineItem(lineItemId string, opts ...Option) (*Empty, error)

RemoveLineItem wraps RemoveLineItemWithContext using the background context

func (*Client) RemoveLineItemWithContext added in v3.12.0

func (c *Client) RemoveLineItemWithContext(ctx context.Context, lineItemId string, opts ...Option) (*Empty, error)

RemoveLineItemWithContext Delete an uninvoiced line item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_line_item

Returns: Line item deleted.

func (*Client) RemoveMeasuredUnit added in v3.5.0

func (c *Client) RemoveMeasuredUnit(measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

RemoveMeasuredUnit wraps RemoveMeasuredUnitWithContext using the background context

func (*Client) RemoveMeasuredUnitWithContext added in v3.12.0

func (c *Client) RemoveMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

RemoveMeasuredUnitWithContext Remove a measured unit

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_measured_unit

Returns: A measured unit.

func (*Client) RemovePlan

func (c *Client) RemovePlan(planId string, opts ...Option) (*Plan, error)

RemovePlan wraps RemovePlanWithContext using the background context

func (*Client) RemovePlanAddOn

func (c *Client) RemovePlanAddOn(planId string, addOnId string, opts ...Option) (*AddOn, error)

RemovePlanAddOn wraps RemovePlanAddOnWithContext using the background context

func (*Client) RemovePlanAddOnWithContext added in v3.12.0

func (c *Client) RemovePlanAddOnWithContext(ctx context.Context, planId string, addOnId string, opts ...Option) (*AddOn, error)

RemovePlanAddOnWithContext Remove an add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_plan_add_on

Returns: Add-on deleted

func (*Client) RemovePlanWithContext added in v3.12.0

func (c *Client) RemovePlanWithContext(ctx context.Context, planId string, opts ...Option) (*Plan, error)

RemovePlanWithContext Remove a plan

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_plan

Returns: Plan deleted

func (*Client) RemoveShippingAddress

func (c *Client) RemoveShippingAddress(accountId string, shippingAddressId string, opts ...Option) (*Empty, error)

RemoveShippingAddress wraps RemoveShippingAddressWithContext using the background context

func (*Client) RemoveShippingAddressWithContext added in v3.12.0

func (c *Client) RemoveShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, opts ...Option) (*Empty, error)

RemoveShippingAddressWithContext Remove an account's shipping address

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_shipping_address

Returns: Shipping address deleted.

func (*Client) RemoveSubscriptionChange

func (c *Client) RemoveSubscriptionChange(subscriptionId string, opts ...Option) (*Empty, error)

RemoveSubscriptionChange wraps RemoveSubscriptionChangeWithContext using the background context

func (*Client) RemoveSubscriptionChangeWithContext added in v3.12.0

func (c *Client) RemoveSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Empty, error)

RemoveSubscriptionChangeWithContext Delete the pending subscription change

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_subscription_change

Returns: Subscription change was deleted.

func (*Client) RemoveUsage added in v3.5.0

func (c *Client) RemoveUsage(usageId string, opts ...Option) (*Empty, error)

RemoveUsage wraps RemoveUsageWithContext using the background context

func (*Client) RemoveUsageWithContext added in v3.12.0

func (c *Client) RemoveUsageWithContext(ctx context.Context, usageId string, opts ...Option) (*Empty, error)

RemoveUsageWithContext Delete a usage record.

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/remove_usage

Returns: Usage was successfully deleted.

func (*Client) ReopenInvoice

func (c *Client) ReopenInvoice(invoiceId string, opts ...Option) (*Invoice, error)

ReopenInvoice wraps ReopenInvoiceWithContext using the background context

func (*Client) ReopenInvoiceWithContext added in v3.12.0

func (c *Client) ReopenInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

ReopenInvoiceWithContext Reopen a closed, manual invoice

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/reopen_invoice

Returns: The updated invoice.

func (*Client) RestoreCoupon added in v3.9.0

func (c *Client) RestoreCoupon(couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

RestoreCoupon wraps RestoreCouponWithContext using the background context

func (*Client) RestoreCouponWithContext added in v3.12.0

func (c *Client) RestoreCouponWithContext(ctx context.Context, couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

RestoreCouponWithContext Restore an inactive coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon

Returns: The restored coupon.

func (*Client) ResumeSubscription

func (c *Client) ResumeSubscription(subscriptionId string, opts ...Option) (*Subscription, error)

ResumeSubscription wraps ResumeSubscriptionWithContext using the background context

func (*Client) ResumeSubscriptionWithContext added in v3.12.0

func (c *Client) ResumeSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

ResumeSubscriptionWithContext Resume subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/resume_subscription

Returns: A subscription.

func (*Client) TerminateSubscription

func (c *Client) TerminateSubscription(subscriptionId string, params *TerminateSubscriptionParams, opts ...Option) (*Subscription, error)

TerminateSubscription wraps TerminateSubscriptionWithContext using the background context

func (*Client) TerminateSubscriptionWithContext added in v3.12.0

func (c *Client) TerminateSubscriptionWithContext(ctx context.Context, subscriptionId string, params *TerminateSubscriptionParams, opts ...Option) (*Subscription, error)

TerminateSubscriptionWithContext Terminate a subscription

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/terminate_subscription

Returns: An expired subscription.

func (*Client) UpdateABillingInfo added in v3.10.0

func (c *Client) UpdateABillingInfo(accountId string, billingInfoId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

UpdateABillingInfo wraps UpdateABillingInfoWithContext using the background context

func (*Client) UpdateABillingInfoWithContext added in v3.12.0

func (c *Client) UpdateABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

UpdateABillingInfoWithContext Update an account's billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_a_billing_info

Returns: Updated billing information.

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(accountId string, body *AccountUpdate, opts ...Option) (*Account, error)

UpdateAccount wraps UpdateAccountWithContext using the background context

func (*Client) UpdateAccountAcquisition

func (c *Client) UpdateAccountAcquisition(accountId string, body *AccountAcquisitionUpdatable, opts ...Option) (*AccountAcquisition, error)

UpdateAccountAcquisition wraps UpdateAccountAcquisitionWithContext using the background context

func (*Client) UpdateAccountAcquisitionWithContext added in v3.12.0

func (c *Client) UpdateAccountAcquisitionWithContext(ctx context.Context, accountId string, body *AccountAcquisitionUpdatable, opts ...Option) (*AccountAcquisition, error)

UpdateAccountAcquisitionWithContext Update an account's acquisition data

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_account_acquisition

Returns: An account's updated acquisition data.

func (*Client) UpdateAccountWithContext added in v3.12.0

func (c *Client) UpdateAccountWithContext(ctx context.Context, accountId string, body *AccountUpdate, opts ...Option) (*Account, error)

UpdateAccountWithContext Modify an account

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_account

Returns: An account.

func (*Client) UpdateBillingInfo

func (c *Client) UpdateBillingInfo(accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

UpdateBillingInfo wraps UpdateBillingInfoWithContext using the background context

func (*Client) UpdateBillingInfoWithContext added in v3.12.0

func (c *Client) UpdateBillingInfoWithContext(ctx context.Context, accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

UpdateBillingInfoWithContext Set an account's billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_billing_info

Returns: Updated billing information.

func (*Client) UpdateCoupon

func (c *Client) UpdateCoupon(couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

UpdateCoupon wraps UpdateCouponWithContext using the background context

func (*Client) UpdateCouponWithContext added in v3.12.0

func (c *Client) UpdateCouponWithContext(ctx context.Context, couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

UpdateCouponWithContext Update an active coupon

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_coupon

Returns: The updated coupon.

func (*Client) UpdateItem

func (c *Client) UpdateItem(itemId string, body *ItemUpdate, opts ...Option) (*Item, error)

UpdateItem wraps UpdateItemWithContext using the background context

func (*Client) UpdateItemWithContext added in v3.12.0

func (c *Client) UpdateItemWithContext(ctx context.Context, itemId string, body *ItemUpdate, opts ...Option) (*Item, error)

UpdateItemWithContext Update an active item

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_item

Returns: The updated item.

func (*Client) UpdateMeasuredUnit added in v3.5.0

func (c *Client) UpdateMeasuredUnit(measuredUnitId string, body *MeasuredUnitUpdate, opts ...Option) (*MeasuredUnit, error)

UpdateMeasuredUnit wraps UpdateMeasuredUnitWithContext using the background context

func (*Client) UpdateMeasuredUnitWithContext added in v3.12.0

func (c *Client) UpdateMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, body *MeasuredUnitUpdate, opts ...Option) (*MeasuredUnit, error)

UpdateMeasuredUnitWithContext Update a measured unit

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_measured_unit

Returns: The updated measured_unit.

func (*Client) UpdatePlan

func (c *Client) UpdatePlan(planId string, body *PlanUpdate, opts ...Option) (*Plan, error)

UpdatePlan wraps UpdatePlanWithContext using the background context

func (*Client) UpdatePlanAddOn

func (c *Client) UpdatePlanAddOn(planId string, addOnId string, body *AddOnUpdate, opts ...Option) (*AddOn, error)

UpdatePlanAddOn wraps UpdatePlanAddOnWithContext using the background context

func (*Client) UpdatePlanAddOnWithContext added in v3.12.0

func (c *Client) UpdatePlanAddOnWithContext(ctx context.Context, planId string, addOnId string, body *AddOnUpdate, opts ...Option) (*AddOn, error)

UpdatePlanAddOnWithContext Update an add-on

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_plan_add_on

Returns: An add-on.

func (*Client) UpdatePlanWithContext added in v3.12.0

func (c *Client) UpdatePlanWithContext(ctx context.Context, planId string, body *PlanUpdate, opts ...Option) (*Plan, error)

UpdatePlanWithContext Update a plan

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_plan

Returns: A plan.

func (*Client) UpdateShippingAddress

func (c *Client) UpdateShippingAddress(accountId string, shippingAddressId string, body *ShippingAddressUpdate, opts ...Option) (*ShippingAddress, error)

UpdateShippingAddress wraps UpdateShippingAddressWithContext using the background context

func (*Client) UpdateShippingAddressWithContext added in v3.12.0

func (c *Client) UpdateShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, body *ShippingAddressUpdate, opts ...Option) (*ShippingAddress, error)

UpdateShippingAddressWithContext Update an account's shipping address

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_address

Returns: The updated shipping address.

func (*Client) UpdateShippingMethod added in v3.2.0

func (c *Client) UpdateShippingMethod(shippingMethodId string, body *ShippingMethodUpdate, opts ...Option) (*ShippingMethod, error)

UpdateShippingMethod wraps UpdateShippingMethodWithContext using the background context

func (*Client) UpdateShippingMethodWithContext added in v3.12.0

func (c *Client) UpdateShippingMethodWithContext(ctx context.Context, shippingMethodId string, body *ShippingMethodUpdate, opts ...Option) (*ShippingMethod, error)

UpdateShippingMethodWithContext Update an active Shipping Method

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_method

Returns: The updated shipping method.

func (*Client) UpdateUsage added in v3.5.0

func (c *Client) UpdateUsage(usageId string, body *UsageCreate, opts ...Option) (*Usage, error)

UpdateUsage wraps UpdateUsageWithContext using the background context

func (*Client) UpdateUsageWithContext added in v3.12.0

func (c *Client) UpdateUsageWithContext(ctx context.Context, usageId string, body *UsageCreate, opts ...Option) (*Usage, error)

UpdateUsageWithContext Update a usage record

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/update_usage

Returns: The updated usage record.

func (*Client) VerifyBillingInfo added in v3.14.0

func (c *Client) VerifyBillingInfo(accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error)

VerifyBillingInfo wraps VerifyBillingInfoWithContext using the background context

func (*Client) VerifyBillingInfoWithContext added in v3.14.0

func (c *Client) VerifyBillingInfoWithContext(ctx context.Context, accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error)

VerifyBillingInfoWithContext Verify an account's credit card billing information

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/verify_billing_info

Returns: Transaction information from verify.

func (*Client) VoidInvoice

func (c *Client) VoidInvoice(invoiceId string, opts ...Option) (*Invoice, error)

VoidInvoice wraps VoidInvoiceWithContext using the background context

func (*Client) VoidInvoiceWithContext added in v3.12.0

func (c *Client) VoidInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

VoidInvoiceWithContext Void a credit invoice.

API Documentation: https://developers.recurly.com/api/v2019-10-10#operation/void_invoice

Returns: The updated invoice.

type ClientInterface added in v3.6.0

type ClientInterface interface {
	ListSites(params *ListSitesParams, opts ...Option) *SiteList

	GetSite(siteId string, opts ...Option) (*Site, error)
	GetSiteWithContext(ctx context.Context, siteId string, opts ...Option) (*Site, error)

	ListAccounts(params *ListAccountsParams, opts ...Option) *AccountList

	CreateAccount(body *AccountCreate, opts ...Option) (*Account, error)
	CreateAccountWithContext(ctx context.Context, body *AccountCreate, opts ...Option) (*Account, error)

	GetAccount(accountId string, opts ...Option) (*Account, error)
	GetAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

	UpdateAccount(accountId string, body *AccountUpdate, opts ...Option) (*Account, error)
	UpdateAccountWithContext(ctx context.Context, accountId string, body *AccountUpdate, opts ...Option) (*Account, error)

	DeactivateAccount(accountId string, opts ...Option) (*Account, error)
	DeactivateAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

	GetAccountAcquisition(accountId string, opts ...Option) (*AccountAcquisition, error)
	GetAccountAcquisitionWithContext(ctx context.Context, accountId string, opts ...Option) (*AccountAcquisition, error)

	UpdateAccountAcquisition(accountId string, body *AccountAcquisitionUpdatable, opts ...Option) (*AccountAcquisition, error)
	UpdateAccountAcquisitionWithContext(ctx context.Context, accountId string, body *AccountAcquisitionUpdatable, opts ...Option) (*AccountAcquisition, error)

	RemoveAccountAcquisition(accountId string, opts ...Option) (*Empty, error)
	RemoveAccountAcquisitionWithContext(ctx context.Context, accountId string, opts ...Option) (*Empty, error)

	ReactivateAccount(accountId string, opts ...Option) (*Account, error)
	ReactivateAccountWithContext(ctx context.Context, accountId string, opts ...Option) (*Account, error)

	GetAccountBalance(accountId string, opts ...Option) (*AccountBalance, error)
	GetAccountBalanceWithContext(ctx context.Context, accountId string, opts ...Option) (*AccountBalance, error)

	GetBillingInfo(accountId string, opts ...Option) (*BillingInfo, error)
	GetBillingInfoWithContext(ctx context.Context, accountId string, opts ...Option) (*BillingInfo, error)

	UpdateBillingInfo(accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)
	UpdateBillingInfoWithContext(ctx context.Context, accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

	RemoveBillingInfo(accountId string, opts ...Option) (*Empty, error)
	RemoveBillingInfoWithContext(ctx context.Context, accountId string, opts ...Option) (*Empty, error)

	VerifyBillingInfo(accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error)
	VerifyBillingInfoWithContext(ctx context.Context, accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error)

	ListBillingInfos(accountId string, params *ListBillingInfosParams, opts ...Option) *BillingInfoList

	CreateBillingInfo(accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)
	CreateBillingInfoWithContext(ctx context.Context, accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

	GetABillingInfo(accountId string, billingInfoId string, opts ...Option) (*BillingInfo, error)
	GetABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, opts ...Option) (*BillingInfo, error)

	UpdateABillingInfo(accountId string, billingInfoId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)
	UpdateABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error)

	RemoveABillingInfo(accountId string, billingInfoId string, opts ...Option) (*Empty, error)
	RemoveABillingInfoWithContext(ctx context.Context, accountId string, billingInfoId string, opts ...Option) (*Empty, error)

	ListAccountCouponRedemptions(accountId string, params *ListAccountCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

	GetActiveCouponRedemption(accountId string, opts ...Option) (*CouponRedemption, error)
	GetActiveCouponRedemptionWithContext(ctx context.Context, accountId string, opts ...Option) (*CouponRedemption, error)

	CreateCouponRedemption(accountId string, body *CouponRedemptionCreate, opts ...Option) (*CouponRedemption, error)
	CreateCouponRedemptionWithContext(ctx context.Context, accountId string, body *CouponRedemptionCreate, opts ...Option) (*CouponRedemption, error)

	RemoveCouponRedemption(accountId string, opts ...Option) (*CouponRedemption, error)
	RemoveCouponRedemptionWithContext(ctx context.Context, accountId string, opts ...Option) (*CouponRedemption, error)

	ListAccountCreditPayments(accountId string, params *ListAccountCreditPaymentsParams, opts ...Option) *CreditPaymentList

	ListAccountInvoices(accountId string, params *ListAccountInvoicesParams, opts ...Option) *InvoiceList

	CreateInvoice(accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)
	CreateInvoiceWithContext(ctx context.Context, accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

	PreviewInvoice(accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)
	PreviewInvoiceWithContext(ctx context.Context, accountId string, body *InvoiceCreate, opts ...Option) (*InvoiceCollection, error)

	ListAccountLineItems(accountId string, params *ListAccountLineItemsParams, opts ...Option) *LineItemList

	CreateLineItem(accountId string, body *LineItemCreate, opts ...Option) (*LineItem, error)
	CreateLineItemWithContext(ctx context.Context, accountId string, body *LineItemCreate, opts ...Option) (*LineItem, error)

	ListAccountNotes(accountId string, params *ListAccountNotesParams, opts ...Option) *AccountNoteList

	GetAccountNote(accountId string, accountNoteId string, opts ...Option) (*AccountNote, error)
	GetAccountNoteWithContext(ctx context.Context, accountId string, accountNoteId string, opts ...Option) (*AccountNote, error)

	ListShippingAddresses(accountId string, params *ListShippingAddressesParams, opts ...Option) *ShippingAddressList

	CreateShippingAddress(accountId string, body *ShippingAddressCreate, opts ...Option) (*ShippingAddress, error)
	CreateShippingAddressWithContext(ctx context.Context, accountId string, body *ShippingAddressCreate, opts ...Option) (*ShippingAddress, error)

	GetShippingAddress(accountId string, shippingAddressId string, opts ...Option) (*ShippingAddress, error)
	GetShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, opts ...Option) (*ShippingAddress, error)

	UpdateShippingAddress(accountId string, shippingAddressId string, body *ShippingAddressUpdate, opts ...Option) (*ShippingAddress, error)
	UpdateShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, body *ShippingAddressUpdate, opts ...Option) (*ShippingAddress, error)

	RemoveShippingAddress(accountId string, shippingAddressId string, opts ...Option) (*Empty, error)
	RemoveShippingAddressWithContext(ctx context.Context, accountId string, shippingAddressId string, opts ...Option) (*Empty, error)

	ListAccountSubscriptions(accountId string, params *ListAccountSubscriptionsParams, opts ...Option) *SubscriptionList

	ListAccountTransactions(accountId string, params *ListAccountTransactionsParams, opts ...Option) *TransactionList

	ListChildAccounts(accountId string, params *ListChildAccountsParams, opts ...Option) *AccountList

	ListAccountAcquisition(params *ListAccountAcquisitionParams, opts ...Option) *AccountAcquisitionList

	ListCoupons(params *ListCouponsParams, opts ...Option) *CouponList

	CreateCoupon(body *CouponCreate, opts ...Option) (*Coupon, error)
	CreateCouponWithContext(ctx context.Context, body *CouponCreate, opts ...Option) (*Coupon, error)

	GetCoupon(couponId string, opts ...Option) (*Coupon, error)
	GetCouponWithContext(ctx context.Context, couponId string, opts ...Option) (*Coupon, error)

	UpdateCoupon(couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)
	UpdateCouponWithContext(ctx context.Context, couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

	DeactivateCoupon(couponId string, opts ...Option) (*Coupon, error)
	DeactivateCouponWithContext(ctx context.Context, couponId string, opts ...Option) (*Coupon, error)

	RestoreCoupon(couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)
	RestoreCouponWithContext(ctx context.Context, couponId string, body *CouponUpdate, opts ...Option) (*Coupon, error)

	ListUniqueCouponCodes(couponId string, params *ListUniqueCouponCodesParams, opts ...Option) *UniqueCouponCodeList

	ListCreditPayments(params *ListCreditPaymentsParams, opts ...Option) *CreditPaymentList

	GetCreditPayment(creditPaymentId string, opts ...Option) (*CreditPayment, error)
	GetCreditPaymentWithContext(ctx context.Context, creditPaymentId string, opts ...Option) (*CreditPayment, error)

	ListCustomFieldDefinitions(params *ListCustomFieldDefinitionsParams, opts ...Option) *CustomFieldDefinitionList

	GetCustomFieldDefinition(customFieldDefinitionId string, opts ...Option) (*CustomFieldDefinition, error)
	GetCustomFieldDefinitionWithContext(ctx context.Context, customFieldDefinitionId string, opts ...Option) (*CustomFieldDefinition, error)

	ListItems(params *ListItemsParams, opts ...Option) *ItemList

	CreateItem(body *ItemCreate, opts ...Option) (*Item, error)
	CreateItemWithContext(ctx context.Context, body *ItemCreate, opts ...Option) (*Item, error)

	GetItem(itemId string, opts ...Option) (*Item, error)
	GetItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

	UpdateItem(itemId string, body *ItemUpdate, opts ...Option) (*Item, error)
	UpdateItemWithContext(ctx context.Context, itemId string, body *ItemUpdate, opts ...Option) (*Item, error)

	DeactivateItem(itemId string, opts ...Option) (*Item, error)
	DeactivateItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

	ReactivateItem(itemId string, opts ...Option) (*Item, error)
	ReactivateItemWithContext(ctx context.Context, itemId string, opts ...Option) (*Item, error)

	ListMeasuredUnit(params *ListMeasuredUnitParams, opts ...Option) *MeasuredUnitList

	CreateMeasuredUnit(body *MeasuredUnitCreate, opts ...Option) (*MeasuredUnit, error)
	CreateMeasuredUnitWithContext(ctx context.Context, body *MeasuredUnitCreate, opts ...Option) (*MeasuredUnit, error)

	GetMeasuredUnit(measuredUnitId string, opts ...Option) (*MeasuredUnit, error)
	GetMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

	UpdateMeasuredUnit(measuredUnitId string, body *MeasuredUnitUpdate, opts ...Option) (*MeasuredUnit, error)
	UpdateMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, body *MeasuredUnitUpdate, opts ...Option) (*MeasuredUnit, error)

	RemoveMeasuredUnit(measuredUnitId string, opts ...Option) (*MeasuredUnit, error)
	RemoveMeasuredUnitWithContext(ctx context.Context, measuredUnitId string, opts ...Option) (*MeasuredUnit, error)

	ListInvoices(params *ListInvoicesParams, opts ...Option) *InvoiceList

	GetInvoice(invoiceId string, opts ...Option) (*Invoice, error)
	GetInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	PutInvoice(invoiceId string, body *InvoiceUpdatable, opts ...Option) (*Invoice, error)
	PutInvoiceWithContext(ctx context.Context, invoiceId string, body *InvoiceUpdatable, opts ...Option) (*Invoice, error)

	ApplyCreditBalance(invoiceId string, opts ...Option) (*Invoice, error)
	ApplyCreditBalanceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	CollectInvoice(invoiceId string, params *CollectInvoiceParams, opts ...Option) (*Invoice, error)
	CollectInvoiceWithContext(ctx context.Context, invoiceId string, params *CollectInvoiceParams, opts ...Option) (*Invoice, error)

	FailInvoice(invoiceId string, opts ...Option) (*Invoice, error)
	FailInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	MarkInvoiceSuccessful(invoiceId string, opts ...Option) (*Invoice, error)
	MarkInvoiceSuccessfulWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	ReopenInvoice(invoiceId string, opts ...Option) (*Invoice, error)
	ReopenInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	VoidInvoice(invoiceId string, opts ...Option) (*Invoice, error)
	VoidInvoiceWithContext(ctx context.Context, invoiceId string, opts ...Option) (*Invoice, error)

	RecordExternalTransaction(invoiceId string, body *ExternalTransaction, opts ...Option) (*Transaction, error)
	RecordExternalTransactionWithContext(ctx context.Context, invoiceId string, body *ExternalTransaction, opts ...Option) (*Transaction, error)

	ListInvoiceLineItems(invoiceId string, params *ListInvoiceLineItemsParams, opts ...Option) *LineItemList

	ListInvoiceCouponRedemptions(invoiceId string, params *ListInvoiceCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

	ListRelatedInvoices(invoiceId string, opts ...Option) *InvoiceList

	RefundInvoice(invoiceId string, body *InvoiceRefund, opts ...Option) (*Invoice, error)
	RefundInvoiceWithContext(ctx context.Context, invoiceId string, body *InvoiceRefund, opts ...Option) (*Invoice, error)

	ListLineItems(params *ListLineItemsParams, opts ...Option) *LineItemList

	GetLineItem(lineItemId string, opts ...Option) (*LineItem, error)
	GetLineItemWithContext(ctx context.Context, lineItemId string, opts ...Option) (*LineItem, error)

	RemoveLineItem(lineItemId string, opts ...Option) (*Empty, error)
	RemoveLineItemWithContext(ctx context.Context, lineItemId string, opts ...Option) (*Empty, error)

	ListPlans(params *ListPlansParams, opts ...Option) *PlanList

	CreatePlan(body *PlanCreate, opts ...Option) (*Plan, error)
	CreatePlanWithContext(ctx context.Context, body *PlanCreate, opts ...Option) (*Plan, error)

	GetPlan(planId string, opts ...Option) (*Plan, error)
	GetPlanWithContext(ctx context.Context, planId string, opts ...Option) (*Plan, error)

	UpdatePlan(planId string, body *PlanUpdate, opts ...Option) (*Plan, error)
	UpdatePlanWithContext(ctx context.Context, planId string, body *PlanUpdate, opts ...Option) (*Plan, error)

	RemovePlan(planId string, opts ...Option) (*Plan, error)
	RemovePlanWithContext(ctx context.Context, planId string, opts ...Option) (*Plan, error)

	ListPlanAddOns(planId string, params *ListPlanAddOnsParams, opts ...Option) *AddOnList

	CreatePlanAddOn(planId string, body *AddOnCreate, opts ...Option) (*AddOn, error)
	CreatePlanAddOnWithContext(ctx context.Context, planId string, body *AddOnCreate, opts ...Option) (*AddOn, error)

	GetPlanAddOn(planId string, addOnId string, opts ...Option) (*AddOn, error)
	GetPlanAddOnWithContext(ctx context.Context, planId string, addOnId string, opts ...Option) (*AddOn, error)

	UpdatePlanAddOn(planId string, addOnId string, body *AddOnUpdate, opts ...Option) (*AddOn, error)
	UpdatePlanAddOnWithContext(ctx context.Context, planId string, addOnId string, body *AddOnUpdate, opts ...Option) (*AddOn, error)

	RemovePlanAddOn(planId string, addOnId string, opts ...Option) (*AddOn, error)
	RemovePlanAddOnWithContext(ctx context.Context, planId string, addOnId string, opts ...Option) (*AddOn, error)

	ListAddOns(params *ListAddOnsParams, opts ...Option) *AddOnList

	GetAddOn(addOnId string, opts ...Option) (*AddOn, error)
	GetAddOnWithContext(ctx context.Context, addOnId string, opts ...Option) (*AddOn, error)

	ListShippingMethods(params *ListShippingMethodsParams, opts ...Option) *ShippingMethodList

	CreateShippingMethod(body *ShippingMethodCreate, opts ...Option) (*ShippingMethod, error)
	CreateShippingMethodWithContext(ctx context.Context, body *ShippingMethodCreate, opts ...Option) (*ShippingMethod, error)

	GetShippingMethod(id string, opts ...Option) (*ShippingMethod, error)
	GetShippingMethodWithContext(ctx context.Context, id string, opts ...Option) (*ShippingMethod, error)

	UpdateShippingMethod(shippingMethodId string, body *ShippingMethodUpdate, opts ...Option) (*ShippingMethod, error)
	UpdateShippingMethodWithContext(ctx context.Context, shippingMethodId string, body *ShippingMethodUpdate, opts ...Option) (*ShippingMethod, error)

	DeactivateShippingMethod(shippingMethodId string, opts ...Option) (*ShippingMethod, error)
	DeactivateShippingMethodWithContext(ctx context.Context, shippingMethodId string, opts ...Option) (*ShippingMethod, error)

	ListSubscriptions(params *ListSubscriptionsParams, opts ...Option) *SubscriptionList

	CreateSubscription(body *SubscriptionCreate, opts ...Option) (*Subscription, error)
	CreateSubscriptionWithContext(ctx context.Context, body *SubscriptionCreate, opts ...Option) (*Subscription, error)

	GetSubscription(subscriptionId string, opts ...Option) (*Subscription, error)
	GetSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

	ModifySubscription(subscriptionId string, body *SubscriptionUpdate, opts ...Option) (*Subscription, error)
	ModifySubscriptionWithContext(ctx context.Context, subscriptionId string, body *SubscriptionUpdate, opts ...Option) (*Subscription, error)

	TerminateSubscription(subscriptionId string, params *TerminateSubscriptionParams, opts ...Option) (*Subscription, error)
	TerminateSubscriptionWithContext(ctx context.Context, subscriptionId string, params *TerminateSubscriptionParams, opts ...Option) (*Subscription, error)

	CancelSubscription(subscriptionId string, params *CancelSubscriptionParams, opts ...Option) (*Subscription, error)
	CancelSubscriptionWithContext(ctx context.Context, subscriptionId string, params *CancelSubscriptionParams, opts ...Option) (*Subscription, error)

	ReactivateSubscription(subscriptionId string, opts ...Option) (*Subscription, error)
	ReactivateSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

	PauseSubscription(subscriptionId string, body *SubscriptionPause, opts ...Option) (*Subscription, error)
	PauseSubscriptionWithContext(ctx context.Context, subscriptionId string, body *SubscriptionPause, opts ...Option) (*Subscription, error)

	ResumeSubscription(subscriptionId string, opts ...Option) (*Subscription, error)
	ResumeSubscriptionWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

	ConvertTrial(subscriptionId string, opts ...Option) (*Subscription, error)
	ConvertTrialWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Subscription, error)

	GetPreviewRenewal(subscriptionId string, opts ...Option) (*InvoiceCollection, error)
	GetPreviewRenewalWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*InvoiceCollection, error)

	GetSubscriptionChange(subscriptionId string, opts ...Option) (*SubscriptionChange, error)
	GetSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*SubscriptionChange, error)

	CreateSubscriptionChange(subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChange, error)
	CreateSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChange, error)

	RemoveSubscriptionChange(subscriptionId string, opts ...Option) (*Empty, error)
	RemoveSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, opts ...Option) (*Empty, error)

	PreviewSubscriptionChange(subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChangePreview, error)
	PreviewSubscriptionChangeWithContext(ctx context.Context, subscriptionId string, body *SubscriptionChangeCreate, opts ...Option) (*SubscriptionChangePreview, error)

	ListSubscriptionInvoices(subscriptionId string, params *ListSubscriptionInvoicesParams, opts ...Option) *InvoiceList

	ListSubscriptionLineItems(subscriptionId string, params *ListSubscriptionLineItemsParams, opts ...Option) *LineItemList

	ListSubscriptionCouponRedemptions(subscriptionId string, params *ListSubscriptionCouponRedemptionsParams, opts ...Option) *CouponRedemptionList

	ListUsage(subscriptionId string, addOnId string, params *ListUsageParams, opts ...Option) *UsageList

	CreateUsage(subscriptionId string, addOnId string, body *UsageCreate, opts ...Option) (*Usage, error)
	CreateUsageWithContext(ctx context.Context, subscriptionId string, addOnId string, body *UsageCreate, opts ...Option) (*Usage, error)

	GetUsage(usageId string, opts ...Option) (*Usage, error)
	GetUsageWithContext(ctx context.Context, usageId string, opts ...Option) (*Usage, error)

	UpdateUsage(usageId string, body *UsageCreate, opts ...Option) (*Usage, error)
	UpdateUsageWithContext(ctx context.Context, usageId string, body *UsageCreate, opts ...Option) (*Usage, error)

	RemoveUsage(usageId string, opts ...Option) (*Empty, error)
	RemoveUsageWithContext(ctx context.Context, usageId string, opts ...Option) (*Empty, error)

	ListTransactions(params *ListTransactionsParams, opts ...Option) *TransactionList

	GetTransaction(transactionId string, opts ...Option) (*Transaction, error)
	GetTransactionWithContext(ctx context.Context, transactionId string, opts ...Option) (*Transaction, error)

	GetUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)
	GetUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

	DeactivateUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)
	DeactivateUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

	ReactivateUniqueCouponCode(uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)
	ReactivateUniqueCouponCodeWithContext(ctx context.Context, uniqueCouponCodeId string, opts ...Option) (*UniqueCouponCode, error)

	CreatePurchase(body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)
	CreatePurchaseWithContext(ctx context.Context, body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

	PreviewPurchase(body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)
	PreviewPurchaseWithContext(ctx context.Context, body *PurchaseCreate, opts ...Option) (*InvoiceCollection, error)

	GetExportDates(opts ...Option) (*ExportDates, error)
	GetExportDatesWithContext(ctx context.Context, opts ...Option) (*ExportDates, error)

	GetExportFiles(exportDate string, opts ...Option) (*ExportFiles, error)
	GetExportFilesWithContext(ctx context.Context, exportDate string, opts ...Option) (*ExportFiles, error)

	ListDunningCampaigns(params *ListDunningCampaignsParams, opts ...Option) *DunningCampaignList

	GetDunningCampaign(dunningCampaignId string, opts ...Option) (*DunningCampaign, error)
	GetDunningCampaignWithContext(ctx context.Context, dunningCampaignId string, opts ...Option) (*DunningCampaign, error)

	PutDunningCampaignBulkUpdate(dunningCampaignId string, body *DunningCampaignsBulkUpdate, opts ...Option) (*DunningCampaignsBulkUpdateResponse, error)
	PutDunningCampaignBulkUpdateWithContext(ctx context.Context, dunningCampaignId string, body *DunningCampaignsBulkUpdate, opts ...Option) (*DunningCampaignsBulkUpdateResponse, error)
}

type CollectInvoiceParams

type CollectInvoiceParams struct {
	Params

	// Body - The body of the request.
	Body *InvoiceCollect
}

func (*CollectInvoiceParams) URLParams added in v3.12.0

func (list *CollectInvoiceParams) URLParams() []KeyValue

type Coupon

type Coupon struct {

	// Coupon ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The code the customer enters to redeem the coupon.
	Code string `json:"code,omitempty"`

	// The internal name for the coupon.
	Name string `json:"name,omitempty"`

	// Indicates if the coupon is redeemable, and if it is not, why.
	State string `json:"state,omitempty"`

	// A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
	MaxRedemptions int `json:"max_redemptions,omitempty"`

	// Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
	MaxRedemptionsPerAccount int `json:"max_redemptions_per_account,omitempty"`

	// When this number reaches `max_redemptions` the coupon will no longer be redeemable.
	UniqueCouponCodesCount int `json:"unique_coupon_codes_count,omitempty"`

	// On a bulk coupon, the template from which unique coupon codes are generated.
	UniqueCodeTemplate string `json:"unique_code_template,omitempty"`

	// - "single_use" coupons applies to the first invoice only.
	// - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
	Duration string `json:"duration,omitempty"`

	// If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
	TemporalAmount int `json:"temporal_amount,omitempty"`

	// If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
	TemporalUnit string `json:"temporal_unit,omitempty"`

	// Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.
	FreeTrialUnit string `json:"free_trial_unit,omitempty"`

	// Sets the duration of time the `free_trial_unit` is for.
	FreeTrialAmount int `json:"free_trial_amount,omitempty"`

	// The coupon is valid for all plans if true. If false then `plans` and `plans_names` will list the applicable plans.
	AppliesToAllPlans bool `json:"applies_to_all_plans,omitempty"`

	// The coupon is valid for all items if true. If false then `items`
	// will list the applicable items.
	AppliesToAllItems bool `json:"applies_to_all_items,omitempty"`

	// The coupon is valid for one-time, non-plan charges if true.
	AppliesToNonPlanCharges bool `json:"applies_to_non_plan_charges,omitempty"`

	// A list of plan names for which this coupon applies.
	PlansNames []string `json:"plans_names,omitempty"`

	// A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`.
	Plans []PlanMini `json:"plans,omitempty"`

	// A list of items for which this coupon applies. This will be
	// `null` if `applies_to_all_items=true`.
	Items []ItemMini `json:"items,omitempty"`

	// Whether the discount is for all eligible charges on the account, or only a specific subscription.
	RedemptionResource string `json:"redemption_resource,omitempty"`

	// Details of the discount a coupon applies. Will contain a `type`
	// property and one of the following properties: `percent`, `fixed`, `trial`.
	Discount CouponDiscount `json:"discount,omitempty"`

	// Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
	CouponType string `json:"coupon_type,omitempty"`

	// This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
	HostedPageDescription string `json:"hosted_page_description,omitempty"`

	// Description of the coupon on the invoice.
	InvoiceDescription string `json:"invoice_description,omitempty"`

	// The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
	RedeemBy time.Time `json:"redeem_by,omitempty"`

	// The Coupon ID of the parent Bulk Coupon
	BulkCouponId string `json:"bulk_coupon_id,omitempty"`

	// The Coupon code of the parent Bulk Coupon
	BulkCouponCode string `json:"bulk_coupon_code,omitempty"`

	// The date and time the unique coupon code was redeemed. This is only present for bulk coupons.
	RedeemedAt time.Time `json:"redeemed_at,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// The date and time the coupon was expired early or reached its `max_redemptions`.
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Coupon) GetResponse

func (resource *Coupon) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponBulkCreate

type CouponBulkCreate struct {
	Params `json:"-"`

	// The quantity of unique coupon codes to generate
	NumberOfUniqueCodes *int `json:"number_of_unique_codes,omitempty"`
}

type CouponCreate

type CouponCreate struct {
	Params `json:"-"`

	// The internal name for the coupon.
	Name *string `json:"name,omitempty"`

	// A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
	MaxRedemptions *int `json:"max_redemptions,omitempty"`

	// Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
	MaxRedemptionsPerAccount *int `json:"max_redemptions_per_account,omitempty"`

	// This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
	HostedDescription *string `json:"hosted_description,omitempty"`

	// Description of the coupon on the invoice.
	InvoiceDescription *string `json:"invoice_description,omitempty"`

	// The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
	RedeemByDate *string `json:"redeem_by_date,omitempty"`

	// The code the customer enters to redeem the coupon.
	Code *string `json:"code,omitempty"`

	// The type of discount provided by the coupon (how the amount discounted is calculated)
	DiscountType *string `json:"discount_type,omitempty"`

	// The percent of the price discounted by the coupon.  Required if `discount_type` is `percent`.
	DiscountPercent *int `json:"discount_percent,omitempty"`

	// Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.  Required if `discount_type` is `free_trial`.
	FreeTrialUnit *string `json:"free_trial_unit,omitempty"`

	// Sets the duration of time the `free_trial_unit` is for. Required if `discount_type` is `free_trial`.
	FreeTrialAmount *int `json:"free_trial_amount,omitempty"`

	// Fixed discount currencies by currency. Required if the coupon type is `fixed`. This parameter should contain the coupon discount values
	Currencies []CouponPricing `json:"currencies,omitempty"`

	// The coupon is valid for one-time, non-plan charges if true.
	AppliesToNonPlanCharges *bool `json:"applies_to_non_plan_charges,omitempty"`

	// The coupon is valid for all plans if true. If false then
	// `plans` and `plans_names` will list the applicable plans.
	AppliesToAllPlans *bool `json:"applies_to_all_plans,omitempty"`

	// To apply coupon to Items in your Catalog, include a list
	// of `item_codes` in the request that the coupon will apply to. Or set value
	// to true to apply to all Items in your Catalog. The following values
	// are not permitted when `applies_to_all_items` is included: `free_trial_amount`
	// and `free_trial_unit`.
	AppliesToAllItems *bool `json:"applies_to_all_items,omitempty"`

	// List of plan codes to which this coupon applies. Required
	// if `applies_to_all_plans` is false. Overrides `applies_to_all_plans`
	// when `applies_to_all_plans` is true.
	PlanCodes []string `json:"plan_codes,omitempty"`

	// List of item codes to which this coupon applies. Sending
	// `item_codes` is only permitted when `applies_to_all_items` is set to false.
	// The following values are not permitted when `item_codes` is included:
	// `free_trial_amount` and `free_trial_unit`.
	ItemCodes []string `json:"item_codes,omitempty"`

	// This field does not apply when the discount_type is `free_trial`.
	// - "single_use" coupons applies to the first invoice only.
	// - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
	// - "forever" coupons will apply to invoices forever.
	Duration *string `json:"duration,omitempty"`

	// If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
	TemporalAmount *int `json:"temporal_amount,omitempty"`

	// If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
	TemporalUnit *string `json:"temporal_unit,omitempty"`

	// Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
	CouponType *string `json:"coupon_type,omitempty"`

	// On a bulk coupon, the template from which unique coupon codes are generated.
	// - You must start the template with your coupon_code wrapped in single quotes.
	// - Outside of single quotes, use a 9 for a character that you want to be a random number.
	// - Outside of single quotes, use an "x" for a character that you want to be a random letter.
	// - Outside of single quotes, use an * for a character that you want to be a random number or letter.
	// - Use single quotes ' ' for characters that you want to remain static. These strings can be alphanumeric and may contain a - _ or +.
	// For example: "'abc-'****'-def'"
	UniqueCodeTemplate *string `json:"unique_code_template,omitempty"`

	// Whether the discount is for all eligible charges on the account, or only a specific subscription.
	RedemptionResource *string `json:"redemption_resource,omitempty"`
}

type CouponDiscount

type CouponDiscount struct {
	Type string `json:"type,omitempty"`

	// This is only present when `type=percent`.
	Percent int `json:"percent,omitempty"`

	// This is only present when `type=fixed`.
	Currencies []CouponDiscountPricing `json:"currencies,omitempty"`

	// This is only present when `type=free_trial`.
	Trial CouponDiscountTrial `json:"trial,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponDiscount) GetResponse

func (resource *CouponDiscount) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponDiscountList

type CouponDiscountList struct {
	HasMore bool
	Data    []CouponDiscount
	// contains filtered or unexported fields
}

CouponDiscountList allows you to paginate CouponDiscount objects

func NewCouponDiscountList added in v3.6.0

func NewCouponDiscountList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponDiscountList

func (*CouponDiscountList) Count

func (list *CouponDiscountList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountList) CountWithContext added in v3.12.0

func (list *CouponDiscountList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountList) Fetch

func (list *CouponDiscountList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponDiscountList) FetchWithContext added in v3.12.0

func (list *CouponDiscountList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponDiscountPricing

type CouponDiscountPricing struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Value of the fixed discount that this coupon applies.
	Amount float64 `json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponDiscountPricing) GetResponse

func (resource *CouponDiscountPricing) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponDiscountPricingList

type CouponDiscountPricingList struct {
	HasMore bool
	Data    []CouponDiscountPricing
	// contains filtered or unexported fields
}

CouponDiscountPricingList allows you to paginate CouponDiscountPricing objects

func NewCouponDiscountPricingList added in v3.6.0

func NewCouponDiscountPricingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponDiscountPricingList

func (*CouponDiscountPricingList) Count

func (list *CouponDiscountPricingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountPricingList) CountWithContext added in v3.12.0

func (list *CouponDiscountPricingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountPricingList) Fetch

func (list *CouponDiscountPricingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponDiscountPricingList) FetchWithContext added in v3.12.0

func (list *CouponDiscountPricingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponDiscountTrial

type CouponDiscountTrial struct {

	// Temporal unit of the free trial
	Unit string `json:"unit,omitempty"`

	// Trial length measured in the units specified by the sibling `unit` property
	Length int `json:"length,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponDiscountTrial) GetResponse

func (resource *CouponDiscountTrial) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponDiscountTrialList

type CouponDiscountTrialList struct {
	HasMore bool
	Data    []CouponDiscountTrial
	// contains filtered or unexported fields
}

CouponDiscountTrialList allows you to paginate CouponDiscountTrial objects

func NewCouponDiscountTrialList added in v3.6.0

func NewCouponDiscountTrialList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponDiscountTrialList

func (*CouponDiscountTrialList) Count

func (list *CouponDiscountTrialList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountTrialList) CountWithContext added in v3.12.0

func (list *CouponDiscountTrialList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponDiscountTrialList) Fetch

func (list *CouponDiscountTrialList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponDiscountTrialList) FetchWithContext added in v3.12.0

func (list *CouponDiscountTrialList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponList

type CouponList struct {
	HasMore bool
	Data    []Coupon
	// contains filtered or unexported fields
}

CouponList allows you to paginate Coupon objects

func NewCouponList added in v3.6.0

func NewCouponList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponList

func (*CouponList) Count

func (list *CouponList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponList) CountWithContext added in v3.12.0

func (list *CouponList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponList) Fetch

func (list *CouponList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponList) FetchWithContext added in v3.12.0

func (list *CouponList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponMini

type CouponMini struct {

	// Coupon ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The code the customer enters to redeem the coupon.
	Code string `json:"code,omitempty"`

	// The internal name for the coupon.
	Name string `json:"name,omitempty"`

	// Indicates if the coupon is redeemable, and if it is not, why.
	State string `json:"state,omitempty"`

	// Details of the discount a coupon applies. Will contain a `type`
	// property and one of the following properties: `percent`, `fixed`, `trial`.
	Discount CouponDiscount `json:"discount,omitempty"`

	// Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
	CouponType string `json:"coupon_type,omitempty"`

	// The date and time the coupon was expired early or reached its `max_redemptions`.
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponMini) GetResponse

func (resource *CouponMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponMiniList

type CouponMiniList struct {
	HasMore bool
	Data    []CouponMini
	// contains filtered or unexported fields
}

CouponMiniList allows you to paginate CouponMini objects

func NewCouponMiniList added in v3.6.0

func NewCouponMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponMiniList

func (*CouponMiniList) Count

func (list *CouponMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponMiniList) CountWithContext added in v3.12.0

func (list *CouponMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponMiniList) Fetch

func (list *CouponMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponMiniList) FetchWithContext added in v3.12.0

func (list *CouponMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponPricing

type CouponPricing struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// The fixed discount (in dollars) for the corresponding currency.
	Discount *float64 `json:"discount,omitempty"`
}

type CouponRedemption

type CouponRedemption struct {

	// Coupon Redemption ID
	Id string `json:"id,omitempty"`

	// Will always be `coupon`.
	Object string `json:"object,omitempty"`

	// The Account on which the coupon was applied.
	Account AccountMini `json:"account,omitempty"`

	// Subscription ID
	SubscriptionId string `json:"subscription_id,omitempty"`

	Coupon Coupon `json:"coupon,omitempty"`

	// Coupon Redemption state
	State string `json:"state,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// The amount that was discounted upon the application of the coupon, formatted with the currency.
	Discounted float64 `json:"discounted,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// The date and time the redemption was removed from the account (un-redeemed).
	RemovedAt time.Time `json:"removed_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponRedemption) GetResponse

func (resource *CouponRedemption) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponRedemptionCreate

type CouponRedemptionCreate struct {
	Params `json:"-"`

	// Coupon ID
	CouponId *string `json:"coupon_id,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Subscription ID
	SubscriptionId *string `json:"subscription_id,omitempty"`
}

type CouponRedemptionList

type CouponRedemptionList struct {
	HasMore bool
	Data    []CouponRedemption
	// contains filtered or unexported fields
}

CouponRedemptionList allows you to paginate CouponRedemption objects

func NewCouponRedemptionList added in v3.6.0

func NewCouponRedemptionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponRedemptionList

func (*CouponRedemptionList) Count

func (list *CouponRedemptionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponRedemptionList) CountWithContext added in v3.12.0

func (list *CouponRedemptionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponRedemptionList) Fetch

func (list *CouponRedemptionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponRedemptionList) FetchWithContext added in v3.12.0

func (list *CouponRedemptionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponRedemptionMini

type CouponRedemptionMini struct {

	// Coupon Redemption ID
	Id string `json:"id,omitempty"`

	// Will always be `coupon`.
	Object string `json:"object,omitempty"`

	Coupon CouponMini `json:"coupon,omitempty"`

	// Invoice state
	State string `json:"state,omitempty"`

	// The amount that was discounted upon the application of the coupon, formatted with the currency.
	Discounted float64 `json:"discounted,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CouponRedemptionMini) GetResponse

func (resource *CouponRedemptionMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CouponRedemptionMiniList

type CouponRedemptionMiniList struct {
	HasMore bool
	Data    []CouponRedemptionMini
	// contains filtered or unexported fields
}

CouponRedemptionMiniList allows you to paginate CouponRedemptionMini objects

func NewCouponRedemptionMiniList added in v3.6.0

func NewCouponRedemptionMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CouponRedemptionMiniList

func (*CouponRedemptionMiniList) Count

func (list *CouponRedemptionMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponRedemptionMiniList) CountWithContext added in v3.12.0

func (list *CouponRedemptionMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CouponRedemptionMiniList) Fetch

func (list *CouponRedemptionMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CouponRedemptionMiniList) FetchWithContext added in v3.12.0

func (list *CouponRedemptionMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CouponUpdate

type CouponUpdate struct {
	Params `json:"-"`

	// The internal name for the coupon.
	Name *string `json:"name,omitempty"`

	// A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
	MaxRedemptions *int `json:"max_redemptions,omitempty"`

	// Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
	MaxRedemptionsPerAccount *int `json:"max_redemptions_per_account,omitempty"`

	// This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
	HostedDescription *string `json:"hosted_description,omitempty"`

	// Description of the coupon on the invoice.
	InvoiceDescription *string `json:"invoice_description,omitempty"`

	// The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
	RedeemByDate *string `json:"redeem_by_date,omitempty"`
}

type CreditPayment

type CreditPayment struct {

	// Credit Payment ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
	Uuid string `json:"uuid,omitempty"`

	// The action for which the credit was created.
	Action string `json:"action,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// Invoice mini details
	AppliedToInvoice InvoiceMini `json:"applied_to_invoice,omitempty"`

	// Invoice mini details
	OriginalInvoice InvoiceMini `json:"original_invoice,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Total credit payment amount applied to the charge invoice.
	Amount float64 `json:"amount,omitempty"`

	// For credit payments with action `refund`, this is the credit payment that was refunded.
	OriginalCreditPaymentId string `json:"original_credit_payment_id,omitempty"`

	RefundTransaction Transaction `json:"refund_transaction,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Voided at
	VoidedAt time.Time `json:"voided_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CreditPayment) GetResponse

func (resource *CreditPayment) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CreditPaymentList

type CreditPaymentList struct {
	HasMore bool
	Data    []CreditPayment
	// contains filtered or unexported fields
}

CreditPaymentList allows you to paginate CreditPayment objects

func NewCreditPaymentList added in v3.6.0

func NewCreditPaymentList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CreditPaymentList

func (*CreditPaymentList) Count

func (list *CreditPaymentList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CreditPaymentList) CountWithContext added in v3.12.0

func (list *CreditPaymentList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CreditPaymentList) Fetch

func (list *CreditPaymentList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CreditPaymentList) FetchWithContext added in v3.12.0

func (list *CreditPaymentList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CustomField

type CustomField struct {

	// Fields must be created in the UI before values can be assigned to them.
	Name string `json:"name,omitempty"`

	// Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
	Value string `json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*CustomField) GetResponse

func (resource *CustomField) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CustomFieldCreate

type CustomFieldCreate struct {
	Params `json:"-"`

	// Fields must be created in the UI before values can be assigned to them.
	Name *string `json:"name,omitempty"`

	// Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
	Value *string `json:"value,omitempty"`
}

type CustomFieldDefinition

type CustomFieldDefinition struct {

	// Custom field definition ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Related Recurly object type
	RelatedType string `json:"related_type,omitempty"`

	// Used by the API to identify the field or reading and writing. The name can only be used once per Recurly object type.
	Name string `json:"name,omitempty"`

	// The access control applied inside Recurly's admin UI:
	// - `api_only` - No one will be able to view or edit this field's data via the admin UI.
	// - `read_only` - Users with the Customers role will be able to view this field's data via the admin UI, but
	//   editing will only be available via the API.
	// - `write` - Users with the Customers role will be able to view and edit this field's data via the admin UI.
	// - `set_only` - Users with the Customers role will be able to set this field's data via the admin console.
	UserAccess string `json:"user_access,omitempty"`

	// Used to label the field when viewing and editing the field in Recurly's admin UI.
	DisplayName string `json:"display_name,omitempty"`

	// Displayed as a tooltip when editing the field in the Recurly admin UI.
	Tooltip string `json:"tooltip,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Definitions are initially soft deleted, and once all the values are removed from the accouts or subscriptions, will be hard deleted an no longer visible.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CustomFieldDefinition) GetResponse

func (resource *CustomFieldDefinition) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type CustomFieldDefinitionList

type CustomFieldDefinitionList struct {
	HasMore bool
	Data    []CustomFieldDefinition
	// contains filtered or unexported fields
}

CustomFieldDefinitionList allows you to paginate CustomFieldDefinition objects

func NewCustomFieldDefinitionList added in v3.6.0

func NewCustomFieldDefinitionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CustomFieldDefinitionList

func (*CustomFieldDefinitionList) Count

func (list *CustomFieldDefinitionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CustomFieldDefinitionList) CountWithContext added in v3.12.0

func (list *CustomFieldDefinitionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CustomFieldDefinitionList) Fetch

func (list *CustomFieldDefinitionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CustomFieldDefinitionList) FetchWithContext added in v3.12.0

func (list *CustomFieldDefinitionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type CustomFieldList

type CustomFieldList struct {
	HasMore bool
	Data    []CustomField
	// contains filtered or unexported fields
}

CustomFieldList allows you to paginate CustomField objects

func NewCustomFieldList added in v3.6.0

func NewCustomFieldList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *CustomFieldList

func (*CustomFieldList) Count

func (list *CustomFieldList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*CustomFieldList) CountWithContext added in v3.12.0

func (list *CustomFieldList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*CustomFieldList) Fetch

func (list *CustomFieldList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*CustomFieldList) FetchWithContext added in v3.12.0

func (list *CustomFieldList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type DunningCampaign added in v3.14.0

type DunningCampaign struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Campaign code.
	Code string `json:"code,omitempty"`

	// Campaign name.
	Name string `json:"name,omitempty"`

	// Campaign description.
	Description string `json:"description,omitempty"`

	// Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign.
	DefaultCampaign bool `json:"default_campaign,omitempty"`

	// Dunning Cycle settings.
	DunningCycles []DunningCycle `json:"dunning_cycles,omitempty"`

	// When the current campaign was created in Recurly.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the current campaign was updated in Recurly.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// When the current campaign was deleted in Recurly.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*DunningCampaign) GetResponse added in v3.14.0

func (resource *DunningCampaign) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type DunningCampaignList added in v3.14.0

type DunningCampaignList struct {
	HasMore bool
	Data    []DunningCampaign
	// contains filtered or unexported fields
}

DunningCampaignList allows you to paginate DunningCampaign objects

func NewDunningCampaignList added in v3.14.0

func NewDunningCampaignList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *DunningCampaignList

func (*DunningCampaignList) Count added in v3.14.0

func (list *DunningCampaignList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningCampaignList) CountWithContext added in v3.14.0

func (list *DunningCampaignList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningCampaignList) Fetch added in v3.14.0

func (list *DunningCampaignList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*DunningCampaignList) FetchWithContext added in v3.14.0

func (list *DunningCampaignList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type DunningCampaignsBulkUpdate added in v3.14.0

type DunningCampaignsBulkUpdate struct {
	Params `json:"-"`

	// List of `plan_codes` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_ids` is present.
	PlanCodes []string `json:"plan_codes,omitempty"`

	// List of `plan_ids` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_codes` is present.
	PlanIds []string `json:"plan_ids,omitempty"`
}

type DunningCampaignsBulkUpdateResponse added in v3.14.0

type DunningCampaignsBulkUpdateResponse struct {

	// Object type
	Object string `json:"object,omitempty"`

	// An array containing all of the `Plan` resources that have been updated.
	Plans []Plan `json:"plans,omitempty"`
	// contains filtered or unexported fields
}

func (*DunningCampaignsBulkUpdateResponse) GetResponse added in v3.14.0

func (resource *DunningCampaignsBulkUpdateResponse) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type DunningCampaignsBulkUpdateResponseList added in v3.14.0

type DunningCampaignsBulkUpdateResponseList struct {
	HasMore bool
	Data    []DunningCampaignsBulkUpdateResponse
	// contains filtered or unexported fields
}

DunningCampaignsBulkUpdateResponseList allows you to paginate DunningCampaignsBulkUpdateResponse objects

func NewDunningCampaignsBulkUpdateResponseList added in v3.14.0

func NewDunningCampaignsBulkUpdateResponseList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *DunningCampaignsBulkUpdateResponseList

func (*DunningCampaignsBulkUpdateResponseList) Count added in v3.14.0

Count returns the count of items on the server that match this pager

func (*DunningCampaignsBulkUpdateResponseList) CountWithContext added in v3.14.0

func (list *DunningCampaignsBulkUpdateResponseList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningCampaignsBulkUpdateResponseList) Fetch added in v3.14.0

Fetch fetches the next page of data into the `Data` property

func (*DunningCampaignsBulkUpdateResponseList) FetchWithContext added in v3.14.0

func (list *DunningCampaignsBulkUpdateResponseList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type DunningCycle added in v3.14.0

type DunningCycle struct {

	// The type of invoice this cycle applies to.
	Type string `json:"type,omitempty"`

	// Whether the dunning settings will be applied to manual trials. Only applies to trial cycles.
	AppliesToManualTrial bool `json:"applies_to_manual_trial,omitempty"`

	// The number of days after a transaction failure before the first dunning email is sent.
	FirstCommunicationInterval int `json:"first_communication_interval,omitempty"`

	// Whether or not to send an extra email immediately to customers whose initial payment attempt fails with either a hard decline or invalid billing info.
	SendImmediatelyOnHardDecline bool `json:"send_immediately_on_hard_decline,omitempty"`

	// Dunning intervals.
	Intervals []DunningInterval `json:"intervals,omitempty"`

	// Whether the subscription(s) should be cancelled at the end of the dunning cycle.
	ExpireSubscription bool `json:"expire_subscription,omitempty"`

	// Whether the invoice should be failed at the end of the dunning cycle.
	FailInvoice bool `json:"fail_invoice,omitempty"`

	// The number of days between the first dunning email being sent and the end of the dunning cycle.
	TotalDunningDays int `json:"total_dunning_days,omitempty"`

	// The number of days between a transaction failure and the end of the dunning cycle.
	TotalRecyclingDays int `json:"total_recycling_days,omitempty"`

	// Current campaign version.
	Version int `json:"version,omitempty"`

	// When the current settings were created in Recurly.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the current settings were updated in Recurly.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*DunningCycle) GetResponse added in v3.14.0

func (resource *DunningCycle) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type DunningCycleList added in v3.14.0

type DunningCycleList struct {
	HasMore bool
	Data    []DunningCycle
	// contains filtered or unexported fields
}

DunningCycleList allows you to paginate DunningCycle objects

func NewDunningCycleList added in v3.14.0

func NewDunningCycleList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *DunningCycleList

func (*DunningCycleList) Count added in v3.14.0

func (list *DunningCycleList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningCycleList) CountWithContext added in v3.14.0

func (list *DunningCycleList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningCycleList) Fetch added in v3.14.0

func (list *DunningCycleList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*DunningCycleList) FetchWithContext added in v3.14.0

func (list *DunningCycleList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type DunningInterval added in v3.14.0

type DunningInterval struct {

	// Number of days before sending the next email.
	Days int `json:"days,omitempty"`

	// Email template being used.
	EmailTemplate string `json:"email_template,omitempty"`
	// contains filtered or unexported fields
}

func (*DunningInterval) GetResponse added in v3.14.0

func (resource *DunningInterval) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type DunningIntervalList added in v3.14.0

type DunningIntervalList struct {
	HasMore bool
	Data    []DunningInterval
	// contains filtered or unexported fields
}

DunningIntervalList allows you to paginate DunningInterval objects

func NewDunningIntervalList added in v3.14.0

func NewDunningIntervalList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *DunningIntervalList

func (*DunningIntervalList) Count added in v3.14.0

func (list *DunningIntervalList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningIntervalList) CountWithContext added in v3.14.0

func (list *DunningIntervalList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*DunningIntervalList) Fetch added in v3.14.0

func (list *DunningIntervalList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*DunningIntervalList) FetchWithContext added in v3.14.0

func (list *DunningIntervalList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) GetResponse

func (resource *Empty) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type Error

type Error struct {
	Message          string
	Class            ErrorClass
	Type             ErrorType
	Params           []ErrorParam
	TransactionError *TransactionError
	// contains filtered or unexported fields
}

Error contains basic information about the error

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetResponse

func (resource *Error) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this error

type ErrorClass

type ErrorClass string

type ErrorMayHaveTransaction

type ErrorMayHaveTransaction struct {

	// Type
	Type string `json:"type,omitempty"`

	// Message
	Message string `json:"message,omitempty"`

	// Parameter specific errors
	Params []map[string]interface{} `json:"params,omitempty"`

	// This is only included on errors with `type=transaction`.
	TransactionError TransactionError `json:"transaction_error,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorMayHaveTransaction) GetResponse

func (resource *ErrorMayHaveTransaction) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ErrorMayHaveTransactionList

type ErrorMayHaveTransactionList struct {
	HasMore bool
	Data    []ErrorMayHaveTransaction
	// contains filtered or unexported fields
}

ErrorMayHaveTransactionList allows you to paginate ErrorMayHaveTransaction objects

func NewErrorMayHaveTransactionList added in v3.6.0

func NewErrorMayHaveTransactionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ErrorMayHaveTransactionList

func (*ErrorMayHaveTransactionList) Count

func (list *ErrorMayHaveTransactionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ErrorMayHaveTransactionList) CountWithContext added in v3.12.0

func (list *ErrorMayHaveTransactionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ErrorMayHaveTransactionList) Fetch

func (list *ErrorMayHaveTransactionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ErrorMayHaveTransactionList) FetchWithContext added in v3.12.0

func (list *ErrorMayHaveTransactionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ErrorParam

type ErrorParam struct {
	Property string `json:"param"`
	Message  string `json:"message"`
}

type ErrorType

type ErrorType string

func ErrorFromStatusCode added in v3.10.0

func ErrorFromStatusCode(res *http.Response) ErrorType

type ExportDates added in v3.8.0

type ExportDates struct {

	// Object type
	Object string `json:"object,omitempty"`

	// An array of dates that have available exports.
	Dates []string `json:"dates,omitempty"`
	// contains filtered or unexported fields
}

func (*ExportDates) GetResponse added in v3.8.0

func (resource *ExportDates) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ExportDatesList added in v3.8.0

type ExportDatesList struct {
	HasMore bool
	Data    []ExportDates
	// contains filtered or unexported fields
}

ExportDatesList allows you to paginate ExportDates objects

func NewExportDatesList added in v3.8.0

func NewExportDatesList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ExportDatesList

func (*ExportDatesList) Count added in v3.8.0

func (list *ExportDatesList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportDatesList) CountWithContext added in v3.12.0

func (list *ExportDatesList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportDatesList) Fetch added in v3.8.0

func (list *ExportDatesList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ExportDatesList) FetchWithContext added in v3.12.0

func (list *ExportDatesList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ExportFile added in v3.8.0

type ExportFile struct {

	// Name of the export file.
	Name string `json:"name,omitempty"`

	// MD5 hash of the export file.
	Md5sum string `json:"md5sum,omitempty"`

	// A presigned link to download the export file.
	Href string `json:"href,omitempty"`
	// contains filtered or unexported fields
}

func (*ExportFile) GetResponse added in v3.8.0

func (resource *ExportFile) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ExportFileList added in v3.8.0

type ExportFileList struct {
	HasMore bool
	Data    []ExportFile
	// contains filtered or unexported fields
}

ExportFileList allows you to paginate ExportFile objects

func NewExportFileList added in v3.8.0

func NewExportFileList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ExportFileList

func (*ExportFileList) Count added in v3.8.0

func (list *ExportFileList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportFileList) CountWithContext added in v3.12.0

func (list *ExportFileList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportFileList) Fetch added in v3.8.0

func (list *ExportFileList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ExportFileList) FetchWithContext added in v3.12.0

func (list *ExportFileList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ExportFiles added in v3.8.0

type ExportFiles struct {

	// Object type
	Object string `json:"object,omitempty"`

	Files []ExportFile `json:"files,omitempty"`
	// contains filtered or unexported fields
}

func (*ExportFiles) GetResponse added in v3.8.0

func (resource *ExportFiles) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ExportFilesList added in v3.8.0

type ExportFilesList struct {
	HasMore bool
	Data    []ExportFiles
	// contains filtered or unexported fields
}

ExportFilesList allows you to paginate ExportFiles objects

func NewExportFilesList added in v3.8.0

func NewExportFilesList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ExportFilesList

func (*ExportFilesList) Count added in v3.8.0

func (list *ExportFilesList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportFilesList) CountWithContext added in v3.12.0

func (list *ExportFilesList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ExportFilesList) Fetch added in v3.8.0

func (list *ExportFilesList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ExportFilesList) FetchWithContext added in v3.12.0

func (list *ExportFilesList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ExternalRefund

type ExternalRefund struct {
	Params `json:"-"`

	// Payment method used for external refund transaction.
	PaymentMethod *string `json:"payment_method,omitempty"`

	// Used as the refund transactions' description.
	Description *string `json:"description,omitempty"`

	// Date the external refund payment was made. Defaults to the current date-time.
	RefundedAt *time.Time `json:"refunded_at,omitempty"`
}

type ExternalTransaction added in v3.1.0

type ExternalTransaction struct {
	Params `json:"-"`

	// Payment method used for the external transaction.
	PaymentMethod *string `json:"payment_method,omitempty"`

	// Used as the transaction's description.
	Description *string `json:"description,omitempty"`

	// The total amount of the transcaction. Cannot excceed the invoice total.
	Amount *float64 `json:"amount,omitempty"`

	// Datetime that the external payment was collected. Defaults to current datetime.
	CollectedAt *time.Time `json:"collected_at,omitempty"`
}

type FraudInfo

type FraudInfo struct {

	// Kount score
	Score int `json:"score,omitempty"`

	// Kount decision
	Decision string `json:"decision,omitempty"`

	// Kount rules
	RiskRulesTriggered map[string]interface{} `json:"risk_rules_triggered,omitempty"`
	// contains filtered or unexported fields
}

func (*FraudInfo) GetResponse

func (resource *FraudInfo) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type FraudInfoList

type FraudInfoList struct {
	HasMore bool
	Data    []FraudInfo
	// contains filtered or unexported fields
}

FraudInfoList allows you to paginate FraudInfo objects

func NewFraudInfoList added in v3.6.0

func NewFraudInfoList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *FraudInfoList

func (*FraudInfoList) Count

func (list *FraudInfoList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*FraudInfoList) CountWithContext added in v3.12.0

func (list *FraudInfoList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*FraudInfoList) Fetch

func (list *FraudInfoList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*FraudInfoList) FetchWithContext added in v3.12.0

func (list *FraudInfoList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type GatewayAttributes added in v3.23.0

type GatewayAttributes struct {

	// Used by Adyen and Braintree gateways. For Adyen the Shopper Reference value used when the external token was created. For Braintree the PayPal PayerID is populated in the response.
	AccountReference string `json:"account_reference,omitempty"`
	// contains filtered or unexported fields
}

func (*GatewayAttributes) GetResponse added in v3.23.0

func (resource *GatewayAttributes) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type GatewayAttributesCreate added in v3.23.0

type GatewayAttributesCreate struct {
	Params `json:"-"`

	// Used by Adyen and Braintree gateways. For Adyen The Shopper Reference value used when the external token was created. Must be used in conjunction with gateway_token and gateway_code. For Braintree the PayPal PayerID is populated in the response.
	AccountReference *string `json:"account_reference,omitempty"`
}

type GatewayAttributesList added in v3.23.0

type GatewayAttributesList struct {
	HasMore bool
	Data    []GatewayAttributes
	// contains filtered or unexported fields
}

GatewayAttributesList allows you to paginate GatewayAttributes objects

func NewGatewayAttributesList added in v3.23.0

func NewGatewayAttributesList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *GatewayAttributesList

func (*GatewayAttributesList) Count added in v3.23.0

func (list *GatewayAttributesList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*GatewayAttributesList) CountWithContext added in v3.23.0

func (list *GatewayAttributesList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*GatewayAttributesList) Fetch added in v3.23.0

func (list *GatewayAttributesList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*GatewayAttributesList) FetchWithContext added in v3.23.0

func (list *GatewayAttributesList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type GenericParams

type GenericParams interface {
	// contains filtered or unexported methods
}

type HTTPCaller added in v3.12.0

type HTTPCaller interface {
	Call(ctx context.Context, method string, path string, body GenericParams, queryParams GenericParams, requestOptions OptionsApplier, v interface{}) error
}

HTTPCaller is the generic http interface used by the Client

type Invoice

type Invoice struct {

	// Invoice ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Invoices are either charge, credit, or legacy invoices.
	Type string `json:"type,omitempty"`

	// The event that created the invoice.
	Origin string `json:"origin,omitempty"`

	// Invoice state
	State string `json:"state,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
	BillingInfoId string `json:"billing_info_id,omitempty"`

	// If the invoice is charging or refunding for one or more subscriptions, these are their IDs.
	SubscriptionIds []string `json:"subscription_ids,omitempty"`

	// On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed) feature enabled. Sites with Only Bill What Changed enabled should use the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices) to see purchase invoices refunded by this invoice.
	PreviousInvoiceId string `json:"previous_invoice_id,omitempty"`

	// If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
	Number string `json:"number,omitempty"`

	// An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
	CollectionMethod string `json:"collection_method,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms int `json:"net_terms,omitempty"`

	Address InvoiceAddress `json:"address,omitempty"`

	ShippingAddress ShippingAddress `json:"shipping_address,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Total discounts applied to this invoice.
	Discount float64 `json:"discount,omitempty"`

	// The summation of charges and credits, before discounts and taxes.
	Subtotal float64 `json:"subtotal,omitempty"`

	// The total tax on this invoice.
	Tax float64 `json:"tax,omitempty"`

	// The final total on this invoice. The summation of invoice charges, discounts, credits, and tax.
	Total float64 `json:"total,omitempty"`

	// The refundable amount on a charge invoice. It will be null for all other invoices.
	RefundableAmount float64 `json:"refundable_amount,omitempty"`

	// The total amount of successful payments transaction on this invoice.
	Paid float64 `json:"paid,omitempty"`

	// The outstanding balance remaining on this invoice.
	Balance float64 `json:"balance,omitempty"`

	// Tax info
	TaxInfo TaxInfo `json:"tax_info,omitempty"`

	// Will be `true` when the invoice had a successful response from the tax service and `false` when the invoice was not sent to tax service due to a lack of address or enabled jurisdiction or was processed without tax due to a non-blocking error returned from the tax service.
	UsedTaxService bool `json:"used_tax_service,omitempty"`

	// VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method.
	VatNumber string `json:"vat_number,omitempty"`

	// VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
	VatReverseChargeNotes string `json:"vat_reverse_charge_notes,omitempty"`

	// This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
	TermsAndConditions string `json:"terms_and_conditions,omitempty"`

	// This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes.
	CustomerNotes string `json:"customer_notes,omitempty"`

	LineItems LineItemList `json:"line_items,omitempty"`

	// Transactions
	Transactions []Transaction `json:"transactions,omitempty"`

	// Credit payments
	CreditPayments []CreditPayment `json:"credit_payments,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Date invoice is due. This is the date the net terms are reached.
	DueAt time.Time `json:"due_at,omitempty"`

	// Date invoice was marked paid or failed.
	ClosedAt time.Time `json:"closed_at,omitempty"`

	// Unique ID to identify the dunning campaign used when dunning the invoice. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign.
	DunningCampaignId string `json:"dunning_campaign_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Invoice) GetResponse

func (resource *Invoice) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type InvoiceAddress

type InvoiceAddress struct {

	// Name on account
	NameOnAccount string `json:"name_on_account,omitempty"`

	// Company
	Company string `json:"company,omitempty"`

	// First name
	FirstName string `json:"first_name,omitempty"`

	// Last name
	LastName string `json:"last_name,omitempty"`

	// Phone number
	Phone string `json:"phone,omitempty"`

	// Street 1
	Street1 string `json:"street1,omitempty"`

	// Street 2
	Street2 string `json:"street2,omitempty"`

	// City
	City string `json:"city,omitempty"`

	// State or province.
	Region string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode string `json:"geo_code,omitempty"`
	// contains filtered or unexported fields
}

func (*InvoiceAddress) GetResponse

func (resource *InvoiceAddress) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type InvoiceAddressCreate

type InvoiceAddressCreate struct {
	Params `json:"-"`

	// Name on account
	NameOnAccount *string `json:"name_on_account,omitempty"`

	// Company
	Company *string `json:"company,omitempty"`

	// First name
	FirstName *string `json:"first_name,omitempty"`

	// Last name
	LastName *string `json:"last_name,omitempty"`

	// Phone number
	Phone *string `json:"phone,omitempty"`

	// Street 1
	Street1 *string `json:"street1,omitempty"`

	// Street 2
	Street2 *string `json:"street2,omitempty"`

	// City
	City *string `json:"city,omitempty"`

	// State or province.
	Region *string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode *string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country *string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode *string `json:"geo_code,omitempty"`
}

type InvoiceAddressList

type InvoiceAddressList struct {
	HasMore bool
	Data    []InvoiceAddress
	// contains filtered or unexported fields
}

InvoiceAddressList allows you to paginate InvoiceAddress objects

func NewInvoiceAddressList added in v3.6.0

func NewInvoiceAddressList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *InvoiceAddressList

func (*InvoiceAddressList) Count

func (list *InvoiceAddressList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceAddressList) CountWithContext added in v3.12.0

func (list *InvoiceAddressList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceAddressList) Fetch

func (list *InvoiceAddressList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*InvoiceAddressList) FetchWithContext added in v3.12.0

func (list *InvoiceAddressList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type InvoiceCollect

type InvoiceCollect struct {
	Params `json:"-"`

	// A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
	ThreeDSecureActionResultTokenId *string `json:"three_d_secure_action_result_token_id,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	// The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
	BillingInfoId *string `json:"billing_info_id,omitempty"`
}

type InvoiceCollection

type InvoiceCollection struct {

	// Object type
	Object string `json:"object,omitempty"`

	ChargeInvoice Invoice `json:"charge_invoice,omitempty"`

	// Credit invoices
	CreditInvoices []Invoice `json:"credit_invoices,omitempty"`
	// contains filtered or unexported fields
}

func (*InvoiceCollection) GetResponse

func (resource *InvoiceCollection) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type InvoiceCollectionList

type InvoiceCollectionList struct {
	HasMore bool
	Data    []InvoiceCollection
	// contains filtered or unexported fields
}

InvoiceCollectionList allows you to paginate InvoiceCollection objects

func NewInvoiceCollectionList added in v3.6.0

func NewInvoiceCollectionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *InvoiceCollectionList

func (*InvoiceCollectionList) Count

func (list *InvoiceCollectionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceCollectionList) CountWithContext added in v3.12.0

func (list *InvoiceCollectionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceCollectionList) Fetch

func (list *InvoiceCollectionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*InvoiceCollectionList) FetchWithContext added in v3.12.0

func (list *InvoiceCollectionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type InvoiceCreate

type InvoiceCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
	CollectionMethod *string `json:"collection_method,omitempty"`

	// This will default to the Customer Notes text specified on the Invoice Settings for charge invoices. Specify custom notes to add or override Customer Notes on charge invoices.
	ChargeCustomerNotes *string `json:"charge_customer_notes,omitempty"`

	// This will default to the Customer Notes text specified on the Invoice Settings for credit invoices. Specify customer notes to add or override Customer Notes on credit invoices.
	CreditCustomerNotes *string `json:"credit_customer_notes,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms *int `json:"net_terms,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber *string `json:"po_number,omitempty"`

	// This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
	TermsAndConditions *string `json:"terms_and_conditions,omitempty"`

	// VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
	VatReverseChargeNotes *string `json:"vat_reverse_charge_notes,omitempty"`
}

type InvoiceList

type InvoiceList struct {
	HasMore bool
	Data    []Invoice
	// contains filtered or unexported fields
}

InvoiceList allows you to paginate Invoice objects

func NewInvoiceList added in v3.6.0

func NewInvoiceList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *InvoiceList

func (*InvoiceList) Count

func (list *InvoiceList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceList) CountWithContext added in v3.12.0

func (list *InvoiceList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceList) Fetch

func (list *InvoiceList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*InvoiceList) FetchWithContext added in v3.12.0

func (list *InvoiceList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type InvoiceMini

type InvoiceMini struct {

	// Invoice ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Invoice number
	Number string `json:"number,omitempty"`

	// Invoice type
	Type string `json:"type,omitempty"`

	// Invoice state
	State string `json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*InvoiceMini) GetResponse

func (resource *InvoiceMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type InvoiceMiniList

type InvoiceMiniList struct {
	HasMore bool
	Data    []InvoiceMini
	// contains filtered or unexported fields
}

InvoiceMiniList allows you to paginate InvoiceMini objects

func NewInvoiceMiniList added in v3.6.0

func NewInvoiceMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *InvoiceMiniList

func (*InvoiceMiniList) Count

func (list *InvoiceMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceMiniList) CountWithContext added in v3.12.0

func (list *InvoiceMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*InvoiceMiniList) Fetch

func (list *InvoiceMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*InvoiceMiniList) FetchWithContext added in v3.12.0

func (list *InvoiceMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type InvoiceRefund

type InvoiceRefund struct {
	Params `json:"-"`

	// The type of refund. Amount and line items cannot both be specified in the request.
	Type *string `json:"type,omitempty"`

	// The amount to be refunded. The amount will be split between the line items.
	// If no amount is specified, it will default to refunding the total refundable amount on the invoice.
	Amount *float64 `json:"amount,omitempty"`

	// The line items to be refunded. This is required when `type=line_items`.
	LineItems []LineItemRefund `json:"line_items,omitempty"`

	// Indicates how the invoice should be refunded when both a credit and transaction are present on the invoice:
	// - `transaction_first` – Refunds the transaction first, then any amount is issued as credit back to the account. Default value when Credit Invoices feature is enabled.
	// - `credit_first` – Issues credit back to the account first, then refunds any remaining amount back to the transaction. Default value when Credit Invoices feature is not enabled.
	// - `all_credit` – Issues credit to the account for the entire amount of the refund. Only available when the Credit Invoices feature is enabled.
	// - `all_transaction` – Refunds the entire amount back to transactions, using transactions from previous invoices if necessary. Only available when the Credit Invoices feature is enabled.
	RefundMethod *string `json:"refund_method,omitempty"`

	// Used as the Customer Notes on the credit invoice.
	// This field can only be include when the Credit Invoices feature is enabled.
	CreditCustomerNotes *string `json:"credit_customer_notes,omitempty"`

	// Indicates that the refund was settled outside of Recurly, and a manual transaction should be created to track it in Recurly.
	// Required when:
	// - refunding a manually collected charge invoice, and `refund_method` is not `all_credit`
	// - refunding a credit invoice that refunded manually collecting invoices
	// - refunding a credit invoice for a partial amount
	// This field can only be included when the Credit Invoices feature is enabled.
	ExternalRefund *ExternalRefund `json:"external_refund,omitempty"`
}

type InvoiceUpdatable

type InvoiceUpdatable struct {
	Params `json:"-"`

	// This identifies the PO number associated with the invoice. Not editable for credit invoices.
	PoNumber *string `json:"po_number,omitempty"`

	// VAT Reverse Charge Notes are editable only if there was a VAT reverse charge applied to the invoice.
	VatReverseChargeNotes *string `json:"vat_reverse_charge_notes,omitempty"`

	// Terms and conditions are an optional note field. Not editable for credit invoices.
	TermsAndConditions *string `json:"terms_and_conditions,omitempty"`

	// Customer notes are an optional note field.
	CustomerNotes *string `json:"customer_notes,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. Changing Net terms changes due_on, and the invoice could move between past due and pending.
	NetTerms *int `json:"net_terms,omitempty"`

	Address *InvoiceAddressCreate `json:"address,omitempty"`
}

type Item

type Item struct {

	// Item ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Unique code to identify the item.
	Code string `json:"code,omitempty"`

	// The current state of the item.
	State string `json:"state,omitempty"`

	// This name describes your item and will appear on the invoice when it's purchased on a one time basis.
	Name string `json:"name,omitempty"`

	// Optional, description.
	Description string `json:"description,omitempty"`

	// Optional, stock keeping unit to link the item to other inventory systems.
	ExternalSku string `json:"external_sku,omitempty"`

	// Accounting code for invoice line items.
	AccountingCode string `json:"accounting_code,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode string `json:"tax_code,omitempty"`

	// `true` exempts tax on the item, `false` applies tax on the item.
	TaxExempt bool `json:"tax_exempt,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// Item Pricing
	Currencies []Pricing `json:"currencies,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Item) GetResponse

func (resource *Item) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ItemCreate

type ItemCreate struct {
	Params `json:"-"`

	// Unique code to identify the item.
	Code *string `json:"code,omitempty"`

	// This name describes your item and will appear on the invoice when it's purchased on a one time basis.
	Name *string `json:"name,omitempty"`

	// Optional, description.
	Description *string `json:"description,omitempty"`

	// Optional, stock keeping unit to link the item to other inventory systems.
	ExternalSku *string `json:"external_sku,omitempty"`

	// Accounting code for invoice line items.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode *string `json:"tax_code,omitempty"`

	// `true` exempts tax on the item, `false` applies tax on the item.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// Item Pricing
	Currencies []PricingCreate `json:"currencies,omitempty"`
}

type ItemList

type ItemList struct {
	HasMore bool
	Data    []Item
	// contains filtered or unexported fields
}

ItemList allows you to paginate Item objects

func NewItemList added in v3.6.0

func NewItemList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ItemList

func (*ItemList) Count

func (list *ItemList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ItemList) CountWithContext added in v3.12.0

func (list *ItemList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ItemList) Fetch

func (list *ItemList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ItemList) FetchWithContext added in v3.12.0

func (list *ItemList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ItemMini

type ItemMini struct {

	// Item ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Unique code to identify the item.
	Code string `json:"code,omitempty"`

	// The current state of the item.
	State string `json:"state,omitempty"`

	// This name describes your item and will appear on the invoice when it's purchased on a one time basis.
	Name string `json:"name,omitempty"`

	// Optional, description.
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*ItemMini) GetResponse

func (resource *ItemMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ItemMiniList

type ItemMiniList struct {
	HasMore bool
	Data    []ItemMini
	// contains filtered or unexported fields
}

ItemMiniList allows you to paginate ItemMini objects

func NewItemMiniList added in v3.6.0

func NewItemMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ItemMiniList

func (*ItemMiniList) Count

func (list *ItemMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ItemMiniList) CountWithContext added in v3.12.0

func (list *ItemMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ItemMiniList) Fetch

func (list *ItemMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ItemMiniList) FetchWithContext added in v3.12.0

func (list *ItemMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ItemUpdate

type ItemUpdate struct {
	Params `json:"-"`

	// Unique code to identify the item.
	Code *string `json:"code,omitempty"`

	// This name describes your item and will appear on the invoice when it's purchased on a one time basis.
	Name *string `json:"name,omitempty"`

	// Optional, description.
	Description *string `json:"description,omitempty"`

	// Optional, stock keeping unit to link the item to other inventory systems.
	ExternalSku *string `json:"external_sku,omitempty"`

	// Accounting code for invoice line items.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode *string `json:"tax_code,omitempty"`

	// `true` exempts tax on the item, `false` applies tax on the item.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// Item Pricing
	Currencies []PricingCreate `json:"currencies,omitempty"`
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type Level

type Level int

Level log level

const (
	LevelDebug Level = 0
	LevelInfo  Level = 1
	LevelWarn  Level = 2
	LevelError Level = 3
)

type LineItem

type LineItem struct {

	// Line item ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
	Uuid string `json:"uuid,omitempty"`

	// Charges are positive line items that debit the account. Credits are negative line items that credit the account.
	Type string `json:"type,omitempty"`

	// Unique code to identify an item. Available when the Credit Invoices feature is enabled.
	ItemCode string `json:"item_code,omitempty"`

	// System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
	ItemId string `json:"item_id,omitempty"`

	// Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices feature is enabled.
	ExternalSku string `json:"external_sku,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an `invoice_id` value.
	State string `json:"state,omitempty"`

	// Category to describe the role of a line item on a legacy invoice:
	// - "charges" refers to charges being billed for on this invoice.
	// - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo.
	// - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated.
	// - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account.
	LegacyCategory string `json:"legacy_category,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// The UUID of the account responsible for originating the line item.
	BillForAccountId string `json:"bill_for_account_id,omitempty"`

	// If the line item is a charge or credit for a subscription, this is its ID.
	SubscriptionId string `json:"subscription_id,omitempty"`

	// If the line item is a charge or credit for a plan or add-on, this is the plan's ID.
	PlanId string `json:"plan_id,omitempty"`

	// If the line item is a charge or credit for a plan or add-on, this is the plan's code.
	PlanCode string `json:"plan_code,omitempty"`

	// If the line item is a charge or credit for an add-on this is its ID.
	AddOnId string `json:"add_on_id,omitempty"`

	// If the line item is a charge or credit for an add-on, this is its code.
	AddOnCode string `json:"add_on_code,omitempty"`

	// Once the line item has been invoiced this will be the invoice's ID.
	InvoiceId string `json:"invoice_id,omitempty"`

	// Once the line item has been invoiced this will be the invoice's number. If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
	InvoiceNumber string `json:"invoice_number,omitempty"`

	// Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.
	PreviousLineItemId string `json:"previous_line_item_id,omitempty"`

	// The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.
	OriginalLineItemInvoiceId string `json:"original_line_item_invoice_id,omitempty"`

	// A credit created from an original charge will have the value of the charge's origin.
	Origin string `json:"origin,omitempty"`

	// Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice will use the plan or add-on's accounting code, otherwise the value will only be present if you define an accounting code when creating the line item.
	AccountingCode string `json:"accounting_code,omitempty"`

	// For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's `external_sku`.
	ProductCode string `json:"product_code,omitempty"`

	// The reason the credit was given when line item is `type=credit`.
	CreditReasonCode string `json:"credit_reason_code,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// `(quantity * unit_amount) - (discount + tax)`
	Amount float64 `json:"amount,omitempty"`

	// Description that appears on the invoice. For subscription related items this will be filled in automatically.
	Description string `json:"description,omitempty"`

	// This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
	Quantity int `json:"quantity,omitempty"`

	// A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.
	QuantityDecimal string `json:"quantity_decimal,omitempty"`

	// Positive amount for a charge, negative amount for a credit.
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`

	// `quantity * unit_amount`
	Subtotal float64 `json:"subtotal,omitempty"`

	// The discount applied to the line item.
	Discount float64 `json:"discount,omitempty"`

	// The tax amount for the line item.
	Tax float64 `json:"tax,omitempty"`

	// `true` if the line item is taxable, `false` if it is not.
	Taxable bool `json:"taxable,omitempty"`

	// `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
	TaxExempt bool `json:"tax_exempt,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode string `json:"tax_code,omitempty"`

	// Tax info
	TaxInfo TaxInfo `json:"tax_info,omitempty"`

	// When a line item has been prorated, this is the rate of the proration. Proration rates were made available for line items created after March 30, 2017. For line items created prior to that date, the proration rate will be `null`, even if the line item was prorated.
	ProrationRate float64 `json:"proration_rate,omitempty"`

	// Refund?
	Refund bool `json:"refund,omitempty"`

	// For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds).
	RefundedQuantity int `json:"refunded_quantity,omitempty"`

	// A floating-point alternative to Refunded Quantity. For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). The Decimal Quantity feature must be enabled to utilize this field.
	RefundedQuantityDecimal string `json:"refunded_quantity_decimal,omitempty"`

	// The amount of credit from this line item that was applied to the invoice.
	CreditApplied float64 `json:"credit_applied,omitempty"`

	ShippingAddress ShippingAddress `json:"shipping_address,omitempty"`

	// If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date.
	StartDate time.Time `json:"start_date,omitempty"`

	// If this date is provided, it indicates the end of a time range.
	EndDate time.Time `json:"end_date,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// When the line item was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the line item was last changed.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*LineItem) GetResponse

func (resource *LineItem) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type LineItemCreate

type LineItemCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code. If `item_code`/`item_id` is part of the request then `currency` is optional, if the site has a single default currency. `currency` is required if `item_code`/`item_id` is present, and there are multiple currencies defined on the site. If `item_code`/`item_id` is not present `currency` is required.
	Currency *string `json:"currency,omitempty"`

	// A positive or negative amount with `type=charge` will result in a positive `unit_amount`.
	// A positive or negative amount with `type=credit` will result in a negative `unit_amount`.
	// If `item_code`/`item_id` is present, `unit_amount` can be passed in, to override the `Item`'s
	// `unit_amount`. If `item_code`/`item_id` is not present then `unit_amount` is required.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`

	// This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
	Quantity *int `json:"quantity,omitempty"`

	// Description that appears on the invoice. If `item_code`/`item_id` is part of the request then `description` must be absent.
	Description *string `json:"description,omitempty"`

	// Unique code to identify an item. Avaliable when the Credit Invoices feature is enabled.
	ItemCode *string `json:"item_code,omitempty"`

	// System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
	ItemId *string `json:"item_id,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required.
	Type *string `json:"type,omitempty"`

	// The reason the credit was given when line item is `type=credit`. When the Credit Invoices feature is enabled, the value can be set and will default to `general`. When the Credit Invoices feature is not enabled, the value will always be `null`.
	CreditReasonCode *string `json:"credit_reason_code,omitempty"`

	// Accounting Code for the `LineItem`. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `LineItem`, then the `avalara_transaction_type` must be absent.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `LineItem`, then the `avalara_service_type` must be absent.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
	TaxCode *string `json:"tax_code,omitempty"`

	// Optional field to track a product code or SKU for the line item. This can be used to later reporting on product purchases. For Vertex tax calculations, this field will be used as the Vertex `product` field. If `item_code`/`item_id` is part of the request then `product_code` must be absent.
	ProductCode *string `json:"product_code,omitempty"`

	// Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements.  Origin `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to true.  This origin creates a charge and opposite credit on the account to be used for future invoices.
	Origin *string `json:"origin,omitempty"`

	// If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date. Defaults to the current date-time.
	StartDate *time.Time `json:"start_date,omitempty"`

	// If this date is provided, it indicates the end of a time range.
	EndDate *time.Time `json:"end_date,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`
}

type LineItemList

type LineItemList struct {
	HasMore bool
	Data    []LineItem
	// contains filtered or unexported fields
}

LineItemList allows you to paginate LineItem objects

func NewLineItemList added in v3.6.0

func NewLineItemList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *LineItemList

func (*LineItemList) Count

func (list *LineItemList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*LineItemList) CountWithContext added in v3.12.0

func (list *LineItemList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*LineItemList) Fetch

func (list *LineItemList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*LineItemList) FetchWithContext added in v3.12.0

func (list *LineItemList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type LineItemRefund

type LineItemRefund struct {
	Params `json:"-"`

	// Line item ID
	Id *string `json:"id,omitempty"`

	// Line item quantity to be refunded.
	Quantity *int `json:"quantity,omitempty"`

	// A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.
	QuantityDecimal *string `json:"quantity_decimal,omitempty"`

	// Set to `true` if the line item should be prorated; set to `false` if not.
	// This can only be used on line items that have a start and end date.
	Prorate *bool `json:"prorate,omitempty"`
}

type ListAccountAcquisitionParams

type ListAccountAcquisitionParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListAccountAcquisitionParams) URLParams

func (list *ListAccountAcquisitionParams) URLParams() []KeyValue

type ListAccountCouponRedemptionsParams

type ListAccountCouponRedemptionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListAccountCouponRedemptionsParams) URLParams

func (list *ListAccountCouponRedemptionsParams) URLParams() []KeyValue

type ListAccountCreditPaymentsParams

type ListAccountCreditPaymentsParams struct {
	Params

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListAccountCreditPaymentsParams) URLParams

func (list *ListAccountCreditPaymentsParams) URLParams() []KeyValue

type ListAccountInvoicesParams

type ListAccountInvoicesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// State - Invoice state.
	State *string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Type - Filter by type when:
	// - `type=charge`, only charge invoices will be returned.
	// - `type=credit`, only credit invoices will be returned.
	// - `type=non-legacy`, only charge and credit invoices will be returned.
	// - `type=legacy`, only legacy invoices will be returned.
	Type *string
}

func (*ListAccountInvoicesParams) URLParams

func (list *ListAccountInvoicesParams) URLParams() []KeyValue

type ListAccountLineItemsParams

type ListAccountLineItemsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Original - Filter by original field.
	Original *string

	// State - Filter by state field.
	State *string

	// Type - Filter by type field.
	Type *string
}

func (*ListAccountLineItemsParams) URLParams

func (list *ListAccountLineItemsParams) URLParams() []KeyValue

type ListAccountNotesParams

type ListAccountNotesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string
}

func (*ListAccountNotesParams) URLParams

func (list *ListAccountNotesParams) URLParams() []KeyValue

type ListAccountSubscriptionsParams

type ListAccountSubscriptionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	// - When `state=active`, `state=canceled`, `state=expired`, or `state=future`, subscriptions with states that match the query and only those subscriptions will be returned.
	// - When `state=in_trial`, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
	// - When `state=live`, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
	State *string
}

func (*ListAccountSubscriptionsParams) URLParams

func (list *ListAccountSubscriptionsParams) URLParams() []KeyValue

type ListAccountTransactionsParams

type ListAccountTransactionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Type - Filter by type field. The value `payment` will return both `purchase` and `capture` transactions.
	Type *string

	// Success - Filter by success field.
	Success *string
}

func (*ListAccountTransactionsParams) URLParams

func (list *ListAccountTransactionsParams) URLParams() []KeyValue

type ListAccountsParams

type ListAccountsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Email - Filter for accounts with this exact email address. A blank value will return accounts with both `null` and `""` email addresses. Note that multiple accounts can share one email address.
	Email *string

	// Subscriber - Filter for accounts with or without a subscription in the `active`,
	// `canceled`, or `future` state.
	Subscriber *bool

	// PastDue - Filter for accounts with an invoice in the `past_due` state.
	PastDue *string
}

func (*ListAccountsParams) URLParams

func (list *ListAccountsParams) URLParams() []KeyValue

type ListAddOnsParams

type ListAddOnsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListAddOnsParams) URLParams

func (list *ListAddOnsParams) URLParams() []KeyValue

type ListBillingInfosParams added in v3.10.0

type ListBillingInfosParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListBillingInfosParams) URLParams added in v3.10.0

func (list *ListBillingInfosParams) URLParams() []KeyValue

type ListChildAccountsParams

type ListChildAccountsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Email - Filter for accounts with this exact email address. A blank value will return accounts with both `null` and `""` email addresses. Note that multiple accounts can share one email address.
	Email *string

	// Subscriber - Filter for accounts with or without a subscription in the `active`,
	// `canceled`, or `future` state.
	Subscriber *bool

	// PastDue - Filter for accounts with an invoice in the `past_due` state.
	PastDue *string
}

func (*ListChildAccountsParams) URLParams

func (list *ListChildAccountsParams) URLParams() []KeyValue

type ListCouponsParams

type ListCouponsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListCouponsParams) URLParams

func (list *ListCouponsParams) URLParams() []KeyValue

type ListCreditPaymentsParams

type ListCreditPaymentsParams struct {
	Params

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListCreditPaymentsParams) URLParams

func (list *ListCreditPaymentsParams) URLParams() []KeyValue

type ListCustomFieldDefinitionsParams

type ListCustomFieldDefinitionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// RelatedType - Filter by related type.
	RelatedType *string
}

func (*ListCustomFieldDefinitionsParams) URLParams

func (list *ListCustomFieldDefinitionsParams) URLParams() []KeyValue

type ListDunningCampaignsParams added in v3.14.0

type ListDunningCampaignsParams struct {
	Params

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string
}

func (*ListDunningCampaignsParams) URLParams added in v3.14.0

func (list *ListDunningCampaignsParams) URLParams() []KeyValue

type ListInvoiceCouponRedemptionsParams

type ListInvoiceCouponRedemptionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListInvoiceCouponRedemptionsParams) URLParams

func (list *ListInvoiceCouponRedemptionsParams) URLParams() []KeyValue

type ListInvoiceLineItemsParams

type ListInvoiceLineItemsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Original - Filter by original field.
	Original *string

	// State - Filter by state field.
	State *string

	// Type - Filter by type field.
	Type *string
}

func (*ListInvoiceLineItemsParams) URLParams

func (list *ListInvoiceLineItemsParams) URLParams() []KeyValue

type ListInvoicesParams

type ListInvoicesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// State - Invoice state.
	State *string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Type - Filter by type when:
	// - `type=charge`, only charge invoices will be returned.
	// - `type=credit`, only credit invoices will be returned.
	// - `type=non-legacy`, only charge and credit invoices will be returned.
	// - `type=legacy`, only legacy invoices will be returned.
	Type *string
}

func (*ListInvoicesParams) URLParams

func (list *ListInvoicesParams) URLParams() []KeyValue

type ListItemsParams

type ListItemsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListItemsParams) URLParams

func (list *ListItemsParams) URLParams() []KeyValue

type ListLineItemsParams

type ListLineItemsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Original - Filter by original field.
	Original *string

	// State - Filter by state field.
	State *string

	// Type - Filter by type field.
	Type *string
}

func (*ListLineItemsParams) URLParams

func (list *ListLineItemsParams) URLParams() []KeyValue

type ListMeasuredUnitParams added in v3.5.0

type ListMeasuredUnitParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListMeasuredUnitParams) URLParams added in v3.5.0

func (list *ListMeasuredUnitParams) URLParams() []KeyValue

type ListMetadata

type ListMetadata struct {
	ObjectName string `json:"object"`
	HasMore    bool   `json:"has_more"`
	Next       string `json:"next"`
}

type ListOrder

type ListOrder string

ListOrder options for ordering a list

type ListPlanAddOnsParams

type ListPlanAddOnsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListPlanAddOnsParams) URLParams

func (list *ListPlanAddOnsParams) URLParams() []KeyValue

type ListPlansParams

type ListPlansParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	State *string
}

func (*ListPlansParams) URLParams

func (list *ListPlansParams) URLParams() []KeyValue

type ListShippingAddressesParams

type ListShippingAddressesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListShippingAddressesParams) URLParams

func (list *ListShippingAddressesParams) URLParams() []KeyValue

type ListShippingMethodsParams

type ListShippingMethodsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListShippingMethodsParams) URLParams

func (list *ListShippingMethodsParams) URLParams() []KeyValue

type ListSitesParams

type ListSitesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// State - Filter by state.
	State *string
}

func (*ListSitesParams) URLParams

func (list *ListSitesParams) URLParams() []KeyValue

type ListSubscriptionCouponRedemptionsParams

type ListSubscriptionCouponRedemptionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListSubscriptionCouponRedemptionsParams) URLParams

type ListSubscriptionInvoicesParams

type ListSubscriptionInvoicesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// State - Invoice state.
	State *string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Type - Filter by type when:
	// - `type=charge`, only charge invoices will be returned.
	// - `type=credit`, only credit invoices will be returned.
	// - `type=non-legacy`, only charge and credit invoices will be returned.
	// - `type=legacy`, only legacy invoices will be returned.
	Type *string
}

func (*ListSubscriptionInvoicesParams) URLParams

func (list *ListSubscriptionInvoicesParams) URLParams() []KeyValue

type ListSubscriptionLineItemsParams

type ListSubscriptionLineItemsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Original - Filter by original field.
	Original *string

	// State - Filter by state field.
	State *string

	// Type - Filter by type field.
	Type *string
}

func (*ListSubscriptionLineItemsParams) URLParams

func (list *ListSubscriptionLineItemsParams) URLParams() []KeyValue

type ListSubscriptionsParams

type ListSubscriptionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// State - Filter by state.
	// - When `state=active`, `state=canceled`, `state=expired`, or `state=future`, subscriptions with states that match the query and only those subscriptions will be returned.
	// - When `state=in_trial`, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
	// - When `state=live`, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
	State *string
}

func (*ListSubscriptionsParams) URLParams

func (list *ListSubscriptionsParams) URLParams() []KeyValue

type ListTransactionsParams

type ListTransactionsParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// Type - Filter by type field. The value `payment` will return both `purchase` and `capture` transactions.
	Type *string

	// Success - Filter by success field.
	Success *string
}

func (*ListTransactionsParams) URLParams

func (list *ListTransactionsParams) URLParams() []KeyValue

type ListUniqueCouponCodesParams

type ListUniqueCouponCodesParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `updated_at` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time
}

func (*ListUniqueCouponCodesParams) URLParams

func (list *ListUniqueCouponCodesParams) URLParams() []KeyValue

type ListUsageParams added in v3.5.0

type ListUsageParams struct {
	Params

	// Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using
	// commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
	// **Important notes:**
	// * The `ids` parameter cannot be used with any other ordering or filtering
	//   parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
	// * Invalid or unknown IDs will be ignored, so you should check that the
	//   results correspond to your request.
	// * Records are returned in an arbitrary order. Since results are all
	//   returned at once you can sort the records yourself.
	Ids []string

	// Limit - Limit number of records 1-200.
	Limit *int

	// Order - Sort order.
	Order *string

	// Sort - Sort field. You *really* only want to sort by `usage_timestamp` in ascending
	// order. In descending order updated records will move behind the cursor and could
	// prevent some records from being returned.
	Sort *string

	// BeginTime - Inclusively filter by begin_time when `sort=usage_timestamp` or `sort=recorded_timestamp`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	BeginTime *time.Time

	// EndTime - Inclusively filter by end_time when `sort=usage_timestamp` or `sort=recorded_timestamp`.
	// **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
	EndTime *time.Time

	// BillingStatus - Filter by usage record's billing status
	BillingStatus *string
}

func (*ListUsageParams) URLParams added in v3.5.0

func (list *ListUsageParams) URLParams() []KeyValue

type Logger

type Logger struct {
	Level
	StdOut *log.Logger
	StdErr *log.Logger
}

Logger creates a new logger with variable level

func NewLogger

func NewLogger(logLevel Level) *Logger

func (*Logger) Debug

func (log *Logger) Debug(v ...interface{})

func (*Logger) Debugf

func (log *Logger) Debugf(format string, v ...interface{})

func (*Logger) Error

func (log *Logger) Error(v ...interface{})

func (*Logger) Errorf

func (log *Logger) Errorf(format string, v ...interface{})

func (*Logger) Info

func (log *Logger) Info(v ...interface{})

func (*Logger) Infof

func (log *Logger) Infof(format string, v ...interface{})

func (*Logger) IsLevel

func (log *Logger) IsLevel(level Level) bool

IsLevel returns true if the logger would print with the given level

func (*Logger) Warn

func (log *Logger) Warn(v ...interface{})

func (*Logger) Warnf

func (log *Logger) Warnf(format string, v ...interface{})

type MeasuredUnit added in v3.5.0

type MeasuredUnit struct {

	// Item ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Unique internal name of the measured unit on your site.
	Name string `json:"name,omitempty"`

	// Display name for the measured unit. Can only contain spaces, underscores and must be alphanumeric.
	DisplayName string `json:"display_name,omitempty"`

	// The current state of the measured unit.
	State string `json:"state,omitempty"`

	// Optional internal description.
	Description string `json:"description,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*MeasuredUnit) GetResponse added in v3.5.0

func (resource *MeasuredUnit) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type MeasuredUnitCreate added in v3.5.0

type MeasuredUnitCreate struct {
	Params `json:"-"`

	// Unique internal name of the measured unit on your site.
	Name *string `json:"name,omitempty"`

	// Display name for the measured unit.
	DisplayName *string `json:"display_name,omitempty"`

	// Optional internal description.
	Description *string `json:"description,omitempty"`
}

type MeasuredUnitList added in v3.5.0

type MeasuredUnitList struct {
	HasMore bool
	Data    []MeasuredUnit
	// contains filtered or unexported fields
}

MeasuredUnitList allows you to paginate MeasuredUnit objects

func NewMeasuredUnitList added in v3.6.0

func NewMeasuredUnitList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *MeasuredUnitList

func (*MeasuredUnitList) Count added in v3.5.0

func (list *MeasuredUnitList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*MeasuredUnitList) CountWithContext added in v3.12.0

func (list *MeasuredUnitList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*MeasuredUnitList) Fetch added in v3.5.0

func (list *MeasuredUnitList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*MeasuredUnitList) FetchWithContext added in v3.12.0

func (list *MeasuredUnitList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type MeasuredUnitUpdate added in v3.5.0

type MeasuredUnitUpdate struct {
	Params `json:"-"`

	// Unique internal name of the measured unit on your site.
	Name *string `json:"name,omitempty"`

	// Display name for the measured unit.
	DisplayName *string `json:"display_name,omitempty"`

	// Optional internal description.
	Description *string `json:"description,omitempty"`
}

type Option added in v3.12.0

type Option func(o *RequestOptions)

Option allows for customizations to a request.

func WithHeader added in v3.12.0

func WithHeader(h http.Header) Option

WithHeader provides the capability to add custom headers to an operation.

func WithIdempotencyKey added in v3.12.0

func WithIdempotencyKey(k string) Option

WithIdempotencyKey provides the capability to add an Idempotency Key to an operation.

type OptionsApplier added in v3.14.0

type OptionsApplier interface {
	// contains filtered or unexported methods
}

type Params

type Params struct {
	// IdempotencyKey used to prevent duplicate requests
	IdempotencyKey string `json:"-"`
	// Header contains additional request headers for unique requests
	Header http.Header `json:"-"`
	// Context passed to the HTTP request for cancelling requests
	Context context.Context `json:"-"`

	RequestParams `json:"-"`

	// Data contains an object to be JSON encoded and sent in the body of the request
	Data interface{} `json:"-"`
}

Params contains additional request parameters for the API client

func (*Params) URLParams

func (params *Params) URLParams() []KeyValue

URLParams contains additional URL parameters for querying generic lists

type PaymentMethod

type PaymentMethod struct {
	Object string `json:"object,omitempty"`

	// Visa, MasterCard, American Express, Discover, JCB, etc.
	CardType string `json:"card_type,omitempty"`

	// Credit card number's first six digits.
	FirstSix string `json:"first_six,omitempty"`

	// Credit card number's last four digits. Will refer to bank account if payment method is ACH.
	LastFour string `json:"last_four,omitempty"`

	// The IBAN bank account's last two digits.
	LastTwo string `json:"last_two,omitempty"`

	// Expiration month.
	ExpMonth int `json:"exp_month,omitempty"`

	// Expiration year.
	ExpYear int `json:"exp_year,omitempty"`

	// A token used in place of a credit card in order to perform transactions.
	GatewayToken string `json:"gateway_token,omitempty"`

	// The 2-letter ISO 3166-1 alpha-2 country code associated with the credit card BIN, if known by Recurly. Available on the BillingInfo object only. Available when the BIN country lookup feature is enabled.
	CcBinCountry string `json:"cc_bin_country,omitempty"`

	// An identifier for a specific payment gateway.
	GatewayCode string `json:"gateway_code,omitempty"`

	// Gateway specific attributes associated with this PaymentMethod
	GatewayAttributes GatewayAttributes `json:"gateway_attributes,omitempty"`

	// Represents the card network preference associated with the billing info for dual badged cards. Must be a supported card network.
	CardNetworkPreference string `json:"card_network_preference,omitempty"`

	// Billing Agreement identifier. Only present for Amazon or Paypal payment methods.
	BillingAgreementId string `json:"billing_agreement_id,omitempty"`

	// The name associated with the bank account.
	NameOnAccount string `json:"name_on_account,omitempty"`

	// The bank account type. Only present for ACH payment methods.
	AccountType string `json:"account_type,omitempty"`

	// The bank account's routing number. Only present for ACH payment methods.
	RoutingNumber string `json:"routing_number,omitempty"`

	// The bank name of this routing number.
	RoutingNumberBank string `json:"routing_number_bank,omitempty"`
	// contains filtered or unexported fields
}

func (*PaymentMethod) GetResponse

func (resource *PaymentMethod) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PaymentMethodList

type PaymentMethodList struct {
	HasMore bool
	Data    []PaymentMethod
	// contains filtered or unexported fields
}

PaymentMethodList allows you to paginate PaymentMethod objects

func NewPaymentMethodList added in v3.6.0

func NewPaymentMethodList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PaymentMethodList

func (*PaymentMethodList) Count

func (list *PaymentMethodList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PaymentMethodList) CountWithContext added in v3.12.0

func (list *PaymentMethodList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PaymentMethodList) Fetch

func (list *PaymentMethodList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PaymentMethodList) FetchWithContext added in v3.12.0

func (list *PaymentMethodList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type Plan

type Plan struct {

	// Plan ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
	Code string `json:"code,omitempty"`

	// The current state of the plan.
	State string `json:"state,omitempty"`

	// This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
	Name string `json:"name,omitempty"`

	// Optional description, not displayed.
	Description string `json:"description,omitempty"`

	// Unit for the plan's billing interval.
	IntervalUnit string `json:"interval_unit,omitempty"`

	// Length of the plan's billing interval in `interval_unit`.
	IntervalLength int `json:"interval_length,omitempty"`

	// Units for the plan's trial period.
	TrialUnit string `json:"trial_unit,omitempty"`

	// Length of plan's trial period in `trial_units`. `0` means `no trial`.
	TrialLength int `json:"trial_length,omitempty"`

	// Allow free trial subscriptions to be created without billing info.
	TrialRequiresBillingInfo bool `json:"trial_requires_billing_info,omitempty"`

	// Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically stops renewing, defaults to `null` for continuous, automatic renewal.
	TotalBillingCycles int `json:"total_billing_cycles,omitempty"`

	// Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
	AutoRenew bool `json:"auto_renew,omitempty"`

	// A fixed pricing model has the same price for each billing period.
	// A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
	// a specified cadence of billing periods. The price change could be an increase or decrease.
	PricingModel string `json:"pricing_model,omitempty"`

	// Ramp Intervals
	RampIntervals []PlanRampInterval `json:"ramp_intervals,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
	AccountingCode string `json:"accounting_code,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Setup fee revenue schedule type
	SetupFeeRevenueScheduleType string `json:"setup_fee_revenue_schedule_type,omitempty"`

	// Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
	SetupFeeAccountingCode string `json:"setup_fee_accounting_code,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType int `json:"avalara_service_type,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
	TaxCode string `json:"tax_code,omitempty"`

	// `true` exempts tax on the plan, `false` applies tax on the plan.
	TaxExempt bool `json:"tax_exempt,omitempty"`

	// Pricing
	Currencies []PlanPricing `json:"currencies,omitempty"`

	// Hosted pages settings
	HostedPages PlanHostedPages `json:"hosted_pages,omitempty"`

	// Used to determine whether items can be assigned as add-ons to individual subscriptions.
	// If `true`, items can be assigned as add-ons to individual subscription add-ons.
	// If `false`, only plan add-ons can be used.
	AllowAnyItemOnSubscriptions bool `json:"allow_any_item_on_subscriptions,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId string `json:"dunning_campaign_id,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Plan) GetResponse

func (resource *Plan) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanCreate

type PlanCreate struct {
	Params `json:"-"`

	// Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
	Code *string `json:"code,omitempty"`

	// This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
	Name *string `json:"name,omitempty"`

	// Optional description, not displayed.
	Description *string `json:"description,omitempty"`

	// Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Unit for the plan's billing interval.
	IntervalUnit *string `json:"interval_unit,omitempty"`

	// Length of the plan's billing interval in `interval_unit`.
	IntervalLength *int `json:"interval_length,omitempty"`

	// Units for the plan's trial period.
	TrialUnit *string `json:"trial_unit,omitempty"`

	// Length of plan's trial period in `trial_units`. `0` means `no trial`.
	TrialLength *int `json:"trial_length,omitempty"`

	// Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
	TrialRequiresBillingInfo *bool `json:"trial_requires_billing_info,omitempty"`

	// Automatically terminate plans after a defined number of billing cycles.
	TotalBillingCycles *int `json:"total_billing_cycles,omitempty"`

	// Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
	AutoRenew *bool `json:"auto_renew,omitempty"`

	// A fixed pricing model has the same price for each billing period.
	// A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
	// a specified cadence of billing periods. The price change could be an increase or decrease.
	PricingModel *string `json:"pricing_model,omitempty"`

	// Ramp Intervals
	RampIntervals []PlanRampIntervalCreate `json:"ramp_intervals,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Setup fee revenue schedule type
	SetupFeeRevenueScheduleType *string `json:"setup_fee_revenue_schedule_type,omitempty"`

	// Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
	SetupFeeAccountingCode *string `json:"setup_fee_accounting_code,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
	TaxCode *string `json:"tax_code,omitempty"`

	// `true` exempts tax on the plan, `false` applies tax on the plan.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// Pricing
	Currencies []PlanPricingCreate `json:"currencies,omitempty"`

	// Hosted pages settings
	HostedPages *PlanHostedPagesCreate `json:"hosted_pages,omitempty"`

	// Add Ons
	AddOns []AddOnCreate `json:"add_ons,omitempty"`

	// Used to determine whether items can be assigned as add-ons to individual subscriptions.
	// If `true`, items can be assigned as add-ons to individual subscription add-ons.
	// If `false`, only plan add-ons can be used.
	AllowAnyItemOnSubscriptions *bool `json:"allow_any_item_on_subscriptions,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId *string `json:"dunning_campaign_id,omitempty"`
}

type PlanHostedPages

type PlanHostedPages struct {

	// URL to redirect to after signup on the hosted payment pages.
	SuccessUrl string `json:"success_url,omitempty"`

	// URL to redirect to on canceled signup on the hosted payment pages.
	CancelUrl string `json:"cancel_url,omitempty"`

	// If `true`, the customer will be sent directly to your `success_url` after a successful signup, bypassing Recurly's hosted confirmation page.
	BypassConfirmation bool `json:"bypass_confirmation,omitempty"`

	// Determines if the quantity field is displayed on the hosted pages for the plan.
	DisplayQuantity bool `json:"display_quantity,omitempty"`
	// contains filtered or unexported fields
}

func (*PlanHostedPages) GetResponse

func (resource *PlanHostedPages) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanHostedPagesCreate

type PlanHostedPagesCreate struct {
	Params `json:"-"`

	// URL to redirect to after signup on the hosted payment pages.
	SuccessUrl *string `json:"success_url,omitempty"`

	// URL to redirect to on canceled signup on the hosted payment pages.
	CancelUrl *string `json:"cancel_url,omitempty"`

	// If `true`, the customer will be sent directly to your `success_url` after a successful signup, bypassing Recurly's hosted confirmation page.
	BypassConfirmation *bool `json:"bypass_confirmation,omitempty"`

	// Determines if the quantity field is displayed on the hosted pages for the plan.
	DisplayQuantity *bool `json:"display_quantity,omitempty"`
}

type PlanHostedPagesList

type PlanHostedPagesList struct {
	HasMore bool
	Data    []PlanHostedPages
	// contains filtered or unexported fields
}

PlanHostedPagesList allows you to paginate PlanHostedPages objects

func NewPlanHostedPagesList added in v3.6.0

func NewPlanHostedPagesList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanHostedPagesList

func (*PlanHostedPagesList) Count

func (list *PlanHostedPagesList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanHostedPagesList) CountWithContext added in v3.12.0

func (list *PlanHostedPagesList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanHostedPagesList) Fetch

func (list *PlanHostedPagesList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanHostedPagesList) FetchWithContext added in v3.12.0

func (list *PlanHostedPagesList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanList

type PlanList struct {
	HasMore bool
	Data    []Plan
	// contains filtered or unexported fields
}

PlanList allows you to paginate Plan objects

func NewPlanList added in v3.6.0

func NewPlanList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanList

func (*PlanList) Count

func (list *PlanList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanList) CountWithContext added in v3.12.0

func (list *PlanList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanList) Fetch

func (list *PlanList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanList) FetchWithContext added in v3.12.0

func (list *PlanList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanMini

type PlanMini struct {

	// Plan ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
	Code string `json:"code,omitempty"`

	// This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*PlanMini) GetResponse

func (resource *PlanMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanMiniList

type PlanMiniList struct {
	HasMore bool
	Data    []PlanMini
	// contains filtered or unexported fields
}

PlanMiniList allows you to paginate PlanMini objects

func NewPlanMiniList added in v3.6.0

func NewPlanMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanMiniList

func (*PlanMiniList) Count

func (list *PlanMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanMiniList) CountWithContext added in v3.12.0

func (list *PlanMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanMiniList) Fetch

func (list *PlanMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanMiniList) FetchWithContext added in v3.12.0

func (list *PlanMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanPricing

type PlanPricing struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
	SetupFee float64 `json:"setup_fee,omitempty"`

	// This field should not be sent when the pricing model is 'ramp'.
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`
	// contains filtered or unexported fields
}

func (*PlanPricing) GetResponse

func (resource *PlanPricing) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanPricingCreate

type PlanPricingCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
	SetupFee *float64 `json:"setup_fee,omitempty"`

	// This field should not be sent when the pricing model is 'ramp'.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`
}

type PlanPricingList

type PlanPricingList struct {
	HasMore bool
	Data    []PlanPricing
	// contains filtered or unexported fields
}

PlanPricingList allows you to paginate PlanPricing objects

func NewPlanPricingList added in v3.6.0

func NewPlanPricingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanPricingList

func (*PlanPricingList) Count

func (list *PlanPricingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanPricingList) CountWithContext added in v3.12.0

func (list *PlanPricingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanPricingList) Fetch

func (list *PlanPricingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanPricingList) FetchWithContext added in v3.12.0

func (list *PlanPricingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanRampInterval added in v3.16.0

type PlanRampInterval struct {

	// Represents the billing cycle where a ramp interval starts.
	StartingBillingCycle int `json:"starting_billing_cycle,omitempty"`

	// Represents the price for the ramp interval.
	Currencies []PlanRampPricing `json:"currencies,omitempty"`
	// contains filtered or unexported fields
}

func (*PlanRampInterval) GetResponse added in v3.16.0

func (resource *PlanRampInterval) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanRampIntervalCreate added in v3.16.0

type PlanRampIntervalCreate struct {
	Params `json:"-"`

	// Represents the billing cycle where a ramp interval starts.
	StartingBillingCycle *int `json:"starting_billing_cycle,omitempty"`

	// Represents the price for the ramp interval.
	Currencies []PlanRampPricingCreate `json:"currencies,omitempty"`
}

type PlanRampIntervalList added in v3.16.0

type PlanRampIntervalList struct {
	HasMore bool
	Data    []PlanRampInterval
	// contains filtered or unexported fields
}

PlanRampIntervalList allows you to paginate PlanRampInterval objects

func NewPlanRampIntervalList added in v3.16.0

func NewPlanRampIntervalList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanRampIntervalList

func (*PlanRampIntervalList) Count added in v3.16.0

func (list *PlanRampIntervalList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanRampIntervalList) CountWithContext added in v3.16.0

func (list *PlanRampIntervalList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanRampIntervalList) Fetch added in v3.16.0

func (list *PlanRampIntervalList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanRampIntervalList) FetchWithContext added in v3.16.0

func (list *PlanRampIntervalList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanRampPricing added in v3.16.0

type PlanRampPricing struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Represents the price for the Ramp Interval.
	UnitAmount float64 `json:"unit_amount,omitempty"`
	// contains filtered or unexported fields
}

func (*PlanRampPricing) GetResponse added in v3.16.0

func (resource *PlanRampPricing) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PlanRampPricingCreate added in v3.16.0

type PlanRampPricingCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Represents the price for the Ramp Interval.
	UnitAmount *float64 `json:"unit_amount,omitempty"`
}

type PlanRampPricingList added in v3.16.0

type PlanRampPricingList struct {
	HasMore bool
	Data    []PlanRampPricing
	// contains filtered or unexported fields
}

PlanRampPricingList allows you to paginate PlanRampPricing objects

func NewPlanRampPricingList added in v3.16.0

func NewPlanRampPricingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PlanRampPricingList

func (*PlanRampPricingList) Count added in v3.16.0

func (list *PlanRampPricingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanRampPricingList) CountWithContext added in v3.16.0

func (list *PlanRampPricingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PlanRampPricingList) Fetch added in v3.16.0

func (list *PlanRampPricingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PlanRampPricingList) FetchWithContext added in v3.16.0

func (list *PlanRampPricingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PlanUpdate

type PlanUpdate struct {
	Params `json:"-"`

	// Plan ID
	Id *string `json:"id,omitempty"`

	// Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
	Code *string `json:"code,omitempty"`

	// This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
	Name *string `json:"name,omitempty"`

	// Optional description, not displayed.
	Description *string `json:"description,omitempty"`

	// Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Units for the plan's trial period.
	TrialUnit *string `json:"trial_unit,omitempty"`

	// Length of plan's trial period in `trial_units`. `0` means `no trial`.
	TrialLength *int `json:"trial_length,omitempty"`

	// Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
	TrialRequiresBillingInfo *bool `json:"trial_requires_billing_info,omitempty"`

	// Automatically terminate plans after a defined number of billing cycles.
	TotalBillingCycles *int `json:"total_billing_cycles,omitempty"`

	// Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
	AutoRenew *bool `json:"auto_renew,omitempty"`

	// Ramp Intervals
	RampIntervals []PlanRampIntervalCreate `json:"ramp_intervals,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Setup fee revenue schedule type
	SetupFeeRevenueScheduleType *string `json:"setup_fee_revenue_schedule_type,omitempty"`

	// Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
	SetupFeeAccountingCode *string `json:"setup_fee_accounting_code,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraTransactionType *int `json:"avalara_transaction_type,omitempty"`

	// Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
	AvalaraServiceType *int `json:"avalara_service_type,omitempty"`

	// Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
	TaxCode *string `json:"tax_code,omitempty"`

	// `true` exempts tax on the plan, `false` applies tax on the plan.
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// Pricing
	Currencies []PlanPricingCreate `json:"currencies,omitempty"`

	// Hosted pages settings
	HostedPages *PlanHostedPagesCreate `json:"hosted_pages,omitempty"`

	// Used to determine whether items can be assigned as add-ons to individual subscriptions.
	// If `true`, items can be assigned as add-ons to individual subscription add-ons.
	// If `false`, only plan add-ons can be used.
	AllowAnyItemOnSubscriptions *bool `json:"allow_any_item_on_subscriptions,omitempty"`

	// Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
	DunningCampaignId *string `json:"dunning_campaign_id,omitempty"`
}

type Pricing

type Pricing struct {

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Unit price
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`
	// contains filtered or unexported fields
}

func (*Pricing) GetResponse

func (resource *Pricing) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type PricingCreate

type PricingCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Unit price
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`
}

type PricingList

type PricingList struct {
	HasMore bool
	Data    []Pricing
	// contains filtered or unexported fields
}

PricingList allows you to paginate Pricing objects

func NewPricingList added in v3.6.0

func NewPricingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *PricingList

func (*PricingList) Count

func (list *PricingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*PricingList) CountWithContext added in v3.12.0

func (list *PricingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*PricingList) Fetch

func (list *PricingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*PricingList) FetchWithContext added in v3.12.0

func (list *PricingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type PurchaseCreate

type PurchaseCreate struct {
	Params `json:"-"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	Account *AccountPurchase `json:"account,omitempty"`

	// The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
	BillingInfoId *string `json:"billing_info_id,omitempty"`

	// Must be set to manual in order to preview a purchase for an Account that does not have payment information associated with the Billing Info.
	CollectionMethod *string `json:"collection_method,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber *string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms *int `json:"net_terms,omitempty"`

	// Terms and conditions to be put on the purchase invoice.
	TermsAndConditions *string `json:"terms_and_conditions,omitempty"`

	// Customer notes
	CustomerNotes *string `json:"customer_notes,omitempty"`

	// VAT reverse charge notes for cross border European tax settlement.
	VatReverseChargeNotes *string `json:"vat_reverse_charge_notes,omitempty"`

	// Notes to be put on the credit invoice resulting from credits in the purchase, if any.
	CreditCustomerNotes *string `json:"credit_customer_notes,omitempty"`

	// The default payment gateway identifier to be used for the purchase transaction.  This will also be applied as the default for any subscriptions included in the purchase request.
	GatewayCode *string `json:"gateway_code,omitempty"`

	Shipping *ShippingPurchase `json:"shipping,omitempty"`

	// A list of one time charges or credits to be created with the purchase.
	LineItems []LineItemCreate `json:"line_items,omitempty"`

	// A list of subscriptions to be created with the purchase.
	Subscriptions []SubscriptionPurchase `json:"subscriptions,omitempty"`

	// A list of coupon_codes to be redeemed on the subscription or account during the purchase.
	CouponCodes []string `json:"coupon_codes,omitempty"`

	// A gift card redemption code to be redeemed on the purchase invoice.
	GiftCardRedemptionCode *string `json:"gift_card_redemption_code,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`
}

type RateLimit

type RateLimit struct {
	Limit     int
	Remaining int
	// contains filtered or unexported fields
}

RateLimit contains information about the number of API requests available within the rate limit

func (RateLimit) ResetDate

func (limit RateLimit) ResetDate() *time.Time

ResetDate return the date when the API rate limit fully resets See https://dev.recurly.com/docs/rate-limits for more information.

func (RateLimit) String

func (limit RateLimit) String() string

String formats the rate limit

type RequestMetadata

type RequestMetadata struct {
	// ID is the request id assigned by Recurly to this request. Save this for support and debugging purposes.
	ID string
	// URL is the URL created for the request
	URL *url.URL
	// Method is the HTTP method used for the request. Ex (GET, POST, etc)
	Method string
}

type RequestOptions added in v3.12.0

type RequestOptions struct {
	// IdempotencyKey used to prevent duplicate requests
	IdempotencyKey string `json:"-"`
	// Header contains additional request headers for unique requests
	Header http.Header `json:"-"`
}

RequestOptions contains additional request parameters for the API client

func NewRequestOptions added in v3.12.0

func NewRequestOptions(opts ...Option) *RequestOptions

NewRequestOptions will create a new RequestOptions with the passed Options applied to it.

func RequestOptionsFromParams added in v3.12.0

func RequestOptionsFromParams(p Params, opts ...Option) *RequestOptions

RequestOptionsFromParams will create a RequestOptions from a Params

func (*RequestOptions) ApplyOptions added in v3.12.0

func (o *RequestOptions) ApplyOptions(opts ...Option) *RequestOptions

ApplyOptions will apply the passed Options to the RequestOptions.

type RequestParams

type RequestParams interface {
	// URLParams returns a list of key/value pairs to URL encode in the request URL
	URLParams() []KeyValue
}

type Resource

type Resource interface {
	GetResponse() *ResponseMetadata
	// contains filtered or unexported methods
}

type ResponseMetadata

type ResponseMetadata struct {
	// Deprecated is true if the version or endpoint is now deprecated and should not be used.
	Deprecated bool
	// DeprecationDate indicates the version or endpoint will sunset and should not be used after this date.
	DeprecationDate string
	// RateLimit indicates the remaining API requests before the rate limit is exceeded.
	RateLimit RateLimit
	// StatusCode contains the response's HTTP status code
	StatusCode int
	// Version indicates the response version
	Version string
	// TotalRecords is the header corresponding to the `Recurly-Total-Records`. The count of records matching this pager.
	TotalRecords *int64
	// Request is the metadata describing the request for this response
	Request RequestMetadata
}

ResponseMetadata is the response from Recurly's API

func (*ResponseMetadata) String

func (meta *ResponseMetadata) String() string

type Settings

type Settings struct {

	// - full:      Full Address (Street, City, State, Postal Code and Country)
	// - streetzip: Street and Postal Code only
	// - zip:       Postal Code only
	// - none:      No Address
	BillingAddressRequirement string `json:"billing_address_requirement,omitempty"`

	AcceptedCurrencies []string `json:"accepted_currencies,omitempty"`

	// The default 3-letter ISO 4217 currency code.
	DefaultCurrency string `json:"default_currency,omitempty"`
	// contains filtered or unexported fields
}

func (*Settings) GetResponse

func (resource *Settings) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SettingsList

type SettingsList struct {
	HasMore bool
	Data    []Settings
	// contains filtered or unexported fields
}

SettingsList allows you to paginate Settings objects

func NewSettingsList added in v3.6.0

func NewSettingsList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SettingsList

func (*SettingsList) Count

func (list *SettingsList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SettingsList) CountWithContext added in v3.12.0

func (list *SettingsList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SettingsList) Fetch

func (list *SettingsList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SettingsList) FetchWithContext added in v3.12.0

func (list *SettingsList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ShippingAddress

type ShippingAddress struct {

	// Shipping Address ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Account ID
	AccountId string `json:"account_id,omitempty"`

	Nickname string `json:"nickname,omitempty"`

	FirstName string `json:"first_name,omitempty"`

	LastName string `json:"last_name,omitempty"`

	Company string `json:"company,omitempty"`

	Email string `json:"email,omitempty"`

	VatNumber string `json:"vat_number,omitempty"`

	Phone string `json:"phone,omitempty"`

	Street1 string `json:"street1,omitempty"`

	Street2 string `json:"street2,omitempty"`

	City string `json:"city,omitempty"`

	// State or province.
	Region string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode string `json:"geo_code,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*ShippingAddress) GetResponse

func (resource *ShippingAddress) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ShippingAddressCreate

type ShippingAddressCreate struct {
	Params `json:"-"`

	Nickname *string `json:"nickname,omitempty"`

	FirstName *string `json:"first_name,omitempty"`

	LastName *string `json:"last_name,omitempty"`

	Company *string `json:"company,omitempty"`

	Email *string `json:"email,omitempty"`

	VatNumber *string `json:"vat_number,omitempty"`

	Phone *string `json:"phone,omitempty"`

	Street1 *string `json:"street1,omitempty"`

	Street2 *string `json:"street2,omitempty"`

	City *string `json:"city,omitempty"`

	// State or province.
	Region *string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode *string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country *string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode *string `json:"geo_code,omitempty"`
}

type ShippingAddressList

type ShippingAddressList struct {
	HasMore bool
	Data    []ShippingAddress
	// contains filtered or unexported fields
}

ShippingAddressList allows you to paginate ShippingAddress objects

func NewShippingAddressList added in v3.6.0

func NewShippingAddressList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ShippingAddressList

func (*ShippingAddressList) Count

func (list *ShippingAddressList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingAddressList) CountWithContext added in v3.12.0

func (list *ShippingAddressList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingAddressList) Fetch

func (list *ShippingAddressList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ShippingAddressList) FetchWithContext added in v3.12.0

func (list *ShippingAddressList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ShippingAddressUpdate

type ShippingAddressUpdate struct {
	Params `json:"-"`

	// Shipping Address ID
	Id *string `json:"id,omitempty"`

	Nickname *string `json:"nickname,omitempty"`

	FirstName *string `json:"first_name,omitempty"`

	LastName *string `json:"last_name,omitempty"`

	Company *string `json:"company,omitempty"`

	Email *string `json:"email,omitempty"`

	VatNumber *string `json:"vat_number,omitempty"`

	Phone *string `json:"phone,omitempty"`

	Street1 *string `json:"street1,omitempty"`

	Street2 *string `json:"street2,omitempty"`

	City *string `json:"city,omitempty"`

	// State or province.
	Region *string `json:"region,omitempty"`

	// Zip or postal code.
	PostalCode *string `json:"postal_code,omitempty"`

	// Country, 2-letter ISO 3166-1 alpha-2 code.
	Country *string `json:"country,omitempty"`

	// Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
	GeoCode *string `json:"geo_code,omitempty"`
}

type ShippingFeeCreate

type ShippingFeeCreate struct {
	Params `json:"-"`

	// The id of the shipping method used to deliver the purchase. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodId *string `json:"method_id,omitempty"`

	// The code of the shipping method used to deliver the purchase. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodCode *string `json:"method_code,omitempty"`

	// This is priced in the purchase's currency.
	Amount *float64 `json:"amount,omitempty"`
}

type ShippingMethod

type ShippingMethod struct {

	// Shipping Method ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The internal name used identify the shipping method.
	Code string `json:"code,omitempty"`

	// The name of the shipping method displayed to customers.
	Name string `json:"name,omitempty"`

	// Accounting code for shipping method.
	AccountingCode string `json:"accounting_code,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
	// code values are specific to each tax system. If you are using Recurly’s
	// built-in taxes the values are:
	// - `FR` – Common Carrier FOB Destination
	// - `FR022000` – Common Carrier FOB Origin
	// - `FR020400` – Non Common Carrier FOB Destination
	// - `FR020500` – Non Common Carrier FOB Origin
	// - `FR010100` – Delivery by Company Vehicle Before Passage of Title
	// - `FR010200` – Delivery by Company Vehicle After Passage of Title
	// - `NT` – Non-Taxable
	TaxCode string `json:"tax_code,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*ShippingMethod) GetResponse

func (resource *ShippingMethod) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ShippingMethodCreate added in v3.2.0

type ShippingMethodCreate struct {
	Params `json:"-"`

	// The internal name used identify the shipping method.
	Code *string `json:"code,omitempty"`

	// The name of the shipping method displayed to customers.
	Name *string `json:"name,omitempty"`

	// Accounting code for shipping method.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
	// code values are specific to each tax system. If you are using Recurly’s
	// built-in taxes the values are:
	// - `FR` – Common Carrier FOB Destination
	// - `FR022000` – Common Carrier FOB Origin
	// - `FR020400` – Non Common Carrier FOB Destination
	// - `FR020500` – Non Common Carrier FOB Origin
	// - `FR010100` – Delivery by Company Vehicle Before Passage of Title
	// - `FR010200` – Delivery by Company Vehicle After Passage of Title
	// - `NT` – Non-Taxable
	TaxCode *string `json:"tax_code,omitempty"`
}

type ShippingMethodList

type ShippingMethodList struct {
	HasMore bool
	Data    []ShippingMethod
	// contains filtered or unexported fields
}

ShippingMethodList allows you to paginate ShippingMethod objects

func NewShippingMethodList added in v3.6.0

func NewShippingMethodList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ShippingMethodList

func (*ShippingMethodList) Count

func (list *ShippingMethodList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingMethodList) CountWithContext added in v3.12.0

func (list *ShippingMethodList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingMethodList) Fetch

func (list *ShippingMethodList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ShippingMethodList) FetchWithContext added in v3.12.0

func (list *ShippingMethodList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ShippingMethodMini

type ShippingMethodMini struct {

	// Shipping Method ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The internal name used identify the shipping method.
	Code string `json:"code,omitempty"`

	// The name of the shipping method displayed to customers.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*ShippingMethodMini) GetResponse

func (resource *ShippingMethodMini) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type ShippingMethodMiniList

type ShippingMethodMiniList struct {
	HasMore bool
	Data    []ShippingMethodMini
	// contains filtered or unexported fields
}

ShippingMethodMiniList allows you to paginate ShippingMethodMini objects

func NewShippingMethodMiniList added in v3.6.0

func NewShippingMethodMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *ShippingMethodMiniList

func (*ShippingMethodMiniList) Count

func (list *ShippingMethodMiniList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingMethodMiniList) CountWithContext added in v3.12.0

func (list *ShippingMethodMiniList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*ShippingMethodMiniList) Fetch

func (list *ShippingMethodMiniList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*ShippingMethodMiniList) FetchWithContext added in v3.12.0

func (list *ShippingMethodMiniList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type ShippingMethodUpdate added in v3.2.0

type ShippingMethodUpdate struct {
	Params `json:"-"`

	// The internal name used identify the shipping method.
	Code *string `json:"code,omitempty"`

	// The name of the shipping method displayed to customers.
	Name *string `json:"name,omitempty"`

	// Accounting code for shipping method.
	AccountingCode *string `json:"accounting_code,omitempty"`

	// Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
	// code values are specific to each tax system. If you are using Recurly’s
	// built-in taxes the values are:
	// - `FR` – Common Carrier FOB Destination
	// - `FR022000` – Common Carrier FOB Origin
	// - `FR020400` – Non Common Carrier FOB Destination
	// - `FR020500` – Non Common Carrier FOB Origin
	// - `FR010100` – Delivery by Company Vehicle Before Passage of Title
	// - `FR010200` – Delivery by Company Vehicle After Passage of Title
	// - `NT` – Non-Taxable
	TaxCode *string `json:"tax_code,omitempty"`
}

type ShippingPurchase

type ShippingPurchase struct {
	Params `json:"-"`

	// Assign a shipping address from the account's existing shipping addresses. If this and `address` are both present, `address` will take precedence.
	AddressId *string `json:"address_id,omitempty"`

	Address *ShippingAddressCreate `json:"address,omitempty"`

	// A list of shipping fees to be created as charges with the purchase.
	Fees []ShippingFeeCreate `json:"fees,omitempty"`
}

type Site

type Site struct {

	// Site ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	Subdomain string `json:"subdomain,omitempty"`

	// This value is used to configure RecurlyJS to submit tokenized billing information.
	PublicApiKey string `json:"public_api_key,omitempty"`

	// Mode
	Mode string `json:"mode,omitempty"`

	Address Address `json:"address,omitempty"`

	Settings Settings `json:"settings,omitempty"`

	// A list of features enabled for the site.
	Features []string `json:"features,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Site) GetResponse

func (resource *Site) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SiteList

type SiteList struct {
	HasMore bool
	Data    []Site
	// contains filtered or unexported fields
}

SiteList allows you to paginate Site objects

func NewSiteList added in v3.6.0

func NewSiteList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SiteList

func (*SiteList) Count

func (list *SiteList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SiteList) CountWithContext added in v3.12.0

func (list *SiteList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SiteList) Fetch

func (list *SiteList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SiteList) FetchWithContext added in v3.12.0

func (list *SiteList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SortField

type SortField string

SortField specifies a field to sort against

type Subscription

type Subscription struct {

	// Subscription ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
	Uuid string `json:"uuid,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// Just the important parts.
	Plan PlanMini `json:"plan,omitempty"`

	// State
	State string `json:"state,omitempty"`

	// Subscription shipping details
	Shipping SubscriptionShipping `json:"shipping,omitempty"`

	// Returns subscription level coupon redemptions that are tied to this subscription.
	CouponRedemptions []CouponRedemptionMini `json:"coupon_redemptions,omitempty"`

	// Subscription Change
	PendingChange SubscriptionChange `json:"pending_change,omitempty"`

	// Current billing period started at
	CurrentPeriodStartedAt time.Time `json:"current_period_started_at,omitempty"`

	// Current billing period ends at
	CurrentPeriodEndsAt time.Time `json:"current_period_ends_at,omitempty"`

	// The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.
	CurrentTermStartedAt time.Time `json:"current_term_started_at,omitempty"`

	// When the term ends. This is calculated by a plan's interval and `total_billing_cycles` in a term. Subscription changes with a `timeframe=renewal` will be applied on this date.
	CurrentTermEndsAt time.Time `json:"current_term_ends_at,omitempty"`

	// Trial period started at
	TrialStartedAt time.Time `json:"trial_started_at,omitempty"`

	// Trial period ends at
	TrialEndsAt time.Time `json:"trial_ends_at,omitempty"`

	// The remaining billing cycles in the current term.
	RemainingBillingCycles int `json:"remaining_billing_cycles,omitempty"`

	// The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
	TotalBillingCycles int `json:"total_billing_cycles,omitempty"`

	// If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
	RenewalBillingCycles int `json:"renewal_billing_cycles,omitempty"`

	// Whether the subscription renews at the end of its term.
	AutoRenew bool `json:"auto_renew,omitempty"`

	// The ramp intervals representing the pricing schedule for the subscription.
	RampIntervals []SubscriptionRampIntervalResponse `json:"ramp_intervals,omitempty"`

	// Null unless subscription is paused or will pause at the end of the current billing period.
	PausedAt time.Time `json:"paused_at,omitempty"`

	// Null unless subscription is paused or will pause at the end of the current billing period.
	RemainingPauseCycles int `json:"remaining_pause_cycles,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Subscription unit price
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`

	// Subscription quantity
	Quantity int `json:"quantity,omitempty"`

	// Add-ons
	AddOns []SubscriptionAddOn `json:"add_ons,omitempty"`

	// Total price of add-ons
	AddOnsTotal float64 `json:"add_ons_total,omitempty"`

	// Estimated total, before tax.
	Subtotal float64 `json:"subtotal,omitempty"`

	// Collection method
	CollectionMethod string `json:"collection_method,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms int `json:"net_terms,omitempty"`

	// Terms and conditions
	TermsAndConditions string `json:"terms_and_conditions,omitempty"`

	// Customer notes
	CustomerNotes string `json:"customer_notes,omitempty"`

	// Expiration reason
	ExpirationReason string `json:"expiration_reason,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Last updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Activated at
	ActivatedAt time.Time `json:"activated_at,omitempty"`

	// Canceled at
	CanceledAt time.Time `json:"canceled_at,omitempty"`

	// Expires at
	ExpiresAt time.Time `json:"expires_at,omitempty"`

	// Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.
	BankAccountAuthorizedAt time.Time `json:"bank_account_authorized_at,omitempty"`

	// Billing Info ID.
	BillingInfoId string `json:"billing_info_id,omitempty"`

	// The invoice ID of the latest invoice created for an active subscription.
	ActiveInvoiceId string `json:"active_invoice_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Subscription) GetResponse

func (resource *Subscription) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionAddOn

type SubscriptionAddOn struct {

	// Subscription Add-on ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Subscription ID
	SubscriptionId string `json:"subscription_id,omitempty"`

	// Just the important parts.
	AddOn AddOnMini `json:"add_on,omitempty"`

	// Used to determine where the associated add-on data is pulled from. If this value is set to
	// `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
	// `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
	// the associated add-on data will be pulled from the site's item catalog.
	AddOnSource string `json:"add_on_source,omitempty"`

	// Add-on quantity
	Quantity int `json:"quantity,omitempty"`

	// This is priced in the subscription's currency.
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// The type of tiering used by the Add-on.
	TierType string `json:"tier_type,omitempty"`

	// If tiers are provided in the request, all existing tiers on the Subscription Add-on will be
	// removed and replaced by the tiers in the request.
	Tiers []SubscriptionAddOnTier `json:"tiers,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
	UsagePercentage float64 `json:"usage_percentage,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Expired at
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionAddOn) GetResponse

func (resource *SubscriptionAddOn) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionAddOnCreate

type SubscriptionAddOnCreate struct {
	Params `json:"-"`

	// If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used.
	// If `add_on_source` is set to `item`, then the `code` from the associated item should be used.
	Code *string `json:"code,omitempty"`

	// Used to determine where the associated add-on data is pulled from. If this value is set to
	// `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated
	// `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
	// the associated add-on data will be pulled from the site's item catalog.
	AddOnSource *string `json:"add_on_source,omitempty"`

	// Quantity
	Quantity *int `json:"quantity,omitempty"`

	// * Optionally, override the add-on's default unit amount.
	// * If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` must be absent.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
	// must include one to many tiers with `ending_quantity` and `unit_amount`.
	// There must be one tier with an `ending_quantity` of 999999999 which is the
	// default if not provided. See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html)
	// for an overview of how to configure quantity-based pricing models.
	Tiers []SubscriptionAddOnTierCreate `json:"tiers,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
	UsagePercentage *float64 `json:"usage_percentage,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`
}

type SubscriptionAddOnList

type SubscriptionAddOnList struct {
	HasMore bool
	Data    []SubscriptionAddOn
	// contains filtered or unexported fields
}

SubscriptionAddOnList allows you to paginate SubscriptionAddOn objects

func NewSubscriptionAddOnList added in v3.6.0

func NewSubscriptionAddOnList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionAddOnList

func (*SubscriptionAddOnList) Count

func (list *SubscriptionAddOnList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionAddOnList) CountWithContext added in v3.12.0

func (list *SubscriptionAddOnList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionAddOnList) Fetch

func (list *SubscriptionAddOnList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionAddOnList) FetchWithContext added in v3.12.0

func (list *SubscriptionAddOnList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionAddOnTier added in v3.1.0

type SubscriptionAddOnTier struct {

	// Ending quantity
	EndingQuantity int `json:"ending_quantity,omitempty"`

	// Unit amount
	UnitAmount float64 `json:"unit_amount,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionAddOnTier) GetResponse added in v3.1.0

func (resource *SubscriptionAddOnTier) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionAddOnTierCreate added in v3.1.0

type SubscriptionAddOnTierCreate struct {
	Params `json:"-"`

	// Ending quantity
	EndingQuantity *int `json:"ending_quantity,omitempty"`

	// Unit amount
	UnitAmount *float64 `json:"unit_amount,omitempty"`
}

type SubscriptionAddOnTierList added in v3.1.0

type SubscriptionAddOnTierList struct {
	HasMore bool
	Data    []SubscriptionAddOnTier
	// contains filtered or unexported fields
}

SubscriptionAddOnTierList allows you to paginate SubscriptionAddOnTier objects

func NewSubscriptionAddOnTierList added in v3.6.0

func NewSubscriptionAddOnTierList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionAddOnTierList

func (*SubscriptionAddOnTierList) Count added in v3.1.0

func (list *SubscriptionAddOnTierList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionAddOnTierList) CountWithContext added in v3.12.0

func (list *SubscriptionAddOnTierList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionAddOnTierList) Fetch added in v3.1.0

func (list *SubscriptionAddOnTierList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionAddOnTierList) FetchWithContext added in v3.12.0

func (list *SubscriptionAddOnTierList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionAddOnUpdate

type SubscriptionAddOnUpdate struct {
	Params `json:"-"`

	// When an id is provided, the existing subscription add-on attributes will
	// persist unless overridden in the request.
	Id *string `json:"id,omitempty"`

	// If a code is provided without an id, the subscription add-on attributes
	// will be set to the current value for those attributes on the plan add-on
	// unless provided in the request. If `add_on_source` is set to `plan_add_on`
	// or left blank, then plan's add-on `code` should be used. If `add_on_source`
	// is set to `item`, then the `code` from the associated item should be used.
	Code *string `json:"code,omitempty"`

	// Used to determine where the associated add-on data is pulled from. If this value is set to
	// `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated
	// `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
	// the associated add-on data will be pulled from the site's item catalog.
	AddOnSource *string `json:"add_on_source,omitempty"`

	// Quantity
	Quantity *int `json:"quantity,omitempty"`

	// Optionally, override the add-on's default unit amount.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
	// must include one to many tiers with `ending_quantity` and `unit_amount`.
	// There must be one tier with an `ending_quantity` of 999999999 which is the
	// default if not provided.
	Tiers []SubscriptionAddOnTierCreate `json:"tiers,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
	UsagePercentage *float64 `json:"usage_percentage,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`
}

type SubscriptionCancel

type SubscriptionCancel struct {
	Params `json:"-"`

	// The timeframe parameter controls when the expiration takes place. The `bill_date` timeframe causes the subscription to expire when the subscription is scheduled to bill next. The `term_end` timeframe causes the subscription to continue to bill until the end of the subscription term, then expire.
	Timeframe *string `json:"timeframe,omitempty"`
}

type SubscriptionChange

type SubscriptionChange struct {

	// The ID of the Subscription Change.
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The ID of the subscription that is going to be changed.
	SubscriptionId string `json:"subscription_id,omitempty"`

	// Just the important parts.
	Plan PlanMini `json:"plan,omitempty"`

	// These add-ons will be used when the subscription renews.
	AddOns []SubscriptionAddOn `json:"add_ons,omitempty"`

	// Unit amount
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`

	// Subscription quantity
	Quantity int `json:"quantity,omitempty"`

	// Subscription shipping details
	Shipping SubscriptionShipping `json:"shipping,omitempty"`

	// Activated at
	ActivateAt time.Time `json:"activate_at,omitempty"`

	// Returns `true` if the subscription change is activated.
	Activated bool `json:"activated,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Setup fee revenue schedule type
	SetupFeeRevenueScheduleType string `json:"setup_fee_revenue_schedule_type,omitempty"`

	// Invoice Collection
	InvoiceCollection InvoiceCollection `json:"invoice_collection,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`

	// Accept nested attributes for three_d_secure_action_result_token_id
	BillingInfo SubscriptionChangeBillingInfo `json:"billing_info,omitempty"`

	// The ramp intervals representing the pricing schedule for the subscription.
	RampIntervals []SubscriptionRampIntervalResponse `json:"ramp_intervals,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionChange) GetResponse

func (resource *SubscriptionChange) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionChangeBillingInfo added in v3.14.0

type SubscriptionChangeBillingInfo struct {

	// A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
	ThreeDSecureActionResultTokenId string `json:"three_d_secure_action_result_token_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionChangeBillingInfo) GetResponse added in v3.14.0

func (resource *SubscriptionChangeBillingInfo) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionChangeBillingInfoCreate added in v3.14.0

type SubscriptionChangeBillingInfoCreate struct {
	Params `json:"-"`

	// A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
	ThreeDSecureActionResultTokenId *string `json:"three_d_secure_action_result_token_id,omitempty"`
}

type SubscriptionChangeBillingInfoList added in v3.14.0

type SubscriptionChangeBillingInfoList struct {
	HasMore bool
	Data    []SubscriptionChangeBillingInfo
	// contains filtered or unexported fields
}

SubscriptionChangeBillingInfoList allows you to paginate SubscriptionChangeBillingInfo objects

func NewSubscriptionChangeBillingInfoList added in v3.14.0

func NewSubscriptionChangeBillingInfoList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionChangeBillingInfoList

func (*SubscriptionChangeBillingInfoList) Count added in v3.14.0

func (list *SubscriptionChangeBillingInfoList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangeBillingInfoList) CountWithContext added in v3.14.0

func (list *SubscriptionChangeBillingInfoList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangeBillingInfoList) Fetch added in v3.14.0

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionChangeBillingInfoList) FetchWithContext added in v3.14.0

func (list *SubscriptionChangeBillingInfoList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionChangeCreate

type SubscriptionChangeCreate struct {
	Params `json:"-"`

	// The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
	Timeframe *string `json:"timeframe,omitempty"`

	// If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
	PlanId *string `json:"plan_id,omitempty"`

	// If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
	PlanCode *string `json:"plan_code,omitempty"`

	// Optionally, sets custom pricing for the subscription, overriding the plan's default unit amount. The subscription's current currency will be used.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`

	// Optionally override the default quantity of 1.
	Quantity *int `json:"quantity,omitempty"`

	// The shipping address can currently only be changed immediately, using SubscriptionUpdate.
	Shipping *SubscriptionChangeShippingCreate `json:"shipping,omitempty"`

	// A list of coupon_codes to be redeemed on the subscription during the change. Only allowed if timeframe is now and you change something about the subscription that creates an invoice.
	CouponCodes []string `json:"coupon_codes,omitempty"`

	// If this value is omitted your existing add-ons will be removed. If you provide
	// a value for this field it will replace any existing add-ons. So, when adding or
	// modifying an add-on, you need to include the existing subscription add-ons.
	// Unchanged add-ons can be included just using the subscription add-on's ID:
	// `{"id": "abc123"}`.
	// If a subscription add-on's `code` is supplied without the `id`,
	// `{"code": "def456"}`, the subscription add-on attributes will be set to the
	// current values of the plan add-on unless provided in the request.
	// - If an `id` is passed, any attributes not passed in will pull from the
	//   existing subscription add-on
	// - If a `code` is passed, any attributes not passed in will pull from the
	//   current values of the plan add-on
	// - Attributes passed in as part of the request will override either of the
	//   above scenarios
	AddOns []SubscriptionAddOnUpdate `json:"add_ons,omitempty"`

	// Collection method
	CollectionMethod *string `json:"collection_method,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber *string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms *int `json:"net_terms,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`

	BillingInfo *SubscriptionChangeBillingInfoCreate `json:"billing_info,omitempty"`

	// The new set of ramp intervals for the subscription.
	RampIntervals []SubscriptionRampInterval `json:"ramp_intervals,omitempty"`
}

type SubscriptionChangeList

type SubscriptionChangeList struct {
	HasMore bool
	Data    []SubscriptionChange
	// contains filtered or unexported fields
}

SubscriptionChangeList allows you to paginate SubscriptionChange objects

func NewSubscriptionChangeList added in v3.6.0

func NewSubscriptionChangeList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionChangeList

func (*SubscriptionChangeList) Count

func (list *SubscriptionChangeList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangeList) CountWithContext added in v3.12.0

func (list *SubscriptionChangeList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangeList) Fetch

func (list *SubscriptionChangeList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionChangeList) FetchWithContext added in v3.12.0

func (list *SubscriptionChangeList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionChangePreview added in v3.3.0

type SubscriptionChangePreview struct {

	// The ID of the Subscription Change.
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The ID of the subscription that is going to be changed.
	SubscriptionId string `json:"subscription_id,omitempty"`

	// Just the important parts.
	Plan PlanMini `json:"plan,omitempty"`

	// These add-ons will be used when the subscription renews.
	AddOns []SubscriptionAddOn `json:"add_ons,omitempty"`

	// Unit amount
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive bool `json:"tax_inclusive,omitempty"`

	// Subscription quantity
	Quantity int `json:"quantity,omitempty"`

	// Subscription shipping details
	Shipping SubscriptionShipping `json:"shipping,omitempty"`

	// Activated at
	ActivateAt time.Time `json:"activate_at,omitempty"`

	// Returns `true` if the subscription change is activated.
	Activated bool `json:"activated,omitempty"`

	// Revenue schedule type
	RevenueScheduleType string `json:"revenue_schedule_type,omitempty"`

	// Setup fee revenue schedule type
	SetupFeeRevenueScheduleType string `json:"setup_fee_revenue_schedule_type,omitempty"`

	// Invoice Collection
	InvoiceCollection InvoiceCollection `json:"invoice_collection,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomField `json:"custom_fields,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Deleted at
	DeletedAt time.Time `json:"deleted_at,omitempty"`

	// Accept nested attributes for three_d_secure_action_result_token_id
	BillingInfo SubscriptionChangeBillingInfo `json:"billing_info,omitempty"`

	// The ramp intervals representing the pricing schedule for the subscription.
	RampIntervals []SubscriptionRampIntervalResponse `json:"ramp_intervals,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionChangePreview) GetResponse added in v3.3.0

func (resource *SubscriptionChangePreview) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionChangePreviewList added in v3.3.0

type SubscriptionChangePreviewList struct {
	HasMore bool
	Data    []SubscriptionChangePreview
	// contains filtered or unexported fields
}

SubscriptionChangePreviewList allows you to paginate SubscriptionChangePreview objects

func NewSubscriptionChangePreviewList added in v3.6.0

func NewSubscriptionChangePreviewList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionChangePreviewList

func (*SubscriptionChangePreviewList) Count added in v3.3.0

func (list *SubscriptionChangePreviewList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangePreviewList) CountWithContext added in v3.12.0

func (list *SubscriptionChangePreviewList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionChangePreviewList) Fetch added in v3.3.0

func (list *SubscriptionChangePreviewList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionChangePreviewList) FetchWithContext added in v3.12.0

func (list *SubscriptionChangePreviewList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionChangeShippingCreate

type SubscriptionChangeShippingCreate struct {
	Params `json:"-"`

	// The id of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodId *string `json:"method_id,omitempty"`

	// The code of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodCode *string `json:"method_code,omitempty"`

	// Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or `method_code` is required.
	Amount *float64 `json:"amount,omitempty"`
}

type SubscriptionCreate

type SubscriptionCreate struct {
	Params `json:"-"`

	// You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
	PlanCode *string `json:"plan_code,omitempty"`

	// You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
	PlanId *string `json:"plan_id,omitempty"`

	Account *AccountCreate `json:"account,omitempty"`

	// The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
	BillingInfoId *string `json:"billing_info_id,omitempty"`

	// Create a shipping address on the account and assign it to the subscription.
	Shipping *SubscriptionShippingCreate `json:"shipping,omitempty"`

	// Collection method
	CollectionMethod *string `json:"collection_method,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency *string `json:"currency,omitempty"`

	// Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`

	// Optionally override the default quantity of 1.
	Quantity *int `json:"quantity,omitempty"`

	// Add-ons
	AddOns []SubscriptionAddOnCreate `json:"add_ons,omitempty"`

	// Optional coupon code to redeem on the account and discount the subscription. Please note, the subscription request will fail if the coupon is invalid.
	CouponCode *string `json:"coupon_code,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// IIf set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
	TrialEndsAt *time.Time `json:"trial_ends_at,omitempty"`

	// If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
	StartsAt *time.Time `json:"starts_at,omitempty"`

	// If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.
	NextBillDate *time.Time `json:"next_bill_date,omitempty"`

	// The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
	TotalBillingCycles *int `json:"total_billing_cycles,omitempty"`

	// If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
	RenewalBillingCycles *int `json:"renewal_billing_cycles,omitempty"`

	// Whether the subscription renews at the end of its term.
	AutoRenew *bool `json:"auto_renew,omitempty"`

	// The new set of ramp intervals for the subscription.
	RampIntervals []SubscriptionRampInterval `json:"ramp_intervals,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
	TermsAndConditions *string `json:"terms_and_conditions,omitempty"`

	// This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
	CustomerNotes *string `json:"customer_notes,omitempty"`

	// If there are pending credits on the account that will be invoiced during the subscription creation, these will be used as the Customer Notes on the credit invoice.
	CreditCustomerNotes *string `json:"credit_customer_notes,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber *string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms *int `json:"net_terms,omitempty"`

	// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
	TransactionType *string `json:"transaction_type,omitempty"`
}

type SubscriptionList

type SubscriptionList struct {
	HasMore bool
	Data    []Subscription
	// contains filtered or unexported fields
}

SubscriptionList allows you to paginate Subscription objects

func NewSubscriptionList added in v3.6.0

func NewSubscriptionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionList

func (*SubscriptionList) Count

func (list *SubscriptionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionList) CountWithContext added in v3.12.0

func (list *SubscriptionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionList) Fetch

func (list *SubscriptionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionList) FetchWithContext added in v3.12.0

func (list *SubscriptionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionPause

type SubscriptionPause struct {
	Params `json:"-"`

	// Number of billing cycles to pause the subscriptions. A value of 0 will cancel any pending pauses on the subscription.
	RemainingPauseCycles *int `json:"remaining_pause_cycles,omitempty"`
}

type SubscriptionPurchase

type SubscriptionPurchase struct {
	Params `json:"-"`

	// Plan code
	PlanCode *string `json:"plan_code,omitempty"`

	// Plan ID
	PlanId *string `json:"plan_id,omitempty"`

	// Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
	UnitAmount *float64 `json:"unit_amount,omitempty"`

	// Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`

	// Optionally override the default quantity of 1.
	Quantity *int `json:"quantity,omitempty"`

	// Add-ons
	AddOns []SubscriptionAddOnCreate `json:"add_ons,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// Create a shipping address on the account and assign it to the subscription.
	Shipping *SubscriptionShippingPurchase `json:"shipping,omitempty"`

	// If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
	TrialEndsAt *time.Time `json:"trial_ends_at,omitempty"`

	// If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
	StartsAt *time.Time `json:"starts_at,omitempty"`

	// If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.
	NextBillDate *time.Time `json:"next_bill_date,omitempty"`

	// The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
	TotalBillingCycles *int `json:"total_billing_cycles,omitempty"`

	// If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
	RenewalBillingCycles *int `json:"renewal_billing_cycles,omitempty"`

	// Whether the subscription renews at the end of its term.
	AutoRenew *bool `json:"auto_renew,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// The new set of ramp intervals for the subscription.
	RampIntervals []SubscriptionRampInterval `json:"ramp_intervals,omitempty"`
}

type SubscriptionRampInterval added in v3.16.0

type SubscriptionRampInterval struct {
	Params `json:"-"`

	// Represents the billing cycle where a ramp interval starts.
	StartingBillingCycle *int `json:"starting_billing_cycle,omitempty"`

	// Represents the price for the ramp interval.
	UnitAmount *int `json:"unit_amount,omitempty"`
}

type SubscriptionRampIntervalResponse added in v3.16.0

type SubscriptionRampIntervalResponse struct {

	// Represents the billing cycle where a ramp interval starts.
	StartingBillingCycle int `json:"starting_billing_cycle,omitempty"`

	// Represents how many billing cycles are left in a ramp interval.
	RemainingBillingCycles int `json:"remaining_billing_cycles,omitempty"`

	// Date the ramp interval starts
	StartingOn time.Time `json:"starting_on,omitempty"`

	// Date the ramp interval ends
	EndingOn time.Time `json:"ending_on,omitempty"`

	// Represents the price for the ramp interval.
	UnitAmount int `json:"unit_amount,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionRampIntervalResponse) GetResponse added in v3.16.0

func (resource *SubscriptionRampIntervalResponse) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionRampIntervalResponseList added in v3.16.0

type SubscriptionRampIntervalResponseList struct {
	HasMore bool
	Data    []SubscriptionRampIntervalResponse
	// contains filtered or unexported fields
}

SubscriptionRampIntervalResponseList allows you to paginate SubscriptionRampIntervalResponse objects

func NewSubscriptionRampIntervalResponseList added in v3.16.0

func NewSubscriptionRampIntervalResponseList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionRampIntervalResponseList

func (*SubscriptionRampIntervalResponseList) Count added in v3.16.0

Count returns the count of items on the server that match this pager

func (*SubscriptionRampIntervalResponseList) CountWithContext added in v3.16.0

func (list *SubscriptionRampIntervalResponseList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionRampIntervalResponseList) Fetch added in v3.16.0

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionRampIntervalResponseList) FetchWithContext added in v3.16.0

func (list *SubscriptionRampIntervalResponseList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionShipping

type SubscriptionShipping struct {

	// Object type
	Object string `json:"object,omitempty"`

	Address ShippingAddress `json:"address,omitempty"`

	Method ShippingMethodMini `json:"method,omitempty"`

	// Subscription's shipping cost
	Amount float64 `json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionShipping) GetResponse

func (resource *SubscriptionShipping) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type SubscriptionShippingCreate

type SubscriptionShippingCreate struct {
	Params `json:"-"`

	Address *ShippingAddressCreate `json:"address,omitempty"`

	// Assign a shipping address from the account's existing shipping addresses. If `address_id` and `address` are both present, `address` will be used.
	AddressId *string `json:"address_id,omitempty"`

	// The id of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodId *string `json:"method_id,omitempty"`

	// The code of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodCode *string `json:"method_code,omitempty"`

	// Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or `method_code` is required.
	Amount *float64 `json:"amount,omitempty"`
}

type SubscriptionShippingList

type SubscriptionShippingList struct {
	HasMore bool
	Data    []SubscriptionShipping
	// contains filtered or unexported fields
}

SubscriptionShippingList allows you to paginate SubscriptionShipping objects

func NewSubscriptionShippingList added in v3.6.0

func NewSubscriptionShippingList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *SubscriptionShippingList

func (*SubscriptionShippingList) Count

func (list *SubscriptionShippingList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionShippingList) CountWithContext added in v3.12.0

func (list *SubscriptionShippingList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*SubscriptionShippingList) Fetch

func (list *SubscriptionShippingList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*SubscriptionShippingList) FetchWithContext added in v3.12.0

func (list *SubscriptionShippingList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type SubscriptionShippingPurchase

type SubscriptionShippingPurchase struct {
	Params `json:"-"`

	// The id of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodId *string `json:"method_id,omitempty"`

	// The code of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
	MethodCode *string `json:"method_code,omitempty"`

	// Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or `method_code` is required.
	Amount *float64 `json:"amount,omitempty"`
}

type SubscriptionShippingUpdate

type SubscriptionShippingUpdate struct {
	Params `json:"-"`

	// Object type
	Object *string `json:"object,omitempty"`

	Address *ShippingAddressCreate `json:"address,omitempty"`

	// Assign a shipping address from the account's existing shipping addresses.
	AddressId *string `json:"address_id,omitempty"`
}

type SubscriptionUpdate

type SubscriptionUpdate struct {
	Params `json:"-"`

	// Change collection method
	CollectionMethod *string `json:"collection_method,omitempty"`

	// The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
	CustomFields []CustomFieldCreate `json:"custom_fields,omitempty"`

	// The remaining billing cycles in the current term.
	RemainingBillingCycles *int `json:"remaining_billing_cycles,omitempty"`

	// If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
	RenewalBillingCycles *int `json:"renewal_billing_cycles,omitempty"`

	// Whether the subscription renews at the end of its term.
	AutoRenew *bool `json:"auto_renew,omitempty"`

	// If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. For a subscription in a trial period, this will change when the trial expires. This parameter is useful for postponement of a subscription to change its billing date without proration.
	NextBillDate *time.Time `json:"next_bill_date,omitempty"`

	// Revenue schedule type
	RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`

	// Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
	TermsAndConditions *string `json:"terms_and_conditions,omitempty"`

	// Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
	CustomerNotes *string `json:"customer_notes,omitempty"`

	// For manual invoicing, this identifies the PO number associated with the subscription.
	PoNumber *string `json:"po_number,omitempty"`

	// Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
	NetTerms *int `json:"net_terms,omitempty"`

	// This field is deprecated. Please do not use it.
	TaxInclusive *bool `json:"tax_inclusive,omitempty"`

	// Subscription shipping details
	Shipping *SubscriptionShippingUpdate `json:"shipping,omitempty"`

	// The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
	BillingInfoId *string `json:"billing_info_id,omitempty"`
}

type TaxDetail added in v3.14.0

type TaxDetail struct {

	// Provides the tax type for the region or type of Comminications tax when Avalara for Communications is enabled. For Canadian Sales Tax, this will be GST, HST, QST or PST.
	Type string `json:"type,omitempty"`

	// Provides the tax region applied on an invoice. For Canadian Sales Tax, this will be either the 2 letter province code or country code. Not present when Avalara for Communications is enabled.
	Region string `json:"region,omitempty"`

	// Provides the tax rate for the region.
	Rate float64 `json:"rate,omitempty"`

	// The total tax applied for this tax type.
	Tax float64 `json:"tax,omitempty"`

	// Provides the name of the Communications tax applied. Present only when Avalara for Communications is enabled.
	Name string `json:"name,omitempty"`

	// Provides the jurisdiction level for the Communications tax applied. Example values include city, state and federal. Present only when Avalara for Communications is enabled.
	Level string `json:"level,omitempty"`

	// Whether or not the line item is taxable. Only populated for a single LineItem fetch when Avalara for Communications is enabled.
	Billable bool `json:"billable,omitempty"`
	// contains filtered or unexported fields
}

func (*TaxDetail) GetResponse added in v3.14.0

func (resource *TaxDetail) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type TaxDetailList added in v3.14.0

type TaxDetailList struct {
	HasMore bool
	Data    []TaxDetail
	// contains filtered or unexported fields
}

TaxDetailList allows you to paginate TaxDetail objects

func NewTaxDetailList added in v3.14.0

func NewTaxDetailList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TaxDetailList

func (*TaxDetailList) Count added in v3.14.0

func (list *TaxDetailList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*TaxDetailList) CountWithContext added in v3.14.0

func (list *TaxDetailList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*TaxDetailList) Fetch added in v3.14.0

func (list *TaxDetailList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*TaxDetailList) FetchWithContext added in v3.14.0

func (list *TaxDetailList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type TaxInfo

type TaxInfo struct {

	// Provides the tax type as "vat" for EU VAT, "usst" for U.S. Sales Tax, or the 2 letter country code for country level tax types like Canada, Australia, New Zealand, Israel, and all non-EU European countries. Not present when Avalara for Communications is enabled.
	Type string `json:"type,omitempty"`

	// Provides the tax region applied on an invoice. For U.S. Sales Tax, this will be the 2 letter state code. For EU VAT this will be the 2 letter country code. For all country level tax types, this will display the regional tax, like VAT, GST, or PST. Not present when Avalara for Communications is enabled.
	Region string `json:"region,omitempty"`

	// The combined tax rate. Not present when Avalara for Communications is enabled.
	Rate float64 `json:"rate,omitempty"`

	// Provides additional tax details for Communications taxes when Avalara for Communications is enabled or Canadian Sales Tax when there is tax applied at both the country and province levels. This will only be populated for the Invoice response when fetching a single invoice and not for the InvoiceList or LineItemList. Only populated for a single LineItem fetch when Avalara for Communications is enabled.
	TaxDetails []TaxDetail `json:"tax_details,omitempty"`
	// contains filtered or unexported fields
}

func (*TaxInfo) GetResponse

func (resource *TaxInfo) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type TaxInfoList

type TaxInfoList struct {
	HasMore bool
	Data    []TaxInfo
	// contains filtered or unexported fields
}

TaxInfoList allows you to paginate TaxInfo objects

func NewTaxInfoList added in v3.6.0

func NewTaxInfoList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TaxInfoList

func (*TaxInfoList) Count

func (list *TaxInfoList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*TaxInfoList) CountWithContext added in v3.12.0

func (list *TaxInfoList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*TaxInfoList) Fetch

func (list *TaxInfoList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*TaxInfoList) FetchWithContext added in v3.12.0

func (list *TaxInfoList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type TerminateSubscriptionParams

type TerminateSubscriptionParams struct {
	Params

	// Refund - The type of refund to perform:
	// * `full` - Performs a full refund of the last invoice for the current subscription term.
	// * `partial` - Prorates a refund based on the amount of time remaining in the current bill cycle.
	// * `none` - Terminates the subscription without a refund.
	// In the event that the most recent invoice is a $0 invoice paid entirely by credit, Recurly will apply the credit back to the customer’s account.
	// You may also terminate a subscription with no refund and then manually refund specific invoices.
	Refund *string

	// Charge - Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
	Charge *bool
}

func (*TerminateSubscriptionParams) URLParams

func (list *TerminateSubscriptionParams) URLParams() []KeyValue

type Tier added in v3.1.0

type Tier struct {

	// Ending quantity
	EndingQuantity int `json:"ending_quantity,omitempty"`

	// Tier pricing
	Currencies []Pricing `json:"currencies,omitempty"`
	// contains filtered or unexported fields
}

func (*Tier) GetResponse added in v3.1.0

func (resource *Tier) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type TierCreate added in v3.1.0

type TierCreate struct {
	Params `json:"-"`

	// Ending quantity
	EndingQuantity *int `json:"ending_quantity,omitempty"`

	// Tier pricing
	Currencies []PricingCreate `json:"currencies,omitempty"`
}

type TierList added in v3.1.0

type TierList struct {
	HasMore bool
	Data    []Tier
	// contains filtered or unexported fields
}

TierList allows you to paginate Tier objects

func NewTierList added in v3.6.0

func NewTierList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TierList

func (*TierList) Count added in v3.1.0

func (list *TierList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*TierList) CountWithContext added in v3.12.0

func (list *TierList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*TierList) Fetch added in v3.1.0

func (list *TierList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*TierList) FetchWithContext added in v3.12.0

func (list *TierList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type Transaction

type Transaction struct {

	// Transaction ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
	Uuid string `json:"uuid,omitempty"`

	// If this transaction is a refund (`type=refund`), this will be the ID of the original transaction on the invoice being refunded.
	OriginalTransactionId string `json:"original_transaction_id,omitempty"`

	// Account mini details
	Account AccountMini `json:"account,omitempty"`

	// Invoice mini details
	Invoice InvoiceMini `json:"invoice,omitempty"`

	// Invoice mini details
	VoidedByInvoice InvoiceMini `json:"voided_by_invoice,omitempty"`

	// If the transaction is charging or refunding for one or more subscriptions, these are their IDs.
	SubscriptionIds []string `json:"subscription_ids,omitempty"`

	// - `authorization` – verifies billing information and places a hold on money in the customer's account.
	// - `capture` – captures funds held by an authorization and completes a purchase.
	// - `purchase` – combines the authorization and capture in one transaction.
	// - `refund` – returns all or a portion of the money collected in a previous transaction to the customer.
	// - `verify` – a $0 or $1 transaction used to verify billing information which is immediately voided.
	Type string `json:"type,omitempty"`

	// Describes how the transaction was triggered.
	Origin string `json:"origin,omitempty"`

	// 3-letter ISO 4217 currency code.
	Currency string `json:"currency,omitempty"`

	// Total transaction amount sent to the payment gateway.
	Amount float64 `json:"amount,omitempty"`

	// The current transaction status. Note that the status may change, e.g. a `pending` transaction may become `declined` or `success` may later become `void`.
	Status string `json:"status,omitempty"`

	// Did this transaction complete successfully?
	Success bool `json:"success,omitempty"`

	// Indicates if the transaction was completed using a backup payment
	BackupPaymentMethodUsed bool `json:"backup_payment_method_used,omitempty"`

	// Indicates if part or all of this transaction was refunded.
	Refunded bool `json:"refunded,omitempty"`

	BillingAddress Address `json:"billing_address,omitempty"`

	// The method by which the payment was collected.
	CollectionMethod string `json:"collection_method,omitempty"`

	PaymentMethod PaymentMethod `json:"payment_method,omitempty"`

	// IP address provided when the billing information was collected:
	// - When the customer enters billing information into the Recurly.js or Hosted Payment Pages, Recurly records the IP address.
	// - When the merchant enters billing information using the API, the merchant may provide an IP address.
	// - When the merchant enters billing information using the UI, no IP address is recorded.
	IpAddressV4 string `json:"ip_address_v4,omitempty"`

	// Origin IP address country, 2-letter ISO 3166-1 alpha-2 code, if known by Recurly.
	IpAddressCountry string `json:"ip_address_country,omitempty"`

	// Status code
	StatusCode string `json:"status_code,omitempty"`

	// For declined (`success=false`) transactions, the message displayed to the merchant.
	StatusMessage string `json:"status_message,omitempty"`

	// For declined (`success=false`) transactions, the message displayed to the customer.
	CustomerMessage string `json:"customer_message,omitempty"`

	// Language code for the message
	CustomerMessageLocale string `json:"customer_message_locale,omitempty"`

	PaymentGateway TransactionPaymentGateway `json:"payment_gateway,omitempty"`

	// Transaction message from the payment gateway.
	GatewayMessage string `json:"gateway_message,omitempty"`

	// Transaction reference number from the payment gateway.
	GatewayReference string `json:"gateway_reference,omitempty"`

	// Transaction approval code from the payment gateway.
	GatewayApprovalCode string `json:"gateway_approval_code,omitempty"`

	// For declined transactions (`success=false`), this field lists the gateway error code.
	GatewayResponseCode string `json:"gateway_response_code,omitempty"`

	// Time, in seconds, for gateway to process the transaction.
	GatewayResponseTime float64 `json:"gateway_response_time,omitempty"`

	// The values in this field will vary from gateway to gateway.
	GatewayResponseValues map[string]interface{} `json:"gateway_response_values,omitempty"`

	// When processed, result from checking the CVV/CVC value on the transaction.
	CvvCheck string `json:"cvv_check,omitempty"`

	// When processed, result from checking the overall AVS on the transaction.
	AvsCheck string `json:"avs_check,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Voided at
	VoidedAt time.Time `json:"voided_at,omitempty"`

	// Collected at, or if not collected yet, the time the transaction was created.
	CollectedAt time.Time `json:"collected_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Transaction) GetResponse

func (resource *Transaction) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type TransactionError

type TransactionError struct {
	TransactionID             string                   `json:"transaction_id"`
	Category                  TransactionErrorCategory `json:"category"`
	Code                      string                   `json:"code"`
	Message                   string                   `json:"message"`
	MerchantAdvice            string                   `json:"merchant_advice"`
	ThreeDSecureActionTokenId string                   `json:"three_d_secure_action_token_id"`
}

type TransactionErrorCategory

type TransactionErrorCategory string

type TransactionList

type TransactionList struct {
	HasMore bool
	Data    []Transaction
	// contains filtered or unexported fields
}

TransactionList allows you to paginate Transaction objects

func NewTransactionList added in v3.6.0

func NewTransactionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TransactionList

func (*TransactionList) Count

func (list *TransactionList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*TransactionList) CountWithContext added in v3.12.0

func (list *TransactionList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*TransactionList) Fetch

func (list *TransactionList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*TransactionList) FetchWithContext added in v3.12.0

func (list *TransactionList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type TransactionPaymentGateway

type TransactionPaymentGateway struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	Type string `json:"type,omitempty"`

	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*TransactionPaymentGateway) GetResponse

func (resource *TransactionPaymentGateway) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type TransactionPaymentGatewayList

type TransactionPaymentGatewayList struct {
	HasMore bool
	Data    []TransactionPaymentGateway
	// contains filtered or unexported fields
}

TransactionPaymentGatewayList allows you to paginate TransactionPaymentGateway objects

func NewTransactionPaymentGatewayList added in v3.6.0

func NewTransactionPaymentGatewayList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TransactionPaymentGatewayList

func (*TransactionPaymentGatewayList) Count

func (list *TransactionPaymentGatewayList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*TransactionPaymentGatewayList) CountWithContext added in v3.12.0

func (list *TransactionPaymentGatewayList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*TransactionPaymentGatewayList) Fetch

func (list *TransactionPaymentGatewayList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*TransactionPaymentGatewayList) FetchWithContext added in v3.12.0

func (list *TransactionPaymentGatewayList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type UniqueCouponCode

type UniqueCouponCode struct {

	// Unique Coupon Code ID
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// The code the customer enters to redeem the coupon.
	Code string `json:"code,omitempty"`

	// Indicates if the unique coupon code is redeemable or why not.
	State string `json:"state,omitempty"`

	// The Coupon ID of the parent Bulk Coupon
	BulkCouponId string `json:"bulk_coupon_id,omitempty"`

	// The Coupon code of the parent Bulk Coupon
	BulkCouponCode string `json:"bulk_coupon_code,omitempty"`

	// Created at
	CreatedAt time.Time `json:"created_at,omitempty"`

	// Updated at
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// The date and time the unique coupon code was redeemed.
	RedeemedAt time.Time `json:"redeemed_at,omitempty"`

	// The date and time the coupon was expired early or reached its `max_redemptions`.
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

func (*UniqueCouponCode) GetResponse

func (resource *UniqueCouponCode) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type UniqueCouponCodeList

type UniqueCouponCodeList struct {
	HasMore bool
	Data    []UniqueCouponCode
	// contains filtered or unexported fields
}

UniqueCouponCodeList allows you to paginate UniqueCouponCode objects

func NewUniqueCouponCodeList added in v3.6.0

func NewUniqueCouponCodeList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *UniqueCouponCodeList

func (*UniqueCouponCodeList) Count

func (list *UniqueCouponCodeList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*UniqueCouponCodeList) CountWithContext added in v3.12.0

func (list *UniqueCouponCodeList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*UniqueCouponCodeList) Fetch

func (list *UniqueCouponCodeList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*UniqueCouponCodeList) FetchWithContext added in v3.12.0

func (list *UniqueCouponCodeList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type Usage added in v3.5.0

type Usage struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	// Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.
	MerchantTag string `json:"merchant_tag,omitempty"`

	// The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places.  Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500").
	Amount float64 `json:"amount,omitempty"`

	// Type of usage, returns usage type if `add_on_type` is `usage`.
	UsageType string `json:"usage_type,omitempty"`

	// The pricing model for the add-on.  For more information,
	// [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based).
	TierType string `json:"tier_type,omitempty"`

	// The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = null
	Tiers []SubscriptionAddOnTier `json:"tiers,omitempty"`

	// The ID of the measured unit associated with the add-on the usage record is for.
	MeasuredUnitId string `json:"measured_unit_id,omitempty"`

	// When the usage was recorded in your system.
	RecordingTimestamp time.Time `json:"recording_timestamp,omitempty"`

	// When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.
	UsageTimestamp time.Time `json:"usage_timestamp,omitempty"`

	// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
	UsagePercentage float64 `json:"usage_percentage,omitempty"`

	// Unit price
	UnitAmount float64 `json:"unit_amount,omitempty"`

	// When the usage record was billed on an invoice.
	BilledAt time.Time `json:"billed_at,omitempty"`

	// When the usage record was created in Recurly.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When the usage record was billed on an invoice.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Usage) GetResponse added in v3.5.0

func (resource *Usage) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type UsageCreate added in v3.5.0

type UsageCreate struct {
	Params `json:"-"`

	// Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.
	MerchantTag *string `json:"merchant_tag,omitempty"`

	// The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places.  Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500").
	Amount *float64 `json:"amount,omitempty"`

	// When the usage was recorded in your system.
	RecordingTimestamp *time.Time `json:"recording_timestamp,omitempty"`

	// When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.
	UsageTimestamp *time.Time `json:"usage_timestamp,omitempty"`
}

type UsageList added in v3.5.0

type UsageList struct {
	HasMore bool
	Data    []Usage
	// contains filtered or unexported fields
}

UsageList allows you to paginate Usage objects

func NewUsageList added in v3.6.0

func NewUsageList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *UsageList

func (*UsageList) Count added in v3.5.0

func (list *UsageList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*UsageList) CountWithContext added in v3.12.0

func (list *UsageList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*UsageList) Fetch added in v3.5.0

func (list *UsageList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*UsageList) FetchWithContext added in v3.12.0

func (list *UsageList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type User

type User struct {
	Id string `json:"id,omitempty"`

	// Object type
	Object string `json:"object,omitempty"`

	Email string `json:"email,omitempty"`

	FirstName string `json:"first_name,omitempty"`

	LastName string `json:"last_name,omitempty"`

	TimeZone string `json:"time_zone,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`

	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

func (*User) GetResponse

func (resource *User) GetResponse() *ResponseMetadata

GetResponse returns the ResponseMetadata that generated this resource

type UserList

type UserList struct {
	HasMore bool
	Data    []User
	// contains filtered or unexported fields
}

UserList allows you to paginate User objects

func NewUserList added in v3.6.0

func NewUserList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *UserList

func (*UserList) Count

func (list *UserList) Count() (*int64, error)

Count returns the count of items on the server that match this pager

func (*UserList) CountWithContext added in v3.12.0

func (list *UserList) CountWithContext(ctx context.Context) (*int64, error)

Count returns the count of items on the server that match this pager

func (*UserList) Fetch

func (list *UserList) Fetch() error

Fetch fetches the next page of data into the `Data` property

func (*UserList) FetchWithContext added in v3.12.0

func (list *UserList) FetchWithContext(ctx context.Context) error

Fetch fetches the next page of data into the `Data` property

type VerifyBillingInfoParams added in v3.14.0

type VerifyBillingInfoParams struct {
	Params

	// Body - The body of the request.
	Body *BillingInfoVerify
}

func (*VerifyBillingInfoParams) URLParams added in v3.14.0

func (list *VerifyBillingInfoParams) URLParams() []KeyValue

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL