paddle

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

Paddle GO SDK

Paddle Billing is a complete digital product sales and subscription management platform, designed for modern software businesses. It helps you increase your revenue, retain customers, and scale your operations.

This is a Go SDK that you can use to integrate Paddle Billing with applications written in server-side Go.

For working with Paddle in your frontend, use Paddle.js. You can open checkouts, securely collect payment information, build pricing pages, and integrate with Paddle Retain.

Important: This package works with Paddle Billing. It does not support Paddle Classic. To work with Paddle Classic, see: Paddle Classic API reference

Learn more

Requirements

Go 1.21 or later

Before you begin

If you've used this SDK, we'd love to hear how you found it! Email us at team-dx@paddle.com with any thoughts.

While in early access, we may introduce breaking changes. Where we can, we'll tag breaking changes and communicate ahead of time.

Installation

Make sure your project is using Go Modules (it will have a go.mod file in its root if it already is):

go mod init

To install the Paddle Go SDK, use the following command:

go get github.com/PaddleHQ/paddle-go-sdk

Then, reference paddle-go-sdk in a Go program with import:

import (
    paddle "github.com/PaddleHQ/paddle-go-sdk"
)

Usage

To authenticate, you'll need an API key. You can create and manage API keys in Paddle > Developer tools > Authentication.

Pass your API key while initializing a new Paddle client.

import (
    paddle "github.com/PaddleHQ/paddle-go-sdk"
)

client, err := paddle.New(
    os.Getenv("PADDLE_API_KEY"),
    paddle.WithBaseURL(paddle.ProductionBaseURL),
)

You can now use the client to make requests to the Paddle API.

Examples

List all entities

You can list supported entities with the List* function. It returns an iterator to help when working with multiple pages.

products, err := client.ListProducts(ctx, &paddle.ListProductsRequest{IncludePrices: true})
if err != nil {
    panic(err)
}

err = products.Iter(ctx, func(p *paddle.ProductWithIncludes) (bool, error) {
    // Do something with the product
    fmt.Printf("%+v\n", p)
    return true, nil
})
if err != nil {
    panic(err)
}
Create an entity

You can create a supported entity with the Create* function. It accepts the resource's corresponding Create*Request operation e.g. CreateProductRequest. The created entity is returned.

product, err := client.CreateProduct(ctx, &paddle.CreateProductRequest{
    Name:        "Test Product - GO SDK",
    TaxCategory: paddle.TaxCategoryStandard,
})
if err != nil {
    panic(err)
}
fmt.Printf("%+v\n", product)
Update an entity

You can update a supported entity with the Update* function. It accepts the ID of the entity to update and the corresponding Update*Request operation e.g. UpdateProductRequest. The updated entity is returned.

product, err := client.UpdateProduct(ctx, &paddle.UpdateProductRequest{
    ProductID: product.ID,
    Name:      paddle.NewPatchField("Test Product - GO SDK Updated"),
})
if err != nil {
    panic(err)
}
fmt.Printf("%+v\n", product)
Get an entity

You can get an entity with the Get* function. It accepts the ID of the entity to get and the corresponding Get*Request operation e.g. GetProductRequest. The entity is returned.

product, err := client.GetProduct(ctx, &paddle.GetProductRequest{
    ProductID: productID, 
    IncludePrices: true
})
if err != nil {
    panic(err)
}
fmt.Printf("%+v\n", product)

Resources

Webhook signature verification

The SDK includes a couple of helper functions to verify webhook signatures sent by Notifications from Paddle.

You could use a middleware to verify the signature of the incoming request before processing it.

verifier := paddle.NewWebhookVerifier(os.Getenv("WEBHOOK_SECRET_KEY"))
// Wrap your handler with the verifier.Middleware method
handler := verifier.Middleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    // The request making it this far means the webhook was verified
    // Best practice here is to check if you have processed this webhook already using the event id
    // At this point you should store for async processing
    // For example a local queue or db entry

    // Respond as soon as possible with a 200 OK
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(http.StatusOK)
    w.Write([]byte(`{"success": true}`))
}))

Alternatively you can verify the signature of the incoming request manually.

webhookVerifier := paddle.NewWebhookVerifier(os.Getenv("WEBHOOK_SECRET_KEY"))
// Note: the request (req *http.Request) should be pass exactly as it comes without altering it.
ok, err := webhookVerifier.Verify(req)

Feature parity

While in early access, not all operations in the Paddle API are available in our Go SDK. We're working on complete feature parity for our final release.

This table shows which operations are available as of the latest release.

Paddle API operation Support
Products Full
List products
Create a product
Get a product
Update a product
Prices Full
List prices
Create a price
Get a price
Update a price
Discounts Full
List discounts
Create a discount
Get a discount
Update a discount
Customers Full
List customers
Create a customer
Get a customer
Update a customer
List credit balances for a customer
Addresses Full
List addresses for a customer
Create an addresses for a customer
Get an address for a customer
Update an address for a customer
Businesses
List businesses for a customer
Create a business for a customer
Get a business for a customer
Update a business for a customer
Transactions Full
List transactions
Create a transaction
Get a transaction
Update a transaction
Preview a transaction
Get a PDF invoice for a transaction
Subscriptions Full
List subscriptions
Get a subscription
Preview an update to a subscription
Update a subscription
Get a transaction to update payment method
Preview a one-time charge for a subscription
Create a one-time charge for a subscription
Activate a trialing subscription
Pause a subscription
Resume a paused subscription
Cancel a subscription
Adjustments Full
List adjustments
Create an adjustment
Pricing preview Full
Preview prices
Reports Full
List reports
Create a report
Get a report
Get a CSV file for a report
Notification settings Full
List notification settings
Create a notification setting
Get a notification setting
Update a notification setting
Delete a notification setting
Event types Full
List event types
Events -
List events -
Notifications Partial
List notifications -
Get a notification -
Replay a notification
Notification logs Full
List logs for a notification

Learn more

Documentation

Overview

Code generated by the Paddle SDK Generator; DO NOT EDIT.

Package paddle provides the official SDK for using the Paddle Billing API.

Example (Create)

Demonstrates how to create a new entity.

// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})

// Create a new Paddle client.
client, err := paddle.New(
	os.Getenv("PADDLE_API_KEY"),
	paddle.WithBaseURL(s.URL), // Uses the mock server, you will not need this in your integration.
)

if err != nil {
	fmt.Println(err)
	return
}

ctx := context.Background()

// Optionally set a transit ID on the context. This is useful to link your
// own request IDs to Paddle API requests.
ctx = paddle.ContextWithTransitID(ctx, "sdk-testing-request-1")

// Create a transaction.
res, err := client.CreateTransaction(ctx, &paddle.CreateTransactionRequest{
	Items: []paddle.CreateTransactionItems{
		*paddle.NewCreateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 20,
			PriceID:  "pri_01gsz91wy9k1yn7kx82aafwvea",
		}),
		*paddle.NewCreateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 1,
			PriceID:  "pri_01gsz96z29d88jrmsf2ztbfgjg",
		}),
		*paddle.NewCreateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 1,
			PriceID:  "pri_01gsz98e27ak2tyhexptwc58yk",
		}),
	},
	CustomerID:     paddle.PtrTo("ctm_01hv6y1jedq4p1n0yqn5ba3ky4"),
	AddressID:      paddle.PtrTo("add_01hv8gq3318ktkfengj2r75gfx"),
	CurrencyCode:   paddle.PtrTo(paddle.CurrencyCodeUSD),
	CollectionMode: paddle.PtrTo(paddle.CollectionModeManual),
	BillingDetails: &paddle.BillingDetails{
		EnableCheckout:      false,
		PurchaseOrderNumber: "PO-123",
		PaymentTerms: paddle.Duration{
			Interval:  paddle.IntervalDay,
			Frequency: 14,
		},
	},
	BillingPeriod: &paddle.TimePeriod{
		StartsAt: time.Date(2024, 4, 12, 0, 0, 0, 0, time.UTC).Format(time.RFC3339),
		EndsAt:   time.Date(2024, 4, 12, 0, 0, 0, 0, time.UTC).Format(time.RFC3339),
	},
})

fmt.Println(res.ID, err)
Output:

txn_01hv8m0mnx3sj85e7gxc6kga03 <nil>
Example (Get)

Demonstrates how to get an existing entity.

// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})

// Create a new Paddle client.
client, err := paddle.New(
	os.Getenv("PADDLE_API_KEY"),
	paddle.WithBaseURL(s.URL), // Uses the mock server, you will not need this in your integration.
)

if err != nil {
	fmt.Println(err)
	return
}

ctx := context.Background()

// Optionally set a transit ID on the context. This is useful to link your
// own request IDs to Paddle API requests.
ctx = paddle.ContextWithTransitID(ctx, "sdk-testing-request-1")

// Get a transaction.
res, err := client.GetTransaction(ctx, &paddle.GetTransactionRequest{
	TransactionID: "txn_01hv8m0mnx3sj85e7gxc6kga03",
})

fmt.Println(res.ID, err)
Output:

txn_01hv8m0mnx3sj85e7gxc6kga03 <nil>
Example (List)

Demonstrates how to fetch a list and iterate over the provided results.

// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transactions}}})

// Create a new Paddle client.
client, err := paddle.New(
	os.Getenv("PADDLE_API_KEY"),
	paddle.WithBaseURL(s.URL), // Uses the mock server, you will not need this in your integration.
)

if err != nil {
	fmt.Println(err)
	return
}

ctx := context.Background()

// Optionally set a transit ID on the context. This is useful to link your
// own request IDs to Paddle API requests.
ctx = paddle.ContextWithTransitID(ctx, "sdk-testing-request-1")

// Get a collection of transactions.
res, err := client.ListTransactions(ctx, &paddle.ListTransactionsRequest{})

// Iterate the transactions.
err = res.Iter(ctx, func(v *paddle.TransactionIncludes) (bool, error) {
	fmt.Println(v.ID)
	return true, nil
})
fmt.Println(err)
Output:

txn_01hv8xxw3etar07vaxsqbyqasy
txn_01hv8xbtmb6zc7c264ycteehth
txn_01hv8wptq8987qeep44cyrewp9
<nil>
Example (Pagination)

Demonstrates how to fetch a list and iterate over the provided results, including the automatic pagination.

// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{
	transactionsPaginatedPg1,
	transactionsPaginatedPg2,
}}})

// Create a new Paddle client.
client, err := paddle.New(
	os.Getenv("PADDLE_API_KEY"),
	paddle.WithBaseURL(s.URL), // Uses the mock server, you will not need this in your integration.
)

if err != nil {
	fmt.Println(err)
	return
}

ctx := context.Background()

// Optionally set a transit ID on the context. This is useful to link your
// own request IDs to Paddle API requests.
ctx = paddle.ContextWithTransitID(ctx, "sdk-testing-request-1")

// Get a collection of transactions.
res, err := client.ListTransactions(ctx, &paddle.ListTransactionsRequest{})

// Iterate the transactions which will internally paginate to the next page.
err = res.Iter(ctx, func(v *paddle.TransactionIncludes) (bool, error) {
	fmt.Println(v.ID)
	return true, nil
})
fmt.Println(err)
Output:

txn_01hv8xxw3etar07vaxsqbyqasy
txn_01hv8xbtmb6zc7c264ycteehth
txn_01hv8wptq8987qeep44cyrewp9
txn_01hv8wnvvtedwjrhfhpr9vkq9w
txn_01hv8m0mnx3sj85e7gxc6kga03
txn_01hv8kxg3hxyxs9t471ms9kfsz
<nil>
Example (Update)

Demonstrates how to update an existing entity.

// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})

// Create a new Paddle client.
client, err := paddle.New(
	os.Getenv("PADDLE_API_KEY"),
	paddle.WithBaseURL(s.URL), // Uses the mock server, you will not need this in your integration.
)

if err != nil {
	fmt.Println(err)
	return
}

ctx := context.Background()

// Optionally set a transit ID on the context. This is useful to link your
// own request IDs to Paddle API requests.
ctx = paddle.ContextWithTransitID(ctx, "sdk-testing-request-1")

// Update a transaction.
res, err := client.UpdateTransaction(ctx, &paddle.UpdateTransactionRequest{
	DiscountID: paddle.NewPtrPatchField("dsc_01gtgztp8fpchantd5g1wrksa3"),
	Items: paddle.NewPatchField([]paddle.UpdateTransactionItems{
		*paddle.NewUpdateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 50,
			PriceID:  "pri_01gsz91wy9k1yn7kx82aafwvea",
		}),
		*paddle.NewUpdateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 1,
			PriceID:  "pri_01gsz96z29d88jrmsf2ztbfgjg",
		}),
		*paddle.NewUpdateTransactionItemsCatalogItem(&paddle.CatalogItem{
			Quantity: 1,
			PriceID:  "pri_01gsz98e27ak2tyhexptwc58yk",
		}),
	}),
})

fmt.Println(res.ID, err)
Output:

txn_01hv8m0mnx3sj85e7gxc6kga03 <nil>

Index

Examples

Constants

View Source
const (
	NotificationSettingTypeEmail = "email"
	NotificationSettingTypeURL   = "url"
)
View Source
const (
	NotificationStatusNotAttempted = "not_attempted"
	NotificationStatusNeedsRetry   = "needs_retry"
	NotificationStatusDelivered    = "delivered"
	NotificationStatusFailed       = "failed"
)
View Source
const (
	OriginEvent  = "event"
	OriginReplay = "replay"
)
View Source
const (
	// ProductionBaseURL is the base URL for the production Paddle API.
	ProductionBaseURL = "https://api.paddle.com"

	// SandboxBaseURL is the base URL for the sandbox Paddle API.
	SandboxBaseURL = "https://sandbox-api.paddle.com"
)
View Source
const (
	ReportTypeAdjustmentsAdjustments         = "adjustments"
	ReportTypeAdjustmentsAdjustmentLineItems = "adjustment_line_items"
)
View Source
const (
	CatalogTypeCustom   = "custom"
	CatalogTypeStandard = "standard"
)
View Source
const (
	TaxCategoryDigitalGoods                = "digital-goods"
	TaxCategoryEbooks                      = "ebooks"
	TaxCategoryImplementationServices      = "implementation-services"
	TaxCategoryProfessionalServices        = "professional-services"
	TaxCategorySaas                        = "saas"
	TaxCategorySoftwareProgrammingServices = "software-programming-services"
	TaxCategoryStandard                    = "standard"
	TaxCategoryTrainingServices            = "training-services"
	TaxCategoryWebsiteHosting              = "website-hosting"
)
View Source
const (
	StatusActive   = "active"
	StatusArchived = "archived"
)
View Source
const (
	IntervalDay   = "day"
	IntervalWeek  = "week"
	IntervalMonth = "month"
	IntervalYear  = "year"
)
View Source
const (
	TaxModeAccountSetting = "account_setting"
	TaxModeExternal       = "external"
	TaxModeInternal       = "internal"
)
View Source
const (
	CurrencyCodeUSD = "USD"
	CurrencyCodeEUR = "EUR"
	CurrencyCodeGBP = "GBP"
	CurrencyCodeJPY = "JPY"
	CurrencyCodeAUD = "AUD"
	CurrencyCodeCAD = "CAD"
	CurrencyCodeCHF = "CHF"
	CurrencyCodeHKD = "HKD"
	CurrencyCodeSGD = "SGD"
	CurrencyCodeSEK = "SEK"
	CurrencyCodeARS = "ARS"
	CurrencyCodeBRL = "BRL"
	CurrencyCodeCNY = "CNY"
	CurrencyCodeCOP = "COP"
	CurrencyCodeCZK = "CZK"
	CurrencyCodeDKK = "DKK"
	CurrencyCodeHUF = "HUF"
	CurrencyCodeILS = "ILS"
	CurrencyCodeINR = "INR"
	CurrencyCodeKRW = "KRW"
	CurrencyCodeMXN = "MXN"
	CurrencyCodeNOK = "NOK"
	CurrencyCodeNZD = "NZD"
	CurrencyCodePLN = "PLN"
	CurrencyCodeRUB = "RUB"
	CurrencyCodeTHB = "THB"
	CurrencyCodeTRY = "TRY"
	CurrencyCodeTWD = "TWD"
	CurrencyCodeUAH = "UAH"
	CurrencyCodeZAR = "ZAR"
)
View Source
const (
	CountryCodeAD = "AD"
	CountryCodeAE = "AE"
	CountryCodeAG = "AG"
	CountryCodeAI = "AI"
	CountryCodeAL = "AL"
	CountryCodeAM = "AM"
	CountryCodeAO = "AO"
	CountryCodeAR = "AR"
	CountryCodeAS = "AS"
	CountryCodeAT = "AT"
	CountryCodeAU = "AU"
	CountryCodeAW = "AW"
	CountryCodeAX = "AX"
	CountryCodeAZ = "AZ"
	CountryCodeBA = "BA"
	CountryCodeBB = "BB"
	CountryCodeBD = "BD"
	CountryCodeBE = "BE"
	CountryCodeBF = "BF"
	CountryCodeBG = "BG"
	CountryCodeBH = "BH"
	CountryCodeBI = "BI"
	CountryCodeBJ = "BJ"
	CountryCodeBL = "BL"
	CountryCodeBM = "BM"
	CountryCodeBN = "BN"
	CountryCodeBO = "BO"
	CountryCodeBQ = "BQ"
	CountryCodeBR = "BR"
	CountryCodeBS = "BS"
	CountryCodeBT = "BT"
	CountryCodeBV = "BV"
	CountryCodeBW = "BW"
	CountryCodeBZ = "BZ"
	CountryCodeCA = "CA"
	CountryCodeCC = "CC"
	CountryCodeCG = "CG"
	CountryCodeCH = "CH"
	CountryCodeCI = "CI"
	CountryCodeCK = "CK"
	CountryCodeCL = "CL"
	CountryCodeCM = "CM"
	CountryCodeCN = "CN"
	CountryCodeCO = "CO"
	CountryCodeCR = "CR"
	CountryCodeCV = "CV"
	CountryCodeCW = "CW"
	CountryCodeCX = "CX"
	CountryCodeCY = "CY"
	CountryCodeCZ = "CZ"
	CountryCodeDE = "DE"
	CountryCodeDJ = "DJ"
	CountryCodeDK = "DK"
	CountryCodeDM = "DM"
	CountryCodeDO = "DO"
	CountryCodeDZ = "DZ"
	CountryCodeEC = "EC"
	CountryCodeEE = "EE"
	CountryCodeEG = "EG"
	CountryCodeEH = "EH"
	CountryCodeER = "ER"
	CountryCodeES = "ES"
	CountryCodeET = "ET"
	CountryCodeFI = "FI"
	CountryCodeFJ = "FJ"
	CountryCodeFK = "FK"
	CountryCodeFM = "FM"
	CountryCodeFO = "FO"
	CountryCodeFR = "FR"
	CountryCodeGA = "GA"
	CountryCodeGB = "GB"
	CountryCodeGD = "GD"
	CountryCodeGE = "GE"
	CountryCodeGF = "GF"
	CountryCodeGG = "GG"
	CountryCodeGH = "GH"
	CountryCodeGI = "GI"
	CountryCodeGL = "GL"
	CountryCodeGM = "GM"
	CountryCodeGN = "GN"
	CountryCodeGP = "GP"
	CountryCodeGQ = "GQ"
	CountryCodeGR = "GR"
	CountryCodeGS = "GS"
	CountryCodeGT = "GT"
	CountryCodeGU = "GU"
	CountryCodeGW = "GW"
	CountryCodeGY = "GY"
	CountryCodeHK = "HK"
	CountryCodeHM = "HM"
	CountryCodeHN = "HN"
	CountryCodeHR = "HR"
	CountryCodeHU = "HU"
	CountryCodeID = "ID"
	CountryCodeIE = "IE"
	CountryCodeIL = "IL"
	CountryCodeIM = "IM"
	CountryCodeIN = "IN"
	CountryCodeIO = "IO"
	CountryCodeIQ = "IQ"
	CountryCodeIS = "IS"
	CountryCodeIT = "IT"
	CountryCodeJE = "JE"
	CountryCodeJM = "JM"
	CountryCodeJO = "JO"
	CountryCodeJP = "JP"
	CountryCodeKE = "KE"
	CountryCodeKG = "KG"
	CountryCodeKH = "KH"
	CountryCodeKI = "KI"
	CountryCodeKM = "KM"
	CountryCodeKN = "KN"
	CountryCodeKR = "KR"
	CountryCodeKW = "KW"
	CountryCodeKY = "KY"
	CountryCodeKZ = "KZ"
	CountryCodeLA = "LA"
	CountryCodeLB = "LB"
	CountryCodeLC = "LC"
	CountryCodeLI = "LI"
	CountryCodeLK = "LK"
	CountryCodeLR = "LR"
	CountryCodeLS = "LS"
	CountryCodeLT = "LT"
	CountryCodeLU = "LU"
	CountryCodeLV = "LV"
	CountryCodeMA = "MA"
	CountryCodeMC = "MC"
	CountryCodeMD = "MD"
	CountryCodeME = "ME"
	CountryCodeMF = "MF"
	CountryCodeMG = "MG"
	CountryCodeMH = "MH"
	CountryCodeMK = "MK"
	CountryCodeMN = "MN"
	CountryCodeMO = "MO"
	CountryCodeMP = "MP"
	CountryCodeMQ = "MQ"
	CountryCodeMR = "MR"
	CountryCodeMS = "MS"
	CountryCodeMT = "MT"
	CountryCodeMU = "MU"
	CountryCodeMV = "MV"
	CountryCodeMW = "MW"
	CountryCodeMX = "MX"
	CountryCodeMY = "MY"
	CountryCodeMZ = "MZ"
	CountryCodeNA = "NA"
	CountryCodeNC = "NC"
	CountryCodeNE = "NE"
	CountryCodeNF = "NF"
	CountryCodeNG = "NG"
	CountryCodeNL = "NL"
	CountryCodeNO = "NO"
	CountryCodeNP = "NP"
	CountryCodeNR = "NR"
	CountryCodeNU = "NU"
	CountryCodeNZ = "NZ"
	CountryCodeOM = "OM"
	CountryCodePA = "PA"
	CountryCodePE = "PE"
	CountryCodePF = "PF"
	CountryCodePG = "PG"
	CountryCodePH = "PH"
	CountryCodePK = "PK"
	CountryCodePL = "PL"
	CountryCodePM = "PM"
	CountryCodePN = "PN"
	CountryCodePR = "PR"
	CountryCodePS = "PS"
	CountryCodePT = "PT"
	CountryCodePW = "PW"
	CountryCodePY = "PY"
	CountryCodeQA = "QA"
	CountryCodeRE = "RE"
	CountryCodeRO = "RO"
	CountryCodeRS = "RS"
	CountryCodeRW = "RW"
	CountryCodeSA = "SA"
	CountryCodeSB = "SB"
	CountryCodeSC = "SC"
	CountryCodeSE = "SE"
	CountryCodeSG = "SG"
	CountryCodeSH = "SH"
	CountryCodeSI = "SI"
	CountryCodeSJ = "SJ"
	CountryCodeSK = "SK"
	CountryCodeSL = "SL"
	CountryCodeSM = "SM"
	CountryCodeSN = "SN"
	CountryCodeSR = "SR"
	CountryCodeST = "ST"
	CountryCodeSV = "SV"
	CountryCodeSX = "SX"
	CountryCodeSZ = "SZ"
	CountryCodeTC = "TC"
	CountryCodeTD = "TD"
	CountryCodeTF = "TF"
	CountryCodeTG = "TG"
	CountryCodeTH = "TH"
	CountryCodeTJ = "TJ"
	CountryCodeTK = "TK"
	CountryCodeTL = "TL"
	CountryCodeTM = "TM"
	CountryCodeTN = "TN"
	CountryCodeTO = "TO"
	CountryCodeTR = "TR"
	CountryCodeTT = "TT"
	CountryCodeTV = "TV"
	CountryCodeTW = "TW"
	CountryCodeTZ = "TZ"
	CountryCodeUA = "UA"
	CountryCodeUG = "UG"
	CountryCodeUM = "UM"
	CountryCodeUS = "US"
	CountryCodeUY = "UY"
	CountryCodeUZ = "UZ"
	CountryCodeVA = "VA"
	CountryCodeVC = "VC"
	CountryCodeVG = "VG"
	CountryCodeVI = "VI"
	CountryCodeVN = "VN"
	CountryCodeVU = "VU"
	CountryCodeWF = "WF"
	CountryCodeWS = "WS"
	CountryCodeXK = "XK"
	CountryCodeYT = "YT"
	CountryCodeZA = "ZA"
	CountryCodeZM = "ZM"
)
View Source
const (
	CollectionModeAutomatic = "automatic"
	CollectionModeManual    = "manual"
)
View Source
const (
	TransactionStatusDraft     = "draft"
	TransactionStatusReady     = "ready"
	TransactionStatusBilled    = "billed"
	TransactionStatusPaid      = "paid"
	TransactionStatusCompleted = "completed"
	TransactionStatusCanceled  = "canceled"
	TransactionStatusPastDue   = "past_due"
)
View Source
const (
	TransactionOriginAPI                             = "api"
	TransactionOriginSubscriptionCharge              = "subscription_charge"
	TransactionOriginSubscriptionPaymentMethodChange = "subscription_payment_method_change"
	TransactionOriginSubscriptionRecurring           = "subscription_recurring"
	TransactionOriginSubscriptionUpdate              = "subscription_update"
	TransactionOriginWeb                             = "web"
)
View Source
const (
	CurrencyCodePayoutsAUD = "AUD"
	CurrencyCodePayoutsCAD = "CAD"
	CurrencyCodePayoutsCHF = "CHF"
	CurrencyCodePayoutsCNY = "CNY"
	CurrencyCodePayoutsCZK = "CZK"
	CurrencyCodePayoutsDKK = "DKK"
	CurrencyCodePayoutsEUR = "EUR"
	CurrencyCodePayoutsGBP = "GBP"
	CurrencyCodePayoutsHUF = "HUF"
	CurrencyCodePayoutsPLN = "PLN"
	CurrencyCodePayoutsSEK = "SEK"
	CurrencyCodePayoutsUSD = "USD"
	CurrencyCodePayoutsZAR = "ZAR"
)
View Source
const (
	CurrencyCodeChargebacksEUR = "EUR"
	CurrencyCodeChargebacksGBP = "GBP"
	CurrencyCodeChargebacksUSD = "USD"
)
View Source
const (
	PaymentAttemptStatusAuthorized              = "authorized"
	PaymentAttemptStatusAuthorizedFlagged       = "authorized_flagged"
	PaymentAttemptStatusCanceled                = "canceled"
	PaymentAttemptStatusCaptured                = "captured"
	PaymentAttemptStatusError                   = "error"
	PaymentAttemptStatusActionRequired          = "action_required"
	PaymentAttemptStatusPendingNoActionRequired = "pending_no_action_required"
	PaymentAttemptStatusCreated                 = "created"
	PaymentAttemptStatusUnknown                 = "unknown"
	PaymentAttemptStatusDropped                 = "dropped"
)
View Source
const (
	ErrorCodeAlreadyCanceled         = "already_canceled"
	ErrorCodeAlreadyRefunded         = "already_refunded"
	ErrorCodeAuthenticationFailed    = "authentication_failed"
	ErrorCodeBlockedCard             = "blocked_card"
	ErrorCodeCanceled                = "canceled"
	ErrorCodeDeclined                = "declined"
	ErrorCodeDeclinedNotRetryable    = "declined_not_retryable"
	ErrorCodeExpiredCard             = "expired_card"
	ErrorCodeFraud                   = "fraud"
	ErrorCodeInvalidAmount           = "invalid_amount"
	ErrorCodeInvalidPaymentDetails   = "invalid_payment_details"
	ErrorCodeIssuerUnavailable       = "issuer_unavailable"
	ErrorCodeNotEnoughBalance        = "not_enough_balance"
	ErrorCodePspError                = "psp_error"
	ErrorCodeRedactedPaymentMethod   = "redacted_payment_method"
	ErrorCodeSystemError             = "system_error"
	ErrorCodeTransactionNotPermitted = "transaction_not_permitted"
	ErrorCodeUnknown                 = "unknown"
)
View Source
const (
	PaymentMethodTypeAlipay       = "alipay"
	PaymentMethodTypeApplePay     = "apple_pay"
	PaymentMethodTypeBancontact   = "bancontact"
	PaymentMethodTypeCard         = "card"
	PaymentMethodTypeGooglePay    = "google_pay"
	PaymentMethodTypeIdeal        = "ideal"
	PaymentMethodTypeOffline      = "offline"
	PaymentMethodTypePaypal       = "paypal"
	PaymentMethodTypeUnknown      = "unknown"
	PaymentMethodTypeWireTransfer = "wire_transfer"
)
View Source
const (
	CardTypeAmericanExpress = "american_express"
	CardTypeDinersClub      = "diners_club"
	CardTypeDiscover        = "discover"
	CardTypeJcb             = "jcb"
	CardTypeMada            = "mada"
	CardTypeMaestro         = "maestro"
	CardTypeMastercard      = "mastercard"
	CardTypeUnionPay        = "union_pay"
	CardTypeUnknown         = "unknown"
	CardTypeVisa            = "visa"
)
View Source
const (
	ActionCredit            = "credit"
	ActionRefund            = "refund"
	ActionChargeback        = "chargeback"
	ActionChargebackReverse = "chargeback_reverse"
	ActionChargebackWarning = "chargeback_warning"
	ActionCreditReverse     = "credit_reverse"
)
View Source
const (
	AdjustmentStatusPendingApproval = "pending_approval"
	AdjustmentStatusApproved        = "approved"
	AdjustmentStatusRejected        = "rejected"
	AdjustmentStatusReversed        = "reversed"
)
View Source
const (
	AdjustmentTypeFull      = "full"
	AdjustmentTypePartial   = "partial"
	AdjustmentTypeTax       = "tax"
	AdjustmentTypeProration = "proration"
)
View Source
const (
	DiscountStatusActive   = "active"
	DiscountStatusArchived = "archived"
	DiscountStatusExpired  = "expired"
	DiscountStatusUsed     = "used"
)
View Source
const (
	DiscountTypeFlat        = "flat"
	DiscountTypeFlatPerSeat = "flat_per_seat"
	DiscountTypePercentage  = "percentage"
)
View Source
const (
	SubscriptionStatusActive   = "active"
	SubscriptionStatusCanceled = "canceled"
	SubscriptionStatusPastDue  = "past_due"
	SubscriptionStatusPaused   = "paused"
	SubscriptionStatusTrialing = "trialing"
)
View Source
const (
	ScheduledChangeActionCancel = "cancel"
	ScheduledChangeActionPause  = "pause"
	ScheduledChangeActionResume = "resume"
)
View Source
const (
	SubscriptionItemStatusActive   = "active"
	SubscriptionItemStatusInactive = "inactive"
	SubscriptionItemStatusTrialing = "trialing"
)
View Source
const (
	ReportStatusPending = "pending"
	ReportStatusReady   = "ready"
	ReportStatusFailed  = "failed"
	ReportStatusExpired = "expired"
)
View Source
const (
	ReportTypeTransactionsAdjustments          = "adjustments"
	ReportTypeTransactionsAdjustmentLineItems  = "adjustment_line_items"
	ReportTypeTransactionsTransactions         = "transactions"
	ReportTypeTransactionsTransactionLineItems = "transaction_line_items"
	ReportTypeTransactionsProductsPrices       = "products_prices"
	ReportTypeTransactionsDiscounts            = "discounts"
)
View Source
const (
	SharedNameAction           = "action"
	SharedNameCurrencyCode     = "currency_code"
	SharedNameStatus           = "status"
	SharedNameUpdatedAt        = "updated_at"
	SharedNameCollectionMode   = "collection_mode"
	SharedNameOrigin           = "origin"
	SharedNameProductStatus    = "product_status"
	SharedNamePriceStatus      = "price_status"
	SharedNameProductType      = "product_type"
	SharedNamePriceType        = "price_type"
	SharedNameProductUpdatedAt = "product_updated_at"
	SharedNamePriceUpdatedAt   = "price_updated_at"
	SharedNameType             = "type"
)
View Source
const (
	SharedOperatorLt  = "lt"
	SharedOperatorGte = "gte"
)
View Source
const (
	EffectiveFromNextBillingPeriod = "next_billing_period"
	EffectiveFromImmediately       = "immediately"
)
View Source
const (
	ProrationBillingModeProratedImmediately       = "prorated_immediately"
	ProrationBillingModeProratedNextBillingPeriod = "prorated_next_billing_period"
	ProrationBillingModeFullImmediately           = "full_immediately"
	ProrationBillingModeFullNextBillingPeriod     = "full_next_billing_period"
	ProrationBillingModeDoNotBill                 = "do_not_bill"
)
View Source
const (
	SubscriptionOnPaymentFailurePreventChange = "prevent_change"
	SubscriptionOnPaymentFailureApplyChange   = "apply_change"
)
View Source
const (
	ResultActionCredit = "credit"
	ResultActionCharge = "charge"
)
View Source
const TypeProductsPrices = "products_prices"

