Categorygithub.com/umpc/stripe-go
modulepackage
36.1.1+incompatible
Repository: https://github.com/umpc/stripe-go.git
Documentation: pkg.go.dev

# README

Go Stripe

GoDoc Build Status Coverage Status

Summary

The official Stripe Go client library.

Versioning

Each revision of the binding is tagged and the version is updated accordingly.

Given Go's lack of built-in versioning, it is highly recommended you use a package management tool in order to ensure a newer version of the binding does not affect backwards compatibility.

To see the list of past versions, run git tag. To manually get an older version of the client, clone this repo, checkout the specific tag and build the library:

git clone https://github.com/stripe/stripe-go.git
cd stripe-go
git checkout api_version_tag
make build

For more details on changes between versions, see the binding changelog and API changelog.

Installation

go get github.com/stripe/stripe-go

Documentation

For a comprehensive list of examples, check out the API documentation.

For details on all the functionality in this library, see the GoDoc documentation.

Below are a few simple examples:

Customers

params := &stripe.CustomerParams{
	Balance:     stripe.Int64(-123),
	Description: stripe.String("Stripe Developer"),
	Email:       stripe.String("[email protected]"),
}
params.SetSource("tok_1234")

customer, err := customer.New(params)

Charges

params := &stripe.ChargeListParams{Customer: stripe.String(customer.ID)}
params.Filters.AddFilter("include[]", "", "total_count")

// set this so you can easily retry your request in case of a timeout
params.Params.IdempotencyKey = stripe.NewIdempotencyKey()

i := charge.List(params)
for i.Next() {
	charge := i.Charge()
}

if err := i.Err(); err != nil {
	// handle
}

Events

i := event.List(nil)
for i.Next() {
	e := i.Event()

	// access event data via e.GetObjectValue("resource_name_based_on_type", "resource_property_name")
	// alternatively you can access values via e.Data.Object["resource_name_based_on_type"].(map[string]interface{})["resource_property_name"]

	// access previous attributes via e.GetPreviousValue("resource_name_based_on_type", "resource_property_name")
	// alternatively you can access values via e.Data.PrevPreviousAttributes["resource_name_based_on_type"].(map[string]interface{})["resource_property_name"]
}

Alternatively, you can use the even.Data.Raw property to unmarshal to the appropriate struct.

Authentication with Connect

There are two ways of authenticating requests when performing actions on behalf of a connected account, one that uses the Stripe-Account header containing an account's ID, and one that uses the account's keys. Usually the former is the recommended approach. See the documentation for more information.

To use the Stripe-Account approach, use SetStripeAccount() on a ListParams or Params class. For example:

// For a list request
listParams := &stripe.ChargeListParams{}
listParams.SetStripeAccount("acct_123")
// For any other kind of request
params := &stripe.CustomerParams{}
params.SetStripeAccount("acct_123")

To use a key, pass it to API's Init function:


import (
	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/client"
)

stripe := &client.API{}
stripe.Init("access_token", nil)

Google AppEngine

If you're running the client in a Google AppEngine environment, you'll need to create a per-request Stripe client since the http.DefaultClient is not available. Here's a sample handler:

import (
	"fmt"
	"net/http"

	"google.golang.org/appengine"
	"google.golang.org/appengine/urlfetch"

	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/client"
)

func handler(w http.ResponseWriter, r *http.Request) {
        c := appengine.NewContext(r)
        httpClient := urlfetch.Client(c)

        sc := stripeClient.New("sk_live_key", stripe.NewBackends(httpClient))

        chargeParams := &stripe.ChargeParams{
            Amount:      stripe.Int64(2000),
            Currency:    stripe.String(string(stripe.CurrencyUSD)),
            Description: stripe.String("Charge from Google App Engine"),
        }
        chargeParams.SetSource("tok_amex") // obtained with Stripe.js
        charge, err := sc.Charges.New(chargeParams)
        if err != nil {
            fmt.Fprintf(w, "Could not process payment: %v", err)
        }
        fmt.Fprintf(w, "Completed payment: %v", charge.ID)
}

Usage

While some resources may contain more/less APIs, the following pattern is applied throughout the library for a given $resource$:

Without a Client

If you're only dealing with a single key, you can simply import the packages required for the resources you're interacting with without the need to create a client.

import (
	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/$resource$"
)

// Setup
stripe.Key = "sk_key"

stripe.SetBackend("api", backend) // optional, useful for mocking

// Create
$resource$, err := $resource$.New(stripe.$Resource$Params)

// Get
$resource$, err := $resource$.Get(id, stripe.$Resource$Params)

// Update
$resource$, err := $resource$.Update(stripe.$Resource$Params)

// Delete
resourceDeleted, err := $resource$.Del(id, stripe.$Resource$Params)

// List
i := $resource$.List(stripe.$Resource$ListParams)
for i.Next() {
	$resource$ := i.$Resource$()
}

if err := i.Err(); err != nil {
	// handle
}

With a Client

If you're dealing with multiple keys, it is recommended you use client.API. This allows you to create as many clients as needed, each with their own individual key.

import (
	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/client"
)

// Setup
sc := &client.API{}
sc.Init("sk_key", nil) // the second parameter overrides the backends used if needed for mocking

// Create
$resource$, err := sc.$Resource$s.New(stripe.$Resource$Params)

// Get
$resource$, err := sc.$Resource$s.Get(id, stripe.$Resource$Params)

// Update
$resource$, err := sc.$Resource$s.Update(stripe.$Resource$Params)

// Delete
resourceDeleted, err := sc.$Resource$s.Del(id, stripe.$Resource$Params)

// List
i := sc.$Resource$s.List(stripe.$Resource$ListParams)
for i.Next() {
	resource := i.$Resource$()
}

if err := i.Err(); err != nil {
	// handle
}

Writing a Plugin

If you're writing a plugin that uses the library, we'd appreciate it if you identified using stripe.SetAppInfo:

stripe.SetAppInfo(&stripe.AppInfo{
    Name:    "MyAwesomePlugin",
    URL:     "https://myawesomeplugin.info",
    Version: "1.2.34",
})

This information is passed along when the library makes calls to the Stripe API. Note that while Name is always required, URL and Version are optional.

Development

Pull requests from the community are welcome. If you submit one, please keep the following guidelines in mind:

  1. Code must be go fmt compliant.
  2. All types, structs and funcs should be documented.
  3. Ensure that make test succeeds.

Test

The test suite needs testify's require package to run:

github.com/stretchr/testify/require

It also depends on [stripe-mock], so make sure to fetch and run it from a background terminal ([stripe-mock's README][stripe-mock] also contains instructions for installing via Homebrew and other methods):

go get -u github.com/stripe/stripe-mock
stripe-mock

Run all tests:

go test ./...

Run tests for one package:

go test ./invoice

Run a single test:

go test ./invoice -run TestInvoiceGet

For any requests, bug or comments, please open an issue or submit a pull request.

# Packages

Package account provides API functions related to accounts.
Package applepaydomain provides the /apple_pay/domains APIs.
Package balance provides the /balance APIs.
Package bankaccount provides the /bank_accounts APIs.
Package bitcoinreceiver provides the /bitcoin/receivers APIs.
Package bitcointransaction provides the /bitcoin/transactions APIs.
Package card provides the /cards APIs.
Package charge provides API functions related to charges.
Package client provides a Stripe client for invoking APIs across all resources.
Package countryspec provides the /country_specs APIs.
Package coupon provides the /coupons APIs.
Package customer provides the /customers APIs.
Package discount provides the discount-related APIs.
No description provided by the author
Package ephemeralkey provides the /ephemeral_keys APIs.
Package event provides the /events APIs.
Package exchangerate provides the /exchange_rates APIs.
Package fee provides the /application_fees APIs.
Package feerefund provides the /application_fees/refunds APIs.
Package fileupload provides the file upload related APIs.
No description provided by the author
Package invoice provides the /invoices APIs.
Package invoiceitem provides the /invoiceitems APIs.
No description provided by the author
Package loginlink provides the /login_links APIs.
No description provided by the author
No description provided by the author
Package paymentintent provides API functions related to payment intents.
Package paymentsource provides the /sources APIs.
Package payout provides the /payouts APIs.
Package plan provides the /plans APIs.
No description provided by the author
Package recipient provides the /recipients APIs.
Package recipienttransfer provides the /recipient_transfers APIs.
Package refund provides the /refunds APIs.
Package reversal provides the /transfers/reversals APIs.
No description provided by the author
No description provided by the author
Package sourcetransaction provides the /source/transactions APIs.
Package sub provides the /subscriptions APIs.
Package subitem provides the /subscription_items APIs.
No description provided by the author
Package threedsecure provides the /3d_secure APIs This package is deprecated and should not be used anymore.
Package token provides the /tokens APIs.
No description provided by the author
Package transfer provides the /transfers APIs.
Package usagerecord provides the /subscription_items/{SUBSCRIPTION_ITEM_ID}/usage_records APIs.
No description provided by the author

# Functions

Bool returns a pointer to the bool value passed in.
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
Float64 returns a pointer to the float64 value passed in.
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
FormatURLPath takes a format string (of the kind used in the fmt package) representing a URL path with a number of parameters that belong in the path and returns a formatted string.
GetBackend returns one of the library's supported backends based off of the given argument.
GetBackendWithConfig is the same as GetBackend except that it can be given a configuration struct that will configure certain aspects of the backend that's return.
GetIter returns a new Iter for a given query and its options.
Int64 returns a pointer to the int64 value passed in.
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
NewBackends creates a new set of backends with the given HTTP client.
NewIdempotencyKey generates a new idempotency key that can be used on a request.
ParseID attempts to parse a string scalar from a given JSON value which is still encoded as []byte.
SetAppInfo sets app information.
SetBackend sets the backend used in the binding.
SetHTTPClient overrides the default HTTP client.
SourceParamsFor creates SourceParams objects around supported payment sources, returning errors if not.
String returns a pointer to the string value passed in.
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIBackend is a constant representing the API service backend.
APIURL is the URL of the API service backend.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
United Arab Emirates Dirham.
Afghan Afghani.
Albanian Lek.
Armenian Dram.
Netherlands Antillean Gulden.
Angolan Kwanza.
Argentine Peso.
Australian Dollar.
Aruban Florin.
Azerbaijani Manat.
Bosnia & Herzegovina Convertible Mark.
Barbadian Dollar.
Bangladeshi Taka.
Bulgarian Lev.
Burundian Franc.
Bermudian Dollar.
Brunei Dollar.
Bolivian Boliviano.
Brazilian Real.
Bahamian Dollar.
Botswana Pula.
Belize Dollar.
Canadian Dollar.
Congolese Franc.
Swiss Franc.
Chilean Peso.
Chinese Renminbi Yuan.
Colombian Peso.
Costa Rican Colón.
Cape Verdean Escudo.
Czech Koruna.
Djiboutian Franc.
Danish Krone.
Dominican Peso.
Algerian Dinar.
Estonian Kroon.
Egyptian Pound.
Ethiopian Birr.
Euro.
Fijian Dollar.
Falkland Islands Pound.
British Pound.
Georgian Lari.
Gibraltar Pound.
Gambian Dalasi.
Guinean Franc.
Guatemalan Quetzal.
Guyanese Dollar.
Hong Kong Dollar.
Honduran Lempira.
Croatian Kuna.
Haitian Gourde.
Hungarian Forint.
Indonesian Rupiah.
Israeli New Sheqel.
Indian Rupee.
Icelandic Króna.
Jamaican Dollar.
Japanese Yen.
Kenyan Shilling.
Kyrgyzstani Som.
Cambodian Riel.
Comorian Franc.
South Korean Won.
Cayman Islands Dollar.
Kazakhstani Tenge.
Lao Kip.
Lebanese Pound.
Sri Lankan Rupee.
Liberian Dollar.
Lesotho Loti.
Lithuanian Litas.
Latvian Lats.
Moroccan Dirham.
Moldovan Leu.
Malagasy Ariary.
Macedonian Denar.
Mongolian Tögrög.
Macanese Pataca.
Mauritanian Ouguiya.
Mauritian Rupee.
Maldivian Rufiyaa.
Malawian Kwacha.
Mexican Peso.
Malaysian Ringgit.
Mozambican Metical.
Namibian Dollar.
Nigerian Naira.
Nicaraguan Córdoba.
Norwegian Krone.
Nepalese Rupee.
New Zealand Dollar.
Panamanian Balboa.
Peruvian Nuevo Sol.
Papua New Guinean Kina.
Philippine Peso.
Pakistani Rupee.
Polish Złoty.
Paraguayan Guaraní.
Qatari Riyal.
Romanian Leu.
Serbian Dinar.
Russian Ruble.
Rwandan Franc.
Saudi Riyal.
Solomon Islands Dollar.
Seychellois Rupee.
Swedish Krona.
Singapore Dollar.
Saint Helenian Pound.
Sierra Leonean Leone.
Somali Shilling.
Surinamese Dollar.
São Tomé and Príncipe Dobra.
Salvadoran Colón.
Swazi Lilangeni.
Thai Baht.
Tajikistani Somoni.
Tongan Paʻanga.
Turkish Lira.
Trinidad and Tobago Dollar.
New Taiwan Dollar.
Tanzanian Shilling.
Ukrainian Hryvnia.
Ugandan Shilling.
United States Dollar.
Uruguayan Peso.
Uzbekistani Som.
Venezuelan Bolívar.
Vietnamese Đồng.
Vanuatu Vatu.
Samoan Tala.
Central African Cfa Franc.
East Caribbean Dollar.
West African Cfa Franc.
Cfp Franc.
Yemeni Rial.
South African Rand.
Zambian Kwacha.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnknownPlatform is the string returned as the system name if we couldn't get one from `uname`.
UploadsBackend is a constant representing the uploads service backend.
UploadsURL is the URL of the uploads service backend.
No description provided by the author
No description provided by the author

# Variables

Key is the Stripe API key used globally in the binding.
Logger controls how stripe performs logging at a package level.
LogLevel is the logging level for this library.

# Structs

Account is the resource representing your Stripe account.
Address is the structure for an account address.
AccountAddressParams represents an address during account creation/updates.
AccountDeclineSettings is the structure for an account's decline settings.
AccountDeclineSettingsParams represents the parameters allowed for configuring declines on connected accounts.
AccountExternalAccountParams are the parameters allowed to reference an external account when creating an account.
AccountList is a list of accounts as returned from a list endpoint.
AccountListParams are the parameters allowed during account listing.
AccountParams are the parameters allowed during account creation/updates.
AccountRejectParams is the structure for the Reject function.
AdditionalOwner is the structure for an account owner.
AdditionalOwnerParams represents an additional owner during account creation/updates.
Standard address resource.
Standard address parameters.
Amount is a structure wrapping an amount value and its currency.
APIConnectionError is a failure to connect to the Stripe API.
APIError is a catch all for any errors not covered by other types (and should be extremely uncommon).
AppInfo contains information about the "app" which this integration belongs to.
ApplePayDomain is the resource representing a Stripe ApplePayDomain object.
ApplePayDomainList is a list of ApplePayDomains as returned from a list endpoint.
ApplePayDomainListParams are the parameters allowed during ApplePayDomain listing.
ApplePayDomainParams is the set of parameters that can be used when creating an ApplePayDomain object.
No description provided by the author
ApplicationFee is the resource representing a Stripe application fee.
ApplicationFeeList is a list of application fees as retrieved from a list endpoint.
ApplicationFeeListParams is the set of parameters that can be used when listing application fees.
ApplicationFeeParams is the set of parameters that can be used when refunding an application fee.
AuthenticationError is a failure to properly authenticate during a request.
BackendConfig is used to configure a new Stripe backend.
BackendConfiguration is the internal implementation for making HTTP calls to Stripe.
Backends are the currently supported endpoints.
Balance is the resource representing your Stripe balance.
BalanceParams is the set of parameters that can be used when retrieving a balance.
BalanceTransaction is the resource representing the balance transaction.
BalanceTransactionFee is a structure that breaks down the fees in a transaction.
BalanceTransactionList is a list of transactions as returned from a list endpoint.
BalanceTransactionListParams is the set of parameters that can be used when listing balance transactions.
BalanceTransactionParams is the set of parameters that can be used when retrieving a transaction.
BalanceTransactionSource describes the source of a balance Transaction.
BankAccount represents a Stripe bank account.
BankAccountList is a list object for bank accounts.
BankAccountListParams is the set of parameters that can be used when listing bank accounts.
BankAccountParams is the set of parameters that can be used when updating a bank account.
BitcoinReceiver is the resource representing a Stripe bitcoin receiver.
BitcoinReceiverList is a list of bitcoin receivers as retrieved from a list endpoint.
BitcoinReceiverListParams is the set of parameters that can be used when listing BitcoinReceivers.
BitcoinReceiverParams is the set of parameters that can be used when creating a BitcoinReceiver.
BitcoinReceiverUpdateParams is the set of parameters that can be used when updating a BitcoinReceiver.
BitcoinTransaction is the resource representing a Stripe bitcoin transaction.
BitcoinTransactionList is a list object for BitcoinTransactions.
BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions.
CaptureParams is the set of parameters that can be used when capturing a charge.
Card is the resource representing a Stripe credit/debit card.
CardError are the most common type of error you should expect to handle.
CardList is a list object for cards.
CardListParams is the set of parameters that can be used when listing cards.
CardParams is the set of parameters that can be used when creating or updating a card.
Charge is the resource representing a Stripe charge.
ChargeLevel3 represents the Level III data.
ChargeLevel3LineItems represents a line item on level III data.
ChargeLevel3LineItemsParams is the set of parameters that represent a line item on level III data.
ChargeLevel3Params is the set of parameters that can be used for the Level III data.
ChargeList is a list of charges as retrieved from a list endpoint.
ChargeListParams is the set of parameters that can be used when listing charges.
Outcome is the charge's outcome that details whether a payment was accepted and why.
ChargeOutcomeRule tells you the Radar rule that blocked the charge, if any.
ChargeParams is the set of parameters that can be used when creating or updating a charge.
CodeVerificationFlow informs of the state of a verification authentication flow.
CountrySpec is the resource representing the rules required for a Stripe account.
CountrySpecList is a list of country specs as retrieved from a list endpoint.
CountrySpecListParams are the parameters allowed during CountrySpec listing.
CountrySpecParams are the parameters allowed during CountrySpec retrieval.
Coupon is the resource representing a Stripe coupon.
CouponList is a list of coupons as retrieved from a list endpoint.
CouponListParams is the set of parameters that can be used when listing coupons.
CouponParams is the set of parameters that can be used when creating a coupon.
Customer is the resource representing a Stripe customer.
CustomerList is a list of customers as retrieved from a list endpoint.
CustomerListParams is the set of parameters that can be used when listing customers.
CustomerParams is the set of parameters that can be used when creating or updating a customer.
CustomerShippingDetails is the structure containing shipping information.
CustomerShippingDetailsParams is the structure containing shipping information.
CustomerSourceParams are used to manipulate a given Stripe Customer object's payment sources.
No description provided by the author
No description provided by the author
Discount is the resource representing a Stripe discount.
DiscountParams is the set of parameters that can be used when deleting a discount.
Dispute is the resource representing a Stripe dispute.
DisputeEvidence is the structure that contains various details about the evidence submitted for the dispute.
DisputeEvidenceParams is the set of parameters that can be used when submitting evidence for disputes.
DisputeList is a list of disputes as retrieved from a list endpoint.
DisputeListParams is the set of parameters that can be used when listing disputes.
DisputeParams is the set of parameters that can be used when updating a dispute.
DOB is a structure for an account owner's date of birth.
DOBParams represents a DOB during account creation/updates.
EphemeralKey is the resource representing a Stripe ephemeral key.
EphemeralKeyParams is the set of parameters that can be used when creating an ephemeral key.
Error is the response returned when a call is unsuccessful.
Event is the resource representing a Stripe event.
EventData is the unmarshalled object as a map.
EventList is a list of events as retrieved from a list endpoint.
EventListParams is the set of parameters that can be used when listing events.
EventParams is the set of parameters that can be used when retrieving events.
EventRequest contains information on a request that created an event.
EvidenceDetails is the structure representing more details about the dispute.
ExchangeRate is the resource representing the currency exchange rates at a given time.
ExchangeRateList is a list of exchange rates as retrieved from a list endpoint.
ExchangeRateListParams are the parameters allowed during ExchangeRate listing.
ExchangeRateParams is the set of parameters that can be used when retrieving exchange rates.
ExternalAccount is an external account (a bank account or card) that's attached to an account.
ExternalAccountList is a list of external accounts that may be either bank accounts or cards.
ExtraValues are extra parameters that are attached to an API request.
FeeRefund is the resource representing a Stripe application fee refund.
FeeRefundList is a list object for application fee refunds.
FeeRefundListParams is the set of parameters that can be used when listing application fee refunds.
FeeRefundParams is the set of parameters that can be used when refunding an application fee.
FileUpload is the resource representing a Stripe file upload.
FileUploadList is a list of file uploads as retrieved from a list endpoint.
FileUploadListParams is the set of parameters that can be used when listing file uploads.
FileUploadParams is the set of parameters that can be used when creating a file upload.
Filters is a structure that contains a collection of filters for list-related APIs.
FraudDetails is the structure detailing fraud status.
FraudDetailsParams provides information on the fraud details for a charge.
IdentityVerification is the structure for an account's verification.
IdentityVerification represents a verification during account creation/updates.
InvalidRequestError is an error that occurs when a request contains invalid parameters.
No description provided by the author
No description provided by the author
Invoice is the resource representing a Stripe invoice.
InvoiceItem is the resource represneting a Stripe invoice item.
InvoiceItemList is a list of invoice items as retrieved from a list endpoint.
InvoiceItemListParams is the set of parameters that can be used when listing invoice items.
InvoiceItemParams is the set of parameters that can be used when creating or updating an invoice item.
InvoiceLine is the resource representing a Stripe invoice line item.
InvoiceLineList is a list object for invoice line items.
InvoiceLineListParams is the set of parameters that can be used when listing invoice line items.
InvoiceList is a list of invoices as retrieved from a list endpoint.
InvoiceListParams is the set of parameters that can be used when listing invoices.
InvoiceParams is the set of parameters that can be used when creating or updating an invoice.
InvoicePayParams is the set of parameters that can be used when paying invoices.
InvoiceUpcomingInvoiceItemParams is the set of parameters that can be used when adding or modifying invoice items on an upcoming invoice.
IssuerFraudRecord is the resource representing an issuer fraud record.
IssuerFraudRecordList is a list of issuer fraud records as retrieved from a list endpoint.
IssuerFraudRecordListParams is the set of parameters that can be used when listing issuer fraud records.
IssuerFraudRecordParams is the set of parameters that can be used when retrieving issuer fraud records.
Iter provides a convenient interface for iterating over the elements returned from paginated list API calls.
LegalEntity is the structure for properties related to an account's legal state.
LegalEntityParams represents a legal_entity during account creation/updates.
ListMeta is the structure that contains the common properties of List iterators.
ListParams is the structure that contains the common properties of any *ListParams structure.
LoginLink is the resource representing a login link for Express accounts.
LoginLinkParams is the set of parameters that can be used when creating a login_link.
No description provided by the author
No description provided by the author
No description provided by the author
OrderList is a list of orders as retrieved from a list endpoint.
OrderListParams is the set of parameters that can be used when listing orders.
No description provided by the author
OrderPayParams is the set of parameters that can be used when paying orders.
No description provided by the author
OrderReturnList is a list of returns as retrieved from a list endpoint.
OrderReturnListParams is the set of parameters that can be used when listing returns.
OrderReturnParams is the set of parameters that can be used when returning orders.
No description provided by the author
No description provided by the author
PackageDimensions represents the dimension of a product or a sku from the perspective of shipping.
PackageDimensions represents the dimension of a product or a sku from the perspective of shipping.
Params is the structure that contains the common properties of any *Params structure.
Payout is the resource representing a Stripe payout.
PayoutList is a list of payouts as retrieved from a list endpoint.
PaymentIntentListParams is the set of parameters that can be used when listing payment intents.
PaymentIntentParams is the set of parameters that can be used when handling a payment intent.
No description provided by the author
No description provided by the author
PaymentIntentSourceActionValue describes the `value` property in `next_source_action` The `type` in the parent should indicate which object is fleshed out.
No description provided by the author
No description provided by the author
PaymentSource describes the payment source used to make a Charge.
Payout is the resource representing a Stripe payout.
PayoutDestination describes the destination of a Payout.
PayoutList is a list of payouts as retrieved from a list endpoint.
PayoutListParams is the set of parameters that can be used when listing payouts.
PayoutParams is the set of parameters that can be used when creating or updating a payout.
PayoutSchedule is the structure for an account's payout schedule.
PayoutScheduleParams are the parameters allowed for payout schedules.
Period is a structure representing a start and end dates.
PermissionError results when you attempt to make an API request for which your API key doesn't have the right permissions.
PIIParams are parameters for personal identifiable information (PII).
Plan is the resource representing a Stripe plan.
PlanList is a list of plans as returned from a list endpoint.
PlanListParams is the set of parameters that can be used when listing plans.
PlanParams is the set of parameters that can be used when creating or updating a plan.
PlanProductParams is the set of parameters that can be used when creating a product inside a plan This can only be used on plan creation and won't work on plan update.
PlanTier configures tiered pricing.
PlanTierParams configures tiered pricing.
PlanTransformUsage represents the bucket billing configuration.
PlanTransformUsageParams represents the bucket billing configuration.
Product is the resource representing a Stripe product.
ProductList is a list of products as retrieved from a list endpoint.
ProductListParams is the set of parameters that can be used when listing products.
ProductParams is the set of parameters that can be used when creating or updating a product.
RangeQueryParams are a set of generic request parameters that are used on list endpoints to filter their results by some timestamp.
RateLimitError occurs when the Stripe API is hit to with too many requests too quickly and indicates that the current request has been rate limited.
ReceiverFlow informs of the state of a receiver authentication flow.
Recipient is the resource representing a Stripe recipient.
RecipientList is a list of recipients as retrieved from a list endpoint.
RecipientListParams is the set of parameters that can be used when listing recipients.
RecipientParams is the set of parameters that can be used when creating or updating recipients.
RecipientTransfer is the resource representing a Stripe recipient_transfer.
RecipientTransferDestination describes the destination of a RecipientTransfer.
ReceiverFlow informs of the state of a redirect authentication flow.
No description provided by the author
Refund is the resource representing a Stripe refund.
RefundList is a list object for refunds.
RefundListParams is the set of parameters that can be used when listing refunds.
RefundParams is the set of parameters that can be used when refunding a charge.
Reversal represents a transfer reversal.
ReversalList is a list of object for reversals.
ReversalListParams is the set of parameters that can be used when listing reversals.
ReversalParams is the set of parameters that can be used when reversing a transfer.
No description provided by the author
No description provided by the author
ShippingDetails is the structure containing shipping information.
ShippingDetailsParams is the structure containing shipping information as parameters.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SourceList is a list object for cards.
SourceListParams are used to enumerate the payment sources that are attached to a Customer.
No description provided by the author
No description provided by the author
SourceObjectDetachParams is the set of parameters that can be used when detaching a source from a customer.
No description provided by the author
No description provided by the author
No description provided by the author
SourceParams is a union struct used to describe an arbitrary payment source.
SourceTransaction is the resource representing a Stripe source transaction.
SourceTransactionList is a list object for SourceTransactions.
SourceTransactionListParams is the set of parameters that can be used when listing SourceTransactions.
SourceVerifyParams are used to verify a customer source For more details see https://stripe.com/docs/guides/ach-beta.
StatusTransitions are the timestamps at which the order status was updated https://stripe.com/docs/api#order_object.
Subscription is the resource representing a Stripe subscription.
SubscriptionCancelParams is the set of parameters that can be used when canceling a subscription.
SubscriptionItem is the resource representing a Stripe subscription item.
SubscriptionItemList is a list of invoice items as retrieved from a list endpoint.
SubscriptionItemListParams is the set of parameters that can be used when listing invoice items.
SubscriptionItemParams is the set of parameters that can be used when creating or updating a subscription item.
SubscriptionItemsParams is the set of parameters that can be used when creating or updating a subscription item on a subscription For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription.
SubscriptionList is a list object for subscriptions.
SubscriptionListParams is the set of parameters that can be used when listing active subscriptions.
SubscriptionParams is the set of parameters that can be used when creating or updating a subscription.
ThreeDSecure is the resource representing a Stripe 3DS object For more details see https://stripe.com/docs/api#three_d_secure.
ThreeDSecureParams is the set of parameters that can be used when creating a 3DS object.
Token is the resource representing a Stripe token.
TokenParams is the set of parameters that can be used when creating a token.
Topup is the resource representing a Stripe top-up.
TopupList is a list of top-ups as retrieved from a list endpoint.
TopupListParams is the set of parameters that can be used when listing top-ups.
TopupParams is the set of parameters that can be used when creating or updating a top-up.
TOSAcceptanceParams represents tos_acceptance during account creation/updates.
Transfer is the resource representing a Stripe transfer.
TransferDestination describes the destination of a Transfer.
TransferList is a list of transfers as retrieved from a list endpoint.
TransferListParams is the set of parameters that can be used when listing transfers.
TransferParams is the set of parameters that can be used when creating or updating a transfer.
UsageRecord represents a usage record.
UsageRecordParams create a usage record for a specified subscription item and date, and fills it with a quantity.
VerificationFieldsList lists the fields needed for an account verification.

# Interfaces

Backend is an interface for making calls against a Stripe service.
ListParamsContainer is a general interface for which all list parameter structs should comply.
ParamsContainer is a general interface for which all parameter structs should comply.
Printfer is an interface to be implemented by Logger.

# Type aliases

AccountRejectReason describes the valid reason to reject an account.
AccountType is the type of an account.
BalanceTransactionSourceType consts represent valid balance transaction sources.
BalanceTransactionStatus is the list of allowed values for the balance transaction's status.
BalanceTransactionType is the list of allowed values for the balance transaction's type.
BankAccountAccountHolderType is the list of allowed values for the bank account holder type.
BankAccountStatus is the list of allowed values for the bank account's status.
CardBrand is the list of allowed values for the card's brand.
CardFunding is the list of allowed values for the card's funding.
CardTokenizationMethod is the list of allowed values for the card's tokenization method.
CardVerification is the list of allowed verification responses.
ChargeFraudStripeReport is the list of allowed values for reporting fraud.
ChargeFraudUserReport is the list of allowed values for reporting fraud.
Country is the list of supported countries.
CouponDuration is the list of allowed values for the coupon's duration.
Currency is the list of supported currencies.
DisputeReason is the list of allowed values for a discount's reason.
DisputeStatus is the list of allowed values for a discount's status.
ErrorCode is the list of allowed values for the error's code.
ErrorType is the list of allowed values for the error's type.
ExternalAccountType is the type of an external account.
FileUploadPurpose is the purpose of a particular file upload.
IdentityVerificationDetailsCode is a machine-readable code specifying the verification state of a legal entity.
IdentityVerificationDisabledReason describes the valid reason to disable account.
IdentityVerificationStatus describes the different statuses for identity verification.
InvoiceBilling is the type of billing method for this invoice.
InvoiceBillingReason is the reason why a given invoice was created.
InvoiceLineType is the list of allowed values for the invoice line's type.
IssuerFraudType are strings that map to the fraud label category from the issuer.
LegalEntityType describes the types for a legal entity.
OrderDeliveryEstimateType represents the type of delivery estimate for shipping methods.
OrderItemType represents the type of order item.
OrderStatus represents the statuses of an order object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PaymentSourceType consts represent valid payment sources.
PayoutDestinationType consts represent valid payout destinations.
PayoutFailureCode is the list of allowed values for the payout's failure code.
Interval describes the payout interval.
PayoutMethodType represents the type of payout.
PayoutSourceType is the list of allowed values for the payout's source_type field.
PayoutStatus is the list of allowed values for the payout's status.
PayoutType is the list of allowed values for the payout's type.
PlanAggregateUsage is the list of allowed values for a plan's aggregate usage.
PlanBillingScheme is the list of allowed values for a plan's billing scheme.
PlanInterval is the list of allowed values for a plan's interval.
PlanTiersMode is the list of allowed values for a plan's tiers mode.
PlanTransformUsageRound is the list of allowed values for a plan's transform usage round logic.
PlanUsageType is the list of allowed values for a plan's usage type.
ProductType is the type of a product.
Query is the function used to get a page listing.
RecipientTransferDestinationType consts represent valid recipient_transfer destinations.
RecipientTransferFailureCode is the list of allowed values for the recipient_transfer's failure code.
RecipientTransferMethodType represents the type of recipient_transfer.
RecipientTransferSourceType is the list of allowed values for the recipient_transfer's source_type field.
RecipientTransferStatus is the list of allowed values for the recipient_transfer's status.
RecipientTransferType is the list of allowed values for the recipient_transfer's type.
RecipientType is the list of allowed values for the recipient's type.
RefundReason is, if set, the reason the refund is being made.
RefundStatus is the status of the refund.
ReviewReasonType describes the reason why the review is open or closed.
SKUInventoryType describe's the possible value for inventory type.
SKUInventoryValue describe's the possible value for inventory value.
SourceCodeVerificationFlowStatus represents the possible statuses of a code verification flow.
SourceFlow represents the possible flows of a source object.
SourceMandateAcceptanceStatus represents the possible failure reasons of a redirect flow.
SourceRedirectFlowFailureReason represents the possible failure reasons of a redirect flow.
SourceRedirectFlowStatus represents the possible statuses of a redirect flow.
SourceRefundAttributesMethod are the possible method to retrieve a receiver's refund attributes.
SourceRefundAttributesStatus are the possible status of a receiver's refund attributes.
SourceStatus represents the possible statuses of a source object.
SourceUsage represents the possible usages of a source object.
SubscriptionBilling is the type of billing method for this subscription's invoices.
SubscriptionStatus is the list of allowed values for the subscription's status.
SupportedBackend is an enumeration of supported Stripe endpoints.
No description provided by the author
TokenType is the list of allowed values for a token's type.
TransferSourceType is the list of allowed values for the transfer's source_type field.