Variables

View Source
var (
	// ErrMissingSignature is returned when the signature is missing.
	ErrMissingSignature = errors.New("missing signature")

	// ErrInvalidSignatureFormat is returned when the signature format is invalid.
	ErrInvalidSignatureFormat = errors.New("invalid signature format")
)
View Source
var ErrAddressLocationNotAllowed = &paddleerr.Error{
	Code: "address_location_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAddressLocationNotAllowed represents a `address_location_not_allowed` error. See https://developer.paddle.com/errors/addresses/address_location_not_allowed for more information.

View Source
var ErrAdjustmentAmountAboveRemainingAllowed = &paddleerr.Error{
	Code: "adjustment_amount_above_remaining_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentAmountAboveRemainingAllowed represents a `adjustment_amount_above_remaining_allowed` error. See https://developer.paddle.com/errors/adjustments/adjustment_amount_above_remaining_allowed for more information.

View Source
var ErrAdjustmentAmountCannotBeZero = &paddleerr.Error{
	Code: "adjustment_amount_cannot_be_zero",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentAmountCannotBeZero represents a `adjustment_amount_cannot_be_zero` error. See https://developer.paddle.com/errors/adjustments/adjustment_amount_cannot_be_zero for more information.

View Source
var ErrAdjustmentCannotAdjustImportedTransaction = &paddleerr.Error{
	Code: "adjustment_cannot_adjust_imported_transaction",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentCannotAdjustImportedTransaction represents a `adjustment_cannot_adjust_imported_transaction` error. See https://developer.paddle.com/errors/adjustments/adjustment_cannot_adjust_imported_transaction for more information.

View Source
var ErrAdjustmentInvalidCombinationOfTypes = &paddleerr.Error{
	Code: "adjustment_invalid_combination_of_types",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentInvalidCombinationOfTypes represents a `adjustment_invalid_combination_of_types` error. See https://developer.paddle.com/errors/adjustments/adjustment_invalid_combination_of_types for more information.

View Source
var ErrAdjustmentInvalidCreditAction = &paddleerr.Error{
	Code: "adjustment_invalid_credit_action",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentInvalidCreditAction represents a `adjustment_invalid_credit_action` error. See https://developer.paddle.com/errors/adjustments/adjustment_invalid_credit_action for more information.

View Source
var ErrAdjustmentNoTaxAvailableToAdjust = &paddleerr.Error{
	Code: "adjustment_no_tax_available_to_adjust",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentNoTaxAvailableToAdjust represents a `adjustment_no_tax_available_to_adjust` error. See https://developer.paddle.com/errors/adjustments/adjustment_no_tax_available_to_adjust for more information.

View Source
var ErrAdjustmentPendingRefundRequest = &paddleerr.Error{
	Code: "adjustment_pending_refund_request",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentPendingRefundRequest represents a `adjustment_pending_refund_request` error. See https://developer.paddle.com/errors/adjustments/adjustment_pending_refund_request for more information.

View Source
var ErrAdjustmentTotalAmountAboveRemainingAllowed = &paddleerr.Error{
	Code: "adjustment_total_amount_above_remaining_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTotalAmountAboveRemainingAllowed represents a `adjustment_total_amount_above_remaining_allowed` error. See https://developer.paddle.com/errors/adjustments/adjustment_total_amount_above_remaining_allowed for more information.

View Source
var ErrAdjustmentTransactionCustomerMismatch = &paddleerr.Error{
	Code: "adjustment_transaction_customer_mismatch",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionCustomerMismatch represents a `adjustment_transaction_customer_mismatch` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_customer_mismatch for more information.

View Source
var ErrAdjustmentTransactionInvalidStatusForCredit = &paddleerr.Error{
	Code: "adjustment_transaction_invalid_status_for_credit",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionInvalidStatusForCredit represents a `adjustment_transaction_invalid_status_for_credit` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_invalid_status_for_credit for more information.

View Source
var ErrAdjustmentTransactionInvalidStatusForRefund = &paddleerr.Error{
	Code: "adjustment_transaction_invalid_status_for_refund",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionInvalidStatusForRefund represents a `adjustment_transaction_invalid_status_for_refund` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_invalid_status_for_refund for more information.

View Source
var ErrAdjustmentTransactionItemHasAlreadyBeenFullyAdjusted = &paddleerr.Error{
	Code: "adjustment_transaction_item_has_already_been_fully_adjusted",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionItemHasAlreadyBeenFullyAdjusted represents a `adjustment_transaction_item_has_already_been_fully_adjusted` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_item_has_already_been_fully_adjusted for more information.

View Source
var ErrAdjustmentTransactionItemInvalid = &paddleerr.Error{
	Code: "adjustment_transaction_item_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionItemInvalid represents a `adjustment_transaction_item_invalid` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_item_invalid for more information.

View Source
var ErrAdjustmentTransactionItemOverAdjustment = &paddleerr.Error{
	Code: "adjustment_transaction_item_over_adjustment",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionItemOverAdjustment represents a `adjustment_transaction_item_over_adjustment` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_item_over_adjustment for more information.

View Source
var ErrAdjustmentTransactionMissingCustomerID = &paddleerr.Error{
	Code: "adjustment_transaction_missing_customer_id",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionMissingCustomerID represents a `adjustment_transaction_missing_customer_id` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_missing_customer_id for more information.

View Source
var ErrAdjustmentTransactionSubscriptionMismatch = &paddleerr.Error{
	Code: "adjustment_transaction_subscription_mismatch",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAdjustmentTransactionSubscriptionMismatch represents a `adjustment_transaction_subscription_mismatch` error. See https://developer.paddle.com/errors/adjustments/adjustment_transaction_subscription_mismatch for more information.

View Source
var ErrAuthenticationMalformed = &paddleerr.Error{
	Code: "authentication_malformed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAuthenticationMalformed represents a `authentication_malformed` error. See https://developer.paddle.com/errors/shared/authentication_malformed for more information.

View Source
var ErrAuthenticationMissing = &paddleerr.Error{
	Code: "authentication_missing",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrAuthenticationMissing represents a `authentication_missing` error. See https://developer.paddle.com/errors/shared/authentication_missing for more information.

View Source
var ErrBadGateway = &paddleerr.Error{
	Code: "bad_gateway",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrBadGateway represents a `bad_gateway` error. See https://developer.paddle.com/errors/shared/bad_gateway for more information.

View Source
var ErrBadRequest = &paddleerr.Error{
	Code: "bad_request",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrBadRequest represents a `bad_request` error. See https://developer.paddle.com/errors/shared/bad_request for more information.

View Source
var ErrBusinessContactEmailDomainNotAllowed = &paddleerr.Error{
	Code: "business_contact_email_domain_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrBusinessContactEmailDomainNotAllowed represents a `business_contact_email_domain_not_allowed` error. See https://developer.paddle.com/errors/businesses/business_contact_email_domain_not_allowed for more information.

View Source
var ErrConcurrentModification = &paddleerr.Error{
	Code: "concurrent_modification",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrConcurrentModification represents a `concurrent_modification` error. See https://developer.paddle.com/errors/shared/concurrent_modification for more information.

View Source
var ErrConflict = &paddleerr.Error{
	Code: "conflict",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrConflict represents a `conflict` error. See https://developer.paddle.com/errors/shared/conflict for more information.

View Source
var ErrCurrencyCodeInvalid = &paddleerr.Error{
	Code: "currency_code_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCurrencyCodeInvalid represents a `currency_code_invalid` error. See https://developer.paddle.com/errors/currencies/currency_code_invalid for more information.

View Source
var ErrCurrencyCodesInvalid = &paddleerr.Error{
	Code: "currency_codes_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCurrencyCodesInvalid represents a `currency_codes_invalid` error. See https://developer.paddle.com/errors/currencies/currency_codes_invalid for more information.

View Source
var ErrCurrencyPrimaryBalanceInvalid = &paddleerr.Error{
	Code: "currency_primary_balance_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCurrencyPrimaryBalanceInvalid represents a `currency_primary_balance_invalid` error. See https://developer.paddle.com/errors/currencies/currency_primary_balance_invalid for more information.

View Source
var ErrCustomerAlreadyExists = &paddleerr.Error{
	Code: "customer_already_exists",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCustomerAlreadyExists represents a `customer_already_exists` error. See https://developer.paddle.com/errors/customers/customer_already_exists for more information.

View Source
var ErrCustomerEmailDomainNotAllowed = &paddleerr.Error{
	Code: "customer_email_domain_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCustomerEmailDomainNotAllowed represents a `customer_email_domain_not_allowed` error. See https://developer.paddle.com/errors/customers/customer_email_domain_not_allowed for more information.

View Source
var ErrCustomerEmailInvalid = &paddleerr.Error{
	Code: "customer_email_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrCustomerEmailInvalid represents a `customer_email_invalid` error. See https://developer.paddle.com/errors/customers/customer_email_invalid for more information.

View Source
var ErrDiscountCodeConflict = &paddleerr.Error{
	Code: "discount_code_conflict",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrDiscountCodeConflict represents a `discount_code_conflict` error. See https://developer.paddle.com/errors/discounts/discount_code_conflict for more information.

View Source
var ErrDiscountExpired = &paddleerr.Error{
	Code: "discount_expired",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrDiscountExpired represents a `discount_expired` error. See https://developer.paddle.com/errors/discounts/discount_expired for more information.

View Source
var ErrDiscountRestrictedProductNotActive = &paddleerr.Error{
	Code: "discount_restricted_product_not_active",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrDiscountRestrictedProductNotActive represents a `discount_restricted_product_not_active` error. See https://developer.paddle.com/errors/discounts/discount_restricted_product_not_active for more information.

View Source
var ErrDiscountRestrictedProductPriceNotActive = &paddleerr.Error{
	Code: "discount_restricted_product_price_not_active",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrDiscountRestrictedProductPriceNotActive represents a `discount_restricted_product_price_not_active` error. See https://developer.paddle.com/errors/discounts/discount_restricted_product_price_not_active for more information.

View Source
var ErrDiscountUsageLimitExceeded = &paddleerr.Error{
	Code: "discount_usage_limit_exceeded",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrDiscountUsageLimitExceeded represents a `discount_usage_limit_exceeded` error. See https://developer.paddle.com/errors/discounts/discount_usage_limit_exceeded for more information.

View Source
var ErrEmailNotificationSettingIncorrect = &paddleerr.Error{
	Code: "email_notification_setting_incorrect",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrEmailNotificationSettingIncorrect represents a `email_notification_setting_incorrect` error. See https://developer.paddle.com/errors/notifications/email_notification_setting_incorrect for more information.

View Source
var ErrEntityArchived = &paddleerr.Error{
	Code: "entity_archived",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrEntityArchived represents a `entity_archived` error. See https://developer.paddle.com/errors/shared/entity_archived for more information.

View Source
var ErrForbidden = &paddleerr.Error{
	Code: "forbidden",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrForbidden represents a `forbidden` error. See https://developer.paddle.com/errors/shared/forbidden for more information.

View Source
var ErrInternalError = &paddleerr.Error{
	Code: "internal_error",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrInternalError represents a `internal_error` error. See https://developer.paddle.com/errors/shared/internal_error for more information.

View Source
var ErrInvalidField = &paddleerr.Error{
	Code: "invalid_field",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrInvalidField represents a `invalid_field` error. See https://developer.paddle.com/errors/shared/invalid_field for more information.

View Source
var ErrInvalidJson = &paddleerr.Error{
	Code: "invalid_json",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrInvalidJson represents a `invalid_json` error. See https://developer.paddle.com/errors/shared/invalid_json for more information.

View Source
var ErrInvalidTimeQueryParameter = &paddleerr.Error{
	Code: "invalid_time_query_parameter",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrInvalidTimeQueryParameter represents a `invalid_time_query_parameter` error. See https://developer.paddle.com/errors/shared/invalid_time_query_parameter for more information.

View Source
var ErrInvalidToken = &paddleerr.Error{
	Code: "invalid_token",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrInvalidToken represents a `invalid_token` error. See https://developer.paddle.com/errors/shared/invalid_token for more information.

View Source
var ErrInvalidURL = &paddleerr.Error{
	Code: "invalid_url",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrInvalidURL represents a `invalid_url` error. See https://developer.paddle.com/errors/shared/invalid_url for more information.

View Source
var ErrMethodNotAllowed = &paddleerr.Error{
	Code: "method_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrMethodNotAllowed represents a `method_not_allowed` error. See https://developer.paddle.com/errors/shared/method_not_allowed for more information.

View Source
var ErrNotFound = &paddleerr.Error{
	Code: "not_found",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrNotFound represents a `not_found` error. See https://developer.paddle.com/errors/shared/not_found for more information.

View Source
var ErrNotImplemented = &paddleerr.Error{
	Code: "not_implemented",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrNotImplemented represents a `not_implemented` error. See https://developer.paddle.com/errors/shared/not_implemented for more information.

View Source
var ErrNotificationCannotReplay = &paddleerr.Error{
	Code: "notification_cannot_replay",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrNotificationCannotReplay represents a `notification_cannot_replay` error. See https://developer.paddle.com/errors/notifications/notification_cannot_replay for more information.

View Source
var ErrNotificationMaximumActiveSettingsReached = &paddleerr.Error{
	Code: "notification_maximum_active_settings_reached",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrNotificationMaximumActiveSettingsReached represents a `notification_maximum_active_settings_reached` error. See https://developer.paddle.com/errors/notifications/notification_maximum_active_settings_reached for more information.

View Source
var ErrNotificationReplayInvalidOriginType = &paddleerr.Error{
	Code: "notification_replay_invalid_origin_type",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrNotificationReplayInvalidOriginType represents a `notification_replay_invalid_origin_type` error. See https://developer.paddle.com/errors/notifications/notification_replay_invalid_origin_type for more information.

View Source
var ErrPaddleBillingNotEnabled = &paddleerr.Error{
	Code: "paddle_billing_not_enabled",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPaddleBillingNotEnabled represents a `paddle_billing_not_enabled` error. See https://developer.paddle.com/errors/shared/paddle_billing_not_enabled for more information.

View Source
var ErrPriceBillingCycleFrequencyBelow1 = &paddleerr.Error{
	Code: "price_billing_cycle_frequency_below_1",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPriceBillingCycleFrequencyBelow1 represents a `price_billing_cycle_frequency_below_1` error. See https://developer.paddle.com/errors/prices/price_billing_cycle_frequency_below_1 for more information.

View Source
var ErrPriceDuplicateCurrencyOverrideForCountry = &paddleerr.Error{
	Code: "price_duplicate_currency_override_for_country",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPriceDuplicateCurrencyOverrideForCountry represents a `price_duplicate_currency_override_for_country` error. See https://developer.paddle.com/errors/prices/price_duplicate_currency_override_for_country for more information.

View Source
var ErrPriceTrialPeriodFrequencyBelow1 = &paddleerr.Error{
	Code: "price_trial_period_frequency_below_1",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPriceTrialPeriodFrequencyBelow1 represents a `price_trial_period_frequency_below_1` error. See https://developer.paddle.com/errors/prices/price_trial_period_frequency_below_1 for more information.

View Source
var ErrPriceTrialPeriodMissingFields = &paddleerr.Error{
	Code: "price_trial_period_missing_fields",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPriceTrialPeriodMissingFields represents a `price_trial_period_missing_fields` error. See https://developer.paddle.com/errors/prices/price_trial_period_missing_fields for more information.

View Source
var ErrPriceTrialPeriodRequiresBillingCycle = &paddleerr.Error{
	Code: "price_trial_period_requires_billing_cycle",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrPriceTrialPeriodRequiresBillingCycle represents a `price_trial_period_requires_billing_cycle` error. See https://developer.paddle.com/errors/prices/price_trial_period_requires_billing_cycle for more information.

View Source
var ErrProductTaxCategoryNotApproved = &paddleerr.Error{
	Code: "product_tax_category_not_approved",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrProductTaxCategoryNotApproved represents a `product_tax_category_not_approved` error. See https://developer.paddle.com/errors/products/product_tax_category_not_approved for more information.

View Source
var ErrReceiptDataNotEnabled = &paddleerr.Error{
	Code: "receipt_data_not_enabled",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrReceiptDataNotEnabled represents a `receipt_data_not_enabled` error. See https://developer.paddle.com/errors/shared/receipt_data_not_enabled for more information.

View Source
var ErrReportCreationLimitExceeded = &paddleerr.Error{
	Code: "report_creation_limit_exceeded",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrReportCreationLimitExceeded represents a `report_creation_limit_exceeded` error. See https://developer.paddle.com/errors/reports/report_creation_limit_exceeded for more information.

View Source
var ErrReportExpired = &paddleerr.Error{
	Code: "report_expired",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrReportExpired represents a `report_expired` error. See https://developer.paddle.com/errors/reports/report_expired for more information.

View Source
var ErrReportFailed = &paddleerr.Error{
	Code: "report_failed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrReportFailed represents a `report_failed` error. See https://developer.paddle.com/errors/reports/report_failed for more information.

View Source
var ErrReportNotReady = &paddleerr.Error{
	Code: "report_not_ready",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrReportNotReady represents a `report_not_ready` error. See https://developer.paddle.com/errors/reports/report_not_ready for more information.

View Source
var ErrServiceUnavailable = &paddleerr.Error{
	Code: "service_unavailable",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrServiceUnavailable represents a `service_unavailable` error. See https://developer.paddle.com/errors/shared/service_unavailable for more information.

View Source
var ErrStopIteration = errors.New("stop iteration")

ErrStopIteration is used as a return from the iteration function to stop the iteration from proceeding. It will ensure that IterErr returns nil.

View Source
var ErrSubscriptionAddressNotSuitableForCollectionMode = &paddleerr.Error{
	Code: "subscription_address_not_suitable_for_collection_mode",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionAddressNotSuitableForCollectionMode represents a `subscription_address_not_suitable_for_collection_mode` error. See https://developer.paddle.com/errors/subscriptions/subscription_address_not_suitable_for_collection_mode for more information.

View Source
var ErrSubscriptionAllItemsRemoved = &paddleerr.Error{
	Code: "subscription_all_items_removed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionAllItemsRemoved represents a `subscription_all_items_removed` error. See https://developer.paddle.com/errors/subscriptions/subscription_all_items_removed for more information.

View Source
var ErrSubscriptionBillingDetailsRequired = &paddleerr.Error{
	Code: "subscription_billing_details_required",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionBillingDetailsRequired represents a `subscription_billing_details_required` error. See https://developer.paddle.com/errors/subscriptions/subscription_billing_details_required for more information.

View Source
var ErrSubscriptionCannotActivate = &paddleerr.Error{
	Code: "subscription_cannot_activate",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCannotActivate represents a `subscription_cannot_activate` error. See https://developer.paddle.com/errors/subscriptions/subscription_cannot_activate for more information.

View Source
var ErrSubscriptionCannotBePaused = &paddleerr.Error{
	Code: "subscription_cannot_be_paused",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCannotBePaused represents a `subscription_cannot_be_paused` error. See https://developer.paddle.com/errors/subscriptions/subscription_cannot_be_paused for more information.

View Source
var ErrSubscriptionChargeDuplicatePriceIDs = &paddleerr.Error{
	Code: "subscription_charge_duplicate_price_ids",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionChargeDuplicatePriceIDs represents a `subscription_charge_duplicate_price_ids` error. See https://developer.paddle.com/errors/subscriptions/subscription_charge_duplicate_price_ids for more information.

View Source
var ErrSubscriptionCreditCreationAgainstProcessingTransaction = &paddleerr.Error{
	Code: "subscription_credit_creation_against_processing_transaction",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCreditCreationAgainstProcessingTransaction represents a `subscription_credit_creation_against_processing_transaction` error. See https://developer.paddle.com/errors/subscriptions/subscription_credit_creation_against_processing_transaction for more information.

View Source
var ErrSubscriptionCreditCreationAgainstUncompletedTransactionNotAllowed = &paddleerr.Error{
	Code: "subscription_credit_creation_against_uncompleted_transaction_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCreditCreationAgainstUncompletedTransactionNotAllowed represents a `subscription_credit_creation_against_uncompleted_transaction_not_allowed` error. See https://developer.paddle.com/errors/subscriptions/subscription_credit_creation_against_uncompleted_transaction_not_allowed for more information.

View Source
var ErrSubscriptionCurrencyCodeIncompatibleWithPaymentMethodProvider = &paddleerr.Error{
	Code: "subscription_currency_code_incompatible_with_payment_method_provider",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCurrencyCodeIncompatibleWithPaymentMethodProvider represents a `subscription_currency_code_incompatible_with_payment_method_provider` error. See https://developer.paddle.com/errors/subscriptions/subscription_currency_code_incompatible_with_payment_method_provider for more information.

View Source
var ErrSubscriptionCurrencyCodeNotValidForManual = &paddleerr.Error{
	Code: "subscription_currency_code_not_valid_for_manual",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCurrencyCodeNotValidForManual represents a `subscription_currency_code_not_valid_for_manual` error. See https://developer.paddle.com/errors/subscriptions/subscription_currency_code_not_valid_for_manual for more information.

View Source
var ErrSubscriptionCurrencyUpdateAndActionsCreatingCreditsNotAllowed = &paddleerr.Error{
	Code: "subscription_currency_update_and_actions_creating_credits_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCurrencyUpdateAndActionsCreatingCreditsNotAllowed represents a `subscription_currency_update_and_actions_creating_credits_not_allowed` error. See https://developer.paddle.com/errors/subscriptions/subscription_currency_update_and_actions_creating_credits_not_allowed for more information.

View Source
var ErrSubscriptionCurrencyUpdateNotAllowed = &paddleerr.Error{
	Code: "subscription_currency_update_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCurrencyUpdateNotAllowed represents a `subscription_currency_update_not_allowed` error. See https://developer.paddle.com/errors/subscriptions/subscription_currency_update_not_allowed for more information.

View Source
var ErrSubscriptionCustomerEmailDomainNotAllowed = &paddleerr.Error{
	Code: "subscription_customer_email_domain_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCustomerEmailDomainNotAllowed represents a `subscription_customer_email_domain_not_allowed` error. See https://developer.paddle.com/errors/subscriptions/subscription_customer_email_domain_not_allowed for more information.

View Source
var ErrSubscriptionCustomerNotSuitableForCollectionMode = &paddleerr.Error{
	Code: "subscription_customer_not_suitable_for_collection_mode",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionCustomerNotSuitableForCollectionMode represents a `subscription_customer_not_suitable_for_collection_mode` error. See https://developer.paddle.com/errors/subscriptions/subscription_customer_not_suitable_for_collection_mode for more information.

View Source
var ErrSubscriptionDiscountNotValidForItems = &paddleerr.Error{
	Code: "subscription_discount_not_valid_for_items",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionDiscountNotValidForItems represents a `subscription_discount_not_valid_for_items` error. See https://developer.paddle.com/errors/subscriptions/subscription_discount_not_valid_for_items for more information.

View Source
var ErrSubscriptionDuplicatePriceIDs = &paddleerr.Error{
	Code: "subscription_duplicate_price_ids",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionDuplicatePriceIDs represents a `subscription_duplicate_price_ids` error. See https://developer.paddle.com/errors/subscriptions/subscription_duplicate_price_ids for more information.

View Source
var ErrSubscriptionIncorrectProrationOnPausedSubscription = &paddleerr.Error{
	Code: "subscription_incorrect_proration_on_paused_subscription",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionIncorrectProrationOnPausedSubscription represents a `subscription_incorrect_proration_on_paused_subscription` error. See https://developer.paddle.com/errors/subscriptions/subscription_incorrect_proration_on_paused_subscription for more information.

View Source
var ErrSubscriptionInvalidDiscountCurrency = &paddleerr.Error{
	Code: "subscription_invalid_discount_currency",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionInvalidDiscountCurrency represents a `subscription_invalid_discount_currency` error. See https://developer.paddle.com/errors/subscriptions/subscription_invalid_discount_currency for more information.

View Source
var ErrSubscriptionIsCanceledActionInvalid = &paddleerr.Error{
	Code: "subscription_is_canceled_action_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionIsCanceledActionInvalid represents a `subscription_is_canceled_action_invalid` error. See https://developer.paddle.com/errors/subscriptions/subscription_is_canceled_action_invalid for more information.

View Source
var ErrSubscriptionIsInactiveActionInvalid = &paddleerr.Error{
	Code: "subscription_is_inactive_action_invalid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionIsInactiveActionInvalid represents a `subscription_is_inactive_action_invalid` error. See https://developer.paddle.com/errors/subscriptions/subscription_is_inactive_action_invalid for more information.

View Source
var ErrSubscriptionItemsUpdateMissingProrationBillingMode = &paddleerr.Error{
	Code: "subscription_items_update_missing_proration_billing_mode",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionItemsUpdateMissingProrationBillingMode represents a `subscription_items_update_missing_proration_billing_mode` error. See https://developer.paddle.com/errors/subscriptions/subscription_items_update_missing_proration_billing_mode for more information.

View Source
var ErrSubscriptionLockedPendingChanges = &paddleerr.Error{
	Code: "subscription_locked_pending_changes",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionLockedPendingChanges represents a `subscription_locked_pending_changes` error. See https://developer.paddle.com/errors/subscriptions/subscription_locked_pending_changes for more information.

View Source
var ErrSubscriptionLockedProcessing = &paddleerr.Error{
	Code: "subscription_locked_processing",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionLockedProcessing represents a `subscription_locked_processing` error. See https://developer.paddle.com/errors/subscriptions/subscription_locked_processing for more information.

View Source
var ErrSubscriptionLockedRenewal = &paddleerr.Error{
	Code: "subscription_locked_renewal",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionLockedRenewal represents a `subscription_locked_renewal` error. See https://developer.paddle.com/errors/subscriptions/subscription_locked_renewal for more information.

View Source
var ErrSubscriptionMustBePaused = &paddleerr.Error{
	Code: "subscription_must_be_paused",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionMustBePaused represents a `subscription_must_be_paused` error. See https://developer.paddle.com/errors/subscriptions/subscription_must_be_paused for more information.

View Source
var ErrSubscriptionNewItemsNotValid = &paddleerr.Error{
	Code: "subscription_new_items_not_valid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionNewItemsNotValid represents a `subscription_new_items_not_valid` error. See https://developer.paddle.com/errors/subscriptions/subscription_new_items_not_valid for more information.

View Source
var ErrSubscriptionNextBilledAtTooSoon = &paddleerr.Error{
	Code: "subscription_next_billed_at_too_soon",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionNextBilledAtTooSoon represents a `subscription_next_billed_at_too_soon` error. See https://developer.paddle.com/errors/subscriptions/subscription_next_billed_at_too_soon for more information.

View Source
var ErrSubscriptionNoRecurringItemsRemain = &paddleerr.Error{
	Code: "subscription_no_recurring_items_remain",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionNoRecurringItemsRemain represents a `subscription_no_recurring_items_remain` error. See https://developer.paddle.com/errors/subscriptions/subscription_no_recurring_items_remain for more information.

View Source
var ErrSubscriptionNotActive = &paddleerr.Error{
	Code: "subscription_not_active",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionNotActive represents a `subscription_not_active` error. See https://developer.paddle.com/errors/subscriptions/subscription_not_active for more information.

View Source
var ErrSubscriptionNotAutomaticCollection = &paddleerr.Error{
	Code: "subscription_not_automatic_collection",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionNotAutomaticCollection represents a `subscription_not_automatic_collection` error. See https://developer.paddle.com/errors/subscriptions/subscription_not_automatic_collection for more information.

View Source
var ErrSubscriptionOneOffDiscountNotValid = &paddleerr.Error{
	Code: "subscription_one_off_discount_not_valid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionOneOffDiscountNotValid represents a `subscription_one_off_discount_not_valid` error. See https://developer.paddle.com/errors/subscriptions/subscription_one_off_discount_not_valid for more information.

View Source
var ErrSubscriptionOnlyUpdateItemsOnPausedSubscription = &paddleerr.Error{
	Code: "subscription_only_update_items_on_paused_subscription",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionOnlyUpdateItemsOnPausedSubscription represents a `subscription_only_update_items_on_paused_subscription` error. See https://developer.paddle.com/errors/subscriptions/subscription_only_update_items_on_paused_subscription for more information.

View Source
var ErrSubscriptionOutstandingPendingRefund = &paddleerr.Error{
	Code: "subscription_outstanding_pending_refund",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionOutstandingPendingRefund represents a `subscription_outstanding_pending_refund` error. See https://developer.paddle.com/errors/subscriptions/subscription_outstanding_pending_refund for more information.

View Source
var ErrSubscriptionOutstandingTransaction = &paddleerr.Error{
	Code: "subscription_outstanding_transaction",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionOutstandingTransaction represents a `subscription_outstanding_transaction` error. See https://developer.paddle.com/errors/subscriptions/subscription_outstanding_transaction for more information.

View Source
var ErrSubscriptionPaymentDeclined = &paddleerr.Error{
	Code: "subscription_payment_declined",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionPaymentDeclined represents a `subscription_payment_declined` error. See https://developer.paddle.com/errors/subscriptions/subscription_payment_declined for more information.

View Source
var ErrSubscriptionQuantityMissingForNewItems = &paddleerr.Error{
	Code: "subscription_quantity_missing_for_new_items",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionQuantityMissingForNewItems represents a `subscription_quantity_missing_for_new_items` error. See https://developer.paddle.com/errors/subscriptions/subscription_quantity_missing_for_new_items for more information.

View Source
var ErrSubscriptionQuantityNotValid = &paddleerr.Error{
	Code: "subscription_quantity_not_valid",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionQuantityNotValid represents a `subscription_quantity_not_valid` error. See https://developer.paddle.com/errors/subscriptions/subscription_quantity_not_valid for more information.

View Source
var ErrSubscriptionScheduledChangeInvalidUpdate = &paddleerr.Error{
	Code: "subscription_scheduled_change_invalid_update",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionScheduledChangeInvalidUpdate represents a `subscription_scheduled_change_invalid_update` error. See https://developer.paddle.com/errors/subscriptions/subscription_scheduled_change_invalid_update for more information.

View Source
var ErrSubscriptionTrialingDiscountUpdateInvalidOptions = &paddleerr.Error{
	Code: "subscription_trialing_discount_update_invalid_options",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionTrialingDiscountUpdateInvalidOptions represents a `subscription_trialing_discount_update_invalid_options` error. See https://developer.paddle.com/errors/subscriptions/subscription_trialing_discount_update_invalid_options for more information.

View Source
var ErrSubscriptionTrialingItemsUpdateInvalidOptions = &paddleerr.Error{
	Code: "subscription_trialing_items_update_invalid_options",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionTrialingItemsUpdateInvalidOptions represents a `subscription_trialing_items_update_invalid_options` error. See https://developer.paddle.com/errors/subscriptions/subscription_trialing_items_update_invalid_options for more information.

View Source
var ErrSubscriptionUpdateCausingCustomerMismatchNotAllowed = &paddleerr.Error{
	Code: "subscription_update_causing_customer_mismatch_not_allowed",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateCausingCustomerMismatchNotAllowed represents a `subscription_update_causing_customer_mismatch_not_allowed` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_causing_customer_mismatch_not_allowed for more information.

View Source
var ErrSubscriptionUpdateDifferentCurrencyCredits = &paddleerr.Error{
	Code: "subscription_update_different_currency_credits",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateDifferentCurrencyCredits represents a `subscription_update_different_currency_credits` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_different_currency_credits for more information.

View Source
var ErrSubscriptionUpdateErrorWhenPaused = &paddleerr.Error{
	Code: "subscription_update_error_when_paused",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrSubscriptionUpdateErrorWhenPaused represents a `subscription_update_error_when_paused` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_error_when_paused for more information.

View Source
var ErrSubscriptionUpdateTransactionBalanceLessThanChargeLimit = &paddleerr.Error{
	Code: "subscription_update_transaction_balance_less_than_charge_limit",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateTransactionBalanceLessThanChargeLimit represents a `subscription_update_transaction_balance_less_than_charge_limit` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_transaction_balance_less_than_charge_limit for more information.

View Source
var ErrSubscriptionUpdateWhenCanceled = &paddleerr.Error{
	Code: "subscription_update_when_canceled",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateWhenCanceled represents a `subscription_update_when_canceled` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_when_canceled for more information.

View Source
var ErrSubscriptionUpdateWhenPastDue = &paddleerr.Error{
	Code: "subscription_update_when_past_due",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateWhenPastDue represents a `subscription_update_when_past_due` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_when_past_due for more information.

View Source
var ErrSubscriptionUpdateWhenTrialing = &paddleerr.Error{
	Code: "subscription_update_when_trialing",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrSubscriptionUpdateWhenTrialing represents a `subscription_update_when_trialing` error. See https://developer.paddle.com/errors/subscriptions/subscription_update_when_trialing for more information.

View Source
var ErrTooManyRequests = &paddleerr.Error{
	Code: "too_many_requests",
	Type: paddleerr.ErrorTypeAPIError,
}

ErrTooManyRequests represents a `too_many_requests` error. See https://developer.paddle.com/errors/shared/too_many_requests for more information.

View Source
var ErrTransactionAddressNotSuitableForCollectionMode = &paddleerr.Error{
	Code: "transaction_address_not_suitable_for_collection_mode",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionAddressNotSuitableForCollectionMode represents a `transaction_address_not_suitable_for_collection_mode` error. See https://developer.paddle.com/errors/transactions/transaction_address_not_suitable_for_collection_mode for more information.

View Source
var ErrTransactionBalanceLessThanChargeLimit = &paddleerr.Error{
	Code: "transaction_balance_less_than_charge_limit",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionBalanceLessThanChargeLimit represents a `transaction_balance_less_than_charge_limit` error. See https://developer.paddle.com/errors/transactions/transaction_balance_less_than_charge_limit for more information.

View Source
var ErrTransactionBillingDetailsMustBeNull = &paddleerr.Error{
	Code: "transaction_billing_details_must_be_null",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionBillingDetailsMustBeNull represents a `transaction_billing_details_must_be_null` error. See https://developer.paddle.com/errors/transactions/transaction_billing_details_must_be_null for more information.

View Source
var ErrTransactionBillingDetailsObjectRequired = &paddleerr.Error{
	Code: "transaction_billing_details_object_required",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionBillingDetailsObjectRequired represents a `transaction_billing_details_object_required` error. See https://developer.paddle.com/errors/transactions/transaction_billing_details_object_required for more information.

View Source
var ErrTransactionBillingPeriodStartsAtGreaterThanNow = &paddleerr.Error{
	Code: "transaction_billing_period_starts_at_greater_than_now",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionBillingPeriodStartsAtGreaterThanNow represents a `transaction_billing_period_starts_at_greater_than_now` error. See https://developer.paddle.com/errors/transactions/transaction_billing_period_starts_at_greater_than_now for more information.

View Source
var ErrTransactionBothPriceIDAndObjectFound = &paddleerr.Error{
	Code: "transaction_both_price_id_and_object_found",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionBothPriceIDAndObjectFound represents a `transaction_both_price_id_and_object_found` error. See https://developer.paddle.com/errors/transactions/transaction_both_price_id_and_object_found for more information.

View Source
var ErrTransactionCannotBeModifiedAndCanceled = &paddleerr.Error{
	Code: "transaction_cannot_be_modified_and_canceled",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCannotBeModifiedAndCanceled represents a `transaction_cannot_be_modified_and_canceled` error. See https://developer.paddle.com/errors/transactions/transaction_cannot_be_modified_and_canceled for more information.

View Source
var ErrTransactionCannotProvideBothDiscountCodeAndID = &paddleerr.Error{
	Code: "transaction_cannot_provide_both_discount_code_and_id",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCannotProvideBothDiscountCodeAndID represents a `transaction_cannot_provide_both_discount_code_and_id` error. See https://developer.paddle.com/errors/transactions/transaction_cannot_provide_both_discount_code_and_id for more information.

View Source
var ErrTransactionCheckoutNotEnabled = &paddleerr.Error{
	Code: "transaction_checkout_not_enabled",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCheckoutNotEnabled represents a `transaction_checkout_not_enabled` error. See https://developer.paddle.com/errors/transactions/transaction_checkout_not_enabled for more information.

View Source
var ErrTransactionCheckoutURLDomainIsNotApproved = &paddleerr.Error{
	Code: "transaction_checkout_url_domain_is_not_approved",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCheckoutURLDomainIsNotApproved represents a `transaction_checkout_url_domain_is_not_approved` error. See https://developer.paddle.com/errors/transactions/transaction_checkout_url_domain_is_not_approved for more information.

View Source
var ErrTransactionCurrencyCodeNotValidForManual = &paddleerr.Error{
	Code: "transaction_currency_code_not_valid_for_manual",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCurrencyCodeNotValidForManual represents a `transaction_currency_code_not_valid_for_manual` error. See https://developer.paddle.com/errors/transactions/transaction_currency_code_not_valid_for_manual for more information.

View Source
var ErrTransactionCustomerIsRequiredForBusinessValidation = &paddleerr.Error{
	Code: "transaction_customer_is_required_for_business_validation",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCustomerIsRequiredForBusinessValidation represents a `transaction_customer_is_required_for_business_validation` error. See https://developer.paddle.com/errors/transactions/transaction_customer_is_required_for_business_validation for more information.

View Source
var ErrTransactionCustomerIsRequiredWithAddress = &paddleerr.Error{
	Code: "transaction_customer_is_required_with_address",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCustomerIsRequiredWithAddress represents a `transaction_customer_is_required_with_address` error. See https://developer.paddle.com/errors/transactions/transaction_customer_is_required_with_address for more information.

View Source
var ErrTransactionCustomerNotSuitableForCollectionMode = &paddleerr.Error{
	Code: "transaction_customer_not_suitable_for_collection_mode",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionCustomerNotSuitableForCollectionMode represents a `transaction_customer_not_suitable_for_collection_mode` error. See https://developer.paddle.com/errors/transactions/transaction_customer_not_suitable_for_collection_mode for more information.

View Source
var ErrTransactionDefaultCheckoutURLNotSet = &paddleerr.Error{
	Code: "transaction_default_checkout_url_not_set",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionDefaultCheckoutURLNotSet represents a `transaction_default_checkout_url_not_set` error. See https://developer.paddle.com/errors/transactions/transaction_default_checkout_url_not_set for more information.

View Source
var ErrTransactionDiscountNotEligible = &paddleerr.Error{
	Code: "transaction_discount_not_eligible",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionDiscountNotEligible represents a `transaction_discount_not_eligible` error. See https://developer.paddle.com/errors/transactions/transaction_discount_not_eligible for more information.

View Source
var ErrTransactionDiscountNotFound = &paddleerr.Error{
	Code: "transaction_discount_not_found",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionDiscountNotFound represents a `transaction_discount_not_found` error. See https://developer.paddle.com/errors/transactions/transaction_discount_not_found for more information.

View Source
var ErrTransactionDuplicatePriceIDs = &paddleerr.Error{
	Code: "transaction_duplicate_price_ids",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionDuplicatePriceIDs represents a `transaction_duplicate_price_ids` error. See https://developer.paddle.com/errors/transactions/transaction_duplicate_price_ids for more information.

View Source
var ErrTransactionImmutable = &paddleerr.Error{
	Code: "transaction_immutable",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionImmutable represents a `transaction_immutable` error. See https://developer.paddle.com/errors/transactions/transaction_immutable for more information.

View Source
var ErrTransactionInvalidDiscountCurrency = &paddleerr.Error{
	Code: "transaction_invalid_discount_currency",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionInvalidDiscountCurrency represents a `transaction_invalid_discount_currency` error. See https://developer.paddle.com/errors/transactions/transaction_invalid_discount_currency for more information.

View Source
var ErrTransactionInvalidStatusChange = &paddleerr.Error{
	Code: "transaction_invalid_status_change",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionInvalidStatusChange represents a `transaction_invalid_status_change` error. See https://developer.paddle.com/errors/transactions/transaction_invalid_status_change for more information.

View Source
var ErrTransactionItemQuantityOutOfRange = &paddleerr.Error{
	Code: "transaction_item_quantity_out_of_range",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionItemQuantityOutOfRange represents a `transaction_item_quantity_out_of_range` error. See https://developer.paddle.com/errors/transactions/transaction_item_quantity_out_of_range for more information.

View Source
var ErrTransactionNotReadyCannotProcessPayment = &paddleerr.Error{
	Code: "transaction_not_ready_cannot_process_payment",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionNotReadyCannotProcessPayment represents a `transaction_not_ready_cannot_process_payment` error. See https://developer.paddle.com/errors/transactions/transaction_not_ready_cannot_process_payment for more information.

View Source
var ErrTransactionPaymentMethodChangeFieldImmutable = &paddleerr.Error{
	Code: "transaction_payment_method_change_field_immutable",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPaymentMethodChangeFieldImmutable represents a `transaction_payment_method_change_field_immutable` error. See https://developer.paddle.com/errors/transactions/transaction_payment_method_change_field_immutable for more information.

View Source
var ErrTransactionPaymentTermsObjectRequired = &paddleerr.Error{
	Code: "transaction_payment_terms_object_required",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPaymentTermsObjectRequired represents a `transaction_payment_terms_object_required` error. See https://developer.paddle.com/errors/transactions/transaction_payment_terms_object_required for more information.

View Source
var ErrTransactionPreviewAdjustmentSubscriptionConflict = &paddleerr.Error{
	Code: "transaction_preview_adjustment_subscription_conflict",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPreviewAdjustmentSubscriptionConflict represents a `transaction_preview_adjustment_subscription_conflict` error. See https://developer.paddle.com/errors/transactions/transaction_preview_adjustment_subscription_conflict for more information.

View Source
var ErrTransactionPriceDifferentBillingCycle = &paddleerr.Error{
	Code: "transaction_price_different_billing_cycle",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPriceDifferentBillingCycle represents a `transaction_price_different_billing_cycle` error. See https://developer.paddle.com/errors/transactions/transaction_price_different_billing_cycle for more information.

View Source
var ErrTransactionPriceDifferentTrialPeriod = &paddleerr.Error{
	Code: "transaction_price_different_trial_period",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPriceDifferentTrialPeriod represents a `transaction_price_different_trial_period` error. See https://developer.paddle.com/errors/transactions/transaction_price_different_trial_period for more information.

View Source
var ErrTransactionPriceNotFound = &paddleerr.Error{
	Code: "transaction_price_not_found",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionPriceNotFound represents a `transaction_price_not_found` error. See https://developer.paddle.com/errors/transactions/transaction_price_not_found for more information.

View Source
var ErrTransactionProductNotFound = &paddleerr.Error{
	Code: "transaction_product_not_found",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionProductNotFound represents a `transaction_product_not_found` error. See https://developer.paddle.com/errors/transactions/transaction_product_not_found for more information.

View Source
var ErrTransactionRecurringBalanceLessThanChargeLimit = &paddleerr.Error{
	Code: "transaction_recurring_balance_less_than_charge_limit",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionRecurringBalanceLessThanChargeLimit represents a `transaction_recurring_balance_less_than_charge_limit` error. See https://developer.paddle.com/errors/transactions/transaction_recurring_balance_less_than_charge_limit for more information.

View Source
var ErrTransactionStatusMustBeReady = &paddleerr.Error{
	Code: "transaction_status_must_be_ready",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrTransactionStatusMustBeReady represents a `transaction_status_must_be_ready` error. See https://developer.paddle.com/errors/transactions/transaction_status_must_be_ready for more information.

View Source
var ErrURLNotificationSettingIncorrect = &paddleerr.Error{
	Code: "url_notification_setting_incorrect",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrURLNotificationSettingIncorrect represents a `url_notification_setting_incorrect` error. See https://developer.paddle.com/errors/notifications/url_notification_setting_incorrect for more information.

View Source
var ErrUnsupportedMediaType = &paddleerr.Error{
	Code: "unsupported_media_type",
	Type: paddleerr.ErrorTypeRequestError,
}

ErrUnsupportedMediaType represents a `unsupported_media_type` error. See https://developer.paddle.com/errors/shared/unsupported_media_type for more information.

Functions

func ContextWithTransitID

func ContextWithTransitID(ctx context.Context, transitID string) context.Context

ContextWithTransitID returns a new context with the provided transitID. This transit ID will then be present in requests to the Paddle API where this context is used. These can be used by Paddle support to aid in debugging your integration.

func PtrTo

func PtrTo[V any](v V) *V

PtrTo creates a pointer from a given value.

Types

type Action

type Action string

Action: How this adjustment impacts the related transaction. `refund` adjustments must be approved by Paddle, and are created with the status `pending_approval`..

type ActivateSubscriptionRequest

type ActivateSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`
}

ActivateSubscriptionRequest is given as an input to ActivateSubscription.

type Address

type Address struct {
	// ID: Unique Paddle ID for this address entity, prefixed with `add_`.
	ID string `json:"id,omitempty"`
	// CustomerID: Paddle ID for the customer related to this address, prefixed with `cus_`.
	CustomerID string `json:"customer_id,omitempty"`
	// Description: Memorable description for this address.
	Description *string `json:"description,omitempty"`
	// FirstLine: First line of this address.
	FirstLine *string `json:"first_line,omitempty"`
	// SecondLine: Second line of this address.
	SecondLine *string `json:"second_line,omitempty"`
	// City: City of this address.
	City *string `json:"city,omitempty"`
	// PostalCode: ZIP or postal code of this address. Required for some countries.
	PostalCode *string `json:"postal_code,omitempty"`
	// Region: State, county, or region of this address.
	Region *string `json:"region,omitempty"`
	// CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code for this address.
	CountryCode string `json:"country_code,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

Address: Address for this transaction. Returned when the `include` parameter is used with the `address` value and the transaction has an `address_id`.

type AddressPreview

type AddressPreview struct {
	// PostalCode: ZIP or postal code of this address. Include for more accurate tax calculations.
	PostalCode *string `json:"postal_code,omitempty"`
	// CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code for this address.
	CountryCode string `json:"country_code,omitempty"`
}

AddressPreview: Address for this preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.

type AddressesClient

type AddressesClient struct {
	// contains filtered or unexported fields
}

AddressesClient is a client for the Addresses resource.

func (*AddressesClient) CreateAddress

func (c *AddressesClient) CreateAddress(ctx context.Context, req *CreateAddressRequest) (res *Address, err error)

CreateAddress performs the POST operation on a Addresses resource.

func (*AddressesClient) GetAddress

func (c *AddressesClient) GetAddress(ctx context.Context, req *GetAddressRequest) (res *Address, err error)

GetAddress performs the GET operation on a Addresses resource.

func (*AddressesClient) ListAddresses

func (c *AddressesClient) ListAddresses(ctx context.Context, req *ListAddressesRequest) (res *Collection[*Address], err error)

ListAddresses performs the GET operation on a Addresses resource.

func (*AddressesClient) UpdateAddress

func (c *AddressesClient) UpdateAddress(ctx context.Context, req *UpdateAddressRequest) (res *Address, err error)

UpdateAddress performs the PATCH operation on a Addresses resource.

type Adjustment

type Adjustment struct {
	// ID: Unique Paddle ID for this adjustment entity, prefixed with `adj_`.
	ID string `json:"id,omitempty"`
	// Action: How this adjustment impacts the related transaction. `refund` adjustments must be approved by Paddle, and are created with the status `pending_approval`.
	Action string `json:"action,omitempty"`
	// TransactionID: Paddle ID for the transaction related to this adjustment, prefixed with `txn_`.
	TransactionID string `json:"transaction_id,omitempty"`
	/*
	   SubscriptionID: Paddle ID for the subscription related to this adjustment, prefixed with `sub_`.
	   Set automatically by Paddle based on the `subscription_id` of the related transaction.
	*/
	SubscriptionID *string `json:"subscription_id,omitempty"`
	/*
	   CustomerID: Paddle ID for the customer related to this adjustment, prefixed with `ctm_`.
	   Set automatically by Paddle based on the `customer_id` of the related transaction.
	*/
	CustomerID string `json:"customer_id,omitempty"`
	// Reason: Why this adjustment was created. Appears in the Paddle Dashboard. Retained for record-keeping purposes.
	Reason string `json:"reason,omitempty"`
	/*
	   CreditAppliedToBalance: Whether this adjustment was applied to the related customer's credit balance. Only returned for `credit` adjustments.

	   `false` when the related transaction `collection_mode` is `manual` and its `status` is `billed`. The adjustment is used
	   to reduce the `balance` due on the transaction.

	   `true` for automatically-collected transactions and `completed` manually-collected transactions.
	*/
	CreditAppliedToBalance *bool `json:"credit_applied_to_balance,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for this adjustment. Set automatically by Paddle based on the `currency_code` of the related transaction.
	CurrencyCode string `json:"currency_code,omitempty"`
	/*
	   Status: Status of this adjustment. Set automatically by Paddle.

	   `refund` adjustments must be approved by Paddle, and are created with the status `pending_approval`
	   until they move to `approved` or `rejected` on review. Other kinds of adjustment do not need approval,
	   so are created with the status `approved`.
	*/
	Status string `json:"status,omitempty"`
	// Items: List of items on this adjustment.
	Items []AdjustmentItem `json:"items,omitempty"`
	// Totals: Breakdown of the total for an adjustment.
	Totals AdjustmentTotals `json:"totals,omitempty"`
	// PayoutTotals: Breakdown of how this adjustment affects your payout balance.
	PayoutTotals *PayoutTotalsAdjustment `json:"payout_totals,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
}

Adjustment: Represents an adjustment entity.

type AdjustmentItem

type AdjustmentItem struct {
	// ID: Unique Paddle ID for this adjustment item, prefixed with `adjitm_`.
	ID string `json:"id,omitempty"`
	// ItemID: Paddle ID for the transaction item that this adjustment item relates to, prefixed with `txnitm_`.
	ItemID string `json:"item_id,omitempty"`
	/*
	   Type: Type of adjustment for this transaction item. `tax` and `proration` are automatically created by Paddle.
	   Include `amount` when creating a `partial` adjustment.
	*/
	Type string `json:"type,omitempty"`
	// Amount: Amount adjusted for this transaction item. Required when adjustment type is `partial`.
	Amount *string `json:"amount,omitempty"`
	/*
	   Proration: How proration was calculated for this adjustment item. Populated when an adjustment type is `proration`.
	   Set automatically by Paddle.
	*/
	Proration *Proration `json:"proration,omitempty"`
	// Totals: Breakdown of the total for an adjustment item.
	Totals AdjustmentItemTotals `json:"totals,omitempty"`
}

AdjustmentItem: List of items on this adjustment.

type AdjustmentItemTotals

type AdjustmentItemTotals struct {
	// Subtotal: Amount multiplied by quantity.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
}

AdjustmentItemTotals: Breakdown of the total for an adjustment item.

type AdjustmentPreview

type AdjustmentPreview struct {
	// TransactionID: Paddle ID for this transaction entity that this adjustment relates to, prefixed with `txn_`.
	TransactionID string `json:"transaction_id,omitempty"`
	// Items: List of transaction items that this adjustment is for.
	Items []SubscriptionsAdjustmentItem `json:"items,omitempty"`
	// Totals: Calculated totals for this adjustment.
	Totals AdjustmentTotals `json:"totals,omitempty"`
}

AdjustmentPreview: Represents an adjustment entity when previewing adjustments.

type AdjustmentStatus

type AdjustmentStatus string

AdjustmentStatus: Status of this adjustment. Set automatically by Paddle.

`refund` adjustments must be approved by Paddle, and are created with the status `pending_approval` until they move to `approved` or `rejected` on review. Other kinds of adjustment do not need approval, so are created with the status `approved`..

type AdjustmentTotals

type AdjustmentTotals struct {
	// Subtotal: Total before tax. For tax adjustments, the value is 0.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
	// Fee: Total fee taken by Paddle for this adjustment.
	Fee string `json:"fee,omitempty"`
	/*
	   Earnings: Total earnings. This is the subtotal minus the Paddle fee.
	   For tax adjustments, this value is negative, which means a positive effect in the transaction earnings.
	   This is because the fee is originally calculated from the transaction total, so if a tax adjustment is made,
	   then the fee portion of it is returned.
	*/
	Earnings string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code used for this adjustment.
	CurrencyCode string `json:"currency_code,omitempty"`
}

AdjustmentTotals: Breakdown of the total for an adjustment.

type AdjustmentType

type AdjustmentType string

AdjustmentType: Type of adjustment for this transaction item. `tax` and `proration` are automatically created by Paddle. Include `amount` when creating a `partial` adjustment..

type AdjustmentsClient

type AdjustmentsClient struct {
	// contains filtered or unexported fields
}

AdjustmentsClient is a client for the Adjustments resource.

func (*AdjustmentsClient) CreateAdjustment

func (c *AdjustmentsClient) CreateAdjustment(ctx context.Context, req *CreateAdjustmentRequest) (res *Adjustment, err error)

CreateAdjustment performs the POST operation on a Adjustments resource.

func (*AdjustmentsClient) ListAdjustments

func (c *AdjustmentsClient) ListAdjustments(ctx context.Context, req *ListAdjustmentsRequest) (res *Collection[*Adjustment], err error)

ListAdjustments performs the GET operation on a Adjustments resource.

func (*AdjustmentsClient) ListCreditBalances

func (c *AdjustmentsClient) ListCreditBalances(ctx context.Context, req *ListCreditBalancesRequest) (res *Collection[*CreditBalance], err error)

ListCreditBalances performs the GET operation on a Adjustments resource.

type AdjustmentsReports

type AdjustmentsReports struct {
	// Type: Type of report to create.
	Type string `json:"type,omitempty"`
	// Filters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.
	Filters []ReportsReportFilters `json:"filters,omitempty"`
}

AdjustmentsReports: Request body when creating reports for adjustments or adjustment line items.

type AdjustmentsTotals

type AdjustmentsTotals struct {
	// Subtotal: Total before tax.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
	// Fee: Total fee taken by Paddle.
	Fee string `json:"fee,omitempty"`
	/*
	   Earnings: Total earnings. This is the subtotal minus the Paddle fee.
	   For tax adjustments, this value is negative, which means a positive effect in the transaction earnings.
	   This is because the fee is originally calculated from the transaction total, so if a tax adjustment is made,
	   then the fee portion of it is returned.
	   As a result, the earnings from all the adjustments performed could be either negative, positive or zero.
	*/
	Earnings string `json:"earnings,omitempty"`
	// Breakdown: Breakdown of the total adjustments by adjustment action.
	Breakdown Breakdown `json:"breakdown,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code used for adjustments for this transaction.
	CurrencyCode string `json:"currency_code,omitempty"`
}

AdjustmentsTotals: Object containing totals for all adjustments on a transaction. Returned when the `include` parameter is used with the `adjustments_totals` value.

type BillingDetails

type BillingDetails struct {
	// EnableCheckout: Whether the related transaction may be paid using a Paddle Checkout.
	EnableCheckout bool `json:"enable_checkout,omitempty"`
	// PurchaseOrderNumber: Customer purchase order number. Appears on invoice documents.
	PurchaseOrderNumber string `json:"purchase_order_number,omitempty"`
	// AdditionalInformation: Notes or other information to include on this invoice. Appears on invoice documents.
	AdditionalInformation *string `json:"additional_information,omitempty"`
	// PaymentTerms: How long a customer has to pay this invoice once issued.
	PaymentTerms Duration `json:"payment_terms,omitempty"`
}

BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.

type BillingDetailsUpdate

type BillingDetailsUpdate struct {
	// EnableCheckout: Whether the related transaction may be paid using a Paddle Checkout.
	EnableCheckout bool `json:"enable_checkout,omitempty"`
	// PurchaseOrderNumber: Customer purchase order number. Appears on invoice documents.
	PurchaseOrderNumber string `json:"purchase_order_number,omitempty"`
	// AdditionalInformation: Notes or other information to include on this invoice. Appears on invoice documents.
	AdditionalInformation *string `json:"additional_information,omitempty"`
	// PaymentTerms: How long a customer has to pay this invoice once issued.
	PaymentTerms Duration `json:"payment_terms,omitempty"`
}

BillingDetailsUpdate: Details for invoicing. Required if `collection_mode` is `manual`.

type Breakdown

type Breakdown struct {
	// Credit: Total amount of credit adjustments.
	Credit string `json:"credit,omitempty"`
	// Refund: Total amount of refund adjustments.
	Refund string `json:"refund,omitempty"`
	// Chargeback: Total amount of chargeback adjustments.
	Chargeback string `json:"chargeback,omitempty"`
}

Breakdown: Breakdown of the total adjustments by adjustment action.

type Business

type Business struct {
	// ID: Unique Paddle ID for this business entity, prefixed with `biz_`.
	ID string `json:"id,omitempty"`
	// CustomerID: Paddle ID for the customer related to this business, prefixed with `cus_`.
	CustomerID string `json:"customer_id,omitempty"`
	// Name: Name of this business.
	Name string `json:"name,omitempty"`
	// CompanyNumber: Company number for this business.
	CompanyNumber *string `json:"company_number,omitempty"`
	// TaxIdentifier: Tax or VAT Number for this business.
	TaxIdentifier *string `json:"tax_identifier,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// Contacts: List of contacts related to this business, typically used for sending invoices.
	Contacts []Contacts `json:"contacts,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

Business: Business for this transaction. Returned when the `include` parameter is used with the `business` value and the transaction has a `business_id`.

type BusinessesClient

type BusinessesClient struct {
	// contains filtered or unexported fields
}

BusinessesClient is a client for the Businesses resource.

func (*BusinessesClient) CreateBusiness

func (c *BusinessesClient) CreateBusiness(ctx context.Context, req *CreateBusinessRequest) (res *Business, err error)

CreateBusiness performs the POST operation on a Businesses resource.

func (*BusinessesClient) GetBusiness

func (c *BusinessesClient) GetBusiness(ctx context.Context, req *GetBusinessRequest) (res *Business, err error)

GetBusiness performs the GET operation on a Businesses resource.

func (*BusinessesClient) ListBusinesses

func (c *BusinessesClient) ListBusinesses(ctx context.Context, req *ListBusinessesRequest) (res *Collection[*Business], err error)

ListBusinesses performs the GET operation on a Businesses resource.

func (*BusinessesClient) UpdateBusiness

func (c *BusinessesClient) UpdateBusiness(ctx context.Context, req *UpdateBusinessRequest) (res *Business, err error)

UpdateBusiness performs the PATCH operation on a Businesses resource.

type BusinessesContacts

type BusinessesContacts struct {
	// Name: Full name of this contact.
	Name string `json:"name,omitempty"`
	// Email: Email address for this contact.
	Email string `json:"email,omitempty"`
}

BusinessesContacts: List of contacts related to this business, typically used for sending invoices.

type CancelSubscriptionRequest

type CancelSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	/*
	   EffectiveFrom: When this subscription change should take effect from. Defaults to `next_billing_period` for active subscriptions,
	   which creates a `scheduled_change` to apply the subscription change at the end of the billing period.
	*/
	EffectiveFrom *string `json:"effective_from,omitempty"`
}

CancelSubscriptionRequest is given as an input to CancelSubscription.

type Card

type Card struct {
	// Type: Type of credit or debit card used to pay.
	Type string `json:"type,omitempty"`
	// Last4: Last four digits of the card used to pay.
	Last4 string `json:"last4,omitempty"`
	// ExpiryMonth: Month of the expiry date of the card used to pay.
	ExpiryMonth int `json:"expiry_month,omitempty"`
	// ExpiryYear: Year of the expiry year of the card used to pay.
	ExpiryYear int `json:"expiry_year,omitempty"`
	// CardholderName: The name on the card used to pay.
	CardholderName string `json:"cardholder_name,omitempty"`
}

Card: Information about the credit or debit card used to pay. `null` unless `type` is `card`.

type CardType

type CardType string

CardType: Type of credit or debit card used to pay..

type CatalogItem

type CatalogItem struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
	Proration *Proration `json:"proration,omitempty"`
	// PriceID: Paddle ID of an existing catalog price to add to this transaction, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
}

CatalogItem: Add a catalog item to a transaction. In this case, the product and price that you're billing for exist in your product catalog in Paddle.

type CatalogType

type CatalogType string

CatalogType: Return items that match the specified type..

type Charge

type Charge struct {
	// Amount: Total of the transaction to be created for this update.
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for the transaction to be created.
	CurrencyCode string `json:"currency_code,omitempty"`
}

Charge: Details of the transaction to be created for this update. Paddle creates a transaction to bill for new charges.

type ChargebackFee

type ChargebackFee struct {
	// Amount: Chargeback fee converted into the payout currency.
	Amount string `json:"amount,omitempty"`
	// Original: Chargeback fee before conversion to the payout currency. `null` when the chargeback fee is the same as the payout currency.
	Original *Original `json:"original,omitempty"`
}

ChargebackFee: Details of any chargeback fees incurred for this transaction.

type Checkout

type Checkout struct {
	// URL: Paddle Checkout URL for this transaction, composed of the URL passed in the request or your default payment URL + `_?txn=` and the Paddle ID for this transaction.
	URL *string `json:"url,omitempty"`
}

Checkout: Paddle Checkout details for this transaction. Returned for automatically-collected transactions and where `billing_details.enable_checkout` is `true` for manually-collected transactions; `null` otherwise.

type Collection

type Collection[T any] struct {
	// contains filtered or unexported fields
}

Collection is the response from a listing endpoint in the Paddle API. It is used as a container to iterate over many pages of results.

func (*Collection[T]) EstimatedTotal

func (c *Collection[T]) EstimatedTotal() int

EstimatedTotal returns the estimated number of items in the collection.

func (*Collection[T]) HasMore

func (c *Collection[T]) HasMore() bool

HasMore returns true if there are more pages of results to be fetched.

func (*Collection[T]) Iter

func (c *Collection[T]) Iter(ctx context.Context, fn func(v T) (bool, error)) error

Iter iterates over the collection, calling the given function for each result. If the function returns false, the iteration will stop. You should check the error given to your callback function on each iteration.

func (*Collection[T]) IterErr

func (c *Collection[T]) IterErr(ctx context.Context, fn func(v T) error) error

IterErr iterates over the collection, calling the given function for each result. If the function returns false, the iteration will stop. You should check the error given to the function on each iteration.

func (*Collection[T]) Next

func (c *Collection[T]) Next(ctx context.Context) *Res[T]

Next returns the next result from the collection. If there are no more results, the result will response to Ok() with false.

func (*Collection[T]) PerPage

func (c *Collection[T]) PerPage() int

PerPage returns the number of items per page in the collection.

func (*Collection[T]) UnmarshalJSON

func (c *Collection[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the collection from a JSON response.

func (*Collection[T]) Wants

func (c *Collection[T]) Wants(d client.Doer)

Wants sets the client to be used for making requests.

type CollectionMode

type CollectionMode string

CollectionMode: Return entities that match the specified collection mode..

type Contacts

type Contacts struct {
	// Name: Full name of this contact.
	Name string `json:"name,omitempty"`
	// Email: Email address for this contact.
	Email string `json:"email,omitempty"`
}

Contacts: List of contacts related to this business, typically used for sending invoices.

type CountryAndZipPostalCode

type CountryAndZipPostalCode struct {
	// Address: Address for this transaction preview.
	Address AddressPreview `json:"address,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	/*
	   IgnoreTrials: Whether trials should be ignored for transaction preview calculations.

	   By default, recurring items with trials are considered to have a zero charge when previewing. Set to `true` to disable this.
	*/
	IgnoreTrials bool `json:"ignore_trials,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []CountryAndZipPostalCodeItems `json:"items,omitempty"`
}

CountryAndZipPostalCode: Paddle uses the country and ZIP code (where supplied) to calculate totals.

type CountryAndZipPostalCodeItems

CountryAndZipPostalCodeItems represents a union request type of the following types:

  • `TransactionsCatalogItem`
  • `TransactionsNonCatalogPriceForAnExistingProduct`
  • `TransactionsNonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewCountryAndZipPostalCodeItemsTransactionsCatalogItem()`
  • `NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceForAnExistingProduct()`
  • `NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewCountryAndZipPostalCodeItemsTransactionsCatalogItem

func NewCountryAndZipPostalCodeItemsTransactionsCatalogItem(r *TransactionsCatalogItem) *CountryAndZipPostalCodeItems

NewCountryAndZipPostalCodeItemsTransactionsCatalogItem takes a TransactionsCatalogItem type and creates a CountryAndZipPostalCodeItems for use in a request.

func NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceAndProduct

func NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceAndProduct(r *TransactionsNonCatalogPriceAndProduct) *CountryAndZipPostalCodeItems

NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceAndProduct takes a TransactionsNonCatalogPriceAndProduct type and creates a CountryAndZipPostalCodeItems for use in a request.

func NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceForAnExistingProduct

func NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceForAnExistingProduct(r *TransactionsNonCatalogPriceForAnExistingProduct) *CountryAndZipPostalCodeItems

NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceForAnExistingProduct takes a TransactionsNonCatalogPriceForAnExistingProduct type and creates a CountryAndZipPostalCodeItems for use in a request.

func (CountryAndZipPostalCodeItems) MarshalJSON

func (u CountryAndZipPostalCodeItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type CountryCode

type CountryCode string

CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code..

type CreateAddressRequest

type CreateAddressRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`

	// CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code for this address.
	CountryCode string `json:"country_code,omitempty"`
	// Description: Memorable description for this address.
	Description *string `json:"description,omitempty"`
	// FirstLine: First line of this address.
	FirstLine *string `json:"first_line,omitempty"`
	// SecondLine: Second line of this address.
	SecondLine *string `json:"second_line,omitempty"`
	// City: City of this address.
	City *string `json:"city,omitempty"`
	// PostalCode: ZIP or postal code of this address. Required for some countries.
	PostalCode *string `json:"postal_code,omitempty"`
	// Region: State, county, or region of this address.
	Region *string `json:"region,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

CreateAddressRequest is given as an input to CreateAddress.

type CreateAdjustmentRequest

type CreateAdjustmentRequest struct {
	// Action: How this adjustment impacts the related transaction. `refund` adjustments must be approved by Paddle, and are created with the status `pending_approval`.
	Action string `json:"action,omitempty"`
	// Items: List of items on this adjustment.
	Items []AdjustmentItem `json:"items,omitempty"`
	// Reason: Why this adjustment was created. Appears in the Paddle Dashboard. Retained for record-keeping purposes.
	Reason string `json:"reason,omitempty"`
	/*
	   TransactionID: Paddle ID for the transaction related to this adjustment, prefixed with `txn_`.
	   Transactions must be `billed` or `completed`. You can't create an adjustment for a transaction
	   that has an adjustment that's `pending_approval`.
	*/
	TransactionID string `json:"transaction_id,omitempty"`
}

CreateAdjustmentRequest is given as an input to CreateAdjustment.

type CreateBusinessRequest

type CreateBusinessRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`

	// Name: Name of this business.
	Name string `json:"name,omitempty"`
	// CompanyNumber: Company number for this business.
	CompanyNumber *string `json:"company_number,omitempty"`
	// TaxIdentifier: Tax or VAT Number for this business.
	TaxIdentifier *string `json:"tax_identifier,omitempty"`
	// Contacts: List of contacts related to this business, typically used for sending invoices.
	Contacts []BusinessesContacts `json:"contacts,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

CreateBusinessRequest is given as an input to CreateBusiness.

type CreateCustomerRequest

type CreateCustomerRequest struct {
	// Email: Email address for this customer.
	Email string `json:"email,omitempty"`
	// Name: Full name of this customer. Required when creating transactions where `collection_mode` is `manual` (invoices).
	Name *string `json:"name,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Locale: Valid IETF BCP 47 short form locale tag. If omitted, defaults to `en`.
	Locale *string `json:"locale,omitempty"`
}

CreateCustomerRequest is given as an input to CreateCustomer.

type CreateDiscountRequest

type CreateDiscountRequest struct {
	// Amount: Amount to discount by. For `percentage` discounts, must be an amount between `0.01` and `100`. For `flat` and `flat_per_seat` discounts, amount in the lowest denomination for a currency.
	Amount string `json:"amount,omitempty"`
	// Description: Short description for this discount for your reference. Not shown to customers.
	Description string `json:"description,omitempty"`
	// Type: Type of discount.
	Type string `json:"type,omitempty"`
	// EnabledForCheckout: Whether this discount can be applied by a customer at checkout.
	EnabledForCheckout *bool `json:"enabled_for_checkout,omitempty"`
	// Code: Unique code that customers can use to apply this discount at checkout. Use letters and numbers only, up to 16 characters. Paddle generates a random 10-character code if a code is not provided and `enabled_for_checkout` is `true`.
	Code *string `json:"code,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Required where discount type is `flat` or `flat_per_seat`.
	CurrencyCode *string `json:"currency_code,omitempty"`
	// Recur: Whether this discount applies for multiple billing periods.
	Recur *bool `json:"recur,omitempty"`
	// MaximumRecurringIntervals: Amount of subscription billing periods that this discount recurs for. Requires `recur`. `null` if this discount recurs forever.
	MaximumRecurringIntervals *int `json:"maximum_recurring_intervals,omitempty"`
	// UsageLimit: Maximum amount of times this discount can be used. This is an overall limit, rather than a per-customer limit. `null` if this discount can be used an unlimited amount of times.
	UsageLimit *int `json:"usage_limit,omitempty"`
	// RestrictTo: Product or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. `null` if this discount applies to all products and prices.
	RestrictTo []string `json:"restrict_to,omitempty"`
	// ExpiresAt: RFC 3339 datetime string of when this discount expires. Discount can no longer be applied after this date has elapsed. `null` if this discount can be applied forever.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

CreateDiscountRequest is given as an input to CreateDiscount.

type CreateNotificationSettingRequest

type CreateNotificationSettingRequest struct {
	// Description: Short description for this notification destination. Shown in the Paddle Dashboard.
	Description string `json:"description,omitempty"`
	// Destination: Webhook endpoint URL or email address.
	Destination string `json:"destination,omitempty"`
	// SubscribedEvents: Subscribed events for this notification destination. When creating or updating a notification destination, pass an array of event type names only. Paddle returns the complete event type object.
	SubscribedEvents []Event `json:"subscribed_events,omitempty"`
	// Type: Where notifications should be sent for this destination.
	Type string `json:"type,omitempty"`
	// APIVersion: API version that returned objects for events should conform to. Must be a valid version of the Paddle API. Cannot be a version older than your account default. Defaults to your account default if not included.
	APIVersion *int `json:"api_version,omitempty"`
	// IncludeSensitiveFields: Whether potentially sensitive fields should be sent to this notification destination.
	IncludeSensitiveFields *bool `json:"include_sensitive_fields,omitempty"`
}

CreateNotificationSettingRequest is given as an input to CreateNotificationSetting.

type CreatePriceRequest

type CreatePriceRequest struct {
	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description string `json:"description,omitempty"`
	// ProductID: Paddle ID for the product that this price is for, prefixed with `pro_`.
	ProductID string `json:"product_id,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice Money `json:"unit_price,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type *string `json:"type,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *string `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *Duration `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *Duration `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode *string `json:"tax_mode,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides []UnitPriceOverride `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns. If omitted, defaults to 1-100.
	Quantity *PriceQuantity `json:"quantity,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

CreatePriceRequest is given as an input to CreatePrice.

type CreateProductRequest

type CreateProductRequest struct {
	// Name: Name of this product.
	Name string `json:"name,omitempty"`
	// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
	TaxCategory string `json:"tax_category,omitempty"`
	// Description: Short description for this product.
	Description *string `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type *string `json:"type,omitempty"`
	// ImageURL: Image for this product. Included in the checkout and on some customer documents.
	ImageURL *string `json:"image_url,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

CreateProductRequest is given as an input to CreateProduct.

type CreateReportRequest

CreateReportRequest represents a union request type of the following types:

  • `AdjustmentsReports`
  • `TransactionsReports`
  • `ProductsAndPricesReport`
  • `DiscountsReport`

The following constructor functions can be used to create a new instance of this type.

  • `NewCreateReportRequestAdjustmentsReports()`
  • `NewCreateReportRequestTransactionsReports()`
  • `NewCreateReportRequestProductsAndPricesReport()`
  • `NewCreateReportRequestDiscountsReport()`

Only one of the values can be set at a time, the first non-nil value will be used in the request.

func NewCreateReportRequestAdjustmentsReports

func NewCreateReportRequestAdjustmentsReports(r *AdjustmentsReports) *CreateReportRequest

NewCreateReportRequestAdjustmentsReports takes a AdjustmentsReports type and creates a CreateReportRequest for use in a request.

func NewCreateReportRequestDiscountsReport

func NewCreateReportRequestDiscountsReport(r *DiscountsReport) *CreateReportRequest

NewCreateReportRequestDiscountsReport takes a DiscountsReport type and creates a CreateReportRequest for use in a request.

func NewCreateReportRequestProductsAndPricesReport

func NewCreateReportRequestProductsAndPricesReport(r *ProductsAndPricesReport) *CreateReportRequest

NewCreateReportRequestProductsAndPricesReport takes a ProductsAndPricesReport type and creates a CreateReportRequest for use in a request.

func NewCreateReportRequestTransactionsReports

func NewCreateReportRequestTransactionsReports(r *TransactionsReports) *CreateReportRequest

NewCreateReportRequestTransactionsReports takes a TransactionsReports type and creates a CreateReportRequest for use in a request.

func (CreateReportRequest) MarshalJSON

func (u CreateReportRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type CreateSubscriptionChargeItems

CreateSubscriptionChargeItems represents a union request type of the following types:

  • `SubscriptionsSubscriptionsCatalogItem`
  • `SubscriptionsNonCatalogPriceForAnExistingProduct`
  • `SubscriptionsNonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewCreateSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem()`
  • `NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct()`
  • `NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct

func NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct(r *SubscriptionsNonCatalogPriceAndProduct) *CreateSubscriptionChargeItems

NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct takes a SubscriptionsNonCatalogPriceAndProduct type and creates a CreateSubscriptionChargeItems for use in a request.

func NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct

func NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct(r *SubscriptionsNonCatalogPriceForAnExistingProduct) *CreateSubscriptionChargeItems

NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct takes a SubscriptionsNonCatalogPriceForAnExistingProduct type and creates a CreateSubscriptionChargeItems for use in a request.

func NewCreateSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem

func NewCreateSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem(r *SubscriptionsSubscriptionsCatalogItem) *CreateSubscriptionChargeItems

NewCreateSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem takes a SubscriptionsSubscriptionsCatalogItem type and creates a CreateSubscriptionChargeItems for use in a request.

func (CreateSubscriptionChargeItems) MarshalJSON

func (u CreateSubscriptionChargeItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type CreateSubscriptionChargeRequest

type CreateSubscriptionChargeRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	// EffectiveFrom: When one-time charges should be billed.
	EffectiveFrom string `json:"effective_from,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []CreateSubscriptionChargeItems `json:"items,omitempty"`
	// OnPaymentFailure: How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
	OnPaymentFailure *string `json:"on_payment_failure,omitempty"`
}

CreateSubscriptionChargeRequest is given as an input to CreateSubscriptionCharge.

type CreateTransactionItems

CreateTransactionItems represents a union request type of the following types:

  • `CatalogItem`
  • `NonCatalogPriceForAnExistingProduct`
  • `NonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewCreateTransactionItemsCatalogItem()`
  • `NewCreateTransactionItemsNonCatalogPriceForAnExistingProduct()`
  • `NewCreateTransactionItemsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewCreateTransactionItemsCatalogItem

func NewCreateTransactionItemsCatalogItem(r *CatalogItem) *CreateTransactionItems

NewCreateTransactionItemsCatalogItem takes a CatalogItem type and creates a CreateTransactionItems for use in a request.

func NewCreateTransactionItemsNonCatalogPriceAndProduct

func NewCreateTransactionItemsNonCatalogPriceAndProduct(r *NonCatalogPriceAndProduct) *CreateTransactionItems

NewCreateTransactionItemsNonCatalogPriceAndProduct takes a NonCatalogPriceAndProduct type and creates a CreateTransactionItems for use in a request.

func NewCreateTransactionItemsNonCatalogPriceForAnExistingProduct

func NewCreateTransactionItemsNonCatalogPriceForAnExistingProduct(r *NonCatalogPriceForAnExistingProduct) *CreateTransactionItems

NewCreateTransactionItemsNonCatalogPriceForAnExistingProduct takes a NonCatalogPriceForAnExistingProduct type and creates a CreateTransactionItems for use in a request.

func (CreateTransactionItems) MarshalJSON

func (u CreateTransactionItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type CreateTransactionRequest

type CreateTransactionRequest struct {

	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []CreateTransactionItems `json:"items,omitempty"`
	/*
	   Status: Status of this transaction. You may set a transaction to `billed` when creating,
	   or omit to let Paddle set the status. Transactions are created as `ready` if they have
	   an `address_id`, `customer_id`, and `items`, otherwise they are created as `draft`.

	   Marking as `billed` when creating is typically used when working with manually-collected
	   transactions as part of an invoicing workflow. Billed transactions cannot be updated, only canceled.
	*/
	Status *string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this transaction is for, prefixed with `add_`.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode *string `json:"currency_code,omitempty"`
	// CollectionMode: How payment is collected for this transaction. `automatic` for checkout, `manual` for invoices.
	CollectionMode *string `json:"collection_mode,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// BillingPeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.
	BillingPeriod *TimePeriod `json:"billing_period,omitempty"`
	// Checkout: Paddle Checkout details for this transaction. You may pass a URL when creating or updating an automatically-collected transaction, or when creating or updating a manually-collected transaction where `billing_details.enable_checkout` is `true`.
	Checkout *TransactionsCheckout `json:"checkout,omitempty"`

	// IncludeAddress allows requesting the address sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAddress bool `in:"paddle_include=address" json:"-"`

	// IncludeAdjustments allows requesting the adjustment sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustments bool `in:"paddle_include=adjustment" json:"-"`

	// IncludeAdjustmentsTotals allows requesting the adjustments_totals sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustmentsTotals bool `in:"paddle_include=adjustments_totals" json:"-"`

	// IncludeBusiness allows requesting the business sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeBusiness bool `in:"paddle_include=business" json:"-"`

	// IncludeCustomer allows requesting the customer sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeCustomer bool `in:"paddle_include=customer" json:"-"`

	// IncludeDiscount allows requesting the discount sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeDiscount bool `in:"paddle_include=discount" json:"-"`

	// IncludeAvailablePaymentMethods allows requesting the available_payment_methods sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAvailablePaymentMethods bool `in:"paddle_include=available_payment_methods" json:"-"`
}

CreateTransactionRequest is given as an input to CreateTransaction.

type Credit

type Credit struct {
	// Amount: Total of any credit adjustments created for this update.
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for adjustments.
	CurrencyCode string `json:"currency_code,omitempty"`
}

Credit: Details of any credit adjustments. Paddle creates adjustments against existing transactions when prorating.

type CreditBalance

type CreditBalance struct {
	// CustomerID: Paddle ID of the customer that this credit balance is for, prefixed with `ctm_`.
	CustomerID string `json:"customer_id,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for this credit balance.
	CurrencyCode string `json:"currency_code,omitempty"`
	// Balance: Totals for this credit balance. Where a customer has more than one subscription in this currency with a credit balance, includes totals for all subscriptions.
	Balance CustomerBalance `json:"balance,omitempty"`
}

CreditBalance: Represents a credit balance for a customer.

type CurrencyCode

type CurrencyCode string

CurrencyCode: Supported three-letter ISO 4217 currency code..

type CurrencyCodeChargebacks

type CurrencyCodeChargebacks string

CurrencyCodeChargebacks: Three-letter ISO 4217 currency code for the original chargeback fee..

type CurrencyCodePayouts

type CurrencyCodePayouts string

CurrencyCodePayouts: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed..

type CustomData

type CustomData map[string]any

type Customer

type Customer struct {
	// ID: Unique Paddle ID for this customer entity, prefixed with `ctm_`.
	ID string `json:"id,omitempty"`
	// Name: Full name of this customer. Required when creating transactions where `collection_mode` is `manual` (invoices).
	Name *string `json:"name,omitempty"`
	// Email: Email address for this customer.
	Email string `json:"email,omitempty"`
	/*
	   MarketingConsent: Whether this customer opted into marketing from you.
	   Set to `true` by Paddle where a customer checks the marketing consent box when using Paddle Checkout; `false` otherwise.
	*/
	MarketingConsent bool `json:"marketing_consent,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Locale: Valid IETF BCP 47 short form locale tag. If omitted, defaults to `en`.
	Locale string `json:"locale,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

Customer: Customer for this transaction. Returned when the `include` parameter is used with the `customer` value and the transaction has a `customer_id`.

type CustomerBalance

type CustomerBalance struct {
	// Available: Total amount of credit available to use.
	Available string `json:"available,omitempty"`
	// Reserved: Total amount of credit temporarily reserved for `billed` transactions.
	Reserved string `json:"reserved,omitempty"`
	// Used: Total amount of credit used.
	Used string `json:"used,omitempty"`
}

CustomerBalance: Totals for this credit balance. Where a customer has more than one subscription in this currency with a credit balance, includes totals for all subscriptions.

type CustomerIncludes

type CustomerIncludes struct {
	// ID: Unique Paddle ID for this customer entity, prefixed with `ctm_`.
	ID string `json:"id,omitempty"`
	// Name: Full name of this customer. Required when creating transactions where `collection_mode` is `manual` (invoices).
	Name *string `json:"name,omitempty"`
	// Email: Email address for this customer.
	Email string `json:"email,omitempty"`
	/*
	   MarketingConsent: Whether this customer opted into marketing from you.
	   Set to `true` by Paddle where a customer checks the marketing consent box when using Paddle Checkout; `false` otherwise.
	*/
	MarketingConsent bool `json:"marketing_consent,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Locale: Valid IETF BCP 47 short form locale tag. If omitted, defaults to `en`.
	Locale string `json:"locale,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

CustomerIncludes: Represents a customer entity with included entities.

type CustomersClient

type CustomersClient struct {
	// contains filtered or unexported fields
}

CustomersClient is a client for the Customers resource.

func (*CustomersClient) CreateCustomer

func (c *CustomersClient) CreateCustomer(ctx context.Context, req *CreateCustomerRequest) (res *Customer, err error)

CreateCustomer performs the POST operation on a Customers resource.

func (*CustomersClient) GetCustomer

func (c *CustomersClient) GetCustomer(ctx context.Context, req *GetCustomerRequest) (res *CustomerIncludes, err error)

GetCustomer performs the GET operation on a Customers resource.

func (*CustomersClient) ListCustomers

func (c *CustomersClient) ListCustomers(ctx context.Context, req *ListCustomersRequest) (res *Collection[*Customer], err error)

ListCustomers performs the GET operation on a Customers resource.

func (*CustomersClient) UpdateCustomer

func (c *CustomersClient) UpdateCustomer(ctx context.Context, req *UpdateCustomerRequest) (res *Customer, err error)

UpdateCustomer performs the PATCH operation on a Customers resource.

type DeleteNotificationSettingRequest

type DeleteNotificationSettingRequest struct {
	// URL path parameters.
	NotificationSettingID string `in:"path=notification_setting_id" json:"-"`
}

DeleteNotificationSettingRequest is given as an input to DeleteNotificationSetting.

type Discount

type Discount struct {
	// ID: Unique Paddle ID for this discount, prefixed with `dsc_`.
	ID string `json:"id,omitempty"`
	// Status: Whether this entity can be used in Paddle. `expired` and `used` are set automatically by Paddle.
	Status string `json:"status,omitempty"`
	// Description: Short description for this discount for your reference. Not shown to customers.
	Description string `json:"description,omitempty"`
	// EnabledForCheckout: Whether this discount can be applied by a customer at checkout.
	EnabledForCheckout bool `json:"enabled_for_checkout,omitempty"`
	// Code: Unique code that customers can use to apply this discount at checkout. Use letters and numbers only, up to 16 characters. Paddle generates a random 10-character code if a code is not provided and `enabled_for_checkout` is `true`.
	Code *string `json:"code,omitempty"`
	// Type: Type of discount.
	Type string `json:"type,omitempty"`
	// Amount: Amount to discount by. For `percentage` discounts, must be an amount between `0.01` and `100`. For `flat` and `flat_per_seat` discounts, amount in the lowest denomination for a currency.
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Required where discount type is `flat` or `flat_per_seat`.
	CurrencyCode *string `json:"currency_code,omitempty"`
	// Recur: Whether this discount applies for multiple billing periods.
	Recur bool `json:"recur,omitempty"`
	// MaximumRecurringIntervals: Amount of subscription billing periods that this discount recurs for. Requires `recur`. `null` if this discount recurs forever.
	MaximumRecurringIntervals *int `json:"maximum_recurring_intervals,omitempty"`
	// UsageLimit: Maximum amount of times this discount can be used. This is an overall limit, rather than a per-customer limit. `null` if this discount can be used an unlimited amount of times.
	UsageLimit *int `json:"usage_limit,omitempty"`
	// RestrictTo: Product or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. `null` if this discount applies to all products and prices.
	RestrictTo []string `json:"restrict_to,omitempty"`
	// ExpiresAt: RFC 3339 datetime string of when this discount expires. Discount can no longer be applied after this date has elapsed. `null` if this discount can be applied forever.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// TimesUsed: How many times this discount has been redeemed. Automatically incremented by Paddle when an order completes.
	TimesUsed int `json:"times_used,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

Discount: Discount for this transaction. Returned when the `include` parameter is used with the `discount` value and the transaction has a `discount_id`.

type DiscountStatus

type DiscountStatus string

DiscountStatus: Whether this entity can be used in Paddle. `expired` and `used` are set automatically by Paddle..

type DiscountType

type DiscountType string

DiscountType: Type of discount..

type DiscountsClient

type DiscountsClient struct {
	// contains filtered or unexported fields
}

DiscountsClient is a client for the Discounts resource.

func (*DiscountsClient) CreateDiscount

func (c *DiscountsClient) CreateDiscount(ctx context.Context, req *CreateDiscountRequest) (res *Discount, err error)

CreateDiscount performs the POST operation on a Discounts resource.

func (*DiscountsClient) GetDiscount

func (c *DiscountsClient) GetDiscount(ctx context.Context, req *GetDiscountRequest) (res *Discount, err error)

GetDiscount performs the GET operation on a Discounts resource.

func (*DiscountsClient) ListDiscounts

func (c *DiscountsClient) ListDiscounts(ctx context.Context, req *ListDiscountsRequest) (res *Collection[*Discount], err error)

ListDiscounts performs the GET operation on a Discounts resource.

func (*DiscountsClient) UpdateDiscount

func (c *DiscountsClient) UpdateDiscount(ctx context.Context, req *UpdateDiscountRequest) (res *Discount, err error)

UpdateDiscount performs the PATCH operation on a Discounts resource.

type DiscountsReport

type DiscountsReport struct {
	// Type: Type of report to create.
	Type string `json:"type,omitempty"`
	// Filters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.
	Filters []ReportsReportsReportsReportsReportFilters `json:"filters,omitempty"`
}

DiscountsReport: Request body when creating a discounts report.

type Doer

type Doer interface {
	Do(ctx context.Context, method, path string, src, dst any) error
}

Doer is an interface that is used to make requests to the Paddle API. This is of the custom client used by the SDK, instead of the standard http.Client Do method.

type Duration

type Duration struct {
	// Interval: Unit of time.
	Interval string `json:"interval,omitempty"`
	// Frequency: Amount of time.
	Frequency int `json:"frequency,omitempty"`
}

Duration: How often this price should be charged. `null` if price is non-recurring (one-time).

type EffectiveFrom

type EffectiveFrom string

EffectiveFrom: When this discount should take effect from..

type ErrorCode

type ErrorCode *string

ErrorCode: Reason why a payment attempt failed. Returns `null` if payment captured successfully..

type Event

type Event struct {
	// EventID: Unique Paddle ID for this event, prefixed with `evt_`.
	EventID string `json:"event_id,omitempty"`
	// EventType: Type of event sent by Paddle, in the format `entity.event_type`.
	EventType string `json:"event_type,omitempty"`
	// OccurredAt: RFC 3339 datetime string of when this event occurred.
	OccurredAt string `json:"occurred_at,omitempty"`
	// Data: New or changed entity.
	Data any `json:"data,omitempty"`
}

Event: Represents an event entity.

type EventType

type EventType struct {
	// Name: Type of event sent by Paddle, in the format `entity.event_type`.
	Name string `json:"name,omitempty"`
	// Description: Short description of this event type.
	Description string `json:"description,omitempty"`
	// Group: Group for this event type. Typically the entity that this event relates to.
	Group string `json:"group,omitempty"`
	// AvailableVersions: List of API versions that this event type supports.
	AvailableVersions []int `json:"available_versions,omitempty"`
}

EventType: Represents an event type.

type EventsClient

type EventsClient struct {
	// contains filtered or unexported fields
}

EventsClient is a client for the Events resource.

func (*EventsClient) ListEvents

func (c *EventsClient) ListEvents(ctx context.Context, req *ListEventsRequest) (res *Collection[*Event], err error)

ListEvents performs the GET operation on a Events resource.

type EventsTypesClient

type EventsTypesClient struct {
	// contains filtered or unexported fields
}

EventsTypesClient is a client for the Events types resource.

func (*EventsTypesClient) ListEventTypes

func (c *EventsTypesClient) ListEventTypes(ctx context.Context, req *ListEventTypesRequest) (res *Collection[*EventType], err error)

ListEventTypes performs the GET operation on a Events types resource.

type ExistingCustomerPaddleIDs

type ExistingCustomerPaddleIDs struct {
	// AddressID: Paddle ID of the address that this transaction preview is for, prefixed with `add_`. Requires `customer_id`.
	AddressID string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction preview is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	/*
	   IgnoreTrials: Whether trials should be ignored for transaction preview calculations.

	   By default, recurring items with trials are considered to have a zero charge when previewing. Set to `true` to disable this.
	*/
	IgnoreTrials bool `json:"ignore_trials,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []ExistingCustomerPaddleIDsItems `json:"items,omitempty"`
}

ExistingCustomerPaddleIDs: Paddle uses existing customer data to calculate totals. Typically used for logged-in customers.

type ExistingCustomerPaddleIDsItems

ExistingCustomerPaddleIDsItems represents a union request type of the following types:

  • `TransactionsCatalogItem`
  • `TransactionsNonCatalogPriceForAnExistingProduct`
  • `TransactionsNonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewExistingCustomerPaddleIDsItemsTransactionsCatalogItem()`
  • `NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceForAnExistingProduct()`
  • `NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewExistingCustomerPaddleIDsItemsTransactionsCatalogItem

func NewExistingCustomerPaddleIDsItemsTransactionsCatalogItem(r *TransactionsCatalogItem) *ExistingCustomerPaddleIDsItems

NewExistingCustomerPaddleIDsItemsTransactionsCatalogItem takes a TransactionsCatalogItem type and creates a ExistingCustomerPaddleIDsItems for use in a request.

func NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceAndProduct

func NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceAndProduct(r *TransactionsNonCatalogPriceAndProduct) *ExistingCustomerPaddleIDsItems

NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceAndProduct takes a TransactionsNonCatalogPriceAndProduct type and creates a ExistingCustomerPaddleIDsItems for use in a request.

func NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceForAnExistingProduct

func NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceForAnExistingProduct(r *TransactionsNonCatalogPriceForAnExistingProduct) *ExistingCustomerPaddleIDsItems

NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceForAnExistingProduct takes a TransactionsNonCatalogPriceForAnExistingProduct type and creates a ExistingCustomerPaddleIDsItems for use in a request.

func (ExistingCustomerPaddleIDsItems) MarshalJSON

func (u ExistingCustomerPaddleIDsItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type GetAddressRequest

type GetAddressRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
	AddressID  string `in:"path=address_id" json:"-"`
}

GetAddressRequest is given as an input to GetAddress.

type GetBusinessRequest

type GetBusinessRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
	BusinessID string `in:"path=business_id" json:"-"`
}

GetBusinessRequest is given as an input to GetBusiness.

type GetCustomerRequest

type GetCustomerRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
}

GetCustomerRequest is given as an input to GetCustomer.

type GetDiscountRequest

type GetDiscountRequest struct {
	// URL path parameters.
	DiscountID string `in:"path=discount_id" json:"-"`
}

GetDiscountRequest is given as an input to GetDiscount.

type GetIPAddressesRequest

type GetIPAddressesRequest struct{}

GetIPAddressesRequest is given as an input to GetIPAddresses.

type GetNotificationRequest

type GetNotificationRequest struct {
	// URL path parameters.
	NotificationID string `in:"path=notification_id" json:"-"`
}

GetNotificationRequest is given as an input to GetNotification.

type GetNotificationSettingRequest

type GetNotificationSettingRequest struct {
	// URL path parameters.
	NotificationSettingID string `in:"path=notification_setting_id" json:"-"`
}

GetNotificationSettingRequest is given as an input to GetNotificationSetting.

type GetPriceRequest

type GetPriceRequest struct {
	// URL path parameters.
	PriceID string `in:"path=price_id" json:"-"`

	// IncludeProduct allows requesting the product sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeProduct bool `in:"paddle_include=product" json:"-"`
}

GetPriceRequest is given as an input to GetPrice.

type GetProductRequest

type GetProductRequest struct {
	// URL path parameters.
	ProductID string `in:"path=product_id" json:"-"`

	// IncludePrices allows requesting the prices sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludePrices bool `in:"paddle_include=prices" json:"-"`
}

GetProductRequest is given as an input to GetProduct.

type GetReportCSVRequest

type GetReportCSVRequest struct {
	// URL path parameters.
	ReportID string `in:"path=report_id" json:"-"`
}

GetReportCSVRequest is given as an input to GetReportCSV.

type GetReportRequest

type GetReportRequest struct {
	// URL path parameters.
	ReportID string `in:"path=report_id" json:"-"`
}

GetReportRequest is given as an input to GetReport.

type GetSubscriptionRequest

type GetSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	// IncludeNextTransaction allows requesting the next_transaction sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeNextTransaction bool `in:"paddle_include=next_transaction" json:"-"`

	// IncludeRecurringTransactionDetails allows requesting the recurring_transaction_details sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeRecurringTransactionDetails bool `in:"paddle_include=recurring_transaction_details" json:"-"`
}

GetSubscriptionRequest is given as an input to GetSubscription.

type GetSubscriptionUpdatePaymentMethodTransactionRequest

type GetSubscriptionUpdatePaymentMethodTransactionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`
}

GetSubscriptionUpdatePaymentMethodTransactionRequest is given as an input to GetSubscriptionUpdatePaymentMethodTransaction.

type GetTransactionInvoiceRequest

type GetTransactionInvoiceRequest struct {
	// URL path parameters.
	TransactionID string `in:"path=transaction_id" json:"-"`
}

GetTransactionInvoiceRequest is given as an input to GetTransactionInvoice.

type GetTransactionRequest

type GetTransactionRequest struct {
	// URL path parameters.
	TransactionID string `in:"path=transaction_id" json:"-"`

	// IncludeAddress allows requesting the address sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAddress bool `in:"paddle_include=address" json:"-"`

	// IncludeAdjustments allows requesting the adjustment sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustments bool `in:"paddle_include=adjustment" json:"-"`

	// IncludeAdjustmentsTotals allows requesting the adjustments_totals sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustmentsTotals bool `in:"paddle_include=adjustments_totals" json:"-"`

	// IncludeBusiness allows requesting the business sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeBusiness bool `in:"paddle_include=business" json:"-"`

	// IncludeCustomer allows requesting the customer sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeCustomer bool `in:"paddle_include=customer" json:"-"`

	// IncludeDiscount allows requesting the discount sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeDiscount bool `in:"paddle_include=discount" json:"-"`

	// IncludeAvailablePaymentMethods allows requesting the available_payment_methods sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAvailablePaymentMethods bool `in:"paddle_include=available_payment_methods" json:"-"`
}

GetTransactionRequest is given as an input to GetTransaction.

type IPAddress

type IPAddress struct {
	// CustomerIPAddress: IP address for this transaction preview.
	CustomerIPAddress string `json:"customer_ip_address,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	/*
	   IgnoreTrials: Whether trials should be ignored for transaction preview calculations.

	   By default, recurring items with trials are considered to have a zero charge when previewing. Set to `true` to disable this.
	*/
	IgnoreTrials bool `json:"ignore_trials,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []IPAddressItems `json:"items,omitempty"`
}

IPAddress: Paddle fetches location using the IP address to calculate totals.

type IPAddressItems

IPAddressItems represents a union request type of the following types:

  • `TransactionsCatalogItem`
  • `TransactionsNonCatalogPriceForAnExistingProduct`
  • `TransactionsNonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewIPAddressItemsTransactionsCatalogItem()`
  • `NewIPAddressItemsTransactionsNonCatalogPriceForAnExistingProduct()`
  • `NewIPAddressItemsTransactionsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewIPAddressItemsTransactionsCatalogItem

func NewIPAddressItemsTransactionsCatalogItem(r *TransactionsCatalogItem) *IPAddressItems

NewIPAddressItemsTransactionsCatalogItem takes a TransactionsCatalogItem type and creates a IPAddressItems for use in a request.

func NewIPAddressItemsTransactionsNonCatalogPriceAndProduct

func NewIPAddressItemsTransactionsNonCatalogPriceAndProduct(r *TransactionsNonCatalogPriceAndProduct) *IPAddressItems

NewIPAddressItemsTransactionsNonCatalogPriceAndProduct takes a TransactionsNonCatalogPriceAndProduct type and creates a IPAddressItems for use in a request.

func NewIPAddressItemsTransactionsNonCatalogPriceForAnExistingProduct

func NewIPAddressItemsTransactionsNonCatalogPriceForAnExistingProduct(r *TransactionsNonCatalogPriceForAnExistingProduct) *IPAddressItems

NewIPAddressItemsTransactionsNonCatalogPriceForAnExistingProduct takes a TransactionsNonCatalogPriceForAnExistingProduct type and creates a IPAddressItems for use in a request.

func (IPAddressItems) MarshalJSON

func (u IPAddressItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type IPAddressesClient

type IPAddressesClient struct {
	// contains filtered or unexported fields
}

IPAddressesClient is a client for the IP addresses resource.

func (*IPAddressesClient) GetIPAddresses

func (c *IPAddressesClient) GetIPAddresses(ctx context.Context, req *GetIPAddressesRequest) (res *IPAddressesData, err error)

GetIPAddresses performs the GET operation on a IP addresses resource.

type IPAddressesData

type IPAddressesData struct {
	// IPv4CIDRs: List of Paddle IPv4 CIDRs.
	IPv4CIDRs []string `json:"ipv4_cidrs,omitempty"`
}

type ImportMeta

type ImportMeta struct {
	// ExternalID: Reference or identifier for this entity from the solution where it was imported from.
	ExternalID *string `json:"external_id,omitempty"`
	// ImportedFrom: Name of the platform where this entity was imported from.
	ImportedFrom string `json:"imported_from,omitempty"`
}

ImportMeta: Import information for this entity. `null` if this entity is not imported.

type Interval

type Interval string

Interval: Unit of time..

type ListAddressesRequest

type ListAddressesRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`

	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Search is a query parameter.
	// Return entities that match a search query. Searches all fields except `status`, `created_at`, and `updated_at`.
	Search *string `in:"query=search;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListAddressesRequest is given as an input to ListAddresses.

type ListAdjustmentsRequest

type ListAdjustmentsRequest struct {
	// Action is a query parameter.
	// Return entities for the specified action.
	Action *string `in:"query=action;omitempty" json:"-"`
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// CustomerID is a query parameter.
	// Return entities related to the specified customer. Use a comma-separated list to specify multiple customer IDs.
	CustomerID []string `in:"query=customer_id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `10`; Maximum: `50`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
	// SubscriptionID is a query parameter.
	// Return entities related to the specified subscription. Use a comma-separated list to specify multiple subscription IDs.
	SubscriptionID []string `in:"query=subscription_id;omitempty" json:"-"`
	// TransactionID is a query parameter.
	// Return entities related to the specified transaction. Use a comma-separated list to specify multiple transaction IDs.
	TransactionID []string `in:"query=transaction_id;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
}

ListAdjustmentsRequest is given as an input to ListAdjustments.

type ListBusinessesRequest

type ListBusinessesRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`

	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Search is a query parameter.
	// Return entities that match a search query. Searches all fields, including contacts, except `status`, `created_at`, and `updated_at`.
	Search *string `in:"query=search;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListBusinessesRequest is given as an input to ListBusinesses.

type ListCreditBalancesRequest

type ListCreditBalancesRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
}

ListCreditBalancesRequest is given as an input to ListCreditBalances.

type ListCustomersRequest

type ListCustomersRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// Email is a query parameter.
	// Return entities that exactly match the specified email address. Use a comma-separated list to specify multiple email addresses. Recommended for precise matching of email addresses.
	Email []string `in:"query=email;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Search is a query parameter.
	// Return entities that match a search query. Searches `id`, `name`, and `email` fields. Use the `email` query parameter for precise matching of email addresses.
	Search *string `in:"query=search;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListCustomersRequest is given as an input to ListCustomers.

type ListDiscountsRequest

type ListDiscountsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// Code is a query parameter.
	// Return entities that match the discount code. Use a comma-separated list to specify multiple discount codes.
	Code []string `in:"query=code;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `created_at` and `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListDiscountsRequest is given as an input to ListDiscounts.

type ListEventTypesRequest

type ListEventTypesRequest struct{}

ListEventTypesRequest is given as an input to ListEventTypes.

type ListEventsRequest

type ListEventsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id` (for `event_id`).
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
}

ListEventsRequest is given as an input to ListEvents.

type ListNotificationLogsRequest

type ListNotificationLogsRequest struct {
	// URL path parameters.
	NotificationID string `in:"path=notification_id" json:"-"`

	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
}

ListNotificationLogsRequest is given as an input to ListNotificationLogs.

type ListNotificationSettingsRequest

type ListNotificationSettingsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `200`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
}

ListNotificationSettingsRequest is given as an input to ListNotificationSettings.

type ListNotificationsRequest

type ListNotificationsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// NotificationSettingID is a query parameter.
	// Return entities related to the specified notification destination. Use a comma-separated list to specify multiple notification destination IDs.
	NotificationSettingID []string `in:"query=notification_setting_id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Search is a query parameter.
	// Return entities that match a search query. Searches `id` and `type` fields.
	Search *string `in:"query=search;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
	// Filter is a query parameter.
	// Return entities that contain the Paddle ID specified. Pass a transaction, customer, or subscription ID.
	Filter *string `in:"query=filter;omitempty" json:"-"`
	// To is a query parameter.
	// Return entities up to a specific time.
	To *string `in:"query=to;omitempty" json:"-"`
	// From is a query parameter.
	// Return entities from a specific time.
	From *string `in:"query=from;omitempty" json:"-"`
}

ListNotificationsRequest is given as an input to ListNotifications.

type ListPricesRequest

type ListPricesRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `billing_cycle.frequency`, `billing_cycle.interval`, `id`, `product_id`, `quantity.maximum`, `quantity.minimum`, `status`, `tax_mode`, `unit_price.amount`, and `unit_price.currency_code`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// ProductID is a query parameter.
	// Return entities related to the specified product. Use a comma-separated list to specify multiple product IDs.
	ProductID []string `in:"query=product_id;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
	// Recurring is a query parameter.
	// Determine whether returned entities are for recurring prices (`true`) or one-time prices (`false`).
	Recurring *bool `in:"query=recurring;omitempty" json:"-"`
	// Type is a query parameter.
	// Return items that match the specified type.
	Type *string `in:"query=type;omitempty" json:"-"`

	// IncludeProduct allows requesting the product sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeProduct bool `in:"paddle_include=product" json:"-"`
}

ListPricesRequest is given as an input to ListPrices.

type ListProductsRequest

type ListProductsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `created_at`, `custom_data`, `description`, `id`, `image_url`, `name`, `status`, `tax_category`, and `updated_at`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
	// TaxCategory is a query parameter.
	// Return entities that match the specified tax category. Use a comma-separated list to specify multiple tax categories.
	TaxCategory []string `in:"query=tax_category;omitempty" json:"-"`
	// Type is a query parameter.
	// Return items that match the specified type.
	Type *string `in:"query=type;omitempty" json:"-"`

	// IncludePrices allows requesting the prices sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludePrices bool `in:"paddle_include=prices" json:"-"`
}

ListProductsRequest is given as an input to ListProducts.

type ListReportsRequest

type ListReportsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListReportsRequest is given as an input to ListReports.

type ListSubscriptionsRequest

type ListSubscriptionsRequest struct {
	// AddressID is a query parameter.
	// Return entities related to the specified address. Use a comma-separated list to specify multiple address IDs.
	AddressID []string `in:"query=address_id;omitempty" json:"-"`
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// CollectionMode is a query parameter.
	// Return entities that match the specified collection mode.
	CollectionMode *string `in:"query=collection_mode;omitempty" json:"-"`
	// CustomerID is a query parameter.
	// Return entities related to the specified customer. Use a comma-separated list to specify multiple customer IDs.
	CustomerID []string `in:"query=customer_id;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `id`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// PerPage is a query parameter.
	/*
	   Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.

	   Default: `50`; Maximum: `200`.
	*/
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// PriceID is a query parameter.
	// Return entities related to the specified price. Use a comma-separated list to specify multiple price IDs.
	PriceID []string `in:"query=price_id;omitempty" json:"-"`
	// ScheduledChangeAction is a query parameter.
	// Return subscriptions that have a scheduled change. Use a comma-separated list to specify multiple scheduled change actions.
	ScheduledChangeAction []string `in:"query=scheduled_change_action;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
}

ListSubscriptionsRequest is given as an input to ListSubscriptions.

type ListTransactionsRequest

type ListTransactionsRequest struct {
	// After is a query parameter.
	// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
	After *string `in:"query=after;omitempty" json:"-"`
	// BilledAt is a query parameter.
	// Return entities billed at a specific time. Pass an RFC 3339 datetime string, or use `[LT]` (less than), `[LTE]` (less than or equal to), `[GT]` (greater than), or `[GTE]` (greater than or equal to) operators. For example, `billed_at=2023-04-18T17:03:26` or `billed_at[LT]=2023-04-18T17:03:26`.
	BilledAt *string `in:"query=billed_at;omitempty" json:"-"`
	// CollectionMode is a query parameter.
	// Return entities that match the specified collection mode.
	CollectionMode *string `in:"query=collection_mode;omitempty" json:"-"`
	// CreatedAt is a query parameter.
	// Return entities created at a specific time. Pass an RFC 3339 datetime string, or use `[LT]` (less than), `[LTE]` (less than or equal to), `[GT]` (greater than), or `[GTE]` (greater than or equal to) operators. For example, `created_at=2023-04-18T17:03:26` or `created_at[LT]=2023-04-18T17:03:26`.
	CreatedAt *string `in:"query=created_at;omitempty" json:"-"`
	// CustomerID is a query parameter.
	// Return entities related to the specified customer. Use a comma-separated list to specify multiple customer IDs.
	CustomerID []string `in:"query=customer_id;omitempty" json:"-"`
	// ID is a query parameter.
	// Return only the IDs specified. Use a comma-separated list to get multiple entities.
	ID []string `in:"query=id;omitempty" json:"-"`
	// InvoiceNumber is a query parameter.
	// Return entities that match the invoice number. Use a comma-separated list to specify multiple invoice numbers.
	InvoiceNumber []string `in:"query=invoice_number;omitempty" json:"-"`
	// Origin is a query parameter.
	// Return entities related to the specified origin. Use a comma-separated list to specify multiple origins.
	Origin []string `in:"query=origin;omitempty" json:"-"`
	// OrderBy is a query parameter.
	/*
	   Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.

	   Valid fields for ordering: `billed_at`, `created_at`, `id`, and `updated_at`.
	*/
	OrderBy *string `in:"query=order_by;omitempty" json:"-"`
	// Status is a query parameter.
	// Return entities that match the specified status. Use a comma-separated list to specify multiple status values.
	Status []string `in:"query=status;omitempty" json:"-"`
	// SubscriptionID is a query parameter.
	// Return entities related to the specified subscription. Use a comma-separated list to specify multiple subscription IDs. Pass `null` to return entities that are not related to any subscription.
	SubscriptionID []string `in:"query=subscription_id;omitempty" json:"-"`
	// PerPage is a query parameter.
	// Set how many entities are returned per page.
	PerPage *int `in:"query=per_page;omitempty" json:"-"`
	// UpdatedAt is a query parameter.
	// Return entities updated at a specific time. Pass an RFC 3339 datetime string, or use `[LT]` (less than), `[LTE]` (less than or equal to), `[GT]` (greater than), or `[GTE]` (greater than or equal to) operators. For example, `updated_at=2023-04-18T17:03:26` or `updated_at[LT]=2023-04-18T17:03:26`.
	UpdatedAt *string `in:"query=updated_at;omitempty" json:"-"`

	// IncludeAddress allows requesting the address sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAddress bool `in:"paddle_include=address" json:"-"`

	// IncludeAdjustments allows requesting the adjustment sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustments bool `in:"paddle_include=adjustment" json:"-"`

	// IncludeAdjustmentsTotals allows requesting the adjustments_totals sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustmentsTotals bool `in:"paddle_include=adjustments_totals" json:"-"`

	// IncludeBusiness allows requesting the business sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeBusiness bool `in:"paddle_include=business" json:"-"`

	// IncludeCustomer allows requesting the customer sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeCustomer bool `in:"paddle_include=customer" json:"-"`

	// IncludeDiscount allows requesting the discount sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeDiscount bool `in:"paddle_include=discount" json:"-"`

	// IncludeAvailablePaymentMethods allows requesting the available_payment_methods sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAvailablePaymentMethods bool `in:"paddle_include=available_payment_methods" json:"-"`
}

ListTransactionsRequest is given as an input to ListTransactions.

type Meta

type Meta struct {
	// RequestID: Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
	RequestID string `json:"request_id,omitempty"`
}

Meta: Information about this response.

type MetaPaginated

type MetaPaginated struct {
	// RequestID: Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
	RequestID string `json:"request_id,omitempty"`
	// Pagination: Keys used for working with paginated results.
	Pagination Pagination `json:"pagination,omitempty"`
}

MetaPaginated: Information about this response.

type MethodDetails

type MethodDetails struct {
	// Type: Type of payment method used for this payment attempt.
	Type string `json:"type,omitempty"`
	// Card: Information about the credit or debit card used to pay. `null` unless `type` is `card`.
	Card *Card `json:"card,omitempty"`
}

MethodDetails: Information about the payment method used for a payment attempt.

type Money

type Money struct {
	// Amount: Amount in the lowest denomination for the currency, e.g. 10 USD = 1000 (cents).
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
}

Money: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.

type NextTransaction

type NextTransaction struct {
	// BillingPeriod: Billing period for the next transaction.
	BillingPeriod TimePeriod `json:"billing_period,omitempty"`
	// Details: Calculated totals for a transaction preview, including discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction preview.
	Details SubscriptionTransactionDetailsPreview `json:"details,omitempty"`
	// Adjustments: Represents an adjustment entity when previewing adjustments.
	Adjustments []AdjustmentPreview `json:"adjustments,omitempty"`
}

NextTransaction: Preview of the next transaction for this subscription. May include prorated charges that are not yet billed and one-time charges. Returned when the `include` parameter is used with the `next_transaction` value. `null` if the subscription is scheduled to cancel or pause.

type NonCatalogPriceAndProduct

type NonCatalogPriceAndProduct struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
	Proration *Proration `json:"proration,omitempty"`
	// Price: Price object for a non-catalog item to charge for. Include a `product` object to create a non-catalog product for this non-catalog price.
	Price TransactionSubscriptionPriceCreateWithProduct `json:"price,omitempty"`
}

NonCatalogPriceAndProduct: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

type NonCatalogPriceForAnExistingProduct

type NonCatalogPriceForAnExistingProduct struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
	Proration *Proration `json:"proration,omitempty"`
	// Price: Price object for a non-catalog item to charge for. Include a `product_id` to relate this non-catalog price to an existing catalog price.
	Price TransactionSubscriptionPriceCreateWithProductID `json:"price,omitempty"`
}

NonCatalogPriceForAnExistingProduct: Add a non-catalog price for an existing product in your catalog to a transaction. In this case, the product you're billing for is a catalog product, but you charge a specific price for it.

type Notification

type Notification struct {
	// ID: Unique Paddle ID for this notification, prefixed with `ntf_`.
	ID string `json:"id,omitempty"`
	// Type: Type of event sent by Paddle, in the format `entity.event_type`.
	Type string `json:"type,omitempty"`
	// Status: Status of this notification.
	Status string `json:"status,omitempty"`
	// Payload: Notification payload. Includes the new or changed event.
	Payload NotificationsEvent `json:"payload,omitempty"`
	// OccurredAt: RFC 3339 datetime string of when this notification occurred.
	OccurredAt string `json:"occurred_at,omitempty"`
	// DeliveredAt: RFC 3339 datetime string of when this notification was delivered. `null` if not yet delivered successfully.
	DeliveredAt *string `json:"delivered_at,omitempty"`
	// ReplayedAt: RFC 3339 datetime string of when this notification was replayed. `null` if not replayed.
	ReplayedAt *string `json:"replayed_at,omitempty"`
	// Origin: Describes how this notification was created.
	Origin string `json:"origin,omitempty"`
	// LastAttemptAt: RFC 3339 datetime string of when this notification was last attempted.
	LastAttemptAt *string `json:"last_attempt_at,omitempty"`
	// RetryAt: RFC 3339 datetime string of when this notification is scheduled to be retried.
	RetryAt *string `json:"retry_at,omitempty"`
	// TimesAttempted: How many times delivery of this notification has been attempted. Automatically incremented by Paddle after an attempt.
	TimesAttempted int `json:"times_attempted,omitempty"`
	// NotificationSettingID: Unique Paddle ID for this notification setting, prefixed with `ntfset_`.
	NotificationSettingID string `json:"notification_setting_id,omitempty"`
}

Notification: Represents a notification entity.

type NotificationLog

type NotificationLog struct {
	// ID: Unique Paddle ID for this notification log, prefixed with `ntflog_`.
	ID string `json:"id,omitempty"`
	// ResponseCode: HTTP code sent by the responding server.
	ResponseCode int `json:"response_code,omitempty"`
	// ResponseContentType: Content-Type sent by the responding server.
	ResponseContentType *string `json:"response_content_type,omitempty"`
	// ResponseBody: Response body sent by the responding server. Typically empty for success responses.
	ResponseBody string `json:"response_body,omitempty"`
	// AttemptedAt: RFC 3339 datetime string of when Paddle attempted to deliver the related notification.
	AttemptedAt string `json:"attempted_at,omitempty"`
}

NotificationLog: Represents a notification log entity.

type NotificationLogsClient

type NotificationLogsClient struct {
	// contains filtered or unexported fields
}

NotificationLogsClient is a client for the Notification logs resource.

func (*NotificationLogsClient) ListNotificationLogs

func (c *NotificationLogsClient) ListNotificationLogs(ctx context.Context, req *ListNotificationLogsRequest) (res *Collection[*NotificationLog], err error)

ListNotificationLogs performs the GET operation on a Notification logs resource.

type NotificationSetting

type NotificationSetting struct {
	// ID: Unique Paddle ID for this notification setting, prefixed with `ntfset_`.
	ID string `json:"id,omitempty"`
	// Description: Short description for this notification destination. Shown in the Paddle web app.
	Description string `json:"description,omitempty"`
	// Type: Where notifications should be sent for this destination.
	Type string `json:"type,omitempty"`
	// Destination: Webhook endpoint URL or email address.
	Destination string `json:"destination,omitempty"`
	// Active: Whether Paddle should try to deliver events to this notification destination.
	Active bool `json:"active,omitempty"`
	// APIVersion: API version that returned objects for events should conform to. Must be a valid version of the Paddle API. Cannot be a version older than your account default. Defaults to your account default if not included.
	APIVersion int `json:"api_version,omitempty"`
	// IncludeSensitiveFields: Whether potentially sensitive fields should be sent to this notification destination.
	IncludeSensitiveFields bool `json:"include_sensitive_fields,omitempty"`
	// SubscribedEvents: Represents an event type.
	SubscribedEvents []EventType `json:"subscribed_events,omitempty"`
	// EndpointSecretKey: Webhook destination secret key, prefixed with `pdl_ntfset_`. Used for signature verification.
	EndpointSecretKey string `json:"endpoint_secret_key,omitempty"`
}

NotificationSetting: Represents a notification destination.

type NotificationSettingReplaysClient

type NotificationSettingReplaysClient struct {
	// contains filtered or unexported fields
}

NotificationSettingReplaysClient is a client for the Notification setting replays resource.

func (*NotificationSettingReplaysClient) ReplayNotification

func (c *NotificationSettingReplaysClient) ReplayNotification(ctx context.Context, req *ReplayNotificationRequest) (err error)

ReplayNotification performs the POST operation on a Notification setting replays resource.

type NotificationSettingType

type NotificationSettingType string

NotificationSettingType: Where notifications should be sent for this destination..

type NotificationSettingsClient

type NotificationSettingsClient struct {
	// contains filtered or unexported fields
}

NotificationSettingsClient is a client for the Notification settings resource.

func (*NotificationSettingsClient) CreateNotificationSetting

func (c *NotificationSettingsClient) CreateNotificationSetting(ctx context.Context, req *CreateNotificationSettingRequest) (res *NotificationSetting, err error)

CreateNotificationSetting performs the POST operation on a Notification settings resource.

func (*NotificationSettingsClient) DeleteNotificationSetting

func (c *NotificationSettingsClient) DeleteNotificationSetting(ctx context.Context, req *DeleteNotificationSettingRequest) (err error)

DeleteNotificationSetting performs the DELETE operation on a Notification settings resource.

func (*NotificationSettingsClient) GetNotificationSetting

func (c *NotificationSettingsClient) GetNotificationSetting(ctx context.Context, req *GetNotificationSettingRequest) (res *NotificationSetting, err error)

GetNotificationSetting performs the GET operation on a Notification settings resource.

func (*NotificationSettingsClient) ListNotificationSettings

ListNotificationSettings performs the GET operation on a Notification settings resource.

func (*NotificationSettingsClient) UpdateNotificationSetting

func (c *NotificationSettingsClient) UpdateNotificationSetting(ctx context.Context, req *UpdateNotificationSettingRequest) (res *NotificationSetting, err error)

UpdateNotificationSetting performs the PATCH operation on a Notification settings resource.

type NotificationStatus

type NotificationStatus string

NotificationStatus: Status of this notification..

type NotificationsClient

type NotificationsClient struct {
	// contains filtered or unexported fields
}

NotificationsClient is a client for the Notifications resource.

func (*NotificationsClient) GetNotification

func (c *NotificationsClient) GetNotification(ctx context.Context, req *GetNotificationRequest) (res *Notification, err error)

GetNotification performs the GET operation on a Notifications resource.

func (*NotificationsClient) ListNotifications

func (c *NotificationsClient) ListNotifications(ctx context.Context, req *ListNotificationsRequest) (res *Collection[*Notification], err error)

ListNotifications performs the GET operation on a Notifications resource.

type NotificationsEvent

type NotificationsEvent struct {
	// EventID: Unique Paddle ID for this event, prefixed with `evt_`.
	EventID string `json:"event_id,omitempty"`
	// EventType: Type of event sent by Paddle, in the format `entity.event_type`.
	EventType string `json:"event_type,omitempty"`
	// OccurredAt: RFC 3339 datetime string of when this event occurred.
	OccurredAt string `json:"occurred_at,omitempty"`
	// Data: New or changed entity.
	Data any `json:"data,omitempty"`
	// NotificationID: Unique Paddle ID for this notification, prefixed with `ntf_`.
	NotificationID string `json:"notification_id,omitempty"`
}

NotificationsEvent: Notification payload. Includes the new or changed event.

type Option

type Option func(*options)

Option is a function that configures the Paddle SDK.

func WithAPIKey

func WithAPIKey(apiKey string) Option

WithAPIKey returns an option that sets the Paddle API key.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL returns an option that sets the base URL for the Paddle API.

func WithClient

func WithClient(c client.HTTPDoer) Option

WithClient returns an option that sets the HTTP client used to make requests to the Paddle API.

type Origin

type Origin string

Origin: Describes how this notification was created..

type Original

type Original struct {
	// Amount: Fee amount for this chargeback in the original currency.
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for the original chargeback fee.
	CurrencyCode string `json:"currency_code,omitempty"`
}

Original: Chargeback fee before conversion to the payout currency. `null` when the chargeback fee is the same as the payout currency.

type Pagination

type Pagination struct {
	// PerPage: Number of entities per page for this response. May differ from the number requested if the requested number is greater than the maximum.
	PerPage int `json:"per_page,omitempty"`
	// Next: URL containing the query parameters of the original request, along with the `after` parameter that marks the starting point of the next page. Always returned, even if `has_more` is `false`.
	Next string `json:"next,omitempty"`
	// HasMore: Whether this response has another page.
	HasMore bool `json:"has_more,omitempty"`
	// EstimatedTotal: Estimated number of entities for this response.
	EstimatedTotal int `json:"estimated_total,omitempty"`
}

Pagination: Keys used for working with paginated results.

type PatchField

type PatchField[T any] struct {
	// contains filtered or unexported fields
}

PatchField is a type that represents a field in a patch request. It is used to differentiate between: * a field that should not be present in the request. * a field that should be present in the request, but with a null value. * a field that should be present in the request, with a non-null value. Using the standard json package, it is not possible to differentiate between a field that is not present and a field that is present with an explicit null value without the use of maps. This type is used to work around this limitation, and provides some type safety by allowing the user to specify the type of the field as a type parameter. To create a new PatchField value, use the NewPatchField function.

func NewNullPatchField

func NewNullPatchField[T any]() *PatchField[T]

NewNullPatchField creates a new PatchField with a null value.

func NewPatchField

func NewPatchField[T any](value T) *PatchField[T]

NewPatchField creates a new PatchField from a given value. This is used for fields that accept either a value, or omitted completely.

func NewPtrPatchField

func NewPtrPatchField[T any](value T) *PatchField[*T]

NewPtrPatchField creates a new PatchField from a concrete value, where the expected PatchField value is a pointer (aka optional). This is an alias to doing NewPatchField(ptrTo(v)), where ptrTo is a function that returns a pointer to the given value (e.g. &v).

func (PatchField[T]) MarshalJSON

func (f PatchField[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. If the PatchField hasn't been set on the type, then the omitempty will handle it as an omitted field. If the PatchField has been set, then this will render the null value as a JSON null.

func (PatchField[T]) Value

func (f PatchField[T]) Value() *T

Value returns the value, if any.

type PauseSubscriptionRequest

type PauseSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	/*
	   EffectiveFrom: When this subscription change should take effect from. Defaults to `next_billing_period` for active subscriptions,
	   which creates a `scheduled_change` to apply the subscription change at the end of the billing period.
	*/
	EffectiveFrom *string `json:"effective_from,omitempty"`
	// ResumeAt: RFC 3339 datetime string of when the paused subscription should resume. Omit to pause indefinitely until resumed.
	ResumeAt *string `json:"resume_at,omitempty"`
}

PauseSubscriptionRequest is given as an input to PauseSubscription.

type PaymentAttemptStatus

type PaymentAttemptStatus string

PaymentAttemptStatus: Status of this payment attempt..

type PaymentMethodType

type PaymentMethodType string

PaymentMethodType: Type of payment method used for this payment attempt..

type PayoutTotalsAdjustment

type PayoutTotalsAdjustment struct {
	// Subtotal: Adjustment total before tax and fees.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the adjustment subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Adjustment total after tax.
	Total string `json:"total,omitempty"`
	// Fee: Adjusted Paddle fee.
	Fee string `json:"fee,omitempty"`
	// ChargebackFee: Chargeback fees incurred for this adjustment. Only returned when the adjustment `action` is `chargeback` or `chargeback_warning`.
	ChargebackFee ChargebackFee `json:"chargeback_fee,omitempty"`
	// Earnings: Adjusted payout earnings. This is the adjustment total plus adjusted Paddle fees, excluding chargeback fees.
	Earnings string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed.
	CurrencyCode string `json:"currency_code,omitempty"`
}

PayoutTotalsAdjustment: Breakdown of how this adjustment affects your payout balance.

type PreviewSubscriptionChargeItems

PreviewSubscriptionChargeItems represents a union request type of the following types:

  • `SubscriptionsSubscriptionsCatalogItem`
  • `SubscriptionsNonCatalogPriceForAnExistingProduct`
  • `SubscriptionsNonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewPreviewSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem()`
  • `NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct()`
  • `NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct

func NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct(r *SubscriptionsNonCatalogPriceAndProduct) *PreviewSubscriptionChargeItems

NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct takes a SubscriptionsNonCatalogPriceAndProduct type and creates a PreviewSubscriptionChargeItems for use in a request.

func NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct

func NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct(r *SubscriptionsNonCatalogPriceForAnExistingProduct) *PreviewSubscriptionChargeItems

NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct takes a SubscriptionsNonCatalogPriceForAnExistingProduct type and creates a PreviewSubscriptionChargeItems for use in a request.

func NewPreviewSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem

func NewPreviewSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem(r *SubscriptionsSubscriptionsCatalogItem) *PreviewSubscriptionChargeItems

NewPreviewSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem takes a SubscriptionsSubscriptionsCatalogItem type and creates a PreviewSubscriptionChargeItems for use in a request.

func (PreviewSubscriptionChargeItems) MarshalJSON

func (u PreviewSubscriptionChargeItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type PreviewSubscriptionChargeRequest

type PreviewSubscriptionChargeRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	// EffectiveFrom: When one-time charges should be billed.
	EffectiveFrom string `json:"effective_from,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items []PreviewSubscriptionChargeItems `json:"items,omitempty"`
	// OnPaymentFailure: How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
	OnPaymentFailure *string `json:"on_payment_failure,omitempty"`
}

PreviewSubscriptionChargeRequest is given as an input to PreviewSubscriptionCharge.

type PreviewSubscriptionRequest

type PreviewSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	// CustomerID: Paddle ID of the customer that this subscription is for, prefixed with `ctm_`. Include to change the customer for a subscription.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this subscription is for, prefixed with `add_`. Include to change the address for a subscription.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this subscription is for, prefixed with `biz_`. Include to change the business for a subscription.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Include to change the currency that a subscription bills in. When changing `collection_mode` to `manual`, you may need to change currency code to `USD`, `EUR`, or `GBP`.
	CurrencyCode *string `json:"currency_code,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this subscription is next scheduled to be billed. Include to change the next billing date.
	NextBilledAt *string `json:"next_billed_at,omitempty"`
	// Discount: Details of the discount applied to this subscription. Include to add a discount to a subscription. `null` to remove a discount.
	Discount *SubscriptionsDiscount `json:"discount,omitempty"`
	// CollectionMode: How payment is collected for transactions created for this subscription. `automatic` for checkout, `manual` for invoices.
	CollectionMode *string `json:"collection_mode,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`. `null` if changing `collection_mode` to `automatic`.
	BillingDetails *BillingDetailsUpdate `json:"billing_details,omitempty"`
	// ScheduledChange: Change that's scheduled to be applied to a subscription. When updating, you may only set to `null` to remove a scheduled change. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes.
	ScheduledChange *SubscriptionScheduledChange `json:"scheduled_change,omitempty"`
	// Items: Add or update a catalog item to a subscription. In this case, the product and price that you're billing for exist in your product catalog in Paddle.
	Items []SubscriptionsCatalogItem `json:"items,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	/*
	   ProrationBillingMode: How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
	   changes that impact billing.

	   For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
	   collects for payment immediately is used.
	*/
	ProrationBillingMode *string `json:"proration_billing_mode,omitempty"`
	// OnPaymentFailure: How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
	OnPaymentFailure *string `json:"on_payment_failure,omitempty"`
}

PreviewSubscriptionRequest is given as an input to PreviewSubscription.

type PreviewSubscriptionUpdateSummary

type PreviewSubscriptionUpdateSummary struct {
	// Credit: Details of any credit adjustments. Paddle creates adjustments against existing transactions when prorating.
	Credit Credit `json:"credit,omitempty"`
	// Charge: Details of the transaction to be created for this update. Paddle creates a transaction to bill for new charges.
	Charge Charge `json:"charge,omitempty"`
	// Result: Details of the result of credits and charges. Where the total of any credit adjustments is greater than the total charge, the result is a prorated credit; otherwise, the result is a prorated charge.
	Result Result `json:"result,omitempty"`
}

PreviewSubscriptionUpdateSummary: Impact of this subscription change. Includes whether the change results in a charge or credit, and totals for prorated amounts.

type PreviewTransactionRequest

type PreviewTransactionRequest struct {
	*CountryAndZipPostalCode
	*IPAddress
	*ExistingCustomerPaddleIDs
}

PreviewTransactionRequest represents a union request type of the following types:

  • `CountryAndZipPostalCode`
  • `IPAddress`
  • `ExistingCustomerPaddleIDs`

The following constructor functions can be used to create a new instance of this type.

  • `NewPreviewTransactionRequestCountryAndZipPostalCode()`
  • `NewPreviewTransactionRequestIPAddress()`
  • `NewPreviewTransactionRequestExistingCustomerPaddleIDs()`

Only one of the values can be set at a time, the first non-nil value will be used in the request.

func NewPreviewTransactionRequestCountryAndZipPostalCode

func NewPreviewTransactionRequestCountryAndZipPostalCode(r *CountryAndZipPostalCode) *PreviewTransactionRequest

NewPreviewTransactionRequestCountryAndZipPostalCode takes a CountryAndZipPostalCode type and creates a PreviewTransactionRequest for use in a request.

func NewPreviewTransactionRequestExistingCustomerPaddleIDs

func NewPreviewTransactionRequestExistingCustomerPaddleIDs(r *ExistingCustomerPaddleIDs) *PreviewTransactionRequest

NewPreviewTransactionRequestExistingCustomerPaddleIDs takes a ExistingCustomerPaddleIDs type and creates a PreviewTransactionRequest for use in a request.

func NewPreviewTransactionRequestIPAddress

func NewPreviewTransactionRequestIPAddress(r *IPAddress) *PreviewTransactionRequest

NewPreviewTransactionRequestIPAddress takes a IPAddress type and creates a PreviewTransactionRequest for use in a request.

func (PreviewTransactionRequest) MarshalJSON

func (u PreviewTransactionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type Price

type Price struct {
	// ID: Unique Paddle ID for this price, prefixed with `pri_`.
	ID string `json:"id,omitempty"`
	// ProductID: Paddle ID for the product that this price is for, prefixed with `pro_`.
	ProductID string `json:"product_id,omitempty"`
	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description string `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type string `json:"type,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *string `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *Duration `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *Duration `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode string `json:"tax_mode,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice Money `json:"unit_price,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides []UnitPriceOverride `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns.
	Quantity PriceQuantity `json:"quantity,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
}

Price: Represents a price entity.

type PriceIncludes

type PriceIncludes struct {
	// ID: Unique Paddle ID for this price, prefixed with `pri_`.
	ID string `json:"id,omitempty"`
	// ProductID: Paddle ID for the product that this price is for, prefixed with `pro_`.
	ProductID string `json:"product_id,omitempty"`
	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description string `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type string `json:"type,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *string `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *Duration `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *Duration `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode string `json:"tax_mode,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice Money `json:"unit_price,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides []UnitPriceOverride `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns.
	Quantity PriceQuantity `json:"quantity,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// Product: Related product for this price. Returned when the `include` parameter is used with the `product` value.
	Product Product `json:"product,omitempty"`
}

PriceIncludes: Represents a price entity with included entities.

type PricePreview

type PricePreview struct {
	// CustomerID: Paddle ID of the customer that this preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this preview is for, prefixed with `add_`. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this preview is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// Address: Address for this preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	Address *AddressPreview `json:"address,omitempty"`
	// CustomerIPAddress: IP address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	CustomerIPAddress *string `json:"customer_ip_address,omitempty"`
	// Items: List of items to preview price calculations for.
	Items []PricePreviewItem `json:"items,omitempty"`
	// Details: Calculated totals for a price preview, including discounts, tax, and currency conversion.
	Details PricePreviewDetails `json:"details,omitempty"`
	// AvailablePaymentMethods: List of available payment methods for Paddle Checkout given the price and location information passed.
	AvailablePaymentMethods []PaymentMethodType `json:"available_payment_methods,omitempty"`
}

type PricePreviewDetails

type PricePreviewDetails struct {
	// LineItems: Information about line items for this preview. Includes totals calculated by Paddle. Considered the source of truth for line item totals.
	LineItems []PricePreviewLineItem `json:"line_items,omitempty"`
}

PricePreviewDetails: Calculated totals for a price preview, including discounts, tax, and currency conversion.

type PricePreviewDiscounts

type PricePreviewDiscounts struct {
	// Discount: Related discount entity for this preview line item.
	Discount Discount `json:"discount,omitempty"`
	// Total: Total amount discounted as a result of this discount.
	Total string `json:"total,omitempty"`
	// FormattedTotal: Total amount discounted as a result of this discount in the format of a given currency. '
	FormattedTotal string `json:"formatted_total,omitempty"`
}

PricePreviewDiscounts: Array of discounts applied to this preview line item. Empty if no discounts applied.

type PricePreviewItem

type PricePreviewItem struct {
	// PriceID: Paddle ID for the price to add to this transaction, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Quantity: Quantity of the item to preview.
	Quantity int `json:"quantity,omitempty"`
}

PricePreviewItem: List of items to preview price calculations for.

type PricePreviewLineItem

type PricePreviewLineItem struct {
	// Price: Related price entity for this preview line item.
	Price Price `json:"price,omitempty"`
	// Quantity: Quantity of this preview line item.
	Quantity int `json:"quantity,omitempty"`
	// TaxRate: Rate used to calculate tax for this preview line item.
	TaxRate string `json:"tax_rate,omitempty"`
	// UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).
	UnitTotals UnitTotals `json:"unit_totals,omitempty"`
	// FormattedUnitTotals: Breakdown of the charge for one unit in the format of a given currency.
	FormattedUnitTotals UnitTotalsFormatted `json:"formatted_unit_totals,omitempty"`
	// Totals: Breakdown of a charge in the lowest denomination of a currency (e.g. cents for USD).
	Totals Totals `json:"totals,omitempty"`
	// FormattedTotals: The financial breakdown of a charge in the format of a given currency.
	FormattedTotals TotalsFormatted `json:"formatted_totals,omitempty"`
	// Product: Related product entity for this preview line item price.
	Product Product `json:"product,omitempty"`
	// Discounts: Array of discounts applied to this preview line item. Empty if no discounts applied.
	Discounts []PricePreviewDiscounts `json:"discounts,omitempty"`
}

PricePreviewLineItem: Information about line items for this preview. Includes totals calculated by Paddle. Considered the source of truth for line item totals.

type PricePreviewRequest

type PricePreviewRequest struct {
	// CustomerID: Paddle ID of the customer that this preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this preview is for, prefixed with `add_`. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this preview is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode *string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// Address: Address for this preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	Address *AddressPreview `json:"address,omitempty"`
	// CustomerIPAddress: IP address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	CustomerIPAddress *string `json:"customer_ip_address,omitempty"`
	// Items: List of items to preview price calculations for.
	Items []PricePreviewItem `json:"items,omitempty"`
}

PricePreviewRequest is given as an input to PricePreview.

type PriceQuantity

type PriceQuantity struct {
	// Minimum: Minimum quantity of the product related to this price that can be bought. Required if `maximum` set.
	Minimum int `json:"minimum,omitempty"`
	// Maximum: Maximum quantity of the product related to this price that can be bought. Required if `minimum` set. Must be greater than or equal to the `minimum` value.
	Maximum int `json:"maximum,omitempty"`
}

PriceQuantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns.

type PricesClient

type PricesClient struct {
	// contains filtered or unexported fields
}

PricesClient is a client for the Prices resource.

func (*PricesClient) CreatePrice

func (c *PricesClient) CreatePrice(ctx context.Context, req *CreatePriceRequest) (res *Price, err error)

CreatePrice performs the POST operation on a Prices resource.

func (*PricesClient) GetPrice

func (c *PricesClient) GetPrice(ctx context.Context, req *GetPriceRequest) (res *PriceIncludes, err error)

GetPrice performs the GET operation on a Prices resource.

func (*PricesClient) ListPrices

func (c *PricesClient) ListPrices(ctx context.Context, req *ListPricesRequest) (res *Collection[*PriceIncludes], err error)

ListPrices performs the GET operation on a Prices resource.

func (*PricesClient) UpdatePrice

func (c *PricesClient) UpdatePrice(ctx context.Context, req *UpdatePriceRequest) (res *Price, err error)

UpdatePrice performs the PATCH operation on a Prices resource.

type PricingPreviewClient

type PricingPreviewClient struct {
	// contains filtered or unexported fields
}

PricingPreviewClient is a client for the Pricing preview resource.

func (*PricingPreviewClient) PricePreview

func (c *PricingPreviewClient) PricePreview(ctx context.Context, req *PricePreviewRequest) (res *PricePreview, err error)

PricePreview performs the POST operation on a Pricing preview resource.

type Product

type Product struct {
	// ID: Unique Paddle ID for this product, prefixed with `pro_`.
	ID string `json:"id,omitempty"`
	// Name: Name of this product.
	Name string `json:"name,omitempty"`
	// Description: Short description for this product.
	Description *string `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type string `json:"type,omitempty"`
	// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
	TaxCategory string `json:"tax_category,omitempty"`
	// ImageURL: Image for this product. Included in the checkout and on some customer documents.
	ImageURL *string `json:"image_url,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
}

Product: Represents a product entity.

type ProductWithIncludes

type ProductWithIncludes struct {
	// ID: Unique Paddle ID for this product, prefixed with `pro_`.
	ID string `json:"id,omitempty"`
	// Name: Name of this product.
	Name string `json:"name,omitempty"`
	// Description: Short description for this product.
	Description *string `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type string `json:"type,omitempty"`
	// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
	TaxCategory string `json:"tax_category,omitempty"`
	// ImageURL: Image for this product. Included in the checkout and on some customer documents.
	ImageURL *string `json:"image_url,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status string `json:"status,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// Prices: Represents a price entity.
	Prices []Price `json:"prices,omitempty"`
}

ProductWithIncludes: Represents a product entity with included entities.

type ProductsAndPricesReport

type ProductsAndPricesReport struct {
	// Type: Type of report to create.
	Type string `json:"type,omitempty"`
	// Filters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `product_updated_at` and `price_updated_at` are greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.
	Filters []ReportsReportsReportsReportFilters `json:"filters,omitempty"`
}

ProductsAndPricesReport: Request body when creating a products and prices report.

type ProductsClient

type ProductsClient struct {
	// contains filtered or unexported fields
}

ProductsClient is a client for the Products resource.

func (*ProductsClient) CreateProduct

func (c *ProductsClient) CreateProduct(ctx context.Context, req *CreateProductRequest) (res *Product, err error)

CreateProduct performs the POST operation on a Products resource.

func (*ProductsClient) GetProduct

func (c *ProductsClient) GetProduct(ctx context.Context, req *GetProductRequest) (res *ProductWithIncludes, err error)

GetProduct performs the GET operation on a Products resource.

func (*ProductsClient) ListProducts

func (c *ProductsClient) ListProducts(ctx context.Context, req *ListProductsRequest) (res *Collection[*ProductWithIncludes], err error)

ListProducts performs the GET operation on a Products resource.

func (*ProductsClient) UpdateProduct

func (c *ProductsClient) UpdateProduct(ctx context.Context, req *UpdateProductRequest) (res *Product, err error)

UpdateProduct performs the PATCH operation on a Products resource.

type Proration

type Proration struct {
	// Rate: Rate used to calculate proration.
	Rate string `json:"rate,omitempty"`
	// BillingPeriod: Billing period that proration is based on.
	BillingPeriod TimePeriod `json:"billing_period,omitempty"`
}

Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.

type ProrationBillingMode

type ProrationBillingMode string

ProrationBillingMode: How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making changes that impact billing.

For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that collects for payment immediately is used..

type ReplayNotificationRequest

type ReplayNotificationRequest struct {
	// URL path parameters.
	NotificationID string `in:"path=notification_id" json:"-"`
}

ReplayNotificationRequest is given as an input to ReplayNotification.

type Report

type Report struct {
	// ID: Unique Paddle ID for this report, prefixed with `rep_`
	ID string `json:"id,omitempty"`
	/*
	   Status: Status of this report. Set automatically by Paddle.

	   Reports are created as `pending` initially, then move to `ready` when they're available to download.
	*/
	Status string `json:"status,omitempty"`
	// Rows: Number of records in this report. `null` if the report is `pending`.
	Rows *int `json:"rows,omitempty"`
	// Type: Type of report.
	Type string `json:"type,omitempty"`
	// Filters: List of filters applied to this report.
	Filters []ReportFilters `json:"filters,omitempty"`
	// ExpiresAt: RFC 3339 datetime string of when this report expires. The report is no longer available to download after this date.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this report was last updated.
	UpdatedAt string `json:"updated_at,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this report was created.
	CreatedAt string `json:"created_at,omitempty"`
}

Report: Represents a report entity.

type ReportCSV

type ReportCSV struct {
	// URL: URL of the requested resource.
	URL string `json:"url,omitempty"`
}

type ReportFilters

type ReportFilters struct {
	// Name: Field name to filter by.
	Name string `json:"name,omitempty"`
	// Operator: Operator to use when filtering. Valid when filtering by `updated_at`, `null` otherwise.
	Operator *string `json:"operator,omitempty"`
	// Value: Value to filter by. Check the allowed values descriptions for the `name` field to see valid values for a field.
	Value string `json:"value,omitempty"`
}

ReportFilters: List of filters applied to this report.

type ReportStatus

type ReportStatus string

ReportStatus: Status of this report. Set automatically by Paddle.

Reports are created as `pending` initially, then move to `ready` when they're available to download..

type ReportTypeAdjustments

type ReportTypeAdjustments string

ReportTypeAdjustments: Type of report to create..

type ReportTypeTransactions

type ReportTypeTransactions string

ReportTypeTransactions: Type of report..

type ReportsClient

type ReportsClient struct {
	// contains filtered or unexported fields
}

ReportsClient is a client for the Reports resource.

func (*ReportsClient) CreateReport

func (c *ReportsClient) CreateReport(ctx context.Context, req *CreateReportRequest) (res *Report, err error)

CreateReport performs the POST operation on a Reports resource.

func (*ReportsClient) GetReport

func (c *ReportsClient) GetReport(ctx context.Context, req *GetReportRequest) (res *Report, err error)

GetReport performs the GET operation on a Reports resource.

func (*ReportsClient) GetReportCSV

func (c *ReportsClient) GetReportCSV(ctx context.Context, req *GetReportCSVRequest) (res *ReportCSV, err error)

GetReportCSV performs the GET operation on a Reports resource.

func (*ReportsClient) ListReports

func (c *ReportsClient) ListReports(ctx context.Context, req *ListReportsRequest) (res *Collection[*Report], err error)

ListReports performs the GET operation on a Reports resource.

type ReportsReportFilters

type ReportsReportFilters struct {
	// Name: Field name to filter by.
	Name string `json:"name,omitempty"`
	// Operator: Operator to use when filtering. Valid when filtering by `updated_at`, `null` otherwise.
	Operator *string `json:"operator,omitempty"`
	// Value: Value to filter by. Check the allowed values descriptions for the `name` field to see valid values for a field.
	Value string `json:"value,omitempty"`
}

ReportsReportFilters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.

type ReportsReportsReportFilters

type ReportsReportsReportFilters struct {
	// Name: Field name to filter by.
	Name string `json:"name,omitempty"`
	// Operator: Operator to use when filtering. Valid when filtering by `updated_at`, `null` otherwise.
	Operator *string `json:"operator,omitempty"`
	// Value: Value to filter by. Check the allowed values descriptions for the `name` field to see valid values for a field.
	Value string `json:"value,omitempty"`
}

ReportsReportsReportFilters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.

type ReportsReportsReportsReportFilters

type ReportsReportsReportsReportFilters struct {
	// Name: Field name to filter by.
	Name string `json:"name,omitempty"`
	// Operator: Operator to use when filtering. Valid when filtering by `product_updated_at` or `price_updated_at`, `null` otherwise.
	Operator *string `json:"operator,omitempty"`
	// Value: Value to filter by.
	Value string `json:"value,omitempty"`
}

ReportsReportsReportsReportFilters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `product_updated_at` and `price_updated_at` are greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.

type ReportsReportsReportsReportsReportFilters

type ReportsReportsReportsReportsReportFilters struct {
	// Name: Field name to filter by.
	Name string `json:"name,omitempty"`
	// Operator: Operator to use when filtering. Valid when filtering by `updated_at`, `null` otherwise.
	Operator *string `json:"operator,omitempty"`
	// Value: Value to filter by. Check the allowed values descriptions for the `name` field to see valid values for a field.
	Value string `json:"value,omitempty"`
}

ReportsReportsReportsReportsReportFilters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.

type Res

type Res[T any] struct {
	// contains filtered or unexported fields
}

Res is a single result returned from an iteration of a collection.

func (*Res[T]) Err

func (r *Res[T]) Err() error

Err returns the error from the result, if it exists. This should be checked on each iteration.

func (*Res[T]) Ok

func (r *Res[T]) Ok() bool

Ok returns true if the result is not an error and not the end of the collection.

func (*Res[T]) Value

func (r *Res[T]) Value() T

Value returns the value contained from the result.

type Result

type Result struct {
	// Action: Whether the subscription change results in a prorated credit or a charge.
	Action string `json:"action,omitempty"`
	// Amount: Amount representing the result of this update, either a charge or a credit.
	Amount string `json:"amount,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code for the transaction or adjustment.
	CurrencyCode string `json:"currency_code,omitempty"`
}

Result: Details of the result of credits and charges. Where the total of any credit adjustments is greater than the total charge, the result is a prorated credit; otherwise, the result is a prorated charge.

type ResultAction

type ResultAction string

ResultAction: Whether the subscription change results in a prorated credit or a charge..

type ResumeImmediately

type ResumeImmediately struct {
	/*
	   EffectiveFrom: When this subscription change should take effect from. You can pass `immediately` to resume immediately.

	   Valid where subscriptions have the status of `paused`.

	   Defaults to `immediately` if omitted.
	*/
	EffectiveFrom *string `json:"effective_from,omitempty"`
}

type ResumeOnASpecificDate

type ResumeOnASpecificDate struct {
	/*
	   EffectiveFrom: When this scheduled change should take effect from. RFC 3339 datetime string of when the subscription should resume.

	   Valid where subscriptions are `active` with a scheduled change to pause, or where they have the status of `paused`.
	*/
	EffectiveFrom string `json:"effective_from,omitempty"`
}

type ResumeSubscriptionRequest

type ResumeSubscriptionRequest struct {
	*ResumeOnASpecificDate
	*ResumeImmediately
}

ResumeSubscriptionRequest represents a union request type of the following types:

  • `ResumeOnASpecificDate`
  • `ResumeImmediately`

The following constructor functions can be used to create a new instance of this type.

  • `NewResumeSubscriptionRequestResumeOnASpecificDate()`
  • `NewResumeSubscriptionRequestResumeImmediately()`

Only one of the values can be set at a time, the first non-nil value will be used in the request.

func NewResumeSubscriptionRequestResumeImmediately

func NewResumeSubscriptionRequestResumeImmediately(r *ResumeImmediately) *ResumeSubscriptionRequest

NewResumeSubscriptionRequestResumeImmediately takes a ResumeImmediately type and creates a ResumeSubscriptionRequest for use in a request.

func NewResumeSubscriptionRequestResumeOnASpecificDate

func NewResumeSubscriptionRequestResumeOnASpecificDate(r *ResumeOnASpecificDate) *ResumeSubscriptionRequest

NewResumeSubscriptionRequestResumeOnASpecificDate takes a ResumeOnASpecificDate type and creates a ResumeSubscriptionRequest for use in a request.

func (ResumeSubscriptionRequest) MarshalJSON

func (u ResumeSubscriptionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type SDK

SDK contains all sub-clients for the Paddle API.

func New

func New(apiKey string, opts ...Option) (*SDK, error)

New creates a new Paddle SDK with the given API key.

func NewSandbox

func NewSandbox(apiKey string, opts ...Option) (*SDK, error)

NewSandbox creates a new Paddle SDK with the given API key, using the sandbox environment.

type ScheduledChangeAction

type ScheduledChangeAction string

ScheduledChangeAction: Kind of change that's scheduled to be applied to this subscription..

type SharedName

type SharedName string

Name: Field name to filter by..

type SharedOperator

type SharedOperator *string

Operator: Operator to use when filtering. Valid when filtering by `updated_at`, `null` otherwise..

type Status

type Status string

Status: Whether this entity can be used in Paddle..

type Subscription

type Subscription struct {
	// ID: Unique Paddle ID for this subscription entity, prefixed with `sub_`.
	ID string `json:"id,omitempty"`
	// Status: Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
	Status string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this subscription is for, prefixed with `ctm_`.
	CustomerID string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this subscription is for, prefixed with `add_`.
	AddressID string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this subscription is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Transactions for this subscription are created in this currency. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode string `json:"currency_code,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// StartedAt: RFC 3339 datetime string of when this subscription started. This may be different from `first_billed_at` if the subscription started in trial.
	StartedAt *string `json:"started_at,omitempty"`
	// FirstBilledAt: RFC 3339 datetime string of when this subscription was first billed. This may be different from `started_at` if the subscription started in trial.
	FirstBilledAt *string `json:"first_billed_at,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this subscription is next scheduled to be billed.
	NextBilledAt *string `json:"next_billed_at,omitempty"`
	// PausedAt: RFC 3339 datetime string of when this subscription was paused. Set automatically by Paddle when the pause subscription operation is used. `null` if not paused.
	PausedAt *string `json:"paused_at,omitempty"`
	// CanceledAt: RFC 3339 datetime string of when this subscription was canceled. Set automatically by Paddle when the cancel subscription operation is used. `null` if not canceled.
	CanceledAt *string `json:"canceled_at,omitempty"`
	// Discount: Details of the discount applied to this subscription.
	Discount *SubscriptionDiscount `json:"discount,omitempty"`
	// CollectionMode: How payment is collected for transactions created for this subscription. `automatic` for checkout, `manual` for invoices.
	CollectionMode string `json:"collection_mode,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// CurrentBillingPeriod: Current billing period for this subscription. Set automatically by Paddle based on the billing cycle.
	CurrentBillingPeriod *TimePeriod `json:"current_billing_period,omitempty"`
	// BillingCycle: How often this subscription renews. Set automatically by Paddle based on the prices on this subscription.
	BillingCycle Duration `json:"billing_cycle,omitempty"`
	// ScheduledChange: Change that's scheduled to be applied to a subscription. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes. `null` if no scheduled changes.
	ScheduledChange *SubscriptionScheduledChange `json:"scheduled_change,omitempty"`
	// ManagementURLs: Public URLs that customers can use to make changes to this subscription. For security, the `token` appended to each link is temporary. You shouldn't store these links.
	ManagementURLs SubscriptionManagementUrLs `json:"management_urls,omitempty"`
	// Items: Represents a subscription item.
	Items []SubscriptionItem `json:"items,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

Subscription: Represents a subscription entity.

type SubscriptionDiscount

type SubscriptionDiscount struct {
	// ID: Unique Paddle ID for this discount, prefixed with `dsc_`.
	ID string `json:"id,omitempty"`
	// StartsAt: RFC 3339 datetime string of when this discount was first applied.
	StartsAt string `json:"starts_at,omitempty"`
	// EndsAt: RFC 3339 datetime string of when this discount no longer applies. Where a discount has `maximum_recurring_intervals`, this is the date of the last billing period where this discount applies. `null` where a discount recurs forever.
	EndsAt *string `json:"ends_at,omitempty"`
}

SubscriptionDiscount: Details of the discount applied to this subscription.

type SubscriptionIncludes

type SubscriptionIncludes struct {
	// ID: Unique Paddle ID for this subscription entity, prefixed with `sub_`.
	ID string `json:"id,omitempty"`
	// Status: Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
	Status string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this subscription is for, prefixed with `ctm_`.
	CustomerID string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this subscription is for, prefixed with `add_`.
	AddressID string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this subscription is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Transactions for this subscription are created in this currency. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode string `json:"currency_code,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// StartedAt: RFC 3339 datetime string of when this subscription started. This may be different from `first_billed_at` if the subscription started in trial.
	StartedAt *string `json:"started_at,omitempty"`
	// FirstBilledAt: RFC 3339 datetime string of when this subscription was first billed. This may be different from `started_at` if the subscription started in trial.
	FirstBilledAt *string `json:"first_billed_at,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this subscription is next scheduled to be billed.
	NextBilledAt *string `json:"next_billed_at,omitempty"`
	// PausedAt: RFC 3339 datetime string of when this subscription was paused. Set automatically by Paddle when the pause subscription operation is used. `null` if not paused.
	PausedAt *string `json:"paused_at,omitempty"`
	// CanceledAt: RFC 3339 datetime string of when this subscription was canceled. Set automatically by Paddle when the cancel subscription operation is used. `null` if not canceled.
	CanceledAt *string `json:"canceled_at,omitempty"`
	// Discount: Details of the discount applied to this subscription.
	Discount *SubscriptionDiscount `json:"discount,omitempty"`
	// CollectionMode: How payment is collected for transactions created for this subscription. `automatic` for checkout, `manual` for invoices.
	CollectionMode string `json:"collection_mode,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// CurrentBillingPeriod: Current billing period for this subscription. Set automatically by Paddle based on the billing cycle.
	CurrentBillingPeriod *TimePeriod `json:"current_billing_period,omitempty"`
	// BillingCycle: How often this subscription renews. Set automatically by Paddle based on the prices on this subscription.
	BillingCycle Duration `json:"billing_cycle,omitempty"`
	// ScheduledChange: Change that's scheduled to be applied to a subscription. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes. `null` if no scheduled changes.
	ScheduledChange *SubscriptionScheduledChange `json:"scheduled_change,omitempty"`
	// ManagementURLs: Public URLs that customers can use to make changes to this subscription. For security, the `token` appended to each link is temporary. You shouldn't store these links.
	ManagementURLs SubscriptionManagementUrLs `json:"management_urls,omitempty"`
	// Items: Represents a subscription item.
	Items []SubscriptionItem `json:"items,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
	// NextTransaction: Preview of the next transaction for this subscription. May include prorated charges that are not yet billed and one-time charges. Returned when the `include` parameter is used with the `next_transaction` value. `null` if the subscription is scheduled to cancel or pause.
	NextTransaction *NextTransaction `json:"next_transaction,omitempty"`
	// RecurringTransactionDetails: Preview of the recurring transaction for this subscription. This is what the customer can expect to be billed when there are no prorated or one-time charges. Returned when the `include` parameter is used with the `recurring_transaction_details` value.
	RecurringTransactionDetails SubscriptionTransactionDetailsPreview `json:"recurring_transaction_details,omitempty"`
}

SubscriptionIncludes: Represents a subscription entity with included entities.

type SubscriptionItem

type SubscriptionItem struct {
	// Status: Status of this subscription item. Set automatically by Paddle.
	Status string `json:"status,omitempty"`
	// Quantity: Quantity of this item on the subscription.
	Quantity int `json:"quantity,omitempty"`
	// Recurring: Whether this is a recurring item. `false` if one-time.
	Recurring bool `json:"recurring,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this item was added to this subscription.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this item was last updated on this subscription.
	UpdatedAt string `json:"updated_at,omitempty"`
	// PreviouslyBilledAt: RFC 3339 datetime string of when this item was last billed.
	PreviouslyBilledAt *string `json:"previously_billed_at,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this item is next scheduled to be billed.
	NextBilledAt *string `json:"next_billed_at,omitempty"`
	// TrialDates: Trial dates for this item.
	TrialDates *TimePeriod `json:"trial_dates,omitempty"`
	// Price: Related price entity for this item. This reflects the price entity at the time it was added to the subscription.
	Price Price `json:"price,omitempty"`
}

SubscriptionItem: Represents a subscription item.

type SubscriptionItemStatus

type SubscriptionItemStatus string

SubscriptionItemStatus: Status of this subscription item. Set automatically by Paddle..

type SubscriptionManagementUrLs

type SubscriptionManagementUrLs struct {
	// UpdatePaymentMethod: Public URL that lets customers update the payment method for this subscription. Creates or gets a transaction that can be used to update a payment method, then passes it to your default checkout page.
	UpdatePaymentMethod *string `json:"update_payment_method,omitempty"`
	// Cancel: Public URL that lets customers cancel this subscription. Takes customers to a Paddle page that lets them cancel their subscription.
	Cancel string `json:"cancel,omitempty"`
}

SubscriptionManagementUrLs: Public URLs that customers can use to make changes to this subscription. For security, the `token` appended to each link is temporary. You shouldn't store these links.

type SubscriptionOnPaymentFailure

type SubscriptionOnPaymentFailure string

SubscriptionOnPaymentFailure: How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`..

type SubscriptionPreview

type SubscriptionPreview struct {
	// Status: Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
	Status string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this subscription is for, prefixed with `ctm_`.
	CustomerID string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this subscription is for, prefixed with `add_`.
	AddressID string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this subscription is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Transactions for this subscription are created in this currency. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode string `json:"currency_code,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// StartedAt: RFC 3339 datetime string of when this subscription started. This may be different from `first_billed_at` if the subscription started in trial.
	StartedAt *string `json:"started_at,omitempty"`
	// FirstBilledAt: RFC 3339 datetime string of when this subscription was first billed. This may be different from `started_at` if the subscription started in trial.
	FirstBilledAt *string `json:"first_billed_at,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this subscription is next scheduled to be billed.
	NextBilledAt *string `json:"next_billed_at,omitempty"`
	// PausedAt: RFC 3339 datetime string of when this subscription was paused. Set automatically by Paddle when the pause subscription operation is used. `null` if not paused.
	PausedAt *string `json:"paused_at,omitempty"`
	// CanceledAt: RFC 3339 datetime string of when this subscription was canceled. Set automatically by Paddle when the cancel subscription operation is used. `null` if not canceled.
	CanceledAt *string `json:"canceled_at,omitempty"`
	// Discount: Details of the discount applied to this subscription.
	Discount *SubscriptionDiscount `json:"discount,omitempty"`
	// CollectionMode: How payment is collected for transactions created for this subscription. `automatic` for checkout, `manual` for invoices.
	CollectionMode string `json:"collection_mode,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// CurrentBillingPeriod: Current billing period for this subscription. Set automatically by Paddle based on the billing cycle.
	CurrentBillingPeriod *TimePeriod `json:"current_billing_period,omitempty"`
	// BillingCycle: How often this subscription renews. Set automatically by Paddle based on the prices on this subscription.
	BillingCycle Duration `json:"billing_cycle,omitempty"`
	// ScheduledChange: Change that's scheduled to be applied to a subscription. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes. `null` if no scheduled changes.
	ScheduledChange *SubscriptionScheduledChange `json:"scheduled_change,omitempty"`
	// ManagementURLs: Public URLs that customers can use to make changes to this subscription. For security, the `token` appended to each link is temporary. You shouldn't store these links.
	ManagementURLs SubscriptionManagementUrLs `json:"management_urls,omitempty"`
	// Items: Represents a subscription item.
	Items []SubscriptionItem `json:"items,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ImmediateTransaction: Preview of the immediate transaction created as a result of changes to the subscription. Returns a complete object where `proration_billing_mode` is `prorated_immediately` or `full_immediately`; `null` otherwise.
	ImmediateTransaction *NextTransaction `json:"immediate_transaction,omitempty"`
	// NextTransaction: Preview of the next transaction for this subscription. Includes charges created where `proration_billing_mode` is `prorated_next_billing_period` or `full_next_billing_period`, as well as one-time charges. `null` if the subscription is scheduled to cancel or pause.
	NextTransaction *NextTransaction `json:"next_transaction,omitempty"`
	// RecurringTransactionDetails: Preview of the recurring transaction for this subscription. This is what the customer can expect to be billed when there are no prorated or one-time charges.
	RecurringTransactionDetails SubscriptionTransactionDetailsPreview `json:"recurring_transaction_details,omitempty"`
	// UpdateSummary: Impact of this subscription change. Includes whether the change results in a charge or credit, and totals for prorated amounts.
	UpdateSummary *PreviewSubscriptionUpdateSummary `json:"update_summary,omitempty"`
	// ImportMeta: Import information for this entity. `null` if this entity is not imported.
	ImportMeta *ImportMeta `json:"import_meta,omitempty"`
}

SubscriptionPreview: Represents a subscription preview when previewing a subscription.

type SubscriptionScheduledChange

type SubscriptionScheduledChange struct {
	// Action: Kind of change that's scheduled to be applied to this subscription.
	Action string `json:"action,omitempty"`
	// EffectiveAt: RFC 3339 datetime string of when this scheduled change takes effect.
	EffectiveAt string `json:"effective_at,omitempty"`
	// ResumeAt: RFC 3339 datetime string of when a paused subscription should resume. Only used for `pause` scheduled changes.
	ResumeAt *string `json:"resume_at,omitempty"`
}

SubscriptionScheduledChange: Change that's scheduled to be applied to a subscription. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes. `null` if no scheduled changes.

type SubscriptionStatus

type SubscriptionStatus string

SubscriptionStatus: Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change..

type SubscriptionTransactionDetailsPreview added in v0.2.0

type SubscriptionTransactionDetailsPreview struct {
	// TaxRatesUsed: List of tax rates applied to this transaction preview.
	TaxRatesUsed []SubscriptionsTaxRatesUsed `json:"tax_rates_used,omitempty"`
	// Totals: Breakdown of the total for a transaction preview. `fee` and `earnings` always return `null` for transaction previews.
	Totals TransactionTotals `json:"totals,omitempty"`
	// LineItems: Information about line items for this transaction preview. Different from transaction preview `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.
	LineItems []SubscriptionsTransactionLineItemPreview `json:"line_items,omitempty"`
}

SubscriptionTransactionDetailsPreview: Calculated totals for a transaction preview, including discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction preview.

type SubscriptionsAdjustmentItem

type SubscriptionsAdjustmentItem struct {
	// ItemID: Paddle ID for the transaction item that this adjustment item relates to, prefixed with `txnitm_`.
	ItemID string `json:"item_id,omitempty"`
	/*
	   Type: Type of adjustment for this transaction item. `tax` and `proration` are automatically created by Paddle.
	   Include `amount` when creating a `partial` adjustment.
	*/
	Type string `json:"type,omitempty"`
	// Amount: Amount adjusted for this transaction item. Required when adjustment type is `partial`.
	Amount *string `json:"amount,omitempty"`
	/*
	   Proration: How proration was calculated for this adjustment item. Populated when an adjustment type is `proration`.
	   Set automatically by Paddle.
	*/
	Proration *Proration `json:"proration,omitempty"`
	// Totals: Breakdown of the total for an adjustment item.
	Totals AdjustmentItemTotals `json:"totals,omitempty"`
}

SubscriptionsAdjustmentItem: List of transaction items that this adjustment is for.

type SubscriptionsCatalogItem

type SubscriptionsCatalogItem struct {
	// PriceID: Paddle ID for the price to add to this subscription, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Quantity: Quantity of this item to add to the subscription. If updating an existing item and not changing the quantity, you may omit `quantity`.
	Quantity int `json:"quantity,omitempty"`
}

SubscriptionsCatalogItem: Add or update a catalog item to a subscription. In this case, the product and price that you're billing for exist in your product catalog in Paddle.

type SubscriptionsClient

type SubscriptionsClient struct {
	// contains filtered or unexported fields
}

SubscriptionsClient is a client for the Subscriptions resource.

func (*SubscriptionsClient) ActivateSubscription

func (c *SubscriptionsClient) ActivateSubscription(ctx context.Context, req *ActivateSubscriptionRequest) (res *Subscription, err error)

ActivateSubscription performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) CancelSubscription

func (c *SubscriptionsClient) CancelSubscription(ctx context.Context, req *CancelSubscriptionRequest) (res *Subscription, err error)

CancelSubscription performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) CreateSubscriptionCharge

func (c *SubscriptionsClient) CreateSubscriptionCharge(ctx context.Context, req *CreateSubscriptionChargeRequest) (res *Subscription, err error)

CreateSubscriptionCharge performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) GetSubscription

func (c *SubscriptionsClient) GetSubscription(ctx context.Context, req *GetSubscriptionRequest) (res *SubscriptionIncludes, err error)

GetSubscription performs the GET operation on a Subscriptions resource.

func (*SubscriptionsClient) GetSubscriptionUpdatePaymentMethodTransaction

func (c *SubscriptionsClient) GetSubscriptionUpdatePaymentMethodTransaction(ctx context.Context, req *GetSubscriptionUpdatePaymentMethodTransactionRequest) (res *Transaction, err error)

GetSubscriptionUpdatePaymentMethodTransaction performs the GET operation on a Subscriptions resource.

func (*SubscriptionsClient) ListSubscriptions

func (c *SubscriptionsClient) ListSubscriptions(ctx context.Context, req *ListSubscriptionsRequest) (res *Collection[*Subscription], err error)

ListSubscriptions performs the GET operation on a Subscriptions resource.

func (*SubscriptionsClient) PauseSubscription

func (c *SubscriptionsClient) PauseSubscription(ctx context.Context, req *PauseSubscriptionRequest) (res *Subscription, err error)

PauseSubscription performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) PreviewSubscription

func (c *SubscriptionsClient) PreviewSubscription(ctx context.Context, req *PreviewSubscriptionRequest) (res *SubscriptionPreview, err error)

PreviewSubscription performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) PreviewSubscriptionCharge

func (c *SubscriptionsClient) PreviewSubscriptionCharge(ctx context.Context, req *PreviewSubscriptionChargeRequest) (res *SubscriptionPreview, err error)

PreviewSubscriptionCharge performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) ResumeSubscription

func (c *SubscriptionsClient) ResumeSubscription(ctx context.Context, req *ResumeSubscriptionRequest) (res *Subscription, err error)

ResumeSubscription performs the POST operation on a Subscriptions resource.

func (*SubscriptionsClient) UpdateSubscription

func (c *SubscriptionsClient) UpdateSubscription(ctx context.Context, req *UpdateSubscriptionRequest) (res *Subscription, err error)

UpdateSubscription performs the PATCH operation on a Subscriptions resource.

type SubscriptionsDiscount

type SubscriptionsDiscount struct {
	// ID: Unique Paddle ID for this discount, prefixed with `dsc_`.
	ID string `json:"id,omitempty"`
	// EffectiveFrom: When this discount should take effect from.
	EffectiveFrom string `json:"effective_from,omitempty"`
}

SubscriptionsDiscount: Details of the discount applied to this subscription. Include to add a discount to a subscription. `null` to remove a discount.

type SubscriptionsNonCatalogPriceAndProduct

type SubscriptionsNonCatalogPriceAndProduct struct {
	// Quantity: Quantity to bill for.
	Quantity int `json:"quantity,omitempty"`
	// Price: Price object for a non-catalog item to charge for. Include a `product` object to create a non-catalog product for this non-catalog price.
	Price TransactionSubscriptionPriceCreateWithProduct `json:"price,omitempty"`
}

SubscriptionsNonCatalogPriceAndProduct: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

type SubscriptionsNonCatalogPriceForAnExistingProduct

type SubscriptionsNonCatalogPriceForAnExistingProduct struct {
	// Quantity: Quantity to bill for.
	Quantity int `json:"quantity,omitempty"`
	// Price: Price object for a non-catalog item to bill for. Include a `product_id` to relate this non-catalog price to an existing catalog price.
	Price TransactionSubscriptionPriceCreateWithProductID `json:"price,omitempty"`
}

SubscriptionsNonCatalogPriceForAnExistingProduct: Add a non-catalog price for an existing product in your catalog to a transaction. In this case, the product you're billing for is a catalog product, but you charge a specific price for it.

type SubscriptionsSubscriptionsCatalogItem

type SubscriptionsSubscriptionsCatalogItem struct {
	// Quantity: Quantity to bill for.
	Quantity int `json:"quantity,omitempty"`
	// PriceID: Paddle ID of an an existing catalog price to bill for.
	PriceID string `json:"price_id,omitempty"`
}

SubscriptionsSubscriptionsCatalogItem: Add a catalog item to a subscription. In this case, the product and price that you're billing for exist in your product catalog in Paddle.

type SubscriptionsTaxRatesUsed

type SubscriptionsTaxRatesUsed struct {
	// TaxRate: Rate used to calculate tax for this transaction preview.
	TaxRate string `json:"tax_rate,omitempty"`
	// Totals: Calculated totals for the tax applied to this transaction preview.
	Totals Totals `json:"totals,omitempty"`
}

SubscriptionsTaxRatesUsed: List of tax rates applied to this transaction preview.

type SubscriptionsTransactionLineItemPreview added in v0.2.0

type SubscriptionsTransactionLineItemPreview struct {
	// PriceID: Paddle ID for the price related to this transaction line item, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Quantity: Quantity of this transaction line item.
	Quantity int `json:"quantity,omitempty"`
	// TaxRate: Rate used to calculate tax for this transaction line item.
	TaxRate string `json:"tax_rate,omitempty"`
	// UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).
	UnitTotals UnitTotals `json:"unit_totals,omitempty"`
	// Totals: Breakdown of a charge in the lowest denomination of a currency (e.g. cents for USD).
	Totals Totals `json:"totals,omitempty"`
	// Product: Related product entity for this transaction line item price.
	Product Product `json:"product,omitempty"`
	// Proration: How proration was calculated for this item.
	Proration Proration `json:"proration,omitempty"`
}

SubscriptionsTransactionLineItemPreview: Information about line items for this transaction preview. Different from transaction preview `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.

type TaxCategory

type TaxCategory string

TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account..

type TaxMode

type TaxMode string

TaxMode: How tax is calculated for this price..

type TaxRatesUsed

type TaxRatesUsed struct {
	// TaxRate: Rate used to calculate tax for this transaction.
	TaxRate string `json:"tax_rate,omitempty"`
	// Totals: Calculated totals for the tax applied to this transaction.
	Totals Totals `json:"totals,omitempty"`
}

TaxRatesUsed: List of tax rates applied for this transaction.

type TimePeriod

type TimePeriod struct {
	// StartsAt: RFC 3339 datetime string of when this period starts.
	StartsAt string `json:"starts_at,omitempty"`
	// EndsAt: RFC 3339 datetime string of when this period ends.
	EndsAt string `json:"ends_at,omitempty"`
}

TimePeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.

type Totals

type Totals struct {
	// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: Total discount as a result of any discounts applied.

	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after discount and tax.
	Total string `json:"total,omitempty"`
}

Totals: Calculated totals for the tax applied to this transaction.

type TotalsFormatted

type TotalsFormatted struct {
	// Subtotal: The amount times the quantity.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: The amount discounted due to a discount code or ID being applied.

	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: The amount of tax due on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: The subtotal - discount + tax.
	Total string `json:"total,omitempty"`
}

TotalsFormatted: The financial breakdown of a charge in the format of a given currency.

type Transaction

type Transaction struct {
	// ID: Unique Paddle ID for this transaction entity, prefixed with `txn_`.
	ID string `json:"id,omitempty"`
	// Status: Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed.
	Status string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this transaction is for, prefixed with `add_`.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode string `json:"currency_code,omitempty"`
	// Origin: Describes how this transaction was created.
	Origin string `json:"origin,omitempty"`
	// SubscriptionID: Paddle ID of the subscription that this transaction is for, prefixed with `sub_`.
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// InvoiceID: Paddle ID of the invoice that this transaction is related to, prefixed with `inv_`. Used for compatibility with the Paddle Invoice API, which is now deprecated. This field is scheduled to be removed in the next version of the Paddle API.
	InvoiceID *string `json:"invoice_id,omitempty"`
	// InvoiceNumber: Invoice number for this transaction. Automatically generated by Paddle when you mark a transaction as `billed` where `collection_mode` is `manual`.
	InvoiceNumber *string `json:"invoice_number,omitempty"`
	// CollectionMode: How payment is collected for this transaction. `automatic` for checkout, `manual` for invoices.
	CollectionMode string `json:"collection_mode,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// BillingPeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.
	BillingPeriod *TimePeriod `json:"billing_period,omitempty"`
	// Items: List of items on this transaction. For calculated totals, use `details.line_items`.
	Items []TransactionItem `json:"items,omitempty"`
	// Details: Calculated totals for a transaction, including proration, discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction.
	Details TransactionDetails `json:"details,omitempty"`
	// Payments: List of payment attempts for this transaction, including successful payments. Sorted by `created_at` in descending order, so most recent attempts are returned first.
	Payments []TransactionPaymentAttempt `json:"payments,omitempty"`
	// Checkout: Paddle Checkout details for this transaction. Returned for automatically-collected transactions and where `billing_details.enable_checkout` is `true` for manually-collected transactions; `null` otherwise.
	Checkout *Checkout `json:"checkout,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// BilledAt: RFC 3339 datetime string of when this transaction was marked as `billed`. `null` for transactions that are not `billed` or `completed`. Set automatically by Paddle.
	BilledAt *string `json:"billed_at,omitempty"`
	// Customer: Related customer for this transaction.
	Customer Customer `json:"customer,omitempty"`
	// Address: Related address for this transaction.
	Address Address `json:"address,omitempty"`
	// Business: Only returned if a business exists for this transaction.
	Business Business `json:"business,omitempty"`
	// Discount: Only returned if a discount exists for this transaction.
	Discount Discount `json:"discount,omitempty"`
	// Adjustments: Represents an adjustment entity.
	Adjustments []Adjustment `json:"adjustments,omitempty"`
}

Transaction: Represents a transaction entity.

type TransactionDetails

type TransactionDetails struct {
	// TaxRatesUsed: List of tax rates applied for this transaction.
	TaxRatesUsed []TaxRatesUsed `json:"tax_rates_used,omitempty"`
	// Totals: Breakdown of the total for a transaction. These numbers can become negative when dealing with subscription updates that result in credit.
	Totals TransactionTotals `json:"totals,omitempty"`
	// AdjustedTotals: Breakdown of the payout totals for a transaction after adjustments. `null` until the transaction is `completed`.
	AdjustedTotals TransactionTotalsAdjusted `json:"adjusted_totals,omitempty"`
	// PayoutTotals: Breakdown of the payout total for a transaction. `null` until the transaction is `completed`. Returned in your payout currency.
	PayoutTotals *TransactionPayoutTotals `json:"payout_totals,omitempty"`
	// AdjustedPayoutTotals: Breakdown of the payout total for a transaction after adjustments. `null` until the transaction is `completed`.
	AdjustedPayoutTotals *TransactionPayoutTotalsAdjusted `json:"adjusted_payout_totals,omitempty"`
	// LineItems: Information about line items for this transaction. Different from transaction `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.
	LineItems []TransactionLineItem `json:"line_items,omitempty"`
}

TransactionDetails: Calculated totals for a transaction, including proration, discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction.

type TransactionDetailsPreview

type TransactionDetailsPreview struct {
	// TaxRatesUsed: List of tax rates applied to this transaction preview.
	TaxRatesUsed []TransactionsTaxRatesUsed `json:"tax_rates_used,omitempty"`
	// Totals: Breakdown of the total for a transaction preview. `fee` and `earnings` always return `null` for transaction previews.
	Totals TransactionTotals `json:"totals,omitempty"`
	// LineItems: Information about line items for this transaction preview. Different from transaction preview `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.
	LineItems []TransactionLineItemPreview `json:"line_items,omitempty"`
}

TransactionDetailsPreview: Calculated totals for a transaction preview, including discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction preview.

type TransactionIncludes

type TransactionIncludes struct {
	// ID: Unique Paddle ID for this transaction entity, prefixed with `txn_`.
	ID string `json:"id,omitempty"`
	// Status: Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed.
	Status string `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this transaction is for, prefixed with `add_`.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode string `json:"currency_code,omitempty"`
	// Origin: Describes how this transaction was created.
	Origin string `json:"origin,omitempty"`
	// SubscriptionID: Paddle ID of the subscription that this transaction is for, prefixed with `sub_`.
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// InvoiceID: Paddle ID of the invoice that this transaction is related to, prefixed with `inv_`. Used for compatibility with the Paddle Invoice API, which is now deprecated. This field is scheduled to be removed in the next version of the Paddle API.
	InvoiceID *string `json:"invoice_id,omitempty"`
	// InvoiceNumber: Invoice number for this transaction. Automatically generated by Paddle when you mark a transaction as `billed` where `collection_mode` is `manual`.
	InvoiceNumber *string `json:"invoice_number,omitempty"`
	// CollectionMode: How payment is collected for this transaction. `automatic` for checkout, `manual` for invoices.
	CollectionMode string `json:"collection_mode,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *BillingDetails `json:"billing_details,omitempty"`
	// BillingPeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.
	BillingPeriod *TimePeriod `json:"billing_period,omitempty"`
	// Items: List of items on this transaction. For calculated totals, use `details.line_items`.
	Items []TransactionItem `json:"items,omitempty"`
	// Details: Calculated totals for a transaction, including proration, discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction.
	Details TransactionDetails `json:"details,omitempty"`
	// Payments: List of payment attempts for this transaction, including successful payments. Sorted by `created_at` in descending order, so most recent attempts are returned first.
	Payments []TransactionPaymentAttempt `json:"payments,omitempty"`
	// Checkout: Paddle Checkout details for this transaction. Returned for automatically-collected transactions and where `billing_details.enable_checkout` is `true` for manually-collected transactions; `null` otherwise.
	Checkout *Checkout `json:"checkout,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// UpdatedAt: RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
	UpdatedAt string `json:"updated_at,omitempty"`
	// BilledAt: RFC 3339 datetime string of when this transaction was marked as `billed`. `null` for transactions that are not `billed` or `completed`. Set automatically by Paddle.
	BilledAt *string `json:"billed_at,omitempty"`
	// Address: Address for this transaction. Returned when the `include` parameter is used with the `address` value and the transaction has an `address_id`.
	Address Address `json:"address,omitempty"`
	// Adjustments: Represents an adjustment entity.
	Adjustments []Adjustment `json:"adjustments,omitempty"`
	// AdjustmentsTotals: Object containing totals for all adjustments on a transaction. Returned when the `include` parameter is used with the `adjustments_totals` value.
	AdjustmentsTotals AdjustmentsTotals `json:"adjustments_totals,omitempty"`
	// Business: Business for this transaction. Returned when the `include` parameter is used with the `business` value and the transaction has a `business_id`.
	Business Business `json:"business,omitempty"`
	// Customer: Customer for this transaction. Returned when the `include` parameter is used with the `customer` value and the transaction has a `customer_id`.
	Customer Customer `json:"customer,omitempty"`
	// Discount: Discount for this transaction. Returned when the `include` parameter is used with the `discount` value and the transaction has a `discount_id`.
	Discount Discount `json:"discount,omitempty"`
	// AvailablePaymentMethods: List of available payment methods for this transaction. Returned when the `include` parameter is used with the `available_payment_methods` value.
	AvailablePaymentMethods []PaymentMethodType `json:"available_payment_methods,omitempty"`
}

TransactionIncludes: Represents a transaction entity with included entities.

type TransactionInvoicePDF

type TransactionInvoicePDF struct {
	// URL: URL of the requested resource.
	URL string `json:"url,omitempty"`
}

type TransactionItem

type TransactionItem struct {
	// PriceID: Paddle ID for the price to add to this transaction, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Price: Represents a price entity.
	Price Price `json:"price,omitempty"`
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
	Proration *Proration `json:"proration,omitempty"`
}

TransactionItem: List of items on this transaction. For calculated totals, use `details.line_items`.

type TransactionItemPreview

type TransactionItemPreview struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// IncludeInTotals: Whether this item should be included in totals for this transaction preview. Typically used to exclude one-time charges from calculations.
	IncludeInTotals bool `json:"include_in_totals,omitempty"`
	// Proration: How proration was calculated for this item. `null` for transaction previews.
	Proration *Proration `json:"proration,omitempty"`
	// Price: Represents a price entity.
	Price Price `json:"price,omitempty"`
}

TransactionItemPreview: List of items to preview transaction calculations for.

type TransactionLineItem

type TransactionLineItem struct {
	// ID: Unique Paddle ID for this transaction item, prefixed with `txnitm_`.
	ID string `json:"id,omitempty"`
	// PriceID: Paddle ID for the price related to this transaction line item, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Quantity: Quantity of this transaction line item.
	Quantity int `json:"quantity,omitempty"`
	// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
	Proration *Proration `json:"proration,omitempty"`
	// TaxRate: Rate used to calculate tax for this transaction line item.
	TaxRate string `json:"tax_rate,omitempty"`
	// UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).
	UnitTotals UnitTotals `json:"unit_totals,omitempty"`
	// Totals: Breakdown of a charge in the lowest denomination of a currency (e.g. cents for USD).
	Totals Totals `json:"totals,omitempty"`
	// Product: Related product entity for this transaction line item price.
	Product Product `json:"product,omitempty"`
}

TransactionLineItem: Information about line items for this transaction. Different from transaction `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.

type TransactionLineItemPreview

type TransactionLineItemPreview struct {
	// PriceID: Paddle ID for the price related to this transaction line item, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
	// Quantity: Quantity of this transaction line item.
	Quantity int `json:"quantity,omitempty"`
	// TaxRate: Rate used to calculate tax for this transaction line item.
	TaxRate string `json:"tax_rate,omitempty"`
	// UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).
	UnitTotals UnitTotals `json:"unit_totals,omitempty"`
	// Totals: Breakdown of a charge in the lowest denomination of a currency (e.g. cents for USD).
	Totals Totals `json:"totals,omitempty"`
	// Product: Related product entity for this transaction line item price.
	Product Product `json:"product,omitempty"`
}

TransactionLineItemPreview: Information about line items for this transaction preview. Different from transaction preview `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.

type TransactionOrigin

type TransactionOrigin string

TransactionOrigin: Describes how this transaction was created..

type TransactionPaymentAttempt

type TransactionPaymentAttempt struct {
	// PaymentAttemptID: UUID for this payment attempt.
	PaymentAttemptID string `json:"payment_attempt_id,omitempty"`
	// StoredPaymentMethodID: UUID for the stored payment method used for this payment attempt. Deprecated - use `payment_method_id` instead.
	StoredPaymentMethodID string `json:"stored_payment_method_id,omitempty"`
	// PaymentMethodID: Paddle ID of the payment method used for this payment attempt, prefixed with `paymtd_`.
	PaymentMethodID string `json:"payment_method_id,omitempty"`
	// Amount: Amount for collection in the lowest denomination of a currency (e.g. cents for USD).
	Amount string `json:"amount,omitempty"`
	// Status: Status of this payment attempt.
	Status string `json:"status,omitempty"`
	// ErrorCode: Reason why a payment attempt failed. Returns `null` if payment captured successfully.
	ErrorCode *string `json:"error_code,omitempty"`
	// MethodDetails: Information about the payment method used for a payment attempt.
	MethodDetails MethodDetails `json:"method_details,omitempty"`
	// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
	CreatedAt string `json:"created_at,omitempty"`
	// CapturedAt: RFC 3339 datetime string of when this payment was captured. `null` if `status` is not `captured`.
	CapturedAt *string `json:"captured_at,omitempty"`
}

TransactionPaymentAttempt: List of payment attempts for this transaction, including successful payments. Sorted by `created_at` in descending order, so most recent attempts are returned first.

type TransactionPayoutTotals

type TransactionPayoutTotals struct {
	// Subtotal: Total before tax and fees.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: Total discount as a result of any discounts applied.
	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
	// Credit: Total credit applied to this transaction. This includes credits applied using a customer's credit balance and adjustments to a `billed` transaction.
	Credit string `json:"credit,omitempty"`
	// CreditToBalance: Additional credit generated from negative `details.line_items`. This credit is added to the customer balance.
	CreditToBalance string `json:"credit_to_balance,omitempty"`
	// Balance: Total due on a transaction after credits and any payments.
	Balance string `json:"balance,omitempty"`
	// GrandTotal: Total due on a transaction after credits but before any payments.
	GrandTotal string `json:"grand_total,omitempty"`
	// Fee: Total fee taken by Paddle for this payout.
	Fee string `json:"fee,omitempty"`
	// Earnings: Total earnings for this payout. This is the subtotal minus the Paddle fee.
	Earnings string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed.
	CurrencyCode string `json:"currency_code,omitempty"`
}

TransactionPayoutTotals: Breakdown of the payout total for a transaction. `null` until the transaction is `completed`. Returned in your payout currency.

type TransactionPayoutTotalsAdjusted

type TransactionPayoutTotalsAdjusted struct {
	// Subtotal: Total before tax and fees.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
	// Fee: Total fee taken by Paddle for this payout.
	Fee string `json:"fee,omitempty"`
	// ChargebackFee: Details of any chargeback fees incurred for this transaction.
	ChargebackFee ChargebackFee `json:"chargeback_fee,omitempty"`
	// Earnings: Total earnings for this payout. This is the subtotal minus the Paddle fee, excluding chargeback fees.
	Earnings string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed.
	CurrencyCode string `json:"currency_code,omitempty"`
}

TransactionPayoutTotalsAdjusted: Breakdown of the payout total for a transaction after adjustments. `null` until the transaction is `completed`.

type TransactionPreview

type TransactionPreview struct {
	// CustomerID: Paddle ID of the customer that this transaction preview is for, prefixed with `ctm_`.
	CustomerID *string `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this transaction preview is for, prefixed with `add_`. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	AddressID *string `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction preview is for, prefixed with `biz_`.
	BusinessID *string `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code.
	CurrencyCode string `json:"currency_code,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction preview, prefixed with `dsc_`.
	DiscountID *string `json:"discount_id,omitempty"`
	// CustomerIPAddress: IP address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	CustomerIPAddress *string `json:"customer_ip_address,omitempty"`
	// Address: Address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
	Address *AddressPreview `json:"address,omitempty"`
	/*
	   IgnoreTrials: Whether trials should be ignored for transaction preview calculations.

	   By default, recurring items with trials are considered to have a zero charge when previewing. Set to `true` to disable this.
	*/
	IgnoreTrials bool `json:"ignore_trials,omitempty"`
	// Items: List of items to preview transaction calculations for.
	Items []TransactionItemPreview `json:"items,omitempty"`
	// Details: Calculated totals for a transaction preview, including discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction preview.
	Details TransactionDetailsPreview `json:"details,omitempty"`
	// AvailablePaymentMethods: List of available payment methods for Paddle Checkout given the price and location information passed.
	AvailablePaymentMethods []PaymentMethodType `json:"available_payment_methods,omitempty"`
}

TransactionPreview: Represents a transaction entity when previewing transactions.

type TransactionStatus

type TransactionStatus string

TransactionStatus: Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed..

type TransactionSubscriptionPriceCreateWithProduct

type TransactionSubscriptionPriceCreateWithProduct struct {
	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description string `json:"description,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *string `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *Duration `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *Duration `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode string `json:"tax_mode,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice Money `json:"unit_price,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides []UnitPriceOverride `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns. If omitted, defaults to 1-100.
	Quantity PriceQuantity `json:"quantity,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// Product: Product object for a non-catalog item to charge for.
	Product TransactionSubscriptionProductCreate `json:"product,omitempty"`
}

TransactionSubscriptionPriceCreateWithProduct: Price object for a non-catalog item to charge for. Include a `product` object to create a non-catalog product for this non-catalog price.

type TransactionSubscriptionPriceCreateWithProductID

type TransactionSubscriptionPriceCreateWithProductID struct {
	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description string `json:"description,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *string `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *Duration `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *Duration `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode string `json:"tax_mode,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice Money `json:"unit_price,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides []UnitPriceOverride `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns. If omitted, defaults to 1-100.
	Quantity PriceQuantity `json:"quantity,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
	// ProductID: Paddle ID for the product that this price is for, prefixed with `pro_`.
	ProductID string `json:"product_id,omitempty"`
}

TransactionSubscriptionPriceCreateWithProductID: Price object for a non-catalog item to charge for. Include a `product_id` to relate this non-catalog price to an existing catalog price.

type TransactionSubscriptionProductCreate

type TransactionSubscriptionProductCreate struct {
	// Name: Name of this product.
	Name string `json:"name,omitempty"`
	// Description: Short description for this product.
	Description *string `json:"description,omitempty"`
	// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
	TaxCategory string `json:"tax_category,omitempty"`
	// ImageURL: Image for this product. Included in the checkout and on some customer documents.
	ImageURL *string `json:"image_url,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData CustomData `json:"custom_data,omitempty"`
}

TransactionSubscriptionProductCreate: Product object for a non-catalog item to charge for.

type TransactionTotals

type TransactionTotals struct {
	// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: Total discount as a result of any discounts applied.

	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after discount and tax.
	Total string `json:"total,omitempty"`
	// Credit: Total credit applied to this transaction. This includes credits applied using a customer's credit balance and adjustments to a `billed` transaction.
	Credit string `json:"credit,omitempty"`
	// CreditToBalance: Additional credit generated from negative `details.line_items`. This credit is added to the customer balance.
	CreditToBalance string `json:"credit_to_balance,omitempty"`
	// Balance: Total due on a transaction after credits and any payments.
	Balance string `json:"balance,omitempty"`
	// GrandTotal: Total due on a transaction after credits but before any payments.
	GrandTotal string `json:"grand_total,omitempty"`
	// Fee: Total fee taken by Paddle for this transaction. `null` until the transaction is `completed` and the fee is processed.
	Fee *string `json:"fee,omitempty"`
	// Earnings: Total earnings for this transaction. This is the total minus the Paddle fee. `null` until the transaction is `completed` and the fee is processed.
	Earnings *string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code of the currency used for this transaction.
	CurrencyCode string `json:"currency_code,omitempty"`
}

TransactionTotals: Breakdown of the total for a transaction. These numbers can become negative when dealing with subscription updates that result in credit.

type TransactionTotalsAdjusted

type TransactionTotalsAdjusted struct {
	// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
	Subtotal string `json:"subtotal,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after tax.
	Total string `json:"total,omitempty"`
	// GrandTotal: Total due after credits but before any payments.
	GrandTotal string `json:"grand_total,omitempty"`
	// Fee: Total fee taken by Paddle for this transaction. `null` until the transaction is `completed` and the fee is processed.
	Fee *string `json:"fee,omitempty"`
	/*
	   Earnings: Total earnings for this transaction. This is the total minus the Paddle fee.
	   `null` until the transaction is `completed` and the fee is processed.
	*/
	Earnings *string `json:"earnings,omitempty"`
	// CurrencyCode: Three-letter ISO 4217 currency code of the currency used for this transaction.
	CurrencyCode string `json:"currency_code,omitempty"`
}

TransactionTotalsAdjusted: Breakdown of the payout totals for a transaction after adjustments. `null` until the transaction is `completed`.

type TransactionsCatalogItem

type TransactionsCatalogItem struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// IncludeInTotals: Whether this item should be included in totals for this transaction preview. Typically used to exclude one-time charges from calculations.
	IncludeInTotals bool `json:"include_in_totals,omitempty"`
	// Proration: How proration was calculated for this item. `null` for transaction previews.
	Proration *Proration `json:"proration,omitempty"`
	// PriceID: Paddle ID of an existing catalog price to preview charging for, prefixed with `pri_`.
	PriceID string `json:"price_id,omitempty"`
}

TransactionsCatalogItem: Add a catalog item to a transaction. In this case, the product and price that you're billing for exist in your product catalog in Paddle.

type TransactionsCheckout

type TransactionsCheckout struct {
	/*
	   URL: Checkout URL to use for the payment link for this transaction. Pass the URL for an approved domain, or omit to use your default payment URL.

	   Paddle returns a unique payment link composed of the URL passed or your default payment URL + `_?txn=` and the Paddle ID for this transaction.
	*/
	URL *string `json:"url,omitempty"`
}

TransactionsCheckout: Paddle Checkout details for this transaction. You may pass a URL when creating or updating an automatically-collected transaction, or when creating or updating a manually-collected transaction where `billing_details.enable_checkout` is `true`.

type TransactionsClient

type TransactionsClient struct {
	// contains filtered or unexported fields
}

TransactionsClient is a client for the Transactions resource.

func (*TransactionsClient) CreateTransaction

func (c *TransactionsClient) CreateTransaction(ctx context.Context, req *CreateTransactionRequest) (res *TransactionIncludes, err error)

CreateTransaction performs the POST operation on a Transactions resource.

func (*TransactionsClient) GetTransaction

func (c *TransactionsClient) GetTransaction(ctx context.Context, req *GetTransactionRequest) (res *TransactionIncludes, err error)

GetTransaction performs the GET operation on a Transactions resource.

func (*TransactionsClient) GetTransactionInvoice

func (c *TransactionsClient) GetTransactionInvoice(ctx context.Context, req *GetTransactionInvoiceRequest) (res *TransactionInvoicePDF, err error)

GetTransactionInvoice performs the GET operation on a Transactions resource.

func (*TransactionsClient) ListTransactions

func (c *TransactionsClient) ListTransactions(ctx context.Context, req *ListTransactionsRequest) (res *Collection[*TransactionIncludes], err error)

ListTransactions performs the GET operation on a Transactions resource.

func (*TransactionsClient) PreviewTransaction

func (c *TransactionsClient) PreviewTransaction(ctx context.Context, req *PreviewTransactionRequest) (res *TransactionPreview, err error)

PreviewTransaction performs the POST operation on a Transactions resource.

func (*TransactionsClient) UpdateTransaction

func (c *TransactionsClient) UpdateTransaction(ctx context.Context, req *UpdateTransactionRequest) (res *TransactionIncludes, err error)

UpdateTransaction performs the PATCH operation on a Transactions resource.

type TransactionsNonCatalogPriceAndProduct

type TransactionsNonCatalogPriceAndProduct struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// IncludeInTotals: Whether this item should be included in totals for this transaction preview. Typically used to exclude one-time charges from calculations.
	IncludeInTotals bool `json:"include_in_totals,omitempty"`
	// Proration: How proration was calculated for this item. `null` for transaction previews.
	Proration *Proration `json:"proration,omitempty"`
	// Price: Price object for a non-catalog item to preview charging for. Include a `product` object to create a non-catalog product for this non-catalog price.
	Price TransactionSubscriptionPriceCreateWithProduct `json:"price,omitempty"`
}

TransactionsNonCatalogPriceAndProduct: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

type TransactionsNonCatalogPriceForAnExistingProduct

type TransactionsNonCatalogPriceForAnExistingProduct struct {
	// Quantity: Quantity of this item on the transaction.
	Quantity int `json:"quantity,omitempty"`
	// IncludeInTotals: Whether this item should be included in totals for this transaction preview. Typically used to exclude one-time charges from calculations.
	IncludeInTotals bool `json:"include_in_totals,omitempty"`
	// Proration: How proration was calculated for this item. `null` for transaction previews.
	Proration *Proration `json:"proration,omitempty"`
	// Price: Price object for a non-catalog item to preview charging for. Include a `product_id` to relate this non-catalog price to an existing catalog price.
	Price TransactionSubscriptionPriceCreateWithProductID `json:"price,omitempty"`
}

TransactionsNonCatalogPriceForAnExistingProduct: Add a non-catalog price for an existing product in your catalog to a transaction. In this case, the product you're billing for is a catalog product, but you charge a specific price for it.

type TransactionsReports

type TransactionsReports struct {
	// Type: Type of report to create.
	Type string `json:"type,omitempty"`
	// Filters: Filter criteria for this report. If omitted, reports are filtered to include data updated in the last 30 days. This means `updated_at` is greater than or equal to (`gte`) the date 30 days ago from the time the report was generated.
	Filters []ReportsReportsReportFilters `json:"filters,omitempty"`
}

TransactionsReports: Request body when creating reports for transaction or transaction line items.

type TransactionsTaxRatesUsed

type TransactionsTaxRatesUsed struct {
	// TaxRate: Rate used to calculate tax for this transaction preview.
	TaxRate string `json:"tax_rate,omitempty"`
	// Totals: Calculated totals for the tax applied to this transaction preview.
	Totals Totals `json:"totals,omitempty"`
}

TransactionsTaxRatesUsed: List of tax rates applied to this transaction preview.

type TransactionsTransactionsCheckout

type TransactionsTransactionsCheckout struct {
	/*
	   URL: Checkout URL to use for the payment link for this transaction. Pass the URL for an approved domain, or `null` to set to your default payment URL.

	   Paddle returns a unique payment link composed of the URL passed or your default payment URL + `_?txn=` and the Paddle ID for this transaction.
	*/
	URL *string `json:"url,omitempty"`
}

TransactionsTransactionsCheckout: Paddle Checkout details for this transaction. You may pass a URL when creating or updating an automatically-collected transaction, or when creating or updating a manually-collected transaction where `billing_details.enable_checkout` is `true`.

type Type

type Type string

Type: Type of report to create..

type UnitPriceOverride

type UnitPriceOverride struct {
	// CountryCodes: Supported two-letter ISO 3166-1 alpha-2 country code.
	CountryCodes []CountryCode `json:"country_codes,omitempty"`
	// UnitPrice: Override price. This price applies to customers located in the countries for this unit price override.
	UnitPrice Money `json:"unit_price,omitempty"`
}

UnitPriceOverride: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.

type UnitTotals

type UnitTotals struct {
	// Subtotal: Unit price.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: Total discount as a result of any discounts applied.
	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after discount and tax.
	Total string `json:"total,omitempty"`
}

UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).

type UnitTotalsFormatted

type UnitTotalsFormatted struct {
	// Subtotal: Unit price.
	Subtotal string `json:"subtotal,omitempty"`
	/*
	   Discount: Total discount as a result of any discounts applied.
	   Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
	*/
	Discount string `json:"discount,omitempty"`
	// Tax: Total tax on the subtotal.
	Tax string `json:"tax,omitempty"`
	// Total: Total after discount and tax.
	Total string `json:"total,omitempty"`
}

UnitTotalsFormatted: Breakdown of the charge for one unit in the format of a given currency.

type UpdateAddressRequest

type UpdateAddressRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
	AddressID  string `in:"path=address_id" json:"-"`

	// Description: Memorable description for this address.
	Description *PatchField[*string] `json:"description,omitempty"`
	// FirstLine: First line of this address.
	FirstLine *PatchField[*string] `json:"first_line,omitempty"`
	// SecondLine: Second line of this address.
	SecondLine *PatchField[*string] `json:"second_line,omitempty"`
	// City: City of this address.
	City *PatchField[*string] `json:"city,omitempty"`
	// PostalCode: ZIP or postal code of this address. Required for some countries.
	PostalCode *PatchField[*string] `json:"postal_code,omitempty"`
	// Region: State, county, or region of this address.
	Region *PatchField[*string] `json:"region,omitempty"`
	// CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code for this address.
	CountryCode *PatchField[string] `json:"country_code,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
}

UpdateAddressRequest is given as an input to UpdateAddress.

type UpdateBusinessRequest

type UpdateBusinessRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`
	BusinessID string `in:"path=business_id" json:"-"`

	// Name: Name of this business.
	Name *PatchField[string] `json:"name,omitempty"`
	// CompanyNumber: Company number for this business.
	CompanyNumber *PatchField[*string] `json:"company_number,omitempty"`
	// TaxIdentifier: Tax or VAT Number for this business.
	TaxIdentifier *PatchField[*string] `json:"tax_identifier,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
	// Contacts: List of contacts related to this business, typically used for sending invoices.
	Contacts *PatchField[[]BusinessesContacts] `json:"contacts,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
}

UpdateBusinessRequest is given as an input to UpdateBusiness.

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	// URL path parameters.
	CustomerID string `in:"path=customer_id" json:"-"`

	// Name: Full name of this customer. Required when creating transactions where `collection_mode` is `manual` (invoices).
	Name *PatchField[*string] `json:"name,omitempty"`
	// Email: Email address for this customer.
	Email *PatchField[string] `json:"email,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
	// Locale: Valid IETF BCP 47 short form locale tag. If omitted, defaults to `en`.
	Locale *PatchField[string] `json:"locale,omitempty"`
}

UpdateCustomerRequest is given as an input to UpdateCustomer.

type UpdateDiscountRequest

type UpdateDiscountRequest struct {
	// URL path parameters.
	DiscountID string `in:"path=discount_id" json:"-"`

	// Status: Whether this entity can be used in Paddle. `expired` and `used` are set automatically by Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
	// Description: Short description for this discount for your reference. Not shown to customers.
	Description *PatchField[string] `json:"description,omitempty"`
	// EnabledForCheckout: Whether this discount can be applied by a customer at checkout.
	EnabledForCheckout *PatchField[bool] `json:"enabled_for_checkout,omitempty"`
	// Code: Unique code that customers can use to apply this discount at checkout. Use letters and numbers only, up to 16 characters. Paddle generates a random 10-character code if a code is not provided and `enabled_for_checkout` is `true`.
	Code *PatchField[*string] `json:"code,omitempty"`
	// Type: Type of discount.
	Type *PatchField[string] `json:"type,omitempty"`
	// Amount: Amount to discount by. For `percentage` discounts, must be an amount between `0.01` and `100`. For `flat` and `flat_per_seat` discounts, amount in the lowest denomination for a currency.
	Amount *PatchField[string] `json:"amount,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Required where discount type is `flat` or `flat_per_seat`.
	CurrencyCode *PatchField[*string] `json:"currency_code,omitempty"`
	// Recur: Whether this discount applies for multiple billing periods.
	Recur *PatchField[bool] `json:"recur,omitempty"`
	// MaximumRecurringIntervals: Amount of subscription billing periods that this discount recurs for. Requires `recur`. `null` if this discount recurs forever.
	MaximumRecurringIntervals *PatchField[*int] `json:"maximum_recurring_intervals,omitempty"`
	// UsageLimit: Maximum amount of times this discount can be used. This is an overall limit, rather than a per-customer limit. `null` if this discount can be used an unlimited amount of times.
	UsageLimit *PatchField[*int] `json:"usage_limit,omitempty"`
	// RestrictTo: Product or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. `null` if this discount applies to all products and prices.
	RestrictTo *PatchField[[]string] `json:"restrict_to,omitempty"`
	// ExpiresAt: RFC 3339 datetime string of when this discount expires. Discount can no longer be applied after this date has elapsed. `null` if this discount can be applied forever.
	ExpiresAt *PatchField[*string] `json:"expires_at,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
}

UpdateDiscountRequest is given as an input to UpdateDiscount.

type UpdateNotificationSettingRequest

type UpdateNotificationSettingRequest struct {
	// URL path parameters.
	NotificationSettingID string `in:"path=notification_setting_id" json:"-"`

	// Description: Short description for this notification destination. Shown in the Paddle Dashboard.
	Description *PatchField[string] `json:"description,omitempty"`
	// Destination: Webhook endpoint URL or email address.
	Destination *PatchField[string] `json:"destination,omitempty"`
	// Active: Whether Paddle should try to deliver events to this notification destination.
	Active *PatchField[bool] `json:"active,omitempty"`
	// APIVersion: API version that returned objects for events should conform to. Must be a valid version of the Paddle API. Cannot be a version older than your account default. Defaults to your account default if omitted.
	APIVersion *PatchField[int] `json:"api_version,omitempty"`
	// IncludeSensitiveFields: Whether potentially sensitive fields should be sent to this notification destination.
	IncludeSensitiveFields *PatchField[bool] `json:"include_sensitive_fields,omitempty"`
	// SubscribedEvents: Subscribed events for this notification destination. When creating or updating a notification destination, pass an array of event type names only. Paddle returns the complete event type object.
	SubscribedEvents *PatchField[[]Event] `json:"subscribed_events,omitempty"`
}

UpdateNotificationSettingRequest is given as an input to UpdateNotificationSetting.

type UpdatePriceRequest

type UpdatePriceRequest struct {
	// URL path parameters.
	PriceID string `in:"path=price_id" json:"-"`

	// Description: Internal description for this price, not shown to customers. Typically notes for your team.
	Description *PatchField[string] `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type *PatchField[string] `json:"type,omitempty"`
	// Name: Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
	Name *PatchField[*string] `json:"name,omitempty"`
	// BillingCycle: How often this price should be charged. `null` if price is non-recurring (one-time).
	BillingCycle *PatchField[*Duration] `json:"billing_cycle,omitempty"`
	// TrialPeriod: Trial period for the product related to this price. The billing cycle begins once the trial period is over. `null` for no trial period. Requires `billing_cycle`.
	TrialPeriod *PatchField[*Duration] `json:"trial_period,omitempty"`
	// TaxMode: How tax is calculated for this price.
	TaxMode *PatchField[string] `json:"tax_mode,omitempty"`
	// UnitPrice: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
	UnitPrice *PatchField[Money] `json:"unit_price,omitempty"`
	// UnitPriceOverrides: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
	UnitPriceOverrides *PatchField[[]UnitPriceOverride] `json:"unit_price_overrides,omitempty"`
	// Quantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns.
	Quantity *PatchField[PriceQuantity] `json:"quantity,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
}

UpdatePriceRequest is given as an input to UpdatePrice.

type UpdateProductRequest

type UpdateProductRequest struct {
	// URL path parameters.
	ProductID string `in:"path=product_id" json:"-"`

	// Name: Name of this product.
	Name *PatchField[string] `json:"name,omitempty"`
	// Description: Short description for this product.
	Description *PatchField[*string] `json:"description,omitempty"`
	// Type: Type of item. Standard items are considered part of your catalog and are shown on the Paddle web app.
	Type *PatchField[string] `json:"type,omitempty"`
	// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
	TaxCategory *PatchField[string] `json:"tax_category,omitempty"`
	// ImageURL: Image for this product. Included in the checkout and on some customer documents.
	ImageURL *PatchField[*string] `json:"image_url,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
	// Status: Whether this entity can be used in Paddle.
	Status *PatchField[string] `json:"status,omitempty"`
}

UpdateProductRequest is given as an input to UpdateProduct.

type UpdateSubscriptionRequest

type UpdateSubscriptionRequest struct {
	// URL path parameters.
	SubscriptionID string `in:"path=subscription_id" json:"-"`

	// CustomerID: Paddle ID of the customer that this subscription is for, prefixed with `ctm_`. Include to change the customer for a subscription.
	CustomerID *PatchField[string] `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this subscription is for, prefixed with `add_`. Include to change the address for a subscription.
	AddressID *PatchField[string] `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this subscription is for, prefixed with `biz_`. Include to change the business for a subscription.
	BusinessID *PatchField[*string] `json:"business_id,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Include to change the currency that a subscription bills in. When changing `collection_mode` to `manual`, you may need to change currency code to `USD`, `EUR`, or `GBP`.
	CurrencyCode *PatchField[string] `json:"currency_code,omitempty"`
	// NextBilledAt: RFC 3339 datetime string of when this subscription is next scheduled to be billed. Include to change the next billing date.
	NextBilledAt *PatchField[string] `json:"next_billed_at,omitempty"`
	// Discount: Details of the discount applied to this subscription. Include to add a discount to a subscription. `null` to remove a discount.
	Discount *PatchField[*SubscriptionsDiscount] `json:"discount,omitempty"`
	// CollectionMode: How payment is collected for transactions created for this subscription. `automatic` for checkout, `manual` for invoices.
	CollectionMode *PatchField[string] `json:"collection_mode,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`. `null` if changing `collection_mode` to `automatic`.
	BillingDetails *PatchField[*BillingDetailsUpdate] `json:"billing_details,omitempty"`
	// ScheduledChange: Change that's scheduled to be applied to a subscription. When updating, you may only set to `null` to remove a scheduled change. Use the pause subscription, cancel subscription, and resume subscription operations to create scheduled changes.
	ScheduledChange *PatchField[*SubscriptionScheduledChange] `json:"scheduled_change,omitempty"`
	// Items: Add or update a catalog item to a subscription. In this case, the product and price that you're billing for exist in your product catalog in Paddle.
	Items *PatchField[[]SubscriptionsCatalogItem] `json:"items,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
	/*
	   ProrationBillingMode: How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
	   changes that impact billing.

	   For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
	   collects for payment immediately is used.
	*/
	ProrationBillingMode *PatchField[string] `json:"proration_billing_mode,omitempty"`
	// OnPaymentFailure: How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
	OnPaymentFailure *PatchField[string] `json:"on_payment_failure,omitempty"`
}

UpdateSubscriptionRequest is given as an input to UpdateSubscription.

type UpdateTransactionItems

UpdateTransactionItems represents a union request type of the following types:

  • `CatalogItem`
  • `NonCatalogPriceForAnExistingProduct`
  • `NonCatalogPriceAndProduct`

The following constructor functions can be used to create a new instance of this type.

  • `NewUpdateTransactionItemsCatalogItem()`
  • `NewUpdateTransactionItemsNonCatalogPriceForAnExistingProduct()`
  • `NewUpdateTransactionItemsNonCatalogPriceAndProduct()`

Only one of the values can be set at a time, the first non-nil value will be used in the request. Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.

func NewUpdateTransactionItemsCatalogItem

func NewUpdateTransactionItemsCatalogItem(r *CatalogItem) *UpdateTransactionItems

NewUpdateTransactionItemsCatalogItem takes a CatalogItem type and creates a UpdateTransactionItems for use in a request.

func NewUpdateTransactionItemsNonCatalogPriceAndProduct

func NewUpdateTransactionItemsNonCatalogPriceAndProduct(r *NonCatalogPriceAndProduct) *UpdateTransactionItems

NewUpdateTransactionItemsNonCatalogPriceAndProduct takes a NonCatalogPriceAndProduct type and creates a UpdateTransactionItems for use in a request.

func NewUpdateTransactionItemsNonCatalogPriceForAnExistingProduct

func NewUpdateTransactionItemsNonCatalogPriceForAnExistingProduct(r *NonCatalogPriceForAnExistingProduct) *UpdateTransactionItems

NewUpdateTransactionItemsNonCatalogPriceForAnExistingProduct takes a NonCatalogPriceForAnExistingProduct type and creates a UpdateTransactionItems for use in a request.

func (UpdateTransactionItems) MarshalJSON

func (u UpdateTransactionItems) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type UpdateTransactionRequest

type UpdateTransactionRequest struct {
	// URL path parameters.
	TransactionID string `in:"path=transaction_id" json:"-"`

	/*
	   Status: Status of this transaction. You may set a transaction to `billed` or `canceled`. Billed transactions cannot be changed.

	   For manually-collected transactions, marking as `billed` is essentially issuing an invoice.
	*/
	Status *PatchField[string] `json:"status,omitempty"`
	// CustomerID: Paddle ID of the customer that this transaction is for, prefixed with `ctm_`.
	CustomerID *PatchField[*string] `json:"customer_id,omitempty"`
	// AddressID: Paddle ID of the address that this transaction is for, prefixed with `add_`.
	AddressID *PatchField[*string] `json:"address_id,omitempty"`
	// BusinessID: Paddle ID of the business that this transaction is for, prefixed with `biz_`.
	BusinessID *PatchField[*string] `json:"business_id,omitempty"`
	// CustomData: Your own structured key-value data.
	CustomData *PatchField[CustomData] `json:"custom_data,omitempty"`
	// CurrencyCode: Supported three-letter ISO 4217 currency code. Must be `USD`, `EUR`, or `GBP` if `collection_mode` is `manual`.
	CurrencyCode *PatchField[string] `json:"currency_code,omitempty"`
	// CollectionMode: How payment is collected for this transaction. `automatic` for checkout, `manual` for invoices.
	CollectionMode *PatchField[string] `json:"collection_mode,omitempty"`
	// DiscountID: Paddle ID of the discount applied to this transaction, prefixed with `dsc_`.
	DiscountID *PatchField[*string] `json:"discount_id,omitempty"`
	// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
	BillingDetails *PatchField[*BillingDetailsUpdate] `json:"billing_details,omitempty"`
	// BillingPeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.
	BillingPeriod *PatchField[*TimePeriod] `json:"billing_period,omitempty"`
	// Items: Add a non-catalog price for a non-catalog product in your catalog to a transaction. In this case, the product and price that you're billing for are specific to this transaction.
	Items *PatchField[[]UpdateTransactionItems] `json:"items,omitempty"`
	// Checkout: Paddle Checkout details for this transaction. You may pass a URL when creating or updating an automatically-collected transaction, or when creating or updating a manually-collected transaction where `billing_details.enable_checkout` is `true`.
	Checkout *PatchField[*TransactionsTransactionsCheckout] `json:"checkout,omitempty"`

	// IncludeAddress allows requesting the address sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAddress bool `in:"paddle_include=address" json:"-"`

	// IncludeAdjustments allows requesting the adjustment sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustments bool `in:"paddle_include=adjustment" json:"-"`

	// IncludeAdjustmentsTotals allows requesting the adjustments_totals sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAdjustmentsTotals bool `in:"paddle_include=adjustments_totals" json:"-"`

	// IncludeBusiness allows requesting the business sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeBusiness bool `in:"paddle_include=business" json:"-"`

	// IncludeCustomer allows requesting the customer sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeCustomer bool `in:"paddle_include=customer" json:"-"`

	// IncludeDiscount allows requesting the discount sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeDiscount bool `in:"paddle_include=discount" json:"-"`

	// IncludeAvailablePaymentMethods allows requesting the available_payment_methods sub-resource as part of this request.
	// If set to true, will be included on the response.
	IncludeAvailablePaymentMethods bool `in:"paddle_include=available_payment_methods" json:"-"`
}

UpdateTransactionRequest is given as an input to UpdateTransaction.

type WebhookVerifier

type WebhookVerifier struct {
	// contains filtered or unexported fields
}

WebhookVerifier is used to verify webhook requests from Paddle.

func NewWebhookVerifier

func NewWebhookVerifier(secretKey string) *WebhookVerifier

NewWebhookVerifier creates a new WebhookVerifier with the given secret key.

func (*WebhookVerifier) Middleware

func (wv *WebhookVerifier) Middleware(next http.Handler) http.Handler

Middleware returns a middleware that verifies the signature of a webhook request.

Example

Demonstrates how to use the WebhookVerifier as a middleware.

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"strings"

	paddle "github.com/PaddleHQ/paddle-go-sdk"
)

const (
	exampleSignature = `ts=1710929255;h1=6c05ef8fa83c44d751be6d259ec955ce5638e2c54095bf128e408e2fce1589c8`
	examplePayload   = `{"data":{"id":"pri_01hsdn96k2hxjzsq5yerecdj9j","name":null,"status":"active","quantity":{"maximum":999999,"minimum":1},"tax_mode":"account_setting","product_id":"pro_01hsdn8qp7yydry3x1yeg6a9rv","unit_price":{"amount":"1000","currency_code":"USD"},"custom_data":null,"description":"testing","import_meta":null,"trial_period":null,"billing_cycle":{"interval":"month","frequency":1},"unit_price_overrides":[]},"event_id":"evt_01hsdn97563968dy0szkmgjwh3","event_type":"price.created","occurred_at":"2024-03-20T10:07:35.590857Z","notification_id":"ntf_01hsdn977e920kbgzt6r6c9rqc"}`
	exampleSecretKey = `pdl_ntfset_01hsdn8d43dt7mezr1ef2jtbaw_hKkRiCGyyRhbFwIUuqiTBgI7gnWoV0Gr`
)

func main() {
	// Create a WebhookVerifier with your secret key
	// You should keep your secret outside the src, e.g. as an env variable
	verifier := paddle.NewWebhookVerifier(exampleSecretKey)

	// Wrap your handler with the verifier.Middleware method
	handler := verifier.Middleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// The request making it this far means the webhook was verified
		// Best practice here is to check if you have processed this webhook already using the event id
		// At this point you should store for async processing
		// For example a local queue or db entry

		// Respond as soon as possible with a 200 OK
		w.Header().Set("Content-Type", "application/json")
		w.WriteHeader(http.StatusOK)
		w.Write([]byte(`{"success": true}`))
	}))

	// We're simulating a call to the server, everything below can be skipped in your implementation

	req, err := http.NewRequest(http.MethodPost, "localhost:8081", strings.NewReader(examplePayload))
	if err != nil {
		fmt.Println(err)
		return
	}
	req.Header.Set("Paddle-Signature", exampleSignature)

	rr := httptest.NewRecorder()
	handler.ServeHTTP(rr, req)

	body, err := io.ReadAll(rr.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body), err)
}
Output:

{"success": true} <nil>

func (*WebhookVerifier) Verify

func (wv *WebhookVerifier) Verify(req *http.Request) (bool, error)

Verify verifies the signature of a webhook request.

Example

Demonstrates how to verify a webhook.

package main

import (
	"errors"
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"strings"

	paddle "github.com/PaddleHQ/paddle-go-sdk"
)

const (
	exampleSignature = `ts=1710929255;h1=6c05ef8fa83c44d751be6d259ec955ce5638e2c54095bf128e408e2fce1589c8`
	examplePayload   = `{"data":{"id":"pri_01hsdn96k2hxjzsq5yerecdj9j","name":null,"status":"active","quantity":{"maximum":999999,"minimum":1},"tax_mode":"account_setting","product_id":"pro_01hsdn8qp7yydry3x1yeg6a9rv","unit_price":{"amount":"1000","currency_code":"USD"},"custom_data":null,"description":"testing","import_meta":null,"trial_period":null,"billing_cycle":{"interval":"month","frequency":1},"unit_price_overrides":[]},"event_id":"evt_01hsdn97563968dy0szkmgjwh3","event_type":"price.created","occurred_at":"2024-03-20T10:07:35.590857Z","notification_id":"ntf_01hsdn977e920kbgzt6r6c9rqc"}`
	exampleSecretKey = `pdl_ntfset_01hsdn8d43dt7mezr1ef2jtbaw_hKkRiCGyyRhbFwIUuqiTBgI7gnWoV0Gr`
)

func main() {
	// Create a WebhookVerifier with your secret key
	// You should keep your secret outside the src, e.g. as an env variable
	verifier := paddle.NewWebhookVerifier(exampleSecretKey)

	// Create a server to receive the webhook
	// Note: you may have this in place already
	s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// Verify the request with the verifier
		ok, err := verifier.Verify(r)

		// Check no error occurred during verification and return an appropriate response
		if err != nil && (errors.Is(err, paddle.ErrMissingSignature) || errors.Is(err, paddle.ErrInvalidSignatureFormat)) {
			http.Error(w, err.Error(), http.StatusBadRequest)
			return
		} else if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		// Check if verification was successful
		if !ok {
			// Return an appropriate response to let Paddle know
			http.Error(w, "signature mismatch", http.StatusForbidden)
			return
		}

		// Best practice here is to check if you have processed this webhook already using the event id
		// At this point you should store for async processing
		// For example a local queue or db entry

		// Respond as soon as possible with a 200 OK
		w.Header().Set("Content-Type", "application/json")
		w.WriteHeader(http.StatusOK)
		w.Write([]byte(`{"success": true}`))
	}))

	// We're simulating a call to the server, everything below can be skipped in your implementation

	req, err := http.NewRequest(http.MethodPost, s.URL, strings.NewReader(examplePayload))
	if err != nil {
		fmt.Println(err)
		return
	}
	req.Header.Set("Paddle-Signature", exampleSignature)

	client := http.Client{}
	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}

	body, err := io.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	defer res.Body.Close()

	fmt.Println(string(body), err)
}
Output:

{"success": true} <nil>

Directories

Path Synopsis
internal
client
Package client provides the base for all requests and responses to the Paddle API.
Package client provides the base for all requests and responses to the Paddle API.
response
Package response provides the response handling logic for responses and any errors returned by the Paddle API.
Package response provides the response handling logic for responses and any errors returned by the Paddle API.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL