straddle

package module
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Straddle Go API Library

Go Reference

The Straddle Go library provides convenient access to the Straddle REST API from applications written in Go.

It is generated with Stainless.

MCP Server

Use the Straddle MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/straddleio/straddle-go" // imported as straddle
)

Or to pin the version:

go get -u 'github.com/straddleio/straddle-go@v0.1.0-alpha.1'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/straddleio/straddle-go"
	"github.com/straddleio/straddle-go/option"
	"github.com/straddleio/straddle-go/shared"
)

func main() {
	client := straddle.NewClient(
		option.WithAPIKey("My API Key"),    // defaults to os.LookupEnv("STRADDLE_API_KEY")
		option.WithEnvironmentProduction(), // defaults to option.WithEnvironmentSandbox()
	)
	chargeV1, err := client.Charges.New(context.TODO(), straddle.ChargeNewParams{
		Amount: 10000,
		Config: straddle.ChargeNewParamsConfig{
			BalanceCheck: "required",
		},
		ConsentType: straddle.ChargeNewParamsConsentTypeInternet,
		Currency:    "currency",
		Description: straddle.String("Monthly subscription fee"),
		Device: shared.DeviceInfoV1Param{
			IPAddress: "192.168.1.1",
		},
		ExternalID:  "external_id",
		Paykey:      "paykey",
		PaymentDate: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", chargeV1.Data)
}

Request fields

The straddle library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, straddle.String(string), straddle.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := straddle.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: straddle.String("..."), // optional property

	Point: straddle.Point{
		X: 0,               // required field will serialize as 0
		Y: straddle.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: straddle.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[straddle.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := straddle.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Charges.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Payments.ListAutoPaging(context.TODO(), straddle.PaymentListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	payment := iter.Current()
	fmt.Printf("%+v\n", payment)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.Payments.List(context.TODO(), straddle.PaymentListParams{})
for page != nil {
	for _, payment := range page.Data {
		fmt.Printf("%+v\n", payment)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *straddle.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Charges.New(context.TODO(), straddle.ChargeNewParams{
	Amount: 10000,
	Config: straddle.ChargeNewParamsConfig{
		BalanceCheck: "required",
	},
	ConsentType: straddle.ChargeNewParamsConsentTypeInternet,
	Currency:    "currency",
	Description: straddle.String("Monthly subscription fee"),
	Device: shared.DeviceInfoV1Param{
		IPAddress: "192.168.1.1",
	},
	ExternalID:  "external_id",
	Paykey:      "paykey",
	PaymentDate: time.Now(),
})
if err != nil {
	var apierr *straddle.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v1/charges": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Charges.New(
	ctx,
	straddle.ChargeNewParams{
		Amount: 10000,
		Config: straddle.ChargeNewParamsConfig{
			BalanceCheck: "required",
		},
		ConsentType: straddle.ChargeNewParamsConsentTypeInternet,
		Currency:    "currency",
		Description: straddle.String("Monthly subscription fee"),
		Device: shared.DeviceInfoV1Param{
			IPAddress: "192.168.1.1",
		},
		ExternalID:  "external_id",
		Paykey:      "paykey",
		PaymentDate: time.Now(),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper straddle.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := straddle.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Charges.New(
	context.TODO(),
	straddle.ChargeNewParams{
		Amount: 10000,
		Config: straddle.ChargeNewParamsConfig{
			BalanceCheck: "required",
		},
		ConsentType: straddle.ChargeNewParamsConsentTypeInternet,
		Currency:    "currency",
		Description: straddle.String("Monthly subscription fee"),
		Device: shared.DeviceInfoV1Param{
			IPAddress: "192.168.1.1",
		},
		ExternalID:  "external_id",
		Paykey:      "paykey",
		PaymentDate: time.Now(),
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
chargeV1, err := client.Charges.New(
	context.TODO(),
	straddle.ChargeNewParams{
		Amount: 10000,
		Config: straddle.ChargeNewParamsConfig{
			BalanceCheck: "required",
		},
		ConsentType: straddle.ChargeNewParamsConsentTypeInternet,
		Currency:    "currency",
		Description: straddle.String("Monthly subscription fee"),
		Device: shared.DeviceInfoV1Param{
			IPAddress: "192.168.1.1",
		},
		ExternalID:  "external_id",
		Paykey:      "paykey",
		PaymentDate: time.Now(),
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", chargeV1)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: straddle.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := straddle.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

View Source
const CustomerDetailsV1CustomerTypeBusiness = shared.CustomerDetailsV1CustomerTypeBusiness

Equals "business"

View Source
const CustomerDetailsV1CustomerTypeIndividual = shared.CustomerDetailsV1CustomerTypeIndividual

Equals "individual"

View Source
const PagedResponseMetadataSortOrderAsc = shared.PagedResponseMetadataSortOrderAsc

Equals "asc"

View Source
const PagedResponseMetadataSortOrderDesc = shared.PagedResponseMetadataSortOrderDesc

Equals "desc"

View Source
const StatusDetailsV1ReasonAmountTooLarge = shared.StatusDetailsV1ReasonAmountTooLarge

Equals "amount_too_large"

View Source
const StatusDetailsV1ReasonAutoHold = shared.StatusDetailsV1ReasonAutoHold

Equals "auto_hold"

View Source
const StatusDetailsV1ReasonBlockedBySystem = shared.StatusDetailsV1ReasonBlockedBySystem

Equals "blocked_by_system"

View Source
const StatusDetailsV1ReasonCancelRequest = shared.StatusDetailsV1ReasonCancelRequest

Equals "cancel_request"

View Source
const StatusDetailsV1ReasonClosedBankAccount = shared.StatusDetailsV1ReasonClosedBankAccount

Equals "closed_bank_account"

View Source
const StatusDetailsV1ReasonDisputed = shared.StatusDetailsV1ReasonDisputed

Equals "disputed"

View Source
const StatusDetailsV1ReasonDuplicateEntry = shared.StatusDetailsV1ReasonDuplicateEntry

Equals "duplicate_entry"

View Source
const StatusDetailsV1ReasonFailedVerification = shared.StatusDetailsV1ReasonFailedVerification

Equals "failed_verification"

View Source
const StatusDetailsV1ReasonFraudulent = shared.StatusDetailsV1ReasonFraudulent

Equals "fraudulent"

View Source
const StatusDetailsV1ReasonFrozenBankAccount = shared.StatusDetailsV1ReasonFrozenBankAccount

Equals "frozen_bank_account"

View Source
const StatusDetailsV1ReasonInsufficientFunds = shared.StatusDetailsV1ReasonInsufficientFunds

Equals "insufficient_funds"

View Source
const StatusDetailsV1ReasonInternalSystemError = shared.StatusDetailsV1ReasonInternalSystemError

Equals "internal_system_error"

View Source
const StatusDetailsV1ReasonInvalidBankAccount = shared.StatusDetailsV1ReasonInvalidBankAccount

Equals "invalid_bank_account"

View Source
const StatusDetailsV1ReasonInvalidPaykey = shared.StatusDetailsV1ReasonInvalidPaykey

Equals "invalid_paykey"

View Source
const StatusDetailsV1ReasonInvalidRouting = shared.StatusDetailsV1ReasonInvalidRouting

Equals "invalid_routing"

View Source
const StatusDetailsV1ReasonOk = shared.StatusDetailsV1ReasonOk

Equals "ok"

View Source
const StatusDetailsV1ReasonOtherNetworkReturn = shared.StatusDetailsV1ReasonOtherNetworkReturn

Equals "other_network_return"

View Source
const StatusDetailsV1ReasonOwnerDeceased = shared.StatusDetailsV1ReasonOwnerDeceased

Equals "owner_deceased"

View Source
const StatusDetailsV1ReasonPaymentBlocked = shared.StatusDetailsV1ReasonPaymentBlocked

Equals "payment_blocked"

View Source
const StatusDetailsV1ReasonPaymentStopped = shared.StatusDetailsV1ReasonPaymentStopped

Equals "payment_stopped"

View Source
const StatusDetailsV1ReasonPayoutRefused = shared.StatusDetailsV1ReasonPayoutRefused

Equals "payout_refused"

View Source
const StatusDetailsV1ReasonRequireReview = shared.StatusDetailsV1ReasonRequireReview

Equals "require_review"

View Source
const StatusDetailsV1ReasonRiskReview = shared.StatusDetailsV1ReasonRiskReview

Equals "risk_review"

View Source
const StatusDetailsV1ReasonTooManyAttempts = shared.StatusDetailsV1ReasonTooManyAttempts

Equals "too_many_attempts"

View Source
const StatusDetailsV1ReasonUserRequest = shared.StatusDetailsV1ReasonUserRequest

Equals "user_request"

View Source
const StatusDetailsV1ReasonValidating = shared.StatusDetailsV1ReasonValidating

Equals "validating"

View Source
const StatusDetailsV1ReasonWatchtowerReview = shared.StatusDetailsV1ReasonWatchtowerReview

Equals "watchtower_review"

View Source
const StatusDetailsV1SourceBankDecline = shared.StatusDetailsV1SourceBankDecline

Equals "bank_decline"

View Source
const StatusDetailsV1SourceCustomerDispute = shared.StatusDetailsV1SourceCustomerDispute

Equals "customer_dispute"

View Source
const StatusDetailsV1SourceSystem = shared.StatusDetailsV1SourceSystem

Equals "system"

View Source
const StatusDetailsV1SourceUserAction = shared.StatusDetailsV1SourceUserAction

Equals "user_action"

View Source
const StatusDetailsV1SourceWatchtower = shared.StatusDetailsV1SourceWatchtower

Equals "watchtower"

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (STRADDLE_API_KEY, STRADDLE_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

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

Types

type AccountPagedV1

type AccountPagedV1 struct {
	Data []AccountPagedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier, timestamp, and
	// pagination details.
	Meta shared.PagedResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType AccountPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1) RawJSON

func (r AccountPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountPagedV1) UnmarshalJSON

func (r *AccountPagedV1) UnmarshalJSON(data []byte) error

type AccountPagedV1Data

type AccountPagedV1Data struct {
	// Unique identifier for the account.
	ID string `json:"id" api:"required" format:"uuid"`
	// The access level granted to the account. This is determined by your platform
	// configuration. Use `standard` unless instructed otherwise by Straddle.
	//
	// Any of "standard", "managed".
	AccessLevel string `json:"access_level" api:"required"`
	// The unique identifier of the organization this account belongs to.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// The current status of the account (e.g., 'active', 'inactive', 'pending').
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive".
	Status       string                         `json:"status" api:"required"`
	StatusDetail AccountPagedV1DataStatusDetail `json:"status_detail" api:"required"`
	// The type of account (e.g., 'individual', 'business').
	//
	// Any of "business".
	Type            string                         `json:"type" api:"required"`
	BusinessProfile BusinessProfileV1              `json:"business_profile"`
	Capabilities    AccountPagedV1DataCapabilities `json:"capabilities"`
	// Timestamp of when the account was created.
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Unique identifier for the account in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the account in a structured format.
	Metadata       map[string]string          `json:"metadata" api:"nullable"`
	Settings       AccountPagedV1DataSettings `json:"settings"`
	TermsOfService TermsOfServiceV1           `json:"terms_of_service"`
	// Timestamp of the most recent update to the account.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AccessLevel     respjson.Field
		OrganizationID  respjson.Field
		Status          respjson.Field
		StatusDetail    respjson.Field
		Type            respjson.Field
		BusinessProfile respjson.Field
		Capabilities    respjson.Field
		CreatedAt       respjson.Field
		ExternalID      respjson.Field
		Metadata        respjson.Field
		Settings        respjson.Field
		TermsOfService  respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1Data) RawJSON

func (r AccountPagedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountPagedV1Data) UnmarshalJSON

func (r *AccountPagedV1Data) UnmarshalJSON(data []byte) error

type AccountPagedV1DataCapabilities

type AccountPagedV1DataCapabilities struct {
	ConsentTypes  AccountPagedV1DataCapabilitiesConsentTypes  `json:"consent_types" api:"required"`
	CustomerTypes AccountPagedV1DataCapabilitiesCustomerTypes `json:"customer_types" api:"required"`
	PaymentTypes  AccountPagedV1DataCapabilitiesPaymentTypes  `json:"payment_types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsentTypes  respjson.Field
		CustomerTypes respjson.Field
		PaymentTypes  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataCapabilities) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataCapabilities) UnmarshalJSON

func (r *AccountPagedV1DataCapabilities) UnmarshalJSON(data []byte) error

type AccountPagedV1DataCapabilitiesConsentTypes

type AccountPagedV1DataCapabilitiesConsentTypes struct {
	// Whether the internet payment authorization capability is enabled for the
	// account.
	Internet CapabilityV1 `json:"internet" api:"required"`
	// Whether the signed agreement payment authorization capability is enabled for the
	// account.
	SignedAgreement CapabilityV1 `json:"signed_agreement" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Internet        respjson.Field
		SignedAgreement respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataCapabilitiesConsentTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataCapabilitiesConsentTypes) UnmarshalJSON

func (r *AccountPagedV1DataCapabilitiesConsentTypes) UnmarshalJSON(data []byte) error

type AccountPagedV1DataCapabilitiesCustomerTypes

type AccountPagedV1DataCapabilitiesCustomerTypes struct {
	Businesses  CapabilityV1 `json:"businesses" api:"required"`
	Individuals CapabilityV1 `json:"individuals" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Businesses  respjson.Field
		Individuals respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataCapabilitiesCustomerTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataCapabilitiesCustomerTypes) UnmarshalJSON

func (r *AccountPagedV1DataCapabilitiesCustomerTypes) UnmarshalJSON(data []byte) error

type AccountPagedV1DataCapabilitiesPaymentTypes

type AccountPagedV1DataCapabilitiesPaymentTypes struct {
	Charges CapabilityV1 `json:"charges" api:"required"`
	Payouts CapabilityV1 `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charges     respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataCapabilitiesPaymentTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataCapabilitiesPaymentTypes) UnmarshalJSON

func (r *AccountPagedV1DataCapabilitiesPaymentTypes) UnmarshalJSON(data []byte) error

type AccountPagedV1DataSettings

type AccountPagedV1DataSettings struct {
	Charges AccountPagedV1DataSettingsCharges `json:"charges" api:"required"`
	Payouts AccountPagedV1DataSettingsPayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charges     respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataSettings) RawJSON

func (r AccountPagedV1DataSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataSettings) UnmarshalJSON

func (r *AccountPagedV1DataSettings) UnmarshalJSON(data []byte) error

type AccountPagedV1DataSettingsCharges

type AccountPagedV1DataSettingsCharges struct {
	// The maximum dollar amount of charges in a calendar day.
	DailyAmount int64 `json:"daily_amount" api:"required"`
	// The amount of time it takes for a charge to be funded. This value is defined by
	// Straddle.
	//
	// Any of "immediate", "next_day", "one_day", "two_day", "three_day", "four_day",
	// "five_day".
	FundingTime string `json:"funding_time" api:"required"`
	// The unique identifier of the linked bank account associated with charges. This
	// value is defined by Straddle.
	LinkedBankAccountID string `json:"linked_bank_account_id" api:"required" format:"uuid"`
	// The maximum amount of a single charge.
	MaxAmount int64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of charges in a calendar month.
	MonthlyAmount int64 `json:"monthly_amount" api:"required"`
	// The maximum number of charges in a calendar month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DailyAmount         respjson.Field
		FundingTime         respjson.Field
		LinkedBankAccountID respjson.Field
		MaxAmount           respjson.Field
		MonthlyAmount       respjson.Field
		MonthlyCount        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataSettingsCharges) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataSettingsCharges) UnmarshalJSON

func (r *AccountPagedV1DataSettingsCharges) UnmarshalJSON(data []byte) error

type AccountPagedV1DataSettingsPayouts

type AccountPagedV1DataSettingsPayouts struct {
	// The maximum dollar amount of payouts in a day.
	DailyAmount int64 `json:"daily_amount" api:"required"`
	// The amount of time it takes for a payout to be funded. This value is defined by
	// Straddle.
	//
	// Any of "immediate", "next_day", "one_day", "two_day", "three_day", "four_day",
	// "five_day".
	FundingTime string `json:"funding_time" api:"required"`
	// The unique identifier of the linked bank account to use for payouts.
	LinkedBankAccountID string `json:"linked_bank_account_id" api:"required" format:"uuid"`
	// The maximum amount of a single payout.
	MaxAmount int64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of payouts in a month.
	MonthlyAmount int64 `json:"monthly_amount" api:"required"`
	// The maximum number of payouts in a month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DailyAmount         respjson.Field
		FundingTime         respjson.Field
		LinkedBankAccountID respjson.Field
		MaxAmount           respjson.Field
		MonthlyAmount       respjson.Field
		MonthlyCount        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataSettingsPayouts) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataSettingsPayouts) UnmarshalJSON

func (r *AccountPagedV1DataSettingsPayouts) UnmarshalJSON(data []byte) error

type AccountPagedV1DataStatusDetail

type AccountPagedV1DataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "terminated", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountPagedV1DataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*AccountPagedV1DataStatusDetail) UnmarshalJSON

func (r *AccountPagedV1DataStatusDetail) UnmarshalJSON(data []byte) error

type AccountPagedV1ResponseType

type AccountPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	AccountPagedV1ResponseTypeObject AccountPagedV1ResponseType = "object"
	AccountPagedV1ResponseTypeArray  AccountPagedV1ResponseType = "array"
	AccountPagedV1ResponseTypeError  AccountPagedV1ResponseType = "error"
	AccountPagedV1ResponseTypeNone   AccountPagedV1ResponseType = "none"
)

type AccountV1

type AccountV1 struct {
	Data AccountV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType AccountV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1) RawJSON

func (r AccountV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountV1) UnmarshalJSON

func (r *AccountV1) UnmarshalJSON(data []byte) error

type AccountV1Data

type AccountV1Data struct {
	// Unique identifier for the account.
	ID string `json:"id" api:"required" format:"uuid"`
	// The access level granted to the account. This is determined by your platform
	// configuration. Use `standard` unless instructed otherwise by Straddle.
	//
	// Any of "standard", "managed".
	AccessLevel string `json:"access_level" api:"required"`
	// The unique identifier of the organization this account belongs to.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// The current status of the account (e.g., 'active', 'inactive', 'pending').
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive".
	Status       string                    `json:"status" api:"required"`
	StatusDetail AccountV1DataStatusDetail `json:"status_detail" api:"required"`
	// The type of account (e.g., 'individual', 'business').
	//
	// Any of "business".
	Type            string                    `json:"type" api:"required"`
	BusinessProfile BusinessProfileV1         `json:"business_profile"`
	Capabilities    AccountV1DataCapabilities `json:"capabilities"`
	// Timestamp of when the account was created.
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Unique identifier for the account in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the account in a structured format.
	Metadata       map[string]string     `json:"metadata" api:"nullable"`
	Settings       AccountV1DataSettings `json:"settings"`
	TermsOfService TermsOfServiceV1      `json:"terms_of_service"`
	// Timestamp of the most recent update to the account.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AccessLevel     respjson.Field
		OrganizationID  respjson.Field
		Status          respjson.Field
		StatusDetail    respjson.Field
		Type            respjson.Field
		BusinessProfile respjson.Field
		Capabilities    respjson.Field
		CreatedAt       respjson.Field
		ExternalID      respjson.Field
		Metadata        respjson.Field
		Settings        respjson.Field
		TermsOfService  respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1Data) RawJSON

func (r AccountV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountV1Data) UnmarshalJSON

func (r *AccountV1Data) UnmarshalJSON(data []byte) error

type AccountV1DataCapabilities

type AccountV1DataCapabilities struct {
	ConsentTypes  AccountV1DataCapabilitiesConsentTypes  `json:"consent_types" api:"required"`
	CustomerTypes AccountV1DataCapabilitiesCustomerTypes `json:"customer_types" api:"required"`
	PaymentTypes  AccountV1DataCapabilitiesPaymentTypes  `json:"payment_types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsentTypes  respjson.Field
		CustomerTypes respjson.Field
		PaymentTypes  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataCapabilities) RawJSON

func (r AccountV1DataCapabilities) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountV1DataCapabilities) UnmarshalJSON

func (r *AccountV1DataCapabilities) UnmarshalJSON(data []byte) error

type AccountV1DataCapabilitiesConsentTypes

type AccountV1DataCapabilitiesConsentTypes struct {
	// Whether the internet payment authorization capability is enabled for the
	// account.
	Internet CapabilityV1 `json:"internet" api:"required"`
	// Whether the signed agreement payment authorization capability is enabled for the
	// account.
	SignedAgreement CapabilityV1 `json:"signed_agreement" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Internet        respjson.Field
		SignedAgreement respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataCapabilitiesConsentTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountV1DataCapabilitiesConsentTypes) UnmarshalJSON

func (r *AccountV1DataCapabilitiesConsentTypes) UnmarshalJSON(data []byte) error

type AccountV1DataCapabilitiesCustomerTypes

type AccountV1DataCapabilitiesCustomerTypes struct {
	Businesses  CapabilityV1 `json:"businesses" api:"required"`
	Individuals CapabilityV1 `json:"individuals" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Businesses  respjson.Field
		Individuals respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataCapabilitiesCustomerTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountV1DataCapabilitiesCustomerTypes) UnmarshalJSON

func (r *AccountV1DataCapabilitiesCustomerTypes) UnmarshalJSON(data []byte) error

type AccountV1DataCapabilitiesPaymentTypes

type AccountV1DataCapabilitiesPaymentTypes struct {
	Charges CapabilityV1 `json:"charges" api:"required"`
	Payouts CapabilityV1 `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charges     respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataCapabilitiesPaymentTypes) RawJSON

Returns the unmodified JSON received from the API

func (*AccountV1DataCapabilitiesPaymentTypes) UnmarshalJSON

func (r *AccountV1DataCapabilitiesPaymentTypes) UnmarshalJSON(data []byte) error

type AccountV1DataSettings

type AccountV1DataSettings struct {
	Charges AccountV1DataSettingsCharges `json:"charges" api:"required"`
	Payouts AccountV1DataSettingsPayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charges     respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataSettings) RawJSON

func (r AccountV1DataSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountV1DataSettings) UnmarshalJSON

func (r *AccountV1DataSettings) UnmarshalJSON(data []byte) error

type AccountV1DataSettingsCharges

type AccountV1DataSettingsCharges struct {
	// The maximum dollar amount of charges in a calendar day.
	DailyAmount int64 `json:"daily_amount" api:"required"`
	// The amount of time it takes for a charge to be funded. This value is defined by
	// Straddle.
	//
	// Any of "immediate", "next_day", "one_day", "two_day", "three_day", "four_day",
	// "five_day".
	FundingTime string `json:"funding_time" api:"required"`
	// The unique identifier of the linked bank account associated with charges. This
	// value is defined by Straddle.
	LinkedBankAccountID string `json:"linked_bank_account_id" api:"required" format:"uuid"`
	// The maximum amount of a single charge.
	MaxAmount int64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of charges in a calendar month.
	MonthlyAmount int64 `json:"monthly_amount" api:"required"`
	// The maximum number of charges in a calendar month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DailyAmount         respjson.Field
		FundingTime         respjson.Field
		LinkedBankAccountID respjson.Field
		MaxAmount           respjson.Field
		MonthlyAmount       respjson.Field
		MonthlyCount        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataSettingsCharges) RawJSON

Returns the unmodified JSON received from the API

func (*AccountV1DataSettingsCharges) UnmarshalJSON

func (r *AccountV1DataSettingsCharges) UnmarshalJSON(data []byte) error

type AccountV1DataSettingsPayouts

type AccountV1DataSettingsPayouts struct {
	// The maximum dollar amount of payouts in a day.
	DailyAmount int64 `json:"daily_amount" api:"required"`
	// The amount of time it takes for a payout to be funded. This value is defined by
	// Straddle.
	//
	// Any of "immediate", "next_day", "one_day", "two_day", "three_day", "four_day",
	// "five_day".
	FundingTime string `json:"funding_time" api:"required"`
	// The unique identifier of the linked bank account to use for payouts.
	LinkedBankAccountID string `json:"linked_bank_account_id" api:"required" format:"uuid"`
	// The maximum amount of a single payout.
	MaxAmount int64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of payouts in a month.
	MonthlyAmount int64 `json:"monthly_amount" api:"required"`
	// The maximum number of payouts in a month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DailyAmount         respjson.Field
		FundingTime         respjson.Field
		LinkedBankAccountID respjson.Field
		MaxAmount           respjson.Field
		MonthlyAmount       respjson.Field
		MonthlyCount        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataSettingsPayouts) RawJSON

Returns the unmodified JSON received from the API

func (*AccountV1DataSettingsPayouts) UnmarshalJSON

func (r *AccountV1DataSettingsPayouts) UnmarshalJSON(data []byte) error

type AccountV1DataStatusDetail

type AccountV1DataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "terminated", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountV1DataStatusDetail) RawJSON

func (r AccountV1DataStatusDetail) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountV1DataStatusDetail) UnmarshalJSON

func (r *AccountV1DataStatusDetail) UnmarshalJSON(data []byte) error

type AccountV1ResponseType

type AccountV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	AccountV1ResponseTypeObject AccountV1ResponseType = "object"
	AccountV1ResponseTypeArray  AccountV1ResponseType = "array"
	AccountV1ResponseTypeError  AccountV1ResponseType = "error"
	AccountV1ResponseTypeNone   AccountV1ResponseType = "none"
)

type AddressV1

type AddressV1 struct {
	// City, district, suburb, town, or village.
	City string `json:"city" api:"required"`
	// Primary address line (e.g., street, PO Box).
	Line1 string `json:"line1" api:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" api:"required"`
	// Two-letter state code.
	State string `json:"state" api:"required"`
	// The country of the address, in ISO 3166-1 alpha-2 format.
	Country string `json:"country" api:"nullable"`
	// Secondary address line (e.g., apartment, suite, unit, or building).
	Line2 string `json:"line2" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City        respjson.Field
		Line1       respjson.Field
		PostalCode  respjson.Field
		State       respjson.Field
		Country     respjson.Field
		Line2       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The address object is optional. If provided, it must be a valid address.

func (AddressV1) RawJSON

func (r AddressV1) RawJSON() string

Returns the unmodified JSON received from the API

func (AddressV1) ToParam

func (r AddressV1) ToParam() AddressV1Param

ToParam converts this AddressV1 to a AddressV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AddressV1Param.Overrides()

func (*AddressV1) UnmarshalJSON

func (r *AddressV1) UnmarshalJSON(data []byte) error

type AddressV1Param

type AddressV1Param struct {
	// City, district, suburb, town, or village.
	City param.Opt[string] `json:"city,omitzero" api:"required"`
	// Primary address line (e.g., street, PO Box).
	Line1 param.Opt[string] `json:"line1,omitzero" api:"required"`
	// Postal or ZIP code.
	PostalCode param.Opt[string] `json:"postal_code,omitzero" api:"required"`
	// Two-letter state code.
	State param.Opt[string] `json:"state,omitzero" api:"required"`
	// The country of the address, in ISO 3166-1 alpha-2 format.
	Country param.Opt[string] `json:"country,omitzero"`
	// Secondary address line (e.g., apartment, suite, unit, or building).
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// contains filtered or unexported fields
}

The address object is optional. If provided, it must be a valid address.

The properties City, Line1, PostalCode, State are required.

func (AddressV1Param) MarshalJSON

func (r AddressV1Param) MarshalJSON() (data []byte, err error)

func (*AddressV1Param) UnmarshalJSON

func (r *AddressV1Param) UnmarshalJSON(data []byte) error

type BridgeInitializeParams

type BridgeInitializeParams struct {
	// The Straddle generated unique identifier of the `customer` to create a bridge
	// token for.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string]            `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string]            `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string]            `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string]            `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string]            `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	Config            BridgeInitializeParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeInitializeParams) MarshalJSON

func (r BridgeInitializeParams) MarshalJSON() (data []byte, err error)

func (*BridgeInitializeParams) UnmarshalJSON

func (r *BridgeInitializeParams) UnmarshalJSON(data []byte) error

type BridgeInitializeParamsConfig

type BridgeInitializeParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeInitializeParamsConfig) MarshalJSON

func (r BridgeInitializeParamsConfig) MarshalJSON() (data []byte, err error)

func (*BridgeInitializeParamsConfig) UnmarshalJSON

func (r *BridgeInitializeParamsConfig) UnmarshalJSON(data []byte) error

type BridgeLinkBankAccountParams

type BridgeLinkBankAccountParams struct {
	// The bank account number.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType BridgeLinkBankAccountParamsAccountType `json:"account_type,omitzero" api:"required"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata map[string]string                 `json:"metadata,omitzero"`
	Config   BridgeLinkBankAccountParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkBankAccountParams) MarshalJSON

func (r BridgeLinkBankAccountParams) MarshalJSON() (data []byte, err error)

func (*BridgeLinkBankAccountParams) UnmarshalJSON

func (r *BridgeLinkBankAccountParams) UnmarshalJSON(data []byte) error

type BridgeLinkBankAccountParamsAccountType

type BridgeLinkBankAccountParamsAccountType string
const (
	BridgeLinkBankAccountParamsAccountTypeChecking BridgeLinkBankAccountParamsAccountType = "checking"
	BridgeLinkBankAccountParamsAccountTypeSavings  BridgeLinkBankAccountParamsAccountType = "savings"
)

type BridgeLinkBankAccountParamsConfig

type BridgeLinkBankAccountParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkBankAccountParamsConfig) MarshalJSON

func (r BridgeLinkBankAccountParamsConfig) MarshalJSON() (data []byte, err error)

func (*BridgeLinkBankAccountParamsConfig) UnmarshalJSON

func (r *BridgeLinkBankAccountParamsConfig) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyParams

type BridgeLinkNewPaykeyParams struct {
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Quiltt processor token generated by your application for use with the Straddle
	// API.
	QuilttToken string `json:"quiltt_token" api:"required"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata map[string]string               `json:"metadata,omitzero"`
	Config   BridgeLinkNewPaykeyParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkNewPaykeyParams) MarshalJSON

func (r BridgeLinkNewPaykeyParams) MarshalJSON() (data []byte, err error)

func (*BridgeLinkNewPaykeyParams) UnmarshalJSON

func (r *BridgeLinkNewPaykeyParams) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyParamsConfig

type BridgeLinkNewPaykeyParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkNewPaykeyParamsConfig) MarshalJSON

func (r BridgeLinkNewPaykeyParamsConfig) MarshalJSON() (data []byte, err error)

func (*BridgeLinkNewPaykeyParamsConfig) UnmarshalJSON

func (r *BridgeLinkNewPaykeyParamsConfig) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponse

type BridgeLinkNewPaykeyResponse struct {
	Data BridgeLinkNewPaykeyResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType BridgeLinkNewPaykeyResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponse) RawJSON

func (r BridgeLinkNewPaykeyResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponse) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponse) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseData

type BridgeLinkNewPaykeyResponseData struct {
	// Unique identifier for the paykey.
	ID     string                                `json:"id" api:"required" format:"uuid"`
	Config BridgeLinkNewPaykeyResponseDataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label that combines the bank name and masked account number to
	// help easility represent this paykey in a UI
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This token is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                               `json:"updated_at" api:"required" format:"date-time"`
	Balance   BridgeLinkNewPaykeyResponseDataBalance  `json:"balance"`
	BankData  BridgeLinkNewPaykeyResponseDataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string                            `json:"metadata" api:"nullable"`
	StatusDetails BridgeLinkNewPaykeyResponseDataStatusDetails `json:"status_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponseData) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponseData) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseDataBalance

type BridgeLinkNewPaykeyResponseDataBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponseDataBalance) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponseDataBalance) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponseDataBalance) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseDataBankData

type BridgeLinkNewPaykeyResponseDataBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponseDataBankData) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponseDataBankData) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponseDataBankData) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseDataConfig

type BridgeLinkNewPaykeyResponseDataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponseDataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponseDataConfig) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponseDataConfig) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseDataStatusDetails

type BridgeLinkNewPaykeyResponseDataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewPaykeyResponseDataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewPaykeyResponseDataStatusDetails) UnmarshalJSON

func (r *BridgeLinkNewPaykeyResponseDataStatusDetails) UnmarshalJSON(data []byte) error

type BridgeLinkNewPaykeyResponseResponseType

type BridgeLinkNewPaykeyResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	BridgeLinkNewPaykeyResponseResponseTypeObject BridgeLinkNewPaykeyResponseResponseType = "object"
	BridgeLinkNewPaykeyResponseResponseTypeArray  BridgeLinkNewPaykeyResponseResponseType = "array"
	BridgeLinkNewPaykeyResponseResponseTypeError  BridgeLinkNewPaykeyResponseResponseType = "error"
	BridgeLinkNewPaykeyResponseResponseTypeNone   BridgeLinkNewPaykeyResponseResponseType = "none"
)

type BridgeLinkNewTanParams

type BridgeLinkNewTanParams struct {
	// Any of "checking", "savings".
	AccountType BridgeLinkNewTanParamsAccountType `json:"account_type,omitzero" api:"required"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Bank routing number.
	RoutingNumber string `json:"routing_number" api:"required"`
	// Tokenized account number.
	Tan string `json:"tan" api:"required"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata map[string]string            `json:"metadata,omitzero"`
	Config   BridgeLinkNewTanParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkNewTanParams) MarshalJSON

func (r BridgeLinkNewTanParams) MarshalJSON() (data []byte, err error)

func (*BridgeLinkNewTanParams) UnmarshalJSON

func (r *BridgeLinkNewTanParams) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanParamsAccountType

type BridgeLinkNewTanParamsAccountType string
const (
	BridgeLinkNewTanParamsAccountTypeChecking BridgeLinkNewTanParamsAccountType = "checking"
	BridgeLinkNewTanParamsAccountTypeSavings  BridgeLinkNewTanParamsAccountType = "savings"
)

type BridgeLinkNewTanParamsConfig

type BridgeLinkNewTanParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkNewTanParamsConfig) MarshalJSON

func (r BridgeLinkNewTanParamsConfig) MarshalJSON() (data []byte, err error)

func (*BridgeLinkNewTanParamsConfig) UnmarshalJSON

func (r *BridgeLinkNewTanParamsConfig) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponse

type BridgeLinkNewTanResponse struct {
	Data BridgeLinkNewTanResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType BridgeLinkNewTanResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponse) RawJSON

func (r BridgeLinkNewTanResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponse) UnmarshalJSON

func (r *BridgeLinkNewTanResponse) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseData

type BridgeLinkNewTanResponseData struct {
	// Unique identifier for the paykey.
	ID     string                             `json:"id" api:"required" format:"uuid"`
	Config BridgeLinkNewTanResponseDataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label that combines the bank name and masked account number to
	// help easility represent this paykey in a UI
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This token is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                            `json:"updated_at" api:"required" format:"date-time"`
	Balance   BridgeLinkNewTanResponseDataBalance  `json:"balance"`
	BankData  BridgeLinkNewTanResponseDataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string                         `json:"metadata" api:"nullable"`
	StatusDetails BridgeLinkNewTanResponseDataStatusDetails `json:"status_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponseData) UnmarshalJSON

func (r *BridgeLinkNewTanResponseData) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseDataBalance

type BridgeLinkNewTanResponseDataBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponseDataBalance) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponseDataBalance) UnmarshalJSON

func (r *BridgeLinkNewTanResponseDataBalance) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseDataBankData

type BridgeLinkNewTanResponseDataBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponseDataBankData) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponseDataBankData) UnmarshalJSON

func (r *BridgeLinkNewTanResponseDataBankData) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseDataConfig

type BridgeLinkNewTanResponseDataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponseDataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponseDataConfig) UnmarshalJSON

func (r *BridgeLinkNewTanResponseDataConfig) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseDataStatusDetails

type BridgeLinkNewTanResponseDataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeLinkNewTanResponseDataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*BridgeLinkNewTanResponseDataStatusDetails) UnmarshalJSON

func (r *BridgeLinkNewTanResponseDataStatusDetails) UnmarshalJSON(data []byte) error

type BridgeLinkNewTanResponseResponseType

type BridgeLinkNewTanResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	BridgeLinkNewTanResponseResponseTypeObject BridgeLinkNewTanResponseResponseType = "object"
	BridgeLinkNewTanResponseResponseTypeArray  BridgeLinkNewTanResponseResponseType = "array"
	BridgeLinkNewTanResponseResponseTypeError  BridgeLinkNewTanResponseResponseType = "error"
	BridgeLinkNewTanResponseResponseTypeNone   BridgeLinkNewTanResponseResponseType = "none"
)

type BridgeLinkPlaidParams

type BridgeLinkPlaidParams struct {
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Plaid processor token generated by your application for use with the Straddle
	// API.
	PlaidToken string `json:"plaid_token" api:"required"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata map[string]string           `json:"metadata,omitzero"`
	Config   BridgeLinkPlaidParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkPlaidParams) MarshalJSON

func (r BridgeLinkPlaidParams) MarshalJSON() (data []byte, err error)

func (*BridgeLinkPlaidParams) UnmarshalJSON

func (r *BridgeLinkPlaidParams) UnmarshalJSON(data []byte) error

type BridgeLinkPlaidParamsConfig

type BridgeLinkPlaidParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (BridgeLinkPlaidParamsConfig) MarshalJSON

func (r BridgeLinkPlaidParamsConfig) MarshalJSON() (data []byte, err error)

func (*BridgeLinkPlaidParamsConfig) UnmarshalJSON

func (r *BridgeLinkPlaidParamsConfig) UnmarshalJSON(data []byte) error

type BridgeLinkService

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

Bridge provides a comprehensive suite of tools for connecting customer bank accounts. Use it to generate secure widget sessions for instant account verification, accept tokens from major providers like Plaid and Finicity, or verify accounts directly via our API. Bridge handles all sensitive banking credentials and ensures secure, compliant connections with support for 90% of US bank accounts.

BridgeLinkService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBridgeLinkService method instead.

func NewBridgeLinkService

func NewBridgeLinkService(opts ...option.RequestOption) (r BridgeLinkService)

NewBridgeLinkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BridgeLinkService) BankAccount

func (r *BridgeLinkService) BankAccount(ctx context.Context, params BridgeLinkBankAccountParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Use Bridge to create a new paykey using a bank routing and account number as the source. This endpoint allows you to create a secure payment token linked to a specific bank account.

func (*BridgeLinkService) NewPaykey

Creates a new paykey using a Quiltt token as the source. This endpoint allows you to create a secure payment token linked to a bank account authenticated through Quiltt.

func (*BridgeLinkService) NewTan

func (*BridgeLinkService) Plaid

func (r *BridgeLinkService) Plaid(ctx context.Context, params BridgeLinkPlaidParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Use Bridge to create a new paykey using a Plaid token as the source. This endpoint allows you to create a secure payment token linked to a bank account authenticated through Plaid.

type BridgeService

type BridgeService struct {

	// Bridge provides a comprehensive suite of tools for connecting customer bank
	// accounts. Use it to generate secure widget sessions for instant account
	// verification, accept tokens from major providers like Plaid and Finicity, or
	// verify accounts directly via our API. Bridge handles all sensitive banking
	// credentials and ensures secure, compliant connections with support for 90% of US
	// bank accounts.
	Link BridgeLinkService
	// contains filtered or unexported fields
}

Bridge provides a comprehensive suite of tools for connecting customer bank accounts. Use it to generate secure widget sessions for instant account verification, accept tokens from major providers like Plaid and Finicity, or verify accounts directly via our API. Bridge handles all sensitive banking credentials and ensures secure, compliant connections with support for 90% of US bank accounts.

BridgeService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBridgeService method instead.

func NewBridgeService

func NewBridgeService(opts ...option.RequestOption) (r BridgeService)

NewBridgeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BridgeService) Initialize

func (r *BridgeService) Initialize(ctx context.Context, params BridgeInitializeParams, opts ...option.RequestOption) (res *BridgeTokenV1, err error)

Use this endpoint to generate a session token for use in the Bridge widget.

type BridgeTokenV1

type BridgeTokenV1 struct {
	Data BridgeTokenV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType BridgeTokenV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeTokenV1) RawJSON

func (r BridgeTokenV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*BridgeTokenV1) UnmarshalJSON

func (r *BridgeTokenV1) UnmarshalJSON(data []byte) error

type BridgeTokenV1Data

type BridgeTokenV1Data struct {
	// JWT Token to use in the bridge widget.
	BridgeToken string `json:"bridge_token" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BridgeToken respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BridgeTokenV1Data) RawJSON

func (r BridgeTokenV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*BridgeTokenV1Data) UnmarshalJSON

func (r *BridgeTokenV1Data) UnmarshalJSON(data []byte) error

type BridgeTokenV1ResponseType

type BridgeTokenV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	BridgeTokenV1ResponseTypeObject BridgeTokenV1ResponseType = "object"
	BridgeTokenV1ResponseTypeArray  BridgeTokenV1ResponseType = "array"
	BridgeTokenV1ResponseTypeError  BridgeTokenV1ResponseType = "error"
	BridgeTokenV1ResponseTypeNone   BridgeTokenV1ResponseType = "none"
)

type BusinessProfileV1

type BusinessProfileV1 struct {
	// The operating or trade name of the business.
	Name string `json:"name" api:"required"`
	// URL of the business's primary marketing website.
	Website string `json:"website" api:"required" format:"uri"`
	// The address object is optional. If provided, it must be a valid address.
	Address AddressV1 `json:"address" api:"nullable"`
	// A brief description of the business and its products or services.
	Description string     `json:"description" api:"nullable"`
	Industry    IndustryV1 `json:"industry"`
	// The official registered name of the business.
	LegalName string `json:"legal_name" api:"nullable"`
	// The primary contact phone number for the business.
	Phone           string            `json:"phone" api:"nullable"`
	SupportChannels SupportChannelsV1 `json:"support_channels"`
	// The business's tax identification number (e.g., EIN in the US).
	TaxID string `json:"tax_id" api:"nullable"`
	// A description of how the business intends to use Straddle's services.
	UseCase string `json:"use_case" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name            respjson.Field
		Website         respjson.Field
		Address         respjson.Field
		Description     respjson.Field
		Industry        respjson.Field
		LegalName       respjson.Field
		Phone           respjson.Field
		SupportChannels respjson.Field
		TaxID           respjson.Field
		UseCase         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BusinessProfileV1) RawJSON

func (r BusinessProfileV1) RawJSON() string

Returns the unmodified JSON received from the API

func (BusinessProfileV1) ToParam

ToParam converts this BusinessProfileV1 to a BusinessProfileV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BusinessProfileV1Param.Overrides()

func (*BusinessProfileV1) UnmarshalJSON

func (r *BusinessProfileV1) UnmarshalJSON(data []byte) error

type BusinessProfileV1Param

type BusinessProfileV1Param struct {
	// The operating or trade name of the business.
	Name string `json:"name" api:"required"`
	// URL of the business's primary marketing website.
	Website string `json:"website" api:"required" format:"uri"`
	// A brief description of the business and its products or services.
	Description param.Opt[string] `json:"description,omitzero"`
	// The official registered name of the business.
	LegalName param.Opt[string] `json:"legal_name,omitzero"`
	// The primary contact phone number for the business.
	Phone param.Opt[string] `json:"phone,omitzero"`
	// The business's tax identification number (e.g., EIN in the US).
	TaxID param.Opt[string] `json:"tax_id,omitzero"`
	// A description of how the business intends to use Straddle's services.
	UseCase param.Opt[string] `json:"use_case,omitzero"`
	// The address object is optional. If provided, it must be a valid address.
	Address         AddressV1Param         `json:"address,omitzero"`
	Industry        IndustryV1Param        `json:"industry,omitzero"`
	SupportChannels SupportChannelsV1Param `json:"support_channels,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Website are required.

func (BusinessProfileV1Param) MarshalJSON

func (r BusinessProfileV1Param) MarshalJSON() (data []byte, err error)

func (*BusinessProfileV1Param) UnmarshalJSON

func (r *BusinessProfileV1Param) UnmarshalJSON(data []byte) error

type CapabilityRequestPagedV1

type CapabilityRequestPagedV1 struct {
	Data []CapabilityRequestPagedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier, timestamp, and
	// pagination details.
	Meta shared.PagedResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType CapabilityRequestPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CapabilityRequestPagedV1) RawJSON

func (r CapabilityRequestPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CapabilityRequestPagedV1) UnmarshalJSON

func (r *CapabilityRequestPagedV1) UnmarshalJSON(data []byte) error

type CapabilityRequestPagedV1Data

type CapabilityRequestPagedV1Data struct {
	// Unique identifier for the capability request.
	ID string `json:"id" api:"required" format:"uuid"`
	// The unique identifier of the account associated with this capability request.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// The category of the requested capability. Use `payment_type` for charges and
	// payouts, `customer_type` to define `individuals` or `businesses`, and
	// `consent_type` for `signed_agreement` or `internet` payment authorization.
	//
	// Any of "payment_type", "customer_type", "consent_type".
	Category string `json:"category" api:"required"`
	// Timestamp of when the capability request was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Whether this capability request is to enable or disable the capability.
	Enable bool `json:"enable" api:"required"`
	// The current status of the capability request.
	//
	// Any of "active", "inactive", "in_review", "rejected", "approved", "reviewing".
	Status string `json:"status" api:"required"`
	// The specific type of capability being requested within the category.
	//
	// Any of "charges", "payouts", "individuals", "businesses", "signed_agreement",
	// "internet".
	Type string `json:"type" api:"required"`
	// Timestamp of the most recent update to the capability request.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Any specific settings or configurations related to the requested capability.
	Settings map[string]any `json:"settings" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AccountID   respjson.Field
		Category    respjson.Field
		CreatedAt   respjson.Field
		Enable      respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Settings    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CapabilityRequestPagedV1Data) RawJSON

Returns the unmodified JSON received from the API

func (*CapabilityRequestPagedV1Data) UnmarshalJSON

func (r *CapabilityRequestPagedV1Data) UnmarshalJSON(data []byte) error

type CapabilityRequestPagedV1ResponseType

type CapabilityRequestPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	CapabilityRequestPagedV1ResponseTypeObject CapabilityRequestPagedV1ResponseType = "object"
	CapabilityRequestPagedV1ResponseTypeArray  CapabilityRequestPagedV1ResponseType = "array"
	CapabilityRequestPagedV1ResponseTypeError  CapabilityRequestPagedV1ResponseType = "error"
	CapabilityRequestPagedV1ResponseTypeNone   CapabilityRequestPagedV1ResponseType = "none"
)

type CapabilityV1

type CapabilityV1 struct {
	// Any of "active", "inactive".
	CapabilityStatus CapabilityV1CapabilityStatus `json:"capability_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapabilityStatus respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CapabilityV1) RawJSON

func (r CapabilityV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CapabilityV1) UnmarshalJSON

func (r *CapabilityV1) UnmarshalJSON(data []byte) error

type CapabilityV1CapabilityStatus

type CapabilityV1CapabilityStatus string
const (
	CapabilityV1CapabilityStatusActive   CapabilityV1CapabilityStatus = "active"
	CapabilityV1CapabilityStatusInactive CapabilityV1CapabilityStatus = "inactive"
)

type ChargeCancelParams

type ChargeCancelParams struct {
	// Details about why the charge status was updated.
	Reason            param.Opt[string] `json:"reason,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ChargeCancelParams) MarshalJSON

func (r ChargeCancelParams) MarshalJSON() (data []byte, err error)

func (*ChargeCancelParams) UnmarshalJSON

func (r *ChargeCancelParams) UnmarshalJSON(data []byte) error

type ChargeGetParams

type ChargeGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ChargeHoldParams

type ChargeHoldParams struct {
	// Details about why the charge status was updated.
	Reason            param.Opt[string] `json:"reason,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ChargeHoldParams) MarshalJSON

func (r ChargeHoldParams) MarshalJSON() (data []byte, err error)

func (*ChargeHoldParams) UnmarshalJSON

func (r *ChargeHoldParams) UnmarshalJSON(data []byte) error

type ChargeNewParams

type ChargeNewParams struct {
	// An arbitrary description for the charge.
	Description param.Opt[string] `json:"description,omitzero" api:"required"`
	// The amount of the charge in cents.
	Amount int64                 `json:"amount" api:"required"`
	Config ChargeNewParamsConfig `json:"config,omitzero" api:"required"`
	// The channel or mechanism through which the payment was authorized. Use
	// `internet` for payments made online or through a mobile app and `signed` for
	// signed agreements where there is a consent form or contract. Use `signed` for
	// PDF signatures.
	//
	// Any of "internet", "signed".
	ConsentType ChargeNewParamsConsentType `json:"consent_type,omitzero" api:"required"`
	// The currency of the charge. Only USD is supported.
	Currency string                   `json:"currency" api:"required"`
	Device   shared.DeviceInfoV1Param `json:"device,omitzero" api:"required"`
	// Unique identifier for the charge in your database. This value must be unique
	// across all charges.
	ExternalID string `json:"external_id" api:"required"`
	// Value of the `paykey` used for the charge.
	Paykey string `json:"paykey" api:"required"`
	// The desired date on which the payment should be occur. For charges, this means
	// the date you want the customer to be debited on.
	PaymentDate       time.Time         `json:"payment_date" api:"required" format:"date"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the charge in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (ChargeNewParams) MarshalJSON

func (r ChargeNewParams) MarshalJSON() (data []byte, err error)

func (*ChargeNewParams) UnmarshalJSON

func (r *ChargeNewParams) UnmarshalJSON(data []byte) error

type ChargeNewParamsConfig

type ChargeNewParamsConfig struct {
	// Defines whether to check the customer's balance before processing the charge.
	//
	// Any of "required", "enabled", "disabled".
	BalanceCheck string `json:"balance_check,omitzero" api:"required"`
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold param.Opt[bool] `json:"auto_hold,omitzero"`
	// The reason the charge is being automatically held on creation.
	AutoHoldMessage param.Opt[string] `json:"auto_hold_message,omitzero"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

The property BalanceCheck is required.

func (ChargeNewParamsConfig) MarshalJSON

func (r ChargeNewParamsConfig) MarshalJSON() (data []byte, err error)

func (*ChargeNewParamsConfig) UnmarshalJSON

func (r *ChargeNewParamsConfig) UnmarshalJSON(data []byte) error

type ChargeNewParamsConsentType

type ChargeNewParamsConsentType string

The channel or mechanism through which the payment was authorized. Use `internet` for payments made online or through a mobile app and `signed` for signed agreements where there is a consent form or contract. Use `signed` for PDF signatures.

const (
	ChargeNewParamsConsentTypeInternet ChargeNewParamsConsentType = "internet"
	ChargeNewParamsConsentTypeSigned   ChargeNewParamsConsentType = "signed"
)

type ChargeReleaseParams

type ChargeReleaseParams struct {
	// Details about why the charge status was updated.
	Reason            param.Opt[string] `json:"reason,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ChargeReleaseParams) MarshalJSON

func (r ChargeReleaseParams) MarshalJSON() (data []byte, err error)

func (*ChargeReleaseParams) UnmarshalJSON

func (r *ChargeReleaseParams) UnmarshalJSON(data []byte) error

type ChargeService

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

Charges represent attempts to debit money from a customer's bank account using a Paykey. Each charge includes automatic balance verification, real-time fraud screening, and multi-rail optimization and detailed status tracking throughout the payment lifecycle. Use charges to accept bank payments with confidence knowing every transaction is protected.

ChargeService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChargeService method instead.

func NewChargeService

func NewChargeService(opts ...option.RequestOption) (r ChargeService)

NewChargeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ChargeService) Cancel

func (r *ChargeService) Cancel(ctx context.Context, id string, params ChargeCancelParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Cancel a charge to prevent it from being originated for processing. The status of the charge must be `created`, `scheduled`, or `on_hold`.

func (*ChargeService) Get

func (r *ChargeService) Get(ctx context.Context, id string, query ChargeGetParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Retrieves the details of an existing charge. Supply the unique charge `id`, and Straddle will return the corresponding charge information.

func (*ChargeService) Hold

func (r *ChargeService) Hold(ctx context.Context, id string, params ChargeHoldParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Place a charge on hold to prevent it from being originated for processing. The status of the charge must be `created` or `scheduled`.

func (*ChargeService) New

func (r *ChargeService) New(ctx context.Context, params ChargeNewParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Use charges to collect money from a customer for the sale of goods or services.

func (*ChargeService) Release

func (r *ChargeService) Release(ctx context.Context, id string, params ChargeReleaseParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Release a charge from an `on_hold` status to allow it to be rescheduled for processing.

func (*ChargeService) Unmask

func (r *ChargeService) Unmask(ctx context.Context, id string, query ChargeUnmaskParams, opts ...option.RequestOption) (res *ChargeUnmaskResponse, err error)

Get a charge by id.

func (*ChargeService) Update

func (r *ChargeService) Update(ctx context.Context, id string, params ChargeUpdateParams, opts ...option.RequestOption) (res *ChargeV1, err error)

Change the values of parameters associated with a charge prior to processing. The status of the charge must be `created`, `scheduled`, or `on_hold`.

type ChargeUnmaskParams

type ChargeUnmaskParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ChargeUnmaskResponse

type ChargeUnmaskResponse struct {
	Data ChargeUnmaskResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType ChargeUnmaskResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeUnmaskResponse) RawJSON

func (r ChargeUnmaskResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeUnmaskResponse) UnmarshalJSON

func (r *ChargeUnmaskResponse) UnmarshalJSON(data []byte) error

type ChargeUnmaskResponseData

type ChargeUnmaskResponseData struct {
	// Id.
	ID string `json:"id" api:"required" format:"uuid"`
	// Amount.
	Amount int64                          `json:"amount" api:"required"`
	Config ChargeUnmaskResponseDataConfig `json:"config" api:"required"`
	// The channel or mechanism through which the payment was authorized. Use
	// `internet` for payments made online or through a mobile app and `signed` for
	// signed agreements where there is a consent form or contract. Use `signed` for
	// PDF signatures.
	//
	// Any of "internet", "signed".
	ConsentType string `json:"consent_type" api:"required"`
	// Created at.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Currency.
	Currency string `json:"currency" api:"required"`
	// Description.
	Description string                         `json:"description" api:"required"`
	Device      ChargeUnmaskResponseDataDevice `json:"device" api:"required"`
	// External id.
	ExternalID string `json:"external_id" api:"required"`
	// Funding Ids
	FundingIDs []string `json:"funding_ids" api:"required" format:"uuid"`
	// Paykey.
	Paykey string `json:"paykey" api:"required"`
	// Payment date.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status        string                 `json:"status" api:"required"`
	StatusDetails shared.StatusDetailsV1 `json:"status_details" api:"required"`
	// Status history.
	StatusHistory []ChargeUnmaskResponseDataStatusHistory `json:"status_history" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// Updated at.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Information about the customer associated with the charge or payout.
	CustomerDetails shared.CustomerDetailsV1 `json:"customer_details"`
	// Effective at.
	EffectiveAt time.Time `json:"effective_at" api:"nullable" format:"date-time"`
	// Metadata.
	Metadata      map[string]string      `json:"metadata" api:"nullable"`
	PaykeyDetails shared.PaykeyDetailsV1 `json:"paykey_details"`
	// The payment rail used for the charge or payout.
	//
	// Any of "ach".
	PaymentRail string `json:"payment_rail"`
	// Processed at.
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Related payments.
	//
	// Any of "original", "resubmit", "refund".
	RelatedPayments map[string]string `json:"related_payments" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Amount          respjson.Field
		Config          respjson.Field
		ConsentType     respjson.Field
		CreatedAt       respjson.Field
		Currency        respjson.Field
		Description     respjson.Field
		Device          respjson.Field
		ExternalID      respjson.Field
		FundingIDs      respjson.Field
		Paykey          respjson.Field
		PaymentDate     respjson.Field
		Status          respjson.Field
		StatusDetails   respjson.Field
		StatusHistory   respjson.Field
		TraceIDs        respjson.Field
		UpdatedAt       respjson.Field
		CustomerDetails respjson.Field
		EffectiveAt     respjson.Field
		Metadata        respjson.Field
		PaykeyDetails   respjson.Field
		PaymentRail     respjson.Field
		ProcessedAt     respjson.Field
		RelatedPayments respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeUnmaskResponseData) RawJSON

func (r ChargeUnmaskResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeUnmaskResponseData) UnmarshalJSON

func (r *ChargeUnmaskResponseData) UnmarshalJSON(data []byte) error

type ChargeUnmaskResponseDataConfig

type ChargeUnmaskResponseDataConfig struct {
	// Defines whether to check the customer's balance before processing the charge.
	//
	// Any of "required", "enabled", "disabled".
	BalanceCheck string `json:"balance_check" api:"required"`
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold bool `json:"auto_hold" api:"nullable"`
	// The reason the charge is being automatically held on creation.
	AutoHoldMessage string `json:"auto_hold_message" api:"nullable"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BalanceCheck    respjson.Field
		AutoHold        respjson.Field
		AutoHoldMessage respjson.Field
		SandboxOutcome  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeUnmaskResponseDataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*ChargeUnmaskResponseDataConfig) UnmarshalJSON

func (r *ChargeUnmaskResponseDataConfig) UnmarshalJSON(data []byte) error

type ChargeUnmaskResponseDataDevice

type ChargeUnmaskResponseDataDevice struct {
	// Ip address.
	IPAddress string `json:"ip_address" api:"required" format:"**.**.**.**"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeUnmaskResponseDataDevice) RawJSON

Returns the unmodified JSON received from the API

func (*ChargeUnmaskResponseDataDevice) UnmarshalJSON

func (r *ChargeUnmaskResponseDataDevice) UnmarshalJSON(data []byte) error

type ChargeUnmaskResponseDataStatusHistory

type ChargeUnmaskResponseDataStatusHistory struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Status      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeUnmaskResponseDataStatusHistory) RawJSON

Returns the unmodified JSON received from the API

func (*ChargeUnmaskResponseDataStatusHistory) UnmarshalJSON

func (r *ChargeUnmaskResponseDataStatusHistory) UnmarshalJSON(data []byte) error

type ChargeUnmaskResponseResponseType

type ChargeUnmaskResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	ChargeUnmaskResponseResponseTypeObject ChargeUnmaskResponseResponseType = "object"
	ChargeUnmaskResponseResponseTypeArray  ChargeUnmaskResponseResponseType = "array"
	ChargeUnmaskResponseResponseTypeError  ChargeUnmaskResponseResponseType = "error"
	ChargeUnmaskResponseResponseTypeNone   ChargeUnmaskResponseResponseType = "none"
)

type ChargeUpdateParams

type ChargeUpdateParams struct {
	// An arbitrary description for the charge.
	Description param.Opt[string] `json:"description,omitzero" api:"required"`
	// The amount of the charge in cents.
	Amount int64 `json:"amount" api:"required"`
	// The desired date on which the payment should be occur. For charges, this means
	// the date you want the customer to be debited on.
	PaymentDate       time.Time         `json:"payment_date" api:"required" format:"date"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the charge in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (ChargeUpdateParams) MarshalJSON

func (r ChargeUpdateParams) MarshalJSON() (data []byte, err error)

func (*ChargeUpdateParams) UnmarshalJSON

func (r *ChargeUpdateParams) UnmarshalJSON(data []byte) error

type ChargeV1

type ChargeV1 struct {
	Data ChargeV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType ChargeV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeV1) RawJSON

func (r ChargeV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeV1) UnmarshalJSON

func (r *ChargeV1) UnmarshalJSON(data []byte) error

type ChargeV1Data

type ChargeV1Data struct {
	// Unique identifier for the charge.
	ID string `json:"id" api:"required" format:"uuid"`
	// The amount of the charge in cents.
	Amount int64 `json:"amount" api:"required"`
	// Configuration options for the charge.
	Config ChargeV1DataConfig `json:"config" api:"required"`
	// The channel or mechanism through which the payment was authorized. Use
	// `internet` for payments made online or through a mobile app and `signed` for
	// signed agreements where there is a consent form or contract. Use `signed` for
	// PDF signatures.
	//
	// Any of "internet", "signed".
	ConsentType string `json:"consent_type" api:"required"`
	// Timestamp of when the charge was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The currency of the charge. Only USD is supported.
	Currency string `json:"currency" api:"required"`
	// An arbitrary description for the charge.
	Description string `json:"description" api:"required"`
	// Information about the device used when the customer authorized the payment.
	Device shared.DeviceInfoV1 `json:"device" api:"required"`
	// Unique identifier for the charge in your database. This value must be unique
	// across all charges.
	ExternalID string `json:"external_id" api:"required"`
	// Funding Ids
	FundingIDs []string `json:"funding_ids" api:"required" format:"uuid"`
	// Value of the `paykey` used for the charge.
	Paykey string `json:"paykey" api:"required"`
	// The desired date on which the payment should be occur. For charges, this means
	// the date you want the customer to be debited on.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// The current status of the charge.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// Additional details about the current status of the charge.
	StatusDetails shared.StatusDetailsV1 `json:"status_details" api:"required"`
	// Status history.
	StatusHistory []ChargeV1DataStatusHistory `json:"status_history" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// Timestamp of when the charge was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Information about the customer associated with the charge.
	CustomerDetails shared.CustomerDetailsV1 `json:"customer_details"`
	// Timestamp of when the charge was effective in the customer's bank account,
	// otherwise known as the date on which the customer is debited.
	EffectiveAt time.Time `json:"effective_at" api:"nullable" format:"date-time"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the charge in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// Information about the paykey used for the charge.
	PaykeyDetails shared.PaykeyDetailsV1 `json:"paykey_details"`
	// The payment rail that the charge will be processed through.
	//
	// Any of "ach".
	PaymentRail string `json:"payment_rail"`
	// Timestamp of when the charge was processed by Straddle and originated to the
	// payment rail.
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Related payments.
	//
	// Any of "original", "resubmit", "refund".
	RelatedPayments map[string]string `json:"related_payments" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Amount          respjson.Field
		Config          respjson.Field
		ConsentType     respjson.Field
		CreatedAt       respjson.Field
		Currency        respjson.Field
		Description     respjson.Field
		Device          respjson.Field
		ExternalID      respjson.Field
		FundingIDs      respjson.Field
		Paykey          respjson.Field
		PaymentDate     respjson.Field
		Status          respjson.Field
		StatusDetails   respjson.Field
		StatusHistory   respjson.Field
		TraceIDs        respjson.Field
		UpdatedAt       respjson.Field
		CustomerDetails respjson.Field
		EffectiveAt     respjson.Field
		Metadata        respjson.Field
		PaykeyDetails   respjson.Field
		PaymentRail     respjson.Field
		ProcessedAt     respjson.Field
		RelatedPayments respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChargeV1Data) RawJSON

func (r ChargeV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeV1Data) UnmarshalJSON

func (r *ChargeV1Data) UnmarshalJSON(data []byte) error

type ChargeV1DataConfig

type ChargeV1DataConfig struct {
	// Defines whether to check the customer's balance before processing the charge.
	//
	// Any of "required", "enabled", "disabled".
	BalanceCheck string `json:"balance_check" api:"required"`
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold bool `json:"auto_hold" api:"nullable"`
	// The reason the charge is being automatically held on creation.
	AutoHoldMessage string `json:"auto_hold_message" api:"nullable"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BalanceCheck    respjson.Field
		AutoHold        respjson.Field
		AutoHoldMessage respjson.Field
		SandboxOutcome  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration options for the charge.

func (ChargeV1DataConfig) RawJSON

func (r ChargeV1DataConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeV1DataConfig) UnmarshalJSON

func (r *ChargeV1DataConfig) UnmarshalJSON(data []byte) error

type ChargeV1DataStatusHistory

type ChargeV1DataStatusHistory struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Status      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A record of the charge's status changes over time.

func (ChargeV1DataStatusHistory) RawJSON

func (r ChargeV1DataStatusHistory) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChargeV1DataStatusHistory) UnmarshalJSON

func (r *ChargeV1DataStatusHistory) UnmarshalJSON(data []byte) error

type ChargeV1ResponseType

type ChargeV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	ChargeV1ResponseTypeObject ChargeV1ResponseType = "object"
	ChargeV1ResponseTypeArray  ChargeV1ResponseType = "array"
	ChargeV1ResponseTypeError  ChargeV1ResponseType = "error"
	ChargeV1ResponseTypeNone   ChargeV1ResponseType = "none"
)

type Client

type Client struct {
	Embed EmbedService
	// Bridge provides a comprehensive suite of tools for connecting customer bank
	// accounts. Use it to generate secure widget sessions for instant account
	// verification, accept tokens from major providers like Plaid and Finicity, or
	// verify accounts directly via our API. Bridge handles all sensitive banking
	// credentials and ensures secure, compliant connections with support for 90% of US
	// bank accounts.
	Bridge BridgeService
	// Customers represent the end users who send or receive payments through your
	// integration. Each customer undergoes automatic identity verification and fraud
	// screening upon creation. Use customers to track payment history, manage bank
	// account connections, and maintain a secure record of all transactions associated
	// with a user. Customers can be either individuals or businesses with appropriate
	// compliance checks for each type.
	Customers CustomerService
	// Paykeys are secure tokens that link verified customer identities to their bank
	// accounts. Each Paykey includes built-in balance checking, fraud detection
	// through LSTM machine learning models, and can be reused for subscriptions and
	// recurring payments without storing sensitive data. Paykeys eliminate fraud by
	// ensuring the person initiating payment owns the funding account.
	Paykeys PaykeyService
	// Charges represent attempts to debit money from a customer's bank account using a
	// Paykey. Each charge includes automatic balance verification, real-time fraud
	// screening, and multi-rail optimization and detailed status tracking throughout
	// the payment lifecycle. Use charges to accept bank payments with confidence
	// knowing every transaction is protected.
	Charges ChargeService
	// Funding events represent all money movement between Straddle and an Account's
	// external bank accounts. They are automatically generated when charges settle or
	// payouts are initiated. Each event provides detailed tracking of settlement
	// status, fee breakdowns, and reconciliation data across both incoming and
	// outgoing transfers. Use funding events to monitor your platform's entire money
	// movement lifecycle.
	FundingEvents FundingEventService
	// Payments provide endpoints to filter both Charges and Payouts with multiple
	// different parameters.
	Payments PaymentService
	// Payouts represent transfers from Straddle to customer bank accounts. Create
	// payouts to handle disbursements, process refunds, or manage marketplace
	// settlements. Use payouts to send money quickly and securely with the most
	// cost-effective rail automatically selected.
	Payouts PayoutService
	Reports ReportService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the straddle API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (STRADDLE_API_KEY, STRADDLE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CustomerAddressV1

type CustomerAddressV1 struct {
	// Primary address line (e.g., street, PO Box).
	Address1 string `json:"address1" api:"required"`
	// City, district, suburb, town, or village.
	City string `json:"city" api:"required"`
	// Two-letter state code.
	State string `json:"state" api:"required"`
	// Zip or postal code.
	Zip string `json:"zip" api:"required"`
	// Secondary address line (e.g., apartment, suite, unit, or building).
	Address2 string `json:"address2" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address1    respjson.Field
		City        respjson.Field
		State       respjson.Field
		Zip         respjson.Field
		Address2    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An object containing the customer's address. This is optional, but if provided, all required fields must be present.

func (CustomerAddressV1) RawJSON

func (r CustomerAddressV1) RawJSON() string

Returns the unmodified JSON received from the API

func (CustomerAddressV1) ToParam

ToParam converts this CustomerAddressV1 to a CustomerAddressV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CustomerAddressV1Param.Overrides()

func (*CustomerAddressV1) UnmarshalJSON

func (r *CustomerAddressV1) UnmarshalJSON(data []byte) error

type CustomerAddressV1Param

type CustomerAddressV1Param struct {
	// Primary address line (e.g., street, PO Box).
	Address1 string `json:"address1" api:"required"`
	// City, district, suburb, town, or village.
	City string `json:"city" api:"required"`
	// Two-letter state code.
	State string `json:"state" api:"required"`
	// Zip or postal code.
	Zip string `json:"zip" api:"required"`
	// Secondary address line (e.g., apartment, suite, unit, or building).
	Address2 param.Opt[string] `json:"address2,omitzero"`
	// contains filtered or unexported fields
}

An object containing the customer's address. This is optional, but if provided, all required fields must be present.

The properties Address1, City, State, Zip are required.

func (CustomerAddressV1Param) MarshalJSON

func (r CustomerAddressV1Param) MarshalJSON() (data []byte, err error)

func (*CustomerAddressV1Param) UnmarshalJSON

func (r *CustomerAddressV1Param) UnmarshalJSON(data []byte) error

type CustomerDeleteParams

type CustomerDeleteParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type CustomerDetailsV1

type CustomerDetailsV1 = shared.CustomerDetailsV1

Information about the customer associated with the charge or payout.

This is an alias to an internal type.

type CustomerDetailsV1CustomerType

type CustomerDetailsV1CustomerType = shared.CustomerDetailsV1CustomerType

The type of customer

This is an alias to an internal type.

type CustomerGetParams

type CustomerGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type CustomerListParams

type CustomerListParams struct {
	// Start date for filtering by `created_at` date.
	CreatedFrom param.Opt[time.Time] `query:"created_from,omitzero" format:"date-time" json:"-"`
	// End date for filtering by `created_at` date.
	CreatedTo param.Opt[time.Time] `query:"created_to,omitzero" format:"date-time" json:"-"`
	// Filter customers by `email` address.
	Email param.Opt[string] `query:"email,omitzero" json:"-"`
	// Filter by your system's `external_id`.
	ExternalID param.Opt[string] `query:"external_id,omitzero" json:"-"`
	// Filter customers by `name` (partial match).
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Page number for paginated results. Starts at 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Number of results per page. Maximum: 1000.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// General search term to filter customers.
	SearchText        param.Opt[string] `query:"search_text,omitzero" json:"-"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Any of "name", "created_at".
	SortBy CustomerListParamsSortBy `query:"sort_by,omitzero" json:"-"`
	// Any of "asc", "desc".
	SortOrder CustomerListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// Filter customers by their current `status`.
	//
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status []string `query:"status,omitzero" json:"-"`
	// Filter by customer type `individual` or `business`.
	//
	// Any of "individual", "business".
	Types []string `query:"types,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CustomerListParams) URLQuery

func (r CustomerListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CustomerListParams's query parameters as `url.Values`.

type CustomerListParamsSortBy

type CustomerListParamsSortBy string
const (
	CustomerListParamsSortByName      CustomerListParamsSortBy = "name"
	CustomerListParamsSortByCreatedAt CustomerListParamsSortBy = "created_at"
)

type CustomerListParamsSortOrder

type CustomerListParamsSortOrder string
const (
	CustomerListParamsSortOrderAsc  CustomerListParamsSortOrder = "asc"
	CustomerListParamsSortOrderDesc CustomerListParamsSortOrder = "desc"
)

type CustomerNewParams

type CustomerNewParams struct {
	Device DeviceUnmaskedV1Param `json:"device,omitzero" api:"required"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the individual or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format. Mobile number is preferred.
	Phone string `json:"phone" api:"required"`
	// Any of "individual", "business".
	Type CustomerNewParamsType `json:"type,omitzero" api:"required"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// An object containing the customer's address. **This is optional.** If used, all
	// required fields must be present.
	Address CustomerAddressV1Param `json:"address,omitzero"`
	// An object containing the customer's compliance profile. **This is optional.** If
	// all required fields must be present for the appropriate customer type.
	ComplianceProfile CustomerNewParamsComplianceProfileUnion `json:"compliance_profile,omitzero"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the customer in a structured format.
	Metadata map[string]string       `json:"metadata,omitzero"`
	Config   CustomerNewParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (CustomerNewParams) MarshalJSON

func (r CustomerNewParams) MarshalJSON() (data []byte, err error)

func (*CustomerNewParams) UnmarshalJSON

func (r *CustomerNewParams) UnmarshalJSON(data []byte) error

type CustomerNewParamsComplianceProfileBusinessComplianceProfile

type CustomerNewParamsComplianceProfileBusinessComplianceProfile struct {
	// Employer Identification Number (format XX-XXXXXXX). Required for Patriot
	// Act-compliant KYB verification.
	Ein param.Opt[string] `json:"ein,omitzero" api:"required"`
	// Official registered business name as listed with the IRS. This value will be
	// matched against the 'legal_business name'.
	LegalBusinessName param.Opt[string] `json:"legal_business_name,omitzero" api:"required"`
	// Official business website URL. Optional but recommended for enhanced KYB.
	Website param.Opt[string] `json:"website,omitzero" format:"uri"`
	// A list of people related to the company. Only valid where customer type is
	// 'business'.
	Representatives []CustomerNewParamsComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives,omitzero"`
	// contains filtered or unexported fields
}

Business registration data required to trigger Patriot Act compliant KYB verification.

The properties Ein, LegalBusinessName are required.

func (CustomerNewParamsComplianceProfileBusinessComplianceProfile) MarshalJSON

func (*CustomerNewParamsComplianceProfileBusinessComplianceProfile) UnmarshalJSON

type CustomerNewParamsComplianceProfileBusinessComplianceProfileRepresentative

type CustomerNewParamsComplianceProfileBusinessComplianceProfileRepresentative struct {
	Name  string            `json:"name" api:"required"`
	Email param.Opt[string] `json:"email,omitzero"`
	Phone param.Opt[string] `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (CustomerNewParamsComplianceProfileBusinessComplianceProfileRepresentative) MarshalJSON

func (*CustomerNewParamsComplianceProfileBusinessComplianceProfileRepresentative) UnmarshalJSON

type CustomerNewParamsComplianceProfileIndividualComplianceProfile

type CustomerNewParamsComplianceProfileIndividualComplianceProfile struct {
	// Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification.
	Dob param.Opt[time.Time] `json:"dob,omitzero" api:"required" format:"date"`
	// Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant
	// KYC verification.
	Ssn param.Opt[string] `json:"ssn,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Individual PII data required to trigger Patriot Act compliant KYC verification.

The properties Dob, Ssn are required.

func (CustomerNewParamsComplianceProfileIndividualComplianceProfile) MarshalJSON

func (*CustomerNewParamsComplianceProfileIndividualComplianceProfile) UnmarshalJSON

type CustomerNewParamsComplianceProfileUnion

type CustomerNewParamsComplianceProfileUnion struct {
	OfIndividualComplianceProfile *CustomerNewParamsComplianceProfileIndividualComplianceProfile `json:",omitzero,inline"`
	OfBusinessComplianceProfile   *CustomerNewParamsComplianceProfileBusinessComplianceProfile   `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (CustomerNewParamsComplianceProfileUnion) MarshalJSON

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

func (*CustomerNewParamsComplianceProfileUnion) UnmarshalJSON

func (u *CustomerNewParamsComplianceProfileUnion) UnmarshalJSON(data []byte) error

type CustomerNewParamsConfig

type CustomerNewParamsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method,omitzero"`
	// Any of "standard", "verified", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (CustomerNewParamsConfig) MarshalJSON

func (r CustomerNewParamsConfig) MarshalJSON() (data []byte, err error)

func (*CustomerNewParamsConfig) UnmarshalJSON

func (r *CustomerNewParamsConfig) UnmarshalJSON(data []byte) error

type CustomerNewParamsType

type CustomerNewParamsType string
const (
	CustomerNewParamsTypeIndividual CustomerNewParamsType = "individual"
	CustomerNewParamsTypeBusiness   CustomerNewParamsType = "business"
)

type CustomerReviewDecisionParams

type CustomerReviewDecisionParams struct {
	// The final status of the customer review.
	//
	// Any of "verified", "rejected".
	Status            CustomerReviewDecisionParamsStatus `json:"status,omitzero" api:"required"`
	CorrelationID     param.Opt[string]                  `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string]                  `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string]                  `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string]                  `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (CustomerReviewDecisionParams) MarshalJSON

func (r CustomerReviewDecisionParams) MarshalJSON() (data []byte, err error)

func (*CustomerReviewDecisionParams) UnmarshalJSON

func (r *CustomerReviewDecisionParams) UnmarshalJSON(data []byte) error

type CustomerReviewDecisionParamsStatus

type CustomerReviewDecisionParamsStatus string

The final status of the customer review.

const (
	CustomerReviewDecisionParamsStatusVerified CustomerReviewDecisionParamsStatus = "verified"
	CustomerReviewDecisionParamsStatusRejected CustomerReviewDecisionParamsStatus = "rejected"
)

type CustomerReviewGetParams

type CustomerReviewGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type CustomerReviewRefreshReviewParams

type CustomerReviewRefreshReviewParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type CustomerReviewService

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

Customers represent the end users who send or receive payments through your integration. Each customer undergoes automatic identity verification and fraud screening upon creation. Use customers to track payment history, manage bank account connections, and maintain a secure record of all transactions associated with a user. Customers can be either individuals or businesses with appropriate compliance checks for each type.

CustomerReviewService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerReviewService method instead.

func NewCustomerReviewService

func NewCustomerReviewService(opts ...option.RequestOption) (r CustomerReviewService)

NewCustomerReviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerReviewService) Decision

Updates the status of a customer's identity decision. This endpoint allows you to modify the outcome of a customer risk screening and is useful for correcting or updating the status of a customer's verification. Note that this endpoint is only available for customers with a current status of `review`.

func (*CustomerReviewService) Get

Retrieves and analyzes the results of a customer's identity validation and fraud score. This endpoint provides a comprehensive breakdown of the validation outcome, including:

  • Risk and correlation scores
  • Reason codes for the decision
  • Results of watchlist screening
  • Any network alerts detected Use this endpoint to gain insights into the verification process and make informed decisions about customer onboarding.

func (*CustomerReviewService) RefreshReview

Updates the decision of a customer's identity validation. This endpoint allows you to modify the outcome of a customer decision and is useful for correcting or updating the status of a customer's verification.

type CustomerReviewV1

type CustomerReviewV1 struct {
	Data CustomerReviewV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType CustomerReviewV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1) RawJSON

func (r CustomerReviewV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerReviewV1) UnmarshalJSON

func (r *CustomerReviewV1) UnmarshalJSON(data []byte) error

type CustomerReviewV1Data

type CustomerReviewV1Data struct {
	CustomerDetails CustomerReviewV1DataCustomerDetails `json:"customer_details" api:"required"`
	IdentityDetails CustomerReviewV1DataIdentityDetails `json:"identity_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomerDetails respjson.Field
		IdentityDetails respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1Data) RawJSON

func (r CustomerReviewV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerReviewV1Data) UnmarshalJSON

func (r *CustomerReviewV1Data) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataCustomerDetails

type CustomerReviewV1DataCustomerDetails struct {
	// Unique identifier for the customer.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the customer record was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the individual or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format.
	Phone string `json:"phone" api:"required"`
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status string `json:"status" api:"required"`
	// Any of "individual", "business".
	Type string `json:"type" api:"required"`
	// Timestamp of the most recent update to the customer record.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An object containing the customer's address. This is optional, but if provided,
	// all required fields must be present.
	Address CustomerAddressV1 `json:"address" api:"nullable"`
	// PII required to trigger Patriot Act compliant KYC verification.
	ComplianceProfile CustomerReviewV1DataCustomerDetailsComplianceProfileUnion `json:"compliance_profile" api:"nullable"`
	Config            CustomerReviewV1DataCustomerDetailsConfig                 `json:"config"`
	Device            CustomerReviewV1DataCustomerDetailsDevice                 `json:"device"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the customer in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		CreatedAt         respjson.Field
		Email             respjson.Field
		Name              respjson.Field
		Phone             respjson.Field
		Status            respjson.Field
		Type              respjson.Field
		UpdatedAt         respjson.Field
		Address           respjson.Field
		ComplianceProfile respjson.Field
		Config            respjson.Field
		Device            respjson.Field
		ExternalID        respjson.Field
		Metadata          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataCustomerDetails) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetails) UnmarshalJSON

func (r *CustomerReviewV1DataCustomerDetails) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile

type CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile struct {
	// Masked Employer Identification Number in the format **-**\*****
	Ein string `json:"ein" api:"required"`
	// The official registered name of the business. This name should be correlated
	// with the `ein` value.
	LegalBusinessName string `json:"legal_business_name" api:"required"`
	// A list of people related to the company. Only valid where customer type is
	// 'business'.
	Representatives []CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives" api:"nullable"`
	// Official business website URL. Optional but recommended for enhanced KYB.
	Website string `json:"website" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business registration data required to trigger Patriot Act compliant KYB verification.

func (CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile) UnmarshalJSON

type CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative

type CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative struct {
	Name  string `json:"name" api:"required"`
	Email string `json:"email" api:"nullable"`
	Phone string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Email       respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative) UnmarshalJSON

type CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile

type CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile struct {
	// Masked date of birth in \***\*-**-\*\* format.
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// Masked Social Security Number in the format **\*-**-\*\*\*\*.
	Ssn string `json:"ssn" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dob         respjson.Field
		Ssn         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

PII required to trigger Patriot Act compliant KYC verification.

func (CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile) UnmarshalJSON

type CustomerReviewV1DataCustomerDetailsComplianceProfileUnion

type CustomerReviewV1DataCustomerDetailsComplianceProfileUnion struct {
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile].
	Dob time.Time `json:"dob"`
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile].
	Ssn string `json:"ssn"`
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile].
	Ein string `json:"ein"`
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile].
	LegalBusinessName string `json:"legal_business_name"`
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile].
	Representatives []CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives"`
	// This field is from variant
	// [CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile].
	Website string `json:"website"`
	JSON    struct {
		Dob               respjson.Field
		Ssn               respjson.Field
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CustomerReviewV1DataCustomerDetailsComplianceProfileUnion contains all possible properties and values from CustomerReviewV1DataCustomerDetailsComplianceProfileIndividualComplianceProfile, CustomerReviewV1DataCustomerDetailsComplianceProfileBusinessComplianceProfile.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (CustomerReviewV1DataCustomerDetailsComplianceProfileUnion) AsBusinessComplianceProfile

func (CustomerReviewV1DataCustomerDetailsComplianceProfileUnion) AsIndividualComplianceProfile

func (CustomerReviewV1DataCustomerDetailsComplianceProfileUnion) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsComplianceProfileUnion) UnmarshalJSON

type CustomerReviewV1DataCustomerDetailsConfig

type CustomerReviewV1DataCustomerDetailsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "verified", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataCustomerDetailsConfig) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsConfig) UnmarshalJSON

func (r *CustomerReviewV1DataCustomerDetailsConfig) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataCustomerDetailsDevice

type CustomerReviewV1DataCustomerDetailsDevice struct {
	// The customer's IP address at the time of profile creation. Use `0.0.0.0` to
	// represent an offline customer registration.
	IPAddress string `json:"ip_address" api:"required" format:"ipv4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataCustomerDetailsDevice) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataCustomerDetailsDevice) UnmarshalJSON

func (r *CustomerReviewV1DataCustomerDetailsDevice) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetails

type CustomerReviewV1DataIdentityDetails struct {
	// Detailed breakdown of the customer verification results, including decisions,
	// risk scores, correlation score, and more.
	Breakdown CustomerReviewV1DataIdentityDetailsBreakdown `json:"breakdown" api:"required"`
	// Timestamp of when the review was initiated.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision" api:"required"`
	// Unique identifier for the review.
	ReviewID string `json:"review_id" api:"required" format:"uuid"`
	// Timestamp of the most recent update to the review.
	UpdatedAt time.Time                              `json:"updated_at" api:"required" format:"date-time"`
	KYC       CustomerReviewV1DataIdentityDetailsKYC `json:"kyc"`
	// Dictionary of all messages from the customer verification process.
	Messages      map[string]string                                `json:"messages" api:"nullable"`
	NetworkAlerts CustomerReviewV1DataIdentityDetailsNetworkAlerts `json:"network_alerts"`
	Reputation    CustomerReviewV1DataIdentityDetailsReputation    `json:"reputation"`
	WatchList     CustomerReviewV1DataIdentityDetailsWatchList     `json:"watch_list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Breakdown     respjson.Field
		CreatedAt     respjson.Field
		Decision      respjson.Field
		ReviewID      respjson.Field
		UpdatedAt     respjson.Field
		KYC           respjson.Field
		Messages      respjson.Field
		NetworkAlerts respjson.Field
		Reputation    respjson.Field
		WatchList     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetails) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetails) UnmarshalJSON

func (r *CustomerReviewV1DataIdentityDetails) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetailsBreakdown

type CustomerReviewV1DataIdentityDetailsBreakdown struct {
	Address                IdentityVerificationBreakdownV1 `json:"address"`
	BusinessEvaluation     IdentityVerificationBreakdownV1 `json:"business_evaluation"`
	BusinessIdentification IdentityVerificationBreakdownV1 `json:"business_identification"`
	BusinessValidation     IdentityVerificationBreakdownV1 `json:"business_validation"`
	Email                  IdentityVerificationBreakdownV1 `json:"email"`
	Fraud                  IdentityVerificationBreakdownV1 `json:"fraud"`
	Phone                  IdentityVerificationBreakdownV1 `json:"phone"`
	Synthetic              IdentityVerificationBreakdownV1 `json:"synthetic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address                respjson.Field
		BusinessEvaluation     respjson.Field
		BusinessIdentification respjson.Field
		BusinessValidation     respjson.Field
		Email                  respjson.Field
		Fraud                  respjson.Field
		Phone                  respjson.Field
		Synthetic              respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed breakdown of the customer verification results, including decisions, risk scores, correlation score, and more.

func (CustomerReviewV1DataIdentityDetailsBreakdown) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsBreakdown) UnmarshalJSON

func (r *CustomerReviewV1DataIdentityDetailsBreakdown) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetailsKYC

type CustomerReviewV1DataIdentityDetailsKYC struct {
	// Boolean values indicating the result of each validation in the KYC process.
	Validations CustomerReviewV1DataIdentityDetailsKYCValidations `json:"validations" api:"required"`
	// List of specific result codes from the KYC screening process.
	Codes []string `json:"codes" api:"nullable"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Validations respjson.Field
		Codes       respjson.Field
		Decision    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsKYC) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsKYC) UnmarshalJSON

func (r *CustomerReviewV1DataIdentityDetailsKYC) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetailsKYCValidations

type CustomerReviewV1DataIdentityDetailsKYCValidations struct {
	Address   bool `json:"address"`
	City      bool `json:"city"`
	Dob       bool `json:"dob"`
	Email     bool `json:"email"`
	FirstName bool `json:"first_name"`
	LastName  bool `json:"last_name"`
	Phone     bool `json:"phone"`
	Ssn       bool `json:"ssn"`
	State     bool `json:"state"`
	Zip       bool `json:"zip"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address     respjson.Field
		City        respjson.Field
		Dob         respjson.Field
		Email       respjson.Field
		FirstName   respjson.Field
		LastName    respjson.Field
		Phone       respjson.Field
		Ssn         respjson.Field
		State       respjson.Field
		Zip         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Boolean values indicating the result of each validation in the KYC process.

func (CustomerReviewV1DataIdentityDetailsKYCValidations) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsKYCValidations) UnmarshalJSON

type CustomerReviewV1DataIdentityDetailsNetworkAlerts

type CustomerReviewV1DataIdentityDetailsNetworkAlerts struct {
	// Any alerts or flags raised during the consortium alert screening.
	Alerts []string `json:"alerts" api:"nullable"`
	// List of specific result codes from the consortium alert screening.
	Codes []string `json:"codes" api:"nullable"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Alerts      respjson.Field
		Codes       respjson.Field
		Decision    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsNetworkAlerts) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsNetworkAlerts) UnmarshalJSON

type CustomerReviewV1DataIdentityDetailsReputation

type CustomerReviewV1DataIdentityDetailsReputation struct {
	// Specific codes related to the Straddle reputation screening results.
	Codes []string `json:"codes" api:"nullable"`
	// Any of "accept", "reject", "review".
	Decision  string                                                `json:"decision"`
	Insights  CustomerReviewV1DataIdentityDetailsReputationInsights `json:"insights"`
	RiskScore float64                                               `json:"risk_score" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Decision    respjson.Field
		Insights    respjson.Field
		RiskScore   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsReputation) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsReputation) UnmarshalJSON

func (r *CustomerReviewV1DataIdentityDetailsReputation) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetailsReputationInsights

type CustomerReviewV1DataIdentityDetailsReputationInsights struct {
	AccountsActiveCount                 int64       `json:"accounts_active_count" api:"nullable"`
	AccountsClosedCount                 int64       `json:"accounts_closed_count" api:"nullable"`
	AccountsClosedDates                 []time.Time `json:"accounts_closed_dates" api:"nullable" format:"date"`
	AccountsCount                       int64       `json:"accounts_count" api:"nullable"`
	AccountsFraudCount                  int64       `json:"accounts_fraud_count" api:"nullable"`
	AccountsFraudLabeledDates           []time.Time `json:"accounts_fraud_labeled_dates" api:"nullable" format:"date"`
	AccountsFraudLossTotalAmount        float64     `json:"accounts_fraud_loss_total_amount" api:"nullable"`
	ACHFraudTransactionsCount           int64       `json:"ach_fraud_transactions_count" api:"nullable"`
	ACHFraudTransactionsDates           []time.Time `json:"ach_fraud_transactions_dates" api:"nullable" format:"date"`
	ACHFraudTransactionsTotalAmount     float64     `json:"ach_fraud_transactions_total_amount" api:"nullable"`
	ACHReturnedTransactionsCount        int64       `json:"ach_returned_transactions_count" api:"nullable"`
	ACHReturnedTransactionsDates        []time.Time `json:"ach_returned_transactions_dates" api:"nullable" format:"date"`
	ACHReturnedTransactionsTotalAmount  float64     `json:"ach_returned_transactions_total_amount" api:"nullable"`
	ApplicationsApprovedCount           int64       `json:"applications_approved_count" api:"nullable"`
	ApplicationsCount                   int64       `json:"applications_count" api:"nullable"`
	ApplicationsDates                   []time.Time `json:"applications_dates" api:"nullable" format:"date"`
	ApplicationsDeclinedCount           int64       `json:"applications_declined_count" api:"nullable"`
	ApplicationsFraudCount              int64       `json:"applications_fraud_count" api:"nullable"`
	CardDisputedTransactionsCount       int64       `json:"card_disputed_transactions_count" api:"nullable"`
	CardDisputedTransactionsDates       []time.Time `json:"card_disputed_transactions_dates" api:"nullable" format:"date"`
	CardDisputedTransactionsTotalAmount float64     `json:"card_disputed_transactions_total_amount" api:"nullable"`
	CardFraudTransactionsCount          int64       `json:"card_fraud_transactions_count" api:"nullable"`
	CardFraudTransactionsDates          []time.Time `json:"card_fraud_transactions_dates" api:"nullable" format:"date"`
	CardFraudTransactionsTotalAmount    float64     `json:"card_fraud_transactions_total_amount" api:"nullable"`
	CardStoppedTransactionsCount        int64       `json:"card_stopped_transactions_count" api:"nullable"`
	CardStoppedTransactionsDates        []time.Time `json:"card_stopped_transactions_dates" api:"nullable" format:"date"`
	UserActiveProfileCount              int64       `json:"user_active_profile_count" api:"nullable"`
	UserAddressCount                    int64       `json:"user_address_count" api:"nullable"`
	UserClosedProfileCount              int64       `json:"user_closed_profile_count" api:"nullable"`
	UserDobCount                        int64       `json:"user_dob_count" api:"nullable"`
	UserEmailCount                      int64       `json:"user_email_count" api:"nullable"`
	UserInstitutionCount                int64       `json:"user_institution_count" api:"nullable"`
	UserMobileCount                     int64       `json:"user_mobile_count" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountsActiveCount                 respjson.Field
		AccountsClosedCount                 respjson.Field
		AccountsClosedDates                 respjson.Field
		AccountsCount                       respjson.Field
		AccountsFraudCount                  respjson.Field
		AccountsFraudLabeledDates           respjson.Field
		AccountsFraudLossTotalAmount        respjson.Field
		ACHFraudTransactionsCount           respjson.Field
		ACHFraudTransactionsDates           respjson.Field
		ACHFraudTransactionsTotalAmount     respjson.Field
		ACHReturnedTransactionsCount        respjson.Field
		ACHReturnedTransactionsDates        respjson.Field
		ACHReturnedTransactionsTotalAmount  respjson.Field
		ApplicationsApprovedCount           respjson.Field
		ApplicationsCount                   respjson.Field
		ApplicationsDates                   respjson.Field
		ApplicationsDeclinedCount           respjson.Field
		ApplicationsFraudCount              respjson.Field
		CardDisputedTransactionsCount       respjson.Field
		CardDisputedTransactionsDates       respjson.Field
		CardDisputedTransactionsTotalAmount respjson.Field
		CardFraudTransactionsCount          respjson.Field
		CardFraudTransactionsDates          respjson.Field
		CardFraudTransactionsTotalAmount    respjson.Field
		CardStoppedTransactionsCount        respjson.Field
		CardStoppedTransactionsDates        respjson.Field
		UserActiveProfileCount              respjson.Field
		UserAddressCount                    respjson.Field
		UserClosedProfileCount              respjson.Field
		UserDobCount                        respjson.Field
		UserEmailCount                      respjson.Field
		UserInstitutionCount                respjson.Field
		UserMobileCount                     respjson.Field
		ExtraFields                         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsReputationInsights) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsReputationInsights) UnmarshalJSON

type CustomerReviewV1DataIdentityDetailsWatchList

type CustomerReviewV1DataIdentityDetailsWatchList struct {
	// Specific codes related to the Straddle watchlist screening results.
	Codes []string `json:"codes" api:"nullable"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision"`
	// Information about any matches found during screening.
	Matched []string `json:"matched" api:"nullable"`
	// Information about any matches found during screening.
	Matches []CustomerReviewV1DataIdentityDetailsWatchListMatch `json:"matches" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Decision    respjson.Field
		Matched     respjson.Field
		Matches     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsWatchList) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsWatchList) UnmarshalJSON

func (r *CustomerReviewV1DataIdentityDetailsWatchList) UnmarshalJSON(data []byte) error

type CustomerReviewV1DataIdentityDetailsWatchListMatch

type CustomerReviewV1DataIdentityDetailsWatchListMatch struct {
	// Any of "low_confidence", "potential_match", "likely_match", "high_confidence".
	Correlation string `json:"correlation" api:"required"`
	// The name of the list the match was found.
	ListName string `json:"list_name" api:"required"`
	// Data fields that matched.
	MatchFields []string `json:"match_fields" api:"required"`
	// Relevent Urls to review.
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Correlation respjson.Field
		ListName    respjson.Field
		MatchFields respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerReviewV1DataIdentityDetailsWatchListMatch) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerReviewV1DataIdentityDetailsWatchListMatch) UnmarshalJSON

type CustomerReviewV1ResponseType

type CustomerReviewV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	CustomerReviewV1ResponseTypeObject CustomerReviewV1ResponseType = "object"
	CustomerReviewV1ResponseTypeArray  CustomerReviewV1ResponseType = "array"
	CustomerReviewV1ResponseTypeError  CustomerReviewV1ResponseType = "error"
	CustomerReviewV1ResponseTypeNone   CustomerReviewV1ResponseType = "none"
)

type CustomerService

type CustomerService struct {

	// Customers represent the end users who send or receive payments through your
	// integration. Each customer undergoes automatic identity verification and fraud
	// screening upon creation. Use customers to track payment history, manage bank
	// account connections, and maintain a secure record of all transactions associated
	// with a user. Customers can be either individuals or businesses with appropriate
	// compliance checks for each type.
	Review CustomerReviewService
	// contains filtered or unexported fields
}

Customers represent the end users who send or receive payments through your integration. Each customer undergoes automatic identity verification and fraud screening upon creation. Use customers to track payment history, manage bank account connections, and maintain a secure record of all transactions associated with a user. Customers can be either individuals or businesses with appropriate compliance checks for each type.

CustomerService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerService method instead.

func NewCustomerService

func NewCustomerService(opts ...option.RequestOption) (r CustomerService)

NewCustomerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerService) Delete

func (r *CustomerService) Delete(ctx context.Context, id string, body CustomerDeleteParams, opts ...option.RequestOption) (res *CustomerV1, err error)

Permanently removes a customer record from Straddle. This action cannot be undone and should only be used to satisfy regulatory requirements or for privacy compliance.

func (*CustomerService) Get

func (r *CustomerService) Get(ctx context.Context, id string, query CustomerGetParams, opts ...option.RequestOption) (res *CustomerV1, err error)

Retrieves the details of an existing customer. Supply the unique customer ID that was returned from your 'create customer' request, and Straddle will return the corresponding customer information.

func (*CustomerService) List

Lists or searches customers connected to your account. All supported query parameters are optional. If none are provided, the response will include all customers connected to your account. This endpoint supports advanced sorting and filtering options.

func (*CustomerService) ListAutoPaging

Lists or searches customers connected to your account. All supported query parameters are optional. If none are provided, the response will include all customers connected to your account. This endpoint supports advanced sorting and filtering options.

func (*CustomerService) New

func (r *CustomerService) New(ctx context.Context, params CustomerNewParams, opts ...option.RequestOption) (res *CustomerV1, err error)

Creates a new customer record and automatically initiates identity, fraud, and risk assessment scores. This endpoint allows you to create a customer profile and associate it with paykeys and payments.

func (*CustomerService) Unmasked

func (r *CustomerService) Unmasked(ctx context.Context, id string, query CustomerUnmaskedParams, opts ...option.RequestOption) (res *CustomerUnmaskedV1, err error)

Retrieves the unmasked details, including PII, of an existing customer. Supply the unique customer ID that was returned from your 'create customer' request, and Straddle will return the corresponding customer information. This endpoint needs to be enabled by Straddle and should only be used when absolutely necessary.

func (*CustomerService) Update

func (r *CustomerService) Update(ctx context.Context, id string, params CustomerUpdateParams, opts ...option.RequestOption) (res *CustomerV1, err error)

Updates an existing customer's information. This endpoint allows you to modify the customer's contact details, PII, and metadata.

type CustomerSummaryPagedV1

type CustomerSummaryPagedV1 struct {
	Data []CustomerSummaryPagedV1Data `json:"data" api:"required"`
	Meta CustomerSummaryPagedV1Meta   `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType CustomerSummaryPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerSummaryPagedV1) RawJSON

func (r CustomerSummaryPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerSummaryPagedV1) UnmarshalJSON

func (r *CustomerSummaryPagedV1) UnmarshalJSON(data []byte) error

type CustomerSummaryPagedV1Data

type CustomerSummaryPagedV1Data struct {
	// Unique identifier for the customer.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the customer record was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the individual or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format.
	Phone string `json:"phone" api:"required"`
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status string `json:"status" api:"required"`
	// Any of "individual", "business".
	Type string `json:"type" api:"required"`
	// Timestamp of the most recent update to the customer record.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Email       respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerSummaryPagedV1Data) RawJSON

func (r CustomerSummaryPagedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerSummaryPagedV1Data) UnmarshalJSON

func (r *CustomerSummaryPagedV1Data) UnmarshalJSON(data []byte) error

type CustomerSummaryPagedV1Meta

type CustomerSummaryPagedV1Meta struct {
	// Unique identifier for this API request, useful for troubleshooting.
	APIRequestID string `json:"api_request_id" api:"required" format:"uuid"`
	// Timestamp for this API request, useful for troubleshooting.
	APIRequestTimestamp time.Time `json:"api_request_timestamp" api:"required" format:"date-time"`
	// Maximum allowed page size for this endpoint.
	MaxPageSize int64 `json:"max_page_size" api:"required"`
	// Page number for paginated results.
	PageNumber int64 `json:"page_number" api:"required"`
	// Number of items per page in this response.
	PageSize int64 `json:"page_size" api:"required"`
	// The field that the results were sorted by.
	SortBy string `json:"sort_by" api:"required"`
	// Any of "asc", "desc".
	SortOrder  string `json:"sort_order" api:"required"`
	TotalItems int64  `json:"total_items" api:"required"`
	// The number of pages available.
	TotalPages int64 `json:"total_pages" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIRequestID        respjson.Field
		APIRequestTimestamp respjson.Field
		MaxPageSize         respjson.Field
		PageNumber          respjson.Field
		PageSize            respjson.Field
		SortBy              respjson.Field
		SortOrder           respjson.Field
		TotalItems          respjson.Field
		TotalPages          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerSummaryPagedV1Meta) RawJSON

func (r CustomerSummaryPagedV1Meta) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerSummaryPagedV1Meta) UnmarshalJSON

func (r *CustomerSummaryPagedV1Meta) UnmarshalJSON(data []byte) error

type CustomerSummaryPagedV1ResponseType

type CustomerSummaryPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	CustomerSummaryPagedV1ResponseTypeObject CustomerSummaryPagedV1ResponseType = "object"
	CustomerSummaryPagedV1ResponseTypeArray  CustomerSummaryPagedV1ResponseType = "array"
	CustomerSummaryPagedV1ResponseTypeError  CustomerSummaryPagedV1ResponseType = "error"
	CustomerSummaryPagedV1ResponseTypeNone   CustomerSummaryPagedV1ResponseType = "none"
)

type CustomerUnmaskedParams

type CustomerUnmaskedParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type CustomerUnmaskedV1

type CustomerUnmaskedV1 struct {
	Data CustomerUnmaskedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType CustomerUnmaskedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerUnmaskedV1) RawJSON

func (r CustomerUnmaskedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1) UnmarshalJSON

func (r *CustomerUnmaskedV1) UnmarshalJSON(data []byte) error

type CustomerUnmaskedV1Data

type CustomerUnmaskedV1Data struct {
	// Unique identifier for the customer.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the customer record was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the individual or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format.
	Phone string `json:"phone" api:"required"`
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status string `json:"status" api:"required"`
	// Any of "individual", "business".
	Type string `json:"type" api:"required"`
	// Timestamp of the most recent update to the customer record.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An object containing the customer's address. This is optional, but if provided,
	// all required fields must be present.
	Address CustomerAddressV1 `json:"address" api:"nullable"`
	// Individual PII data required to trigger Patriot Act compliant KYC verification.
	ComplianceProfile CustomerUnmaskedV1DataComplianceProfileUnion `json:"compliance_profile" api:"nullable"`
	Config            CustomerUnmaskedV1DataConfig                 `json:"config"`
	Device            DeviceUnmaskedV1                             `json:"device"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the customer in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		CreatedAt         respjson.Field
		Email             respjson.Field
		Name              respjson.Field
		Phone             respjson.Field
		Status            respjson.Field
		Type              respjson.Field
		UpdatedAt         respjson.Field
		Address           respjson.Field
		ComplianceProfile respjson.Field
		Config            respjson.Field
		Device            respjson.Field
		ExternalID        respjson.Field
		Metadata          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerUnmaskedV1Data) RawJSON

func (r CustomerUnmaskedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1Data) UnmarshalJSON

func (r *CustomerUnmaskedV1Data) UnmarshalJSON(data []byte) error

type CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile

type CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile struct {
	// Employer Identification Number (format XX-XXXXXXX). Required for Patriot
	// Act-compliant KYB verification.
	Ein string `json:"ein" api:"required"`
	// Official registered business name as listed with the IRS. This value will be
	// matched against the 'legal_business name'.
	LegalBusinessName string `json:"legal_business_name" api:"required"`
	// A list of people related to the company. Only valid where customer type is
	// 'business'.
	Representatives []CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives" api:"nullable"`
	// Official business website URL. Optional but recommended for enhanced KYB.
	Website string `json:"website" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business registration data required to trigger Patriot Act compliant KYB verification.

func (CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile) UnmarshalJSON

type CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative

type CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative struct {
	Name  string `json:"name" api:"required"`
	Email string `json:"email" api:"nullable"`
	Phone string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Email       respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative) UnmarshalJSON

type CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile

type CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile struct {
	// Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification.
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant
	// KYC verification.
	Ssn string `json:"ssn" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dob         respjson.Field
		Ssn         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Individual PII data required to trigger Patriot Act compliant KYC verification.

func (CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile) UnmarshalJSON

type CustomerUnmaskedV1DataComplianceProfileUnion

type CustomerUnmaskedV1DataComplianceProfileUnion struct {
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile].
	Dob time.Time `json:"dob"`
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile].
	Ssn string `json:"ssn"`
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile].
	Ein string `json:"ein"`
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile].
	LegalBusinessName string `json:"legal_business_name"`
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile].
	Representatives []CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives"`
	// This field is from variant
	// [CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile].
	Website string `json:"website"`
	JSON    struct {
		Dob               respjson.Field
		Ssn               respjson.Field
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CustomerUnmaskedV1DataComplianceProfileUnion contains all possible properties and values from CustomerUnmaskedV1DataComplianceProfileIndividualComplianceProfile, CustomerUnmaskedV1DataComplianceProfileBusinessComplianceProfile.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (CustomerUnmaskedV1DataComplianceProfileUnion) AsBusinessComplianceProfile

func (CustomerUnmaskedV1DataComplianceProfileUnion) AsIndividualComplianceProfile

func (CustomerUnmaskedV1DataComplianceProfileUnion) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1DataComplianceProfileUnion) UnmarshalJSON

func (r *CustomerUnmaskedV1DataComplianceProfileUnion) UnmarshalJSON(data []byte) error

type CustomerUnmaskedV1DataConfig

type CustomerUnmaskedV1DataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "verified", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerUnmaskedV1DataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerUnmaskedV1DataConfig) UnmarshalJSON

func (r *CustomerUnmaskedV1DataConfig) UnmarshalJSON(data []byte) error

type CustomerUnmaskedV1ResponseType

type CustomerUnmaskedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	CustomerUnmaskedV1ResponseTypeObject CustomerUnmaskedV1ResponseType = "object"
	CustomerUnmaskedV1ResponseTypeArray  CustomerUnmaskedV1ResponseType = "array"
	CustomerUnmaskedV1ResponseTypeError  CustomerUnmaskedV1ResponseType = "error"
	CustomerUnmaskedV1ResponseTypeNone   CustomerUnmaskedV1ResponseType = "none"
)

type CustomerUpdateParams

type CustomerUpdateParams struct {
	Device DeviceUnmaskedV1Param `json:"device,omitzero" api:"required"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// The customer's full name or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format.
	Phone string `json:"phone" api:"required"`
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status CustomerUpdateParamsStatus `json:"status,omitzero" api:"required"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID        param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// An object containing the customer's address. This is optional, but if provided,
	// all required fields must be present.
	Address CustomerAddressV1Param `json:"address,omitzero"`
	// Individual PII data required to trigger Patriot Act compliant KYC verification.
	ComplianceProfile CustomerUpdateParamsComplianceProfileUnion `json:"compliance_profile,omitzero"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the customer in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (CustomerUpdateParams) MarshalJSON

func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error)

func (*CustomerUpdateParams) UnmarshalJSON

func (r *CustomerUpdateParams) UnmarshalJSON(data []byte) error

type CustomerUpdateParamsComplianceProfileBusinessComplianceProfile

type CustomerUpdateParamsComplianceProfileBusinessComplianceProfile struct {
	// Employer Identification Number (format XX-XXXXXXX). Required for Patriot
	// Act-compliant KYB verification.
	Ein param.Opt[string] `json:"ein,omitzero" api:"required"`
	// Official registered business name as listed with the IRS. This value will be
	// matched against the 'legal_business name'.
	LegalBusinessName param.Opt[string] `json:"legal_business_name,omitzero" api:"required"`
	// Official business website URL. Optional but recommended for enhanced KYB.
	Website param.Opt[string] `json:"website,omitzero" format:"uri"`
	// A list of people related to the company. Only valid where customer type is
	// 'business'.
	Representatives []CustomerUpdateParamsComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives,omitzero"`
	// contains filtered or unexported fields
}

Business registration data required to trigger Patriot Act compliant KYB verification.

The properties Ein, LegalBusinessName are required.

func (CustomerUpdateParamsComplianceProfileBusinessComplianceProfile) MarshalJSON

func (*CustomerUpdateParamsComplianceProfileBusinessComplianceProfile) UnmarshalJSON

type CustomerUpdateParamsComplianceProfileBusinessComplianceProfileRepresentative

type CustomerUpdateParamsComplianceProfileBusinessComplianceProfileRepresentative struct {
	Name  string            `json:"name" api:"required"`
	Email param.Opt[string] `json:"email,omitzero"`
	Phone param.Opt[string] `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (CustomerUpdateParamsComplianceProfileBusinessComplianceProfileRepresentative) MarshalJSON

func (*CustomerUpdateParamsComplianceProfileBusinessComplianceProfileRepresentative) UnmarshalJSON

type CustomerUpdateParamsComplianceProfileIndividualComplianceProfile

type CustomerUpdateParamsComplianceProfileIndividualComplianceProfile struct {
	// Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification.
	Dob param.Opt[time.Time] `json:"dob,omitzero" api:"required" format:"date"`
	// Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant
	// KYC verification.
	Ssn param.Opt[string] `json:"ssn,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Individual PII data required to trigger Patriot Act compliant KYC verification.

The properties Dob, Ssn are required.

func (CustomerUpdateParamsComplianceProfileIndividualComplianceProfile) MarshalJSON

func (*CustomerUpdateParamsComplianceProfileIndividualComplianceProfile) UnmarshalJSON

type CustomerUpdateParamsComplianceProfileUnion

type CustomerUpdateParamsComplianceProfileUnion struct {
	OfIndividualComplianceProfile *CustomerUpdateParamsComplianceProfileIndividualComplianceProfile `json:",omitzero,inline"`
	OfBusinessComplianceProfile   *CustomerUpdateParamsComplianceProfileBusinessComplianceProfile   `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (CustomerUpdateParamsComplianceProfileUnion) MarshalJSON

func (*CustomerUpdateParamsComplianceProfileUnion) UnmarshalJSON

func (u *CustomerUpdateParamsComplianceProfileUnion) UnmarshalJSON(data []byte) error

type CustomerUpdateParamsStatus

type CustomerUpdateParamsStatus string
const (
	CustomerUpdateParamsStatusPending  CustomerUpdateParamsStatus = "pending"
	CustomerUpdateParamsStatusReview   CustomerUpdateParamsStatus = "review"
	CustomerUpdateParamsStatusVerified CustomerUpdateParamsStatus = "verified"
	CustomerUpdateParamsStatusInactive CustomerUpdateParamsStatus = "inactive"
	CustomerUpdateParamsStatusRejected CustomerUpdateParamsStatus = "rejected"
)

type CustomerV1

type CustomerV1 struct {
	Data CustomerV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType CustomerV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerV1) RawJSON

func (r CustomerV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerV1) UnmarshalJSON

func (r *CustomerV1) UnmarshalJSON(data []byte) error

type CustomerV1Data

type CustomerV1Data struct {
	// Unique identifier for the customer.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the customer record was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The customer's email address.
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the individual or business name.
	Name string `json:"name" api:"required"`
	// The customer's phone number in E.164 format.
	Phone string `json:"phone" api:"required"`
	// Any of "pending", "review", "verified", "inactive", "rejected".
	Status string `json:"status" api:"required"`
	// Any of "individual", "business".
	Type string `json:"type" api:"required"`
	// Timestamp of the most recent update to the customer record.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An object containing the customer's address. This is optional, but if provided,
	// all required fields must be present.
	Address CustomerAddressV1 `json:"address" api:"nullable"`
	// PII required to trigger Patriot Act compliant KYC verification.
	ComplianceProfile CustomerV1DataComplianceProfileUnion `json:"compliance_profile" api:"nullable"`
	Config            CustomerV1DataConfig                 `json:"config"`
	Device            CustomerV1DataDevice                 `json:"device"`
	// Unique identifier for the customer in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the customer in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		CreatedAt         respjson.Field
		Email             respjson.Field
		Name              respjson.Field
		Phone             respjson.Field
		Status            respjson.Field
		Type              respjson.Field
		UpdatedAt         respjson.Field
		Address           respjson.Field
		ComplianceProfile respjson.Field
		Config            respjson.Field
		Device            respjson.Field
		ExternalID        respjson.Field
		Metadata          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerV1Data) RawJSON

func (r CustomerV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerV1Data) UnmarshalJSON

func (r *CustomerV1Data) UnmarshalJSON(data []byte) error

type CustomerV1DataComplianceProfileBusinessComplianceProfile

type CustomerV1DataComplianceProfileBusinessComplianceProfile struct {
	// Masked Employer Identification Number in the format **-**\*****
	Ein string `json:"ein" api:"required"`
	// The official registered name of the business. This name should be correlated
	// with the `ein` value.
	LegalBusinessName string `json:"legal_business_name" api:"required"`
	// A list of people related to the company. Only valid where customer type is
	// 'business'.
	Representatives []CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives" api:"nullable"`
	// Official business website URL. Optional but recommended for enhanced KYB.
	Website string `json:"website" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business registration data required to trigger Patriot Act compliant KYB verification.

func (CustomerV1DataComplianceProfileBusinessComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerV1DataComplianceProfileBusinessComplianceProfile) UnmarshalJSON

type CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative

type CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative struct {
	Name  string `json:"name" api:"required"`
	Email string `json:"email" api:"nullable"`
	Phone string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Email       respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative) UnmarshalJSON

type CustomerV1DataComplianceProfileIndividualComplianceProfile

type CustomerV1DataComplianceProfileIndividualComplianceProfile struct {
	// Masked date of birth in \***\*-**-\*\* format.
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// Masked Social Security Number in the format **\*-**-\*\*\*\*.
	Ssn string `json:"ssn" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dob         respjson.Field
		Ssn         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

PII required to trigger Patriot Act compliant KYC verification.

func (CustomerV1DataComplianceProfileIndividualComplianceProfile) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerV1DataComplianceProfileIndividualComplianceProfile) UnmarshalJSON

type CustomerV1DataComplianceProfileUnion

type CustomerV1DataComplianceProfileUnion struct {
	// This field is from variant
	// [CustomerV1DataComplianceProfileIndividualComplianceProfile].
	Dob time.Time `json:"dob"`
	// This field is from variant
	// [CustomerV1DataComplianceProfileIndividualComplianceProfile].
	Ssn string `json:"ssn"`
	// This field is from variant
	// [CustomerV1DataComplianceProfileBusinessComplianceProfile].
	Ein string `json:"ein"`
	// This field is from variant
	// [CustomerV1DataComplianceProfileBusinessComplianceProfile].
	LegalBusinessName string `json:"legal_business_name"`
	// This field is from variant
	// [CustomerV1DataComplianceProfileBusinessComplianceProfile].
	Representatives []CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentative `json:"representatives"`
	// This field is from variant
	// [CustomerV1DataComplianceProfileBusinessComplianceProfile].
	Website string `json:"website"`
	JSON    struct {
		Dob               respjson.Field
		Ssn               respjson.Field
		Ein               respjson.Field
		LegalBusinessName respjson.Field
		Representatives   respjson.Field
		Website           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CustomerV1DataComplianceProfileUnion contains all possible properties and values from CustomerV1DataComplianceProfileIndividualComplianceProfile, CustomerV1DataComplianceProfileBusinessComplianceProfile.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (CustomerV1DataComplianceProfileUnion) AsBusinessComplianceProfile

func (CustomerV1DataComplianceProfileUnion) AsIndividualComplianceProfile

func (CustomerV1DataComplianceProfileUnion) RawJSON

Returns the unmodified JSON received from the API

func (*CustomerV1DataComplianceProfileUnion) UnmarshalJSON

func (r *CustomerV1DataComplianceProfileUnion) UnmarshalJSON(data []byte) error

type CustomerV1DataConfig

type CustomerV1DataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "verified", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerV1DataConfig) RawJSON

func (r CustomerV1DataConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerV1DataConfig) UnmarshalJSON

func (r *CustomerV1DataConfig) UnmarshalJSON(data []byte) error

type CustomerV1DataDevice

type CustomerV1DataDevice struct {
	// The customer's IP address at the time of profile creation. Use `0.0.0.0` to
	// represent an offline customer registration.
	IPAddress string `json:"ip_address" api:"required" format:"ipv4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CustomerV1DataDevice) RawJSON

func (r CustomerV1DataDevice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomerV1DataDevice) UnmarshalJSON

func (r *CustomerV1DataDevice) UnmarshalJSON(data []byte) error

type CustomerV1ResponseType

type CustomerV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	CustomerV1ResponseTypeObject CustomerV1ResponseType = "object"
	CustomerV1ResponseTypeArray  CustomerV1ResponseType = "array"
	CustomerV1ResponseTypeError  CustomerV1ResponseType = "error"
	CustomerV1ResponseTypeNone   CustomerV1ResponseType = "none"
)

type DeviceInfoV1

type DeviceInfoV1 = shared.DeviceInfoV1

This is an alias to an internal type.

type DeviceInfoV1Param

type DeviceInfoV1Param = shared.DeviceInfoV1Param

This is an alias to an internal type.

type DeviceUnmaskedV1

type DeviceUnmaskedV1 struct {
	// The customer's IP address at the time of profile creation. Use `0.0.0.0` to
	// represent an offline customer registration.
	IPAddress string `json:"ip_address" api:"required" format:"ipv4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeviceUnmaskedV1) RawJSON

func (r DeviceUnmaskedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (DeviceUnmaskedV1) ToParam

ToParam converts this DeviceUnmaskedV1 to a DeviceUnmaskedV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DeviceUnmaskedV1Param.Overrides()

func (*DeviceUnmaskedV1) UnmarshalJSON

func (r *DeviceUnmaskedV1) UnmarshalJSON(data []byte) error

type DeviceUnmaskedV1Param

type DeviceUnmaskedV1Param struct {
	// The customer's IP address at the time of profile creation. Use `0.0.0.0` to
	// represent an offline customer registration.
	IPAddress string `json:"ip_address" api:"required" format:"ipv4"`
	// contains filtered or unexported fields
}

The property IPAddress is required.

func (DeviceUnmaskedV1Param) MarshalJSON

func (r DeviceUnmaskedV1Param) MarshalJSON() (data []byte, err error)

func (*DeviceUnmaskedV1Param) UnmarshalJSON

func (r *DeviceUnmaskedV1Param) UnmarshalJSON(data []byte) error

type EmbedAccountCapabilityRequestListParams

type EmbedAccountCapabilityRequestListParams struct {
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Page size.Max value: 1000
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Sort By.
	SortBy        param.Opt[string] `query:"sort_by,omitzero" json:"-"`
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Filter capability requests by category.
	//
	// Any of "payment_type", "customer_type", "consent_type".
	Category EmbedAccountCapabilityRequestListParamsCategory `query:"category,omitzero" json:"-"`
	// Sort Order.
	//
	// Any of "asc", "desc".
	SortOrder EmbedAccountCapabilityRequestListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// Filter capability requests by their current status.
	//
	// Any of "active", "inactive", "in_review", "rejected".
	Status EmbedAccountCapabilityRequestListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter capability requests by the specific type of capability.
	//
	// Any of "charges", "payouts", "individuals", "businesses", "signed_agreement",
	// "internet".
	Type EmbedAccountCapabilityRequestListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedAccountCapabilityRequestListParams) URLQuery

URLQuery serializes EmbedAccountCapabilityRequestListParams's query parameters as `url.Values`.

type EmbedAccountCapabilityRequestListParamsCategory

type EmbedAccountCapabilityRequestListParamsCategory string

Filter capability requests by category.

const (
	EmbedAccountCapabilityRequestListParamsCategoryPaymentType  EmbedAccountCapabilityRequestListParamsCategory = "payment_type"
	EmbedAccountCapabilityRequestListParamsCategoryCustomerType EmbedAccountCapabilityRequestListParamsCategory = "customer_type"
	EmbedAccountCapabilityRequestListParamsCategoryConsentType  EmbedAccountCapabilityRequestListParamsCategory = "consent_type"
)

type EmbedAccountCapabilityRequestListParamsSortOrder

type EmbedAccountCapabilityRequestListParamsSortOrder string

Sort Order.

const (
	EmbedAccountCapabilityRequestListParamsSortOrderAsc  EmbedAccountCapabilityRequestListParamsSortOrder = "asc"
	EmbedAccountCapabilityRequestListParamsSortOrderDesc EmbedAccountCapabilityRequestListParamsSortOrder = "desc"
)

type EmbedAccountCapabilityRequestListParamsStatus

type EmbedAccountCapabilityRequestListParamsStatus string

Filter capability requests by their current status.

const (
	EmbedAccountCapabilityRequestListParamsStatusActive   EmbedAccountCapabilityRequestListParamsStatus = "active"
	EmbedAccountCapabilityRequestListParamsStatusInactive EmbedAccountCapabilityRequestListParamsStatus = "inactive"
	EmbedAccountCapabilityRequestListParamsStatusInReview EmbedAccountCapabilityRequestListParamsStatus = "in_review"
	EmbedAccountCapabilityRequestListParamsStatusRejected EmbedAccountCapabilityRequestListParamsStatus = "rejected"
)

type EmbedAccountCapabilityRequestListParamsType

type EmbedAccountCapabilityRequestListParamsType string

Filter capability requests by the specific type of capability.

const (
	EmbedAccountCapabilityRequestListParamsTypeCharges         EmbedAccountCapabilityRequestListParamsType = "charges"
	EmbedAccountCapabilityRequestListParamsTypePayouts         EmbedAccountCapabilityRequestListParamsType = "payouts"
	EmbedAccountCapabilityRequestListParamsTypeIndividuals     EmbedAccountCapabilityRequestListParamsType = "individuals"
	EmbedAccountCapabilityRequestListParamsTypeBusinesses      EmbedAccountCapabilityRequestListParamsType = "businesses"
	EmbedAccountCapabilityRequestListParamsTypeSignedAgreement EmbedAccountCapabilityRequestListParamsType = "signed_agreement"
	EmbedAccountCapabilityRequestListParamsTypeInternet        EmbedAccountCapabilityRequestListParamsType = "internet"
)

type EmbedAccountCapabilityRequestNewParams

type EmbedAccountCapabilityRequestNewParams struct {
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Allows the account to accept payments from businesses.
	Businesses EmbedAccountCapabilityRequestNewParamsBusinesses `json:"businesses,omitzero"`
	// The charges capability settings for the account.
	Charges EmbedAccountCapabilityRequestNewParamsCharges `json:"charges,omitzero"`
	// Allows the account to accept payments from individuals.
	Individuals EmbedAccountCapabilityRequestNewParamsIndividuals `json:"individuals,omitzero"`
	// Allows the account to accept payments authorized via the internet or mobile
	// applications.
	Internet EmbedAccountCapabilityRequestNewParamsInternet `json:"internet,omitzero"`
	// The payouts capability settings for the account.
	Payouts EmbedAccountCapabilityRequestNewParamsPayouts `json:"payouts,omitzero"`
	// Allows the account to accept payments authorized by signed agreements or
	// contracts.
	SignedAgreement EmbedAccountCapabilityRequestNewParamsSignedAgreement `json:"signed_agreement,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedAccountCapabilityRequestNewParams) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParams) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParams) UnmarshalJSON

func (r *EmbedAccountCapabilityRequestNewParams) UnmarshalJSON(data []byte) error

type EmbedAccountCapabilityRequestNewParamsBusinesses

type EmbedAccountCapabilityRequestNewParamsBusinesses struct {
	Enable bool `json:"enable" api:"required"`
	// contains filtered or unexported fields
}

Allows the account to accept payments from businesses.

The property Enable is required.

func (EmbedAccountCapabilityRequestNewParamsBusinesses) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParamsBusinesses) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParamsBusinesses) UnmarshalJSON

type EmbedAccountCapabilityRequestNewParamsCharges

type EmbedAccountCapabilityRequestNewParamsCharges struct {
	// The maximum dollar amount of charges in a calendar day.
	DailyAmount float64 `json:"daily_amount" api:"required"`
	// Determines whether `charges` are enabled for the account.
	Enable bool `json:"enable" api:"required"`
	// The maximum amount of a single charge.
	MaxAmount float64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of charges in a calendar month.
	MonthlyAmount float64 `json:"monthly_amount" api:"required"`
	// The maximum number of charges in a calendar month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// contains filtered or unexported fields
}

The charges capability settings for the account.

The properties DailyAmount, Enable, MaxAmount, MonthlyAmount, MonthlyCount are required.

func (EmbedAccountCapabilityRequestNewParamsCharges) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParamsCharges) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParamsCharges) UnmarshalJSON

func (r *EmbedAccountCapabilityRequestNewParamsCharges) UnmarshalJSON(data []byte) error

type EmbedAccountCapabilityRequestNewParamsIndividuals

type EmbedAccountCapabilityRequestNewParamsIndividuals struct {
	Enable bool `json:"enable" api:"required"`
	// contains filtered or unexported fields
}

Allows the account to accept payments from individuals.

The property Enable is required.

func (EmbedAccountCapabilityRequestNewParamsIndividuals) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParamsIndividuals) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParamsIndividuals) UnmarshalJSON

type EmbedAccountCapabilityRequestNewParamsInternet

type EmbedAccountCapabilityRequestNewParamsInternet struct {
	Enable bool `json:"enable" api:"required"`
	// contains filtered or unexported fields
}

Allows the account to accept payments authorized via the internet or mobile applications.

The property Enable is required.

func (EmbedAccountCapabilityRequestNewParamsInternet) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParamsInternet) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParamsInternet) UnmarshalJSON

type EmbedAccountCapabilityRequestNewParamsPayouts

type EmbedAccountCapabilityRequestNewParamsPayouts struct {
	// The maximum dollar amount of payouts in a day.
	DailyAmount float64 `json:"daily_amount" api:"required"`
	// Determines whether `payouts` are enabled for the account.
	Enable bool `json:"enable" api:"required"`
	// The maximum amount of a single payout.
	MaxAmount float64 `json:"max_amount" api:"required"`
	// The maximum dollar amount of payouts in a month.
	MonthlyAmount float64 `json:"monthly_amount" api:"required"`
	// The maximum number of payouts in a month.
	MonthlyCount int64 `json:"monthly_count" api:"required"`
	// contains filtered or unexported fields
}

The payouts capability settings for the account.

The properties DailyAmount, Enable, MaxAmount, MonthlyAmount, MonthlyCount are required.

func (EmbedAccountCapabilityRequestNewParamsPayouts) MarshalJSON

func (r EmbedAccountCapabilityRequestNewParamsPayouts) MarshalJSON() (data []byte, err error)

func (*EmbedAccountCapabilityRequestNewParamsPayouts) UnmarshalJSON

func (r *EmbedAccountCapabilityRequestNewParamsPayouts) UnmarshalJSON(data []byte) error

type EmbedAccountCapabilityRequestNewParamsSignedAgreement

type EmbedAccountCapabilityRequestNewParamsSignedAgreement struct {
	Enable bool `json:"enable" api:"required"`
	// contains filtered or unexported fields
}

Allows the account to accept payments authorized by signed agreements or contracts.

The property Enable is required.

func (EmbedAccountCapabilityRequestNewParamsSignedAgreement) MarshalJSON

func (*EmbedAccountCapabilityRequestNewParamsSignedAgreement) UnmarshalJSON

type EmbedAccountCapabilityRequestService

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

Capabilities enable specific features and services for an Account. Use capability requests to unlock higher processing limits, new payment types, or additional platform features as your users' businesses grow. Track approval status and manage documentation requirements through a single interface.

EmbedAccountCapabilityRequestService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedAccountCapabilityRequestService method instead.

func NewEmbedAccountCapabilityRequestService

func NewEmbedAccountCapabilityRequestService(opts ...option.RequestOption) (r EmbedAccountCapabilityRequestService)

NewEmbedAccountCapabilityRequestService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbedAccountCapabilityRequestService) List

Retrieves a list of capability requests associated with an account. The requests are returned sorted by creation date, with the most recent requests appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedAccountCapabilityRequestService) ListAutoPaging

Retrieves a list of capability requests associated with an account. The requests are returned sorted by creation date, with the most recent requests appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedAccountCapabilityRequestService) New

Submits a request to enable a specific capability for an account. Use this endpoint to request additional features or services for an account.

type EmbedAccountGetParams

type EmbedAccountGetParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedAccountListParams

type EmbedAccountListParams struct {
	// Results page number. Starts at page 1. Default value: 1
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Page size. Default value: 100. Max value: 1000
	PageSize   param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	SearchText param.Opt[string] `query:"search_text,omitzero" json:"-"`
	// Sort By. Default value: 'id'.
	SortBy        param.Opt[string] `query:"sort_by,omitzero" json:"-"`
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Sort Order. Default value: 'asc'.
	//
	// Any of "asc", "desc".
	SortOrder EmbedAccountListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// Any of "created", "onboarding", "active", "rejected", "inactive".
	Status EmbedAccountListParamsStatus `query:"status,omitzero" json:"-"`
	// Any of "business".
	Type EmbedAccountListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedAccountListParams) URLQuery

func (r EmbedAccountListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmbedAccountListParams's query parameters as `url.Values`.

type EmbedAccountListParamsSortOrder

type EmbedAccountListParamsSortOrder string

Sort Order. Default value: 'asc'.

const (
	EmbedAccountListParamsSortOrderAsc  EmbedAccountListParamsSortOrder = "asc"
	EmbedAccountListParamsSortOrderDesc EmbedAccountListParamsSortOrder = "desc"
)

type EmbedAccountListParamsStatus

type EmbedAccountListParamsStatus string
const (
	EmbedAccountListParamsStatusCreated    EmbedAccountListParamsStatus = "created"
	EmbedAccountListParamsStatusOnboarding EmbedAccountListParamsStatus = "onboarding"
	EmbedAccountListParamsStatusActive     EmbedAccountListParamsStatus = "active"
	EmbedAccountListParamsStatusRejected   EmbedAccountListParamsStatus = "rejected"
	EmbedAccountListParamsStatusInactive   EmbedAccountListParamsStatus = "inactive"
)

type EmbedAccountListParamsType

type EmbedAccountListParamsType string
const (
	EmbedAccountListParamsTypeBusiness EmbedAccountListParamsType = "business"
)

type EmbedAccountNewParams

type EmbedAccountNewParams struct {
	// The access level granted to the account. This is determined by your platform
	// configuration. Use `standard` unless instructed otherwise by Straddle.
	//
	// Any of "standard", "managed".
	AccessLevel EmbedAccountNewParamsAccessLevel `json:"access_level,omitzero" api:"required"`
	// The type of account to be created. Currently, only `business` is supported.
	//
	// Any of "business".
	AccountType     EmbedAccountNewParamsAccountType `json:"account_type,omitzero" api:"required"`
	BusinessProfile BusinessProfileV1Param           `json:"business_profile,omitzero" api:"required"`
	// The unique identifier of the organization related to this account.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// Unique identifier for the account in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID     param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the account in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedAccountNewParams) MarshalJSON

func (r EmbedAccountNewParams) MarshalJSON() (data []byte, err error)

func (*EmbedAccountNewParams) UnmarshalJSON

func (r *EmbedAccountNewParams) UnmarshalJSON(data []byte) error

type EmbedAccountNewParamsAccessLevel

type EmbedAccountNewParamsAccessLevel string

The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle.

const (
	EmbedAccountNewParamsAccessLevelStandard EmbedAccountNewParamsAccessLevel = "standard"
	EmbedAccountNewParamsAccessLevelManaged  EmbedAccountNewParamsAccessLevel = "managed"
)

type EmbedAccountNewParamsAccountType

type EmbedAccountNewParamsAccountType string

The type of account to be created. Currently, only `business` is supported.

const (
	EmbedAccountNewParamsAccountTypeBusiness EmbedAccountNewParamsAccountType = "business"
)

type EmbedAccountOnboardParams

type EmbedAccountOnboardParams struct {
	TermsOfService TermsOfServiceV1Param `json:"terms_of_service,omitzero" api:"required"`
	CorrelationID  param.Opt[string]     `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string]     `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string]     `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedAccountOnboardParams) MarshalJSON

func (r EmbedAccountOnboardParams) MarshalJSON() (data []byte, err error)

func (*EmbedAccountOnboardParams) UnmarshalJSON

func (r *EmbedAccountOnboardParams) UnmarshalJSON(data []byte) error

type EmbedAccountService

type EmbedAccountService struct {

	// Capabilities enable specific features and services for an Account. Use
	// capability requests to unlock higher processing limits, new payment types, or
	// additional platform features as your users' businesses grow. Track approval
	// status and manage documentation requirements through a single interface.
	CapabilityRequests EmbedAccountCapabilityRequestService
	// contains filtered or unexported fields
}

Accounts represent businesses using Straddle through your platform. Each account must complete automated verification before processing payments. Use accounts to manage your users' payment capabilities, track verification status, and control access to features. Accounts can be instantly created in sandbox and require additional verification for production access.

EmbedAccountService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedAccountService method instead.

func NewEmbedAccountService

func NewEmbedAccountService(opts ...option.RequestOption) (r EmbedAccountService)

NewEmbedAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbedAccountService) Get

func (r *EmbedAccountService) Get(ctx context.Context, accountID string, query EmbedAccountGetParams, opts ...option.RequestOption) (res *AccountV1, err error)

Retrieves the details of an account that has previously been created. Supply the unique account ID that was returned from your previous request, and Straddle will return the corresponding account information.

func (*EmbedAccountService) List

Returns a list of accounts associated with your Straddle platform integration. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedAccountService) ListAutoPaging

Returns a list of accounts associated with your Straddle platform integration. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedAccountService) New

Creates a new account associated with your Straddle platform integration. This endpoint allows you to set up an account with specified details, including business information and access levels.

func (*EmbedAccountService) Onboard

func (r *EmbedAccountService) Onboard(ctx context.Context, accountID string, params EmbedAccountOnboardParams, opts ...option.RequestOption) (res *AccountV1, err error)

Initiates the onboarding process for a new account. This endpoint can only be used for accounts where at least one representative and one bank account have already been created.

func (*EmbedAccountService) Simulate

func (r *EmbedAccountService) Simulate(ctx context.Context, accountID string, params EmbedAccountSimulateParams, opts ...option.RequestOption) (res *AccountV1, err error)

Simulate the status transitions for sandbox accounts. This endpoint can only be used for sandbox accounts.

func (*EmbedAccountService) Update

func (r *EmbedAccountService) Update(ctx context.Context, accountID string, params EmbedAccountUpdateParams, opts ...option.RequestOption) (res *AccountV1, err error)

Updates an existing account's information. This endpoint allows you to update various account details during onboarding or after the account has been created.

type EmbedAccountSimulateParams

type EmbedAccountSimulateParams struct {
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Any of "onboarding", "active".
	FinalStatus EmbedAccountSimulateParamsFinalStatus `query:"final_status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedAccountSimulateParams) URLQuery

func (r EmbedAccountSimulateParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmbedAccountSimulateParams's query parameters as `url.Values`.

type EmbedAccountSimulateParamsFinalStatus

type EmbedAccountSimulateParamsFinalStatus string
const (
	EmbedAccountSimulateParamsFinalStatusOnboarding EmbedAccountSimulateParamsFinalStatus = "onboarding"
	EmbedAccountSimulateParamsFinalStatusActive     EmbedAccountSimulateParamsFinalStatus = "active"
)

type EmbedAccountUpdateParams

type EmbedAccountUpdateParams struct {
	BusinessProfile BusinessProfileV1Param `json:"business_profile,omitzero" api:"required"`
	// Unique identifier for the account in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID     param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the account in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedAccountUpdateParams) MarshalJSON

func (r EmbedAccountUpdateParams) MarshalJSON() (data []byte, err error)

func (*EmbedAccountUpdateParams) UnmarshalJSON

func (r *EmbedAccountUpdateParams) UnmarshalJSON(data []byte) error

type EmbedLinkedBankAccountCancelParams

type EmbedLinkedBankAccountCancelParams struct {
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedLinkedBankAccountGetParams

type EmbedLinkedBankAccountGetParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedLinkedBankAccountListParams

type EmbedLinkedBankAccountListParams struct {
	// The unique identifier of the related account.
	AccountID param.Opt[string] `query:"account_id,omitzero" format:"uuid" json:"-"`
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Page size. Max value: 1000
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Sort By.
	SortBy        param.Opt[string] `query:"sort_by,omitzero" json:"-"`
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Any of "account", "platform".
	Level EmbedLinkedBankAccountListParamsLevel `query:"level,omitzero" json:"-"`
	// The purpose of the linked bank accounts to return. Possible values: 'charges',
	// 'payouts', 'billing'.
	//
	// Any of "charges", "payouts", "billing".
	Purpose EmbedLinkedBankAccountListParamsPurpose `query:"purpose,omitzero" json:"-"`
	// Sort Order.
	//
	// Any of "asc", "desc".
	SortOrder EmbedLinkedBankAccountListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// The status of the linked bank accounts to return. Possible values: 'created',
	// 'onboarding', 'active', 'inactive', 'rejected'.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive", "canceled".
	Status EmbedLinkedBankAccountListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedLinkedBankAccountListParams) URLQuery

func (r EmbedLinkedBankAccountListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmbedLinkedBankAccountListParams's query parameters as `url.Values`.

type EmbedLinkedBankAccountListParamsLevel

type EmbedLinkedBankAccountListParamsLevel string
const (
	EmbedLinkedBankAccountListParamsLevelAccount  EmbedLinkedBankAccountListParamsLevel = "account"
	EmbedLinkedBankAccountListParamsLevelPlatform EmbedLinkedBankAccountListParamsLevel = "platform"
)

type EmbedLinkedBankAccountListParamsPurpose

type EmbedLinkedBankAccountListParamsPurpose string

The purpose of the linked bank accounts to return. Possible values: 'charges', 'payouts', 'billing'.

const (
	EmbedLinkedBankAccountListParamsPurposeCharges EmbedLinkedBankAccountListParamsPurpose = "charges"
	EmbedLinkedBankAccountListParamsPurposePayouts EmbedLinkedBankAccountListParamsPurpose = "payouts"
	EmbedLinkedBankAccountListParamsPurposeBilling EmbedLinkedBankAccountListParamsPurpose = "billing"
)

type EmbedLinkedBankAccountListParamsSortOrder

type EmbedLinkedBankAccountListParamsSortOrder string

Sort Order.

const (
	EmbedLinkedBankAccountListParamsSortOrderAsc  EmbedLinkedBankAccountListParamsSortOrder = "asc"
	EmbedLinkedBankAccountListParamsSortOrderDesc EmbedLinkedBankAccountListParamsSortOrder = "desc"
)

type EmbedLinkedBankAccountListParamsStatus

type EmbedLinkedBankAccountListParamsStatus string

The status of the linked bank accounts to return. Possible values: 'created', 'onboarding', 'active', 'inactive', 'rejected'.

const (
	EmbedLinkedBankAccountListParamsStatusCreated    EmbedLinkedBankAccountListParamsStatus = "created"
	EmbedLinkedBankAccountListParamsStatusOnboarding EmbedLinkedBankAccountListParamsStatus = "onboarding"
	EmbedLinkedBankAccountListParamsStatusActive     EmbedLinkedBankAccountListParamsStatus = "active"
	EmbedLinkedBankAccountListParamsStatusRejected   EmbedLinkedBankAccountListParamsStatus = "rejected"
	EmbedLinkedBankAccountListParamsStatusInactive   EmbedLinkedBankAccountListParamsStatus = "inactive"
	EmbedLinkedBankAccountListParamsStatusCanceled   EmbedLinkedBankAccountListParamsStatus = "canceled"
)

type EmbedLinkedBankAccountNewParams

type EmbedLinkedBankAccountNewParams struct {
	// The unique identifier of the Straddle account to associate this bank account
	// with.
	AccountID   param.Opt[string]                          `json:"account_id,omitzero" api:"required" format:"uuid"`
	BankAccount EmbedLinkedBankAccountNewParamsBankAccount `json:"bank_account,omitzero" api:"required"`
	// Optional description for the bank account.
	Description param.Opt[string] `json:"description,omitzero"`
	// The unique identifier of the Straddle Platform to associate this bank account
	// with.
	PlatformID     param.Opt[string] `json:"platform_id,omitzero" format:"uuid"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the linked bank account in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// The purposes for the linked bank account.
	//
	// Any of "charges", "payouts", "billing".
	Purposes []string `json:"purposes,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedLinkedBankAccountNewParams) MarshalJSON

func (r EmbedLinkedBankAccountNewParams) MarshalJSON() (data []byte, err error)

func (*EmbedLinkedBankAccountNewParams) UnmarshalJSON

func (r *EmbedLinkedBankAccountNewParams) UnmarshalJSON(data []byte) error

type EmbedLinkedBankAccountNewParamsBankAccount

type EmbedLinkedBankAccountNewParamsBankAccount struct {
	// The name of the account holder as it appears on the bank account. Typically,
	// this is the legal name of the business associated with the account.
	AccountHolder string `json:"account_holder" api:"required"`
	// The bank account number.
	AccountNumber string `json:"account_number" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// contains filtered or unexported fields
}

The properties AccountHolder, AccountNumber, RoutingNumber are required.

func (EmbedLinkedBankAccountNewParamsBankAccount) MarshalJSON

func (r EmbedLinkedBankAccountNewParamsBankAccount) MarshalJSON() (data []byte, err error)

func (*EmbedLinkedBankAccountNewParamsBankAccount) UnmarshalJSON

func (r *EmbedLinkedBankAccountNewParamsBankAccount) UnmarshalJSON(data []byte) error

type EmbedLinkedBankAccountService

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

Linked bank accounts connect your platform users' external bank accounts to Straddle for settlements and payment funding. Each linked account undergoes automated verification and continuous monitoring. Use linked accounts to manage where clients receive deposits, fund payouts, and track settlement preferences.

EmbedLinkedBankAccountService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedLinkedBankAccountService method instead.

func NewEmbedLinkedBankAccountService

func NewEmbedLinkedBankAccountService(opts ...option.RequestOption) (r EmbedLinkedBankAccountService)

NewEmbedLinkedBankAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbedLinkedBankAccountService) Cancel

Cancels an existing linked bank account. This can be used to cancel a linked bank account before it has been reviewed. The linked bank account must be in 'created' status.

func (*EmbedLinkedBankAccountService) Get

Retrieves the details of a linked bank account that has previously been created. Supply the unique linked bank account `id`, and Straddle will return the corresponding information. The response includes masked account details for security purposes.

func (*EmbedLinkedBankAccountService) List

Returns a list of bank accounts associated with a specific Straddle account. The linked bank accounts are returned sorted by creation date, with the most recently created appearing first. This endpoint supports pagination to handle accounts with multiple linked bank accounts.

func (*EmbedLinkedBankAccountService) ListAutoPaging

Returns a list of bank accounts associated with a specific Straddle account. The linked bank accounts are returned sorted by creation date, with the most recently created appearing first. This endpoint supports pagination to handle accounts with multiple linked bank accounts.

func (*EmbedLinkedBankAccountService) New

Creates a new linked bank account associated with a Straddle account. This endpoint allows you to associate external bank accounts with a Straddle account for various payment operations such as payment deposits, payout withdrawals, and more.

func (*EmbedLinkedBankAccountService) Unmask

Retrieves the unmasked details of a linked bank account that has previously been created. Supply the unique linked bank account `id`, and Straddle will return the corresponding information, including sensitive details. This endpoint needs to be enabled by Straddle for your account and should only be used when absolutely necessary.

func (*EmbedLinkedBankAccountService) Update

Updates an existing linked bank account's information. This can be used to update account details during onboarding or to update metadata associated with the linked account. The linked bank account must be in 'created' or 'onboarding' status.

type EmbedLinkedBankAccountUnmaskParams

type EmbedLinkedBankAccountUnmaskParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedLinkedBankAccountUpdateParams

type EmbedLinkedBankAccountUpdateParams struct {
	BankAccount    EmbedLinkedBankAccountUpdateParamsBankAccount `json:"bank_account,omitzero" api:"required"`
	CorrelationID  param.Opt[string]                             `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string]                             `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string]                             `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the linked bank account in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedLinkedBankAccountUpdateParams) MarshalJSON

func (r EmbedLinkedBankAccountUpdateParams) MarshalJSON() (data []byte, err error)

func (*EmbedLinkedBankAccountUpdateParams) UnmarshalJSON

func (r *EmbedLinkedBankAccountUpdateParams) UnmarshalJSON(data []byte) error

type EmbedLinkedBankAccountUpdateParamsBankAccount

type EmbedLinkedBankAccountUpdateParamsBankAccount struct {
	// The name of the account holder as it appears on the bank account. Typically,
	// this is the legal name of the business associated with the account.
	AccountHolder string `json:"account_holder" api:"required"`
	// The bank account number.
	AccountNumber string `json:"account_number" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// contains filtered or unexported fields
}

The properties AccountHolder, AccountNumber, RoutingNumber are required.

func (EmbedLinkedBankAccountUpdateParamsBankAccount) MarshalJSON

func (r EmbedLinkedBankAccountUpdateParamsBankAccount) MarshalJSON() (data []byte, err error)

func (*EmbedLinkedBankAccountUpdateParamsBankAccount) UnmarshalJSON

func (r *EmbedLinkedBankAccountUpdateParamsBankAccount) UnmarshalJSON(data []byte) error

type EmbedOrganizationGetParams

type EmbedOrganizationGetParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedOrganizationListParams

type EmbedOrganizationListParams struct {
	// List organizations by their external ID.
	ExternalID param.Opt[string] `query:"external_id,omitzero" json:"-"`
	// List organizations by name (partial match supported).
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Page size. Max value: 1000
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Sort By.
	SortBy        param.Opt[string] `query:"sort_by,omitzero" json:"-"`
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Sort Order.
	//
	// Any of "asc", "desc".
	SortOrder EmbedOrganizationListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedOrganizationListParams) URLQuery

func (r EmbedOrganizationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmbedOrganizationListParams's query parameters as `url.Values`.

type EmbedOrganizationListParamsSortOrder

type EmbedOrganizationListParamsSortOrder string

Sort Order.

const (
	EmbedOrganizationListParamsSortOrderAsc  EmbedOrganizationListParamsSortOrder = "asc"
	EmbedOrganizationListParamsSortOrderDesc EmbedOrganizationListParamsSortOrder = "desc"
)

type EmbedOrganizationNewParams

type EmbedOrganizationNewParams struct {
	// The name of the organization.
	Name string `json:"name" api:"required"`
	// Unique identifier for the organization in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID     param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the organization in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedOrganizationNewParams) MarshalJSON

func (r EmbedOrganizationNewParams) MarshalJSON() (data []byte, err error)

func (*EmbedOrganizationNewParams) UnmarshalJSON

func (r *EmbedOrganizationNewParams) UnmarshalJSON(data []byte) error

type EmbedOrganizationService

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

Organizations are a powerful feature in Straddle that allow you to manage multiple accounts under a single umbrella. This hierarchical structure is particularly useful for businesses with complex operations, multiple departments, or legally related entities.

EmbedOrganizationService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedOrganizationService method instead.

func NewEmbedOrganizationService

func NewEmbedOrganizationService(opts ...option.RequestOption) (r EmbedOrganizationService)

NewEmbedOrganizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbedOrganizationService) Get

func (r *EmbedOrganizationService) Get(ctx context.Context, organizationID string, query EmbedOrganizationGetParams, opts ...option.RequestOption) (res *OrganizationV1, err error)

Retrieves the details of an Organization that has previously been created. Supply the unique organization ID that was returned from your previous request, and Straddle will return the corresponding organization information.

func (*EmbedOrganizationService) List

Retrieves a list of organizations associated with your Straddle integration. The organizations are returned sorted by creation date, with the most recently created organizations appearing first. This endpoint supports advanced sorting and filtering options to help you find specific organizations.

func (*EmbedOrganizationService) ListAutoPaging

Retrieves a list of organizations associated with your Straddle integration. The organizations are returned sorted by creation date, with the most recently created organizations appearing first. This endpoint supports advanced sorting and filtering options to help you find specific organizations.

func (*EmbedOrganizationService) New

Creates a new organization related to your Straddle integration. Organizations can be used to group related accounts and manage permissions across multiple users.

type EmbedRepresentativeGetParams

type EmbedRepresentativeGetParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedRepresentativeListParams

type EmbedRepresentativeListParams struct {
	// The unique identifier of the account to list representatives for.
	AccountID      param.Opt[string] `query:"account_id,omitzero" format:"uuid" json:"-"`
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Page size. Max value: 1000
	PageSize   param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	PlatformID param.Opt[string] `query:"platform_id,omitzero" format:"uuid" json:"-"`
	// Sort By.
	SortBy        param.Opt[string] `query:"sort_by,omitzero" json:"-"`
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Any of "account", "platform".
	Level EmbedRepresentativeListParamsLevel `query:"level,omitzero" json:"-"`
	// Sort Order.
	//
	// Any of "asc", "desc".
	SortOrder EmbedRepresentativeListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmbedRepresentativeListParams) URLQuery

func (r EmbedRepresentativeListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmbedRepresentativeListParams's query parameters as `url.Values`.

type EmbedRepresentativeListParamsLevel

type EmbedRepresentativeListParamsLevel string
const (
	EmbedRepresentativeListParamsLevelAccount  EmbedRepresentativeListParamsLevel = "account"
	EmbedRepresentativeListParamsLevelPlatform EmbedRepresentativeListParamsLevel = "platform"
)

type EmbedRepresentativeListParamsSortOrder

type EmbedRepresentativeListParamsSortOrder string

Sort Order.

const (
	EmbedRepresentativeListParamsSortOrderAsc  EmbedRepresentativeListParamsSortOrder = "asc"
	EmbedRepresentativeListParamsSortOrderDesc EmbedRepresentativeListParamsSortOrder = "desc"
)

type EmbedRepresentativeNewParams

type EmbedRepresentativeNewParams struct {
	// The unique identifier of the account this representative is associated with.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Date of birth for the representative in ISO 8601 format (YYYY-MM-DD).
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// The company email address of the representative.
	Email string `json:"email" api:"required" format:"email"`
	// The first name of the representative.
	FirstName string `json:"first_name" api:"required"`
	// The last name of the representative.
	LastName string `json:"last_name" api:"required"`
	// The mobile phone number of the representative.
	MobileNumber string                                   `json:"mobile_number" api:"required"`
	Relationship EmbedRepresentativeNewParamsRelationship `json:"relationship,omitzero" api:"required"`
	// The last 4 digits of the representative's Social Security Number.
	SsnLast4 string `json:"ssn_last4" api:"required"`
	// Unique identifier for the representative in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID     param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the represetative in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedRepresentativeNewParams) MarshalJSON

func (r EmbedRepresentativeNewParams) MarshalJSON() (data []byte, err error)

func (*EmbedRepresentativeNewParams) UnmarshalJSON

func (r *EmbedRepresentativeNewParams) UnmarshalJSON(data []byte) error

type EmbedRepresentativeNewParamsRelationship

type EmbedRepresentativeNewParamsRelationship struct {
	// Whether the representative has significant responsibility to control, manage, or
	// direct the organization. One representative must be identified under the control
	// prong for each legal entity.
	Control bool `json:"control" api:"required"`
	// Whether the representative owns any percentage of of the equity interests of the
	// legal entity.
	Owner bool `json:"owner" api:"required"`
	// Whether the person is authorized as the primary representative of the account.
	// This is the person chosen by the business to provide information about
	// themselves, general information about the account, and who consented to the
	// services agreement.
	//
	// There can be only one primary representative for an account at a time.
	Primary bool `json:"primary" api:"required"`
	// The percentage of ownership the representative has. Required if 'Owner' is true.
	PercentOwnership param.Opt[float64] `json:"percent_ownership,omitzero"`
	// The job title of the representative.
	Title param.Opt[string] `json:"title,omitzero"`
	// contains filtered or unexported fields
}

The properties Control, Owner, Primary are required.

func (EmbedRepresentativeNewParamsRelationship) MarshalJSON

func (r EmbedRepresentativeNewParamsRelationship) MarshalJSON() (data []byte, err error)

func (*EmbedRepresentativeNewParamsRelationship) UnmarshalJSON

func (r *EmbedRepresentativeNewParamsRelationship) UnmarshalJSON(data []byte) error

type EmbedRepresentativeService

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

Representatives are individuals who have legal authority or significant responsibility within a business entity associated with a Straddle account. Each representative undergoes automated verification as part of KYC/KYB compliance. Use representatives to collect and verify beneficial owners, control persons, and authorized signers required for account onboarding. Representatives also determine who can legally operate the account and make important changes.

EmbedRepresentativeService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedRepresentativeService method instead.

func NewEmbedRepresentativeService

func NewEmbedRepresentativeService(opts ...option.RequestOption) (r EmbedRepresentativeService)

NewEmbedRepresentativeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbedRepresentativeService) Get

func (r *EmbedRepresentativeService) Get(ctx context.Context, representativeID string, query EmbedRepresentativeGetParams, opts ...option.RequestOption) (res *Representative, err error)

Retrieves the details of an existing representative. Supply the unique representative ID, and Straddle will return the corresponding representative information.

func (*EmbedRepresentativeService) List

Returns a list of representatives associated with a specific account or organization. The representatives are returned sorted by creation date, with the most recently created representatives appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedRepresentativeService) ListAutoPaging

Returns a list of representatives associated with a specific account or organization. The representatives are returned sorted by creation date, with the most recently created representatives appearing first. This endpoint supports advanced sorting and filtering options.

func (*EmbedRepresentativeService) New

Creates a new representative associated with an account. Representatives are individuals who have legal authority or significant responsibility within the business.

func (*EmbedRepresentativeService) Unmask

func (r *EmbedRepresentativeService) Unmask(ctx context.Context, representativeID string, query EmbedRepresentativeUnmaskParams, opts ...option.RequestOption) (res *Representative, err error)

Retrieves the unmasked details of a representative that has previously been created. Supply the unique representative ID, and Straddle will return the corresponding representative information, including sensitive details. This endpoint requires additional authentication and should be used with caution.

func (*EmbedRepresentativeService) Update

func (r *EmbedRepresentativeService) Update(ctx context.Context, representativeID string, params EmbedRepresentativeUpdateParams, opts ...option.RequestOption) (res *Representative, err error)

Updates an existing representative's information. This can be used to update personal details, contact information, or the relationship to the account or organization.

type EmbedRepresentativeUnmaskParams

type EmbedRepresentativeUnmaskParams struct {
	CorrelationID param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	RequestID     param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type EmbedRepresentativeUpdateParams

type EmbedRepresentativeUpdateParams struct {
	// The date of birth of the representative, in ISO 8601 format (YYYY-MM-DD).
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// The email address of the representative.
	Email string `json:"email" api:"required" format:"email"`
	// The first name of the representative.
	FirstName string `json:"first_name" api:"required"`
	// The last name of the representative.
	LastName string `json:"last_name" api:"required"`
	// The mobile phone number of the representative.
	MobileNumber string                                      `json:"mobile_number" api:"required"`
	Relationship EmbedRepresentativeUpdateParamsRelationship `json:"relationship,omitzero" api:"required"`
	// The last 4 digits of the representative's Social Security Number.
	SsnLast4 string `json:"ssn_last4" api:"required"`
	// Unique identifier for the representative in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID     param.Opt[string] `json:"external_id,omitzero"`
	CorrelationID  param.Opt[string] `header:"correlation-id,omitzero" json:"-"`
	IdempotencyKey param.Opt[string] `header:"idempotency-key,omitzero" json:"-"`
	RequestID      param.Opt[string] `header:"request-id,omitzero" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the represetative in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmbedRepresentativeUpdateParams) MarshalJSON

func (r EmbedRepresentativeUpdateParams) MarshalJSON() (data []byte, err error)

func (*EmbedRepresentativeUpdateParams) UnmarshalJSON

func (r *EmbedRepresentativeUpdateParams) UnmarshalJSON(data []byte) error

type EmbedRepresentativeUpdateParamsRelationship

type EmbedRepresentativeUpdateParamsRelationship struct {
	// Whether the representative has significant responsibility to control, manage, or
	// direct the organization. One representative must be identified under the control
	// prong for each legal entity.
	Control bool `json:"control" api:"required"`
	// Whether the representative owns any percentage of of the equity interests of the
	// legal entity.
	Owner bool `json:"owner" api:"required"`
	// Whether the person is authorized as the primary representative of the account.
	// This is the person chosen by the business to provide information about
	// themselves, general information about the account, and who consented to the
	// services agreement.
	//
	// There can be only one primary representative for an account at a time.
	Primary bool `json:"primary" api:"required"`
	// The percentage of ownership the representative has. Required if 'Owner' is true.
	PercentOwnership param.Opt[float64] `json:"percent_ownership,omitzero"`
	// The job title of the representative.
	Title param.Opt[string] `json:"title,omitzero"`
	// contains filtered or unexported fields
}

The properties Control, Owner, Primary are required.

func (EmbedRepresentativeUpdateParamsRelationship) MarshalJSON

func (r EmbedRepresentativeUpdateParamsRelationship) MarshalJSON() (data []byte, err error)

func (*EmbedRepresentativeUpdateParamsRelationship) UnmarshalJSON

func (r *EmbedRepresentativeUpdateParamsRelationship) UnmarshalJSON(data []byte) error

type EmbedService

type EmbedService struct {

	// Accounts represent businesses using Straddle through your platform. Each account
	// must complete automated verification before processing payments. Use accounts to
	// manage your users' payment capabilities, track verification status, and control
	// access to features. Accounts can be instantly created in sandbox and require
	// additional verification for production access.
	Accounts EmbedAccountService
	// Linked bank accounts connect your platform users' external bank accounts to
	// Straddle for settlements and payment funding. Each linked account undergoes
	// automated verification and continuous monitoring. Use linked accounts to manage
	// where clients receive deposits, fund payouts, and track settlement preferences.
	LinkedBankAccounts EmbedLinkedBankAccountService
	// Organizations are a powerful feature in Straddle that allow you to manage
	// multiple accounts under a single umbrella. This hierarchical structure is
	// particularly useful for businesses with complex operations, multiple
	// departments, or legally related entities.
	Organizations EmbedOrganizationService
	// Representatives are individuals who have legal authority or significant
	// responsibility within a business entity associated with a Straddle account. Each
	// representative undergoes automated verification as part of KYC/KYB compliance.
	// Use representatives to collect and verify beneficial owners, control persons,
	// and authorized signers required for account onboarding. Representatives also
	// determine who can legally operate the account and make important changes.
	Representatives EmbedRepresentativeService
	// contains filtered or unexported fields
}

EmbedService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedService method instead.

func NewEmbedService

func NewEmbedService(opts ...option.RequestOption) (r EmbedService)

NewEmbedService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Error

type Error = apierror.Error

type FundingEventGetParams

type FundingEventGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type FundingEventListParams

type FundingEventListParams struct {
	// The start date of the range to filter by using the `YYYY-MM-DD` format.
	CreatedFrom param.Opt[time.Time] `query:"created_from,omitzero" format:"date" json:"-"`
	// The end date of the range to filter by using the `YYYY-MM-DD` format.
	CreatedTo param.Opt[time.Time] `query:"created_to,omitzero" format:"date" json:"-"`
	// Search text.
	SearchText param.Opt[string] `query:"search_text,omitzero" json:"-"`
	// Trace Id.
	TraceID param.Opt[string] `query:"trace_id,omitzero" json:"-"`
	// Trace number.
	TraceNumber param.Opt[string] `query:"trace_number,omitzero" json:"-"`
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Results page size. Max value: 1000
	PageSize          param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Funding Event status.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status []string `query:"status,omitzero" json:"-"`
	// Reason for latest payment status change.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	StatusReason []string `query:"status_reason,omitzero" json:"-"`
	// Source of latest payment status change.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	StatusSource []string `query:"status_source,omitzero" json:"-"`
	// Describes the direction of the funding event from the perspective of the
	// `linked_bank_account`.
	//
	// Any of "deposit", "withdrawal".
	Direction FundingEventListParamsDirection `query:"direction,omitzero" json:"-"`
	// The funding event types describes the direction and reason for the funding
	// event.
	//
	// Any of "charge_deposit", "charge_reversal", "payout_return",
	// "payout_withdrawal".
	EventType FundingEventListParamsEventType `query:"event_type,omitzero" json:"-"`
	// The field to sort the results by.
	//
	// Any of "transfer_date", "id", "amount".
	SortBy FundingEventListParamsSortBy `query:"sort_by,omitzero" json:"-"`
	// The order in which to sort the results.
	//
	// Any of "asc", "desc".
	SortOrder FundingEventListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FundingEventListParams) URLQuery

func (r FundingEventListParams) URLQuery() (v url.Values, err error)

URLQuery serializes FundingEventListParams's query parameters as `url.Values`.

type FundingEventListParamsDirection

type FundingEventListParamsDirection string

Describes the direction of the funding event from the perspective of the `linked_bank_account`.

const (
	FundingEventListParamsDirectionDeposit    FundingEventListParamsDirection = "deposit"
	FundingEventListParamsDirectionWithdrawal FundingEventListParamsDirection = "withdrawal"
)

type FundingEventListParamsEventType

type FundingEventListParamsEventType string

The funding event types describes the direction and reason for the funding event.

const (
	FundingEventListParamsEventTypeChargeDeposit    FundingEventListParamsEventType = "charge_deposit"
	FundingEventListParamsEventTypeChargeReversal   FundingEventListParamsEventType = "charge_reversal"
	FundingEventListParamsEventTypePayoutReturn     FundingEventListParamsEventType = "payout_return"
	FundingEventListParamsEventTypePayoutWithdrawal FundingEventListParamsEventType = "payout_withdrawal"
)

type FundingEventListParamsSortBy

type FundingEventListParamsSortBy string

The field to sort the results by.

const (
	FundingEventListParamsSortByTransferDate FundingEventListParamsSortBy = "transfer_date"
	FundingEventListParamsSortByID           FundingEventListParamsSortBy = "id"
	FundingEventListParamsSortByAmount       FundingEventListParamsSortBy = "amount"
)

type FundingEventListParamsSortOrder

type FundingEventListParamsSortOrder string

The order in which to sort the results.

const (
	FundingEventListParamsSortOrderAsc  FundingEventListParamsSortOrder = "asc"
	FundingEventListParamsSortOrderDesc FundingEventListParamsSortOrder = "desc"
)

type FundingEventService

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

Funding events represent all money movement between Straddle and an Account's external bank accounts. They are automatically generated when charges settle or payouts are initiated. Each event provides detailed tracking of settlement status, fee breakdowns, and reconciliation data across both incoming and outgoing transfers. Use funding events to monitor your platform's entire money movement lifecycle.

FundingEventService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFundingEventService method instead.

func NewFundingEventService

func NewFundingEventService(opts ...option.RequestOption) (r FundingEventService)

NewFundingEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FundingEventService) Get

Retrieves the details of an existing funding event. Supply the unique funding event `id`, and Straddle will return the individual transaction items that make up the funding event.

func (*FundingEventService) List

Retrieves a list of funding events for your account. This endpoint supports advanced sorting and filtering options.

func (*FundingEventService) ListAutoPaging

Retrieves a list of funding events for your account. This endpoint supports advanced sorting and filtering options.

type FundingEventSummaryItemV1

type FundingEventSummaryItemV1 struct {
	Data FundingEventSummaryItemV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType FundingEventSummaryItemV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryItemV1) RawJSON

func (r FundingEventSummaryItemV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*FundingEventSummaryItemV1) UnmarshalJSON

func (r *FundingEventSummaryItemV1) UnmarshalJSON(data []byte) error

type FundingEventSummaryItemV1Data

type FundingEventSummaryItemV1Data struct {
	// Unique identifier for the funding event.
	ID string `json:"id" api:"required" format:"uuid"`
	// The amount of the funding event in cents.
	Amount int64 `json:"amount" api:"required"`
	// Created at.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Describes the direction of the funding event from the perspective of the
	// `linked_bank_account`.
	//
	// Any of "deposit", "withdrawal".
	Direction string `json:"direction" api:"required"`
	// The funding event types describes the direction and reason for the funding
	// event.
	//
	// Any of "charge_deposit", "charge_reversal", "payout_return",
	// "payout_withdrawal".
	EventType string `json:"event_type" api:"required"`
	// The number of payments associated with the funding event.
	PaymentCount int64 `json:"payment_count" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// Trace number.
	TraceNumbers []string `json:"trace_numbers" api:"required"`
	// The date on which the funding event occurred. For `deposits` and `returns`, this
	// is the date the funds were credited to your bank account. For `withdrawals` and
	// `reversals`, this is the date the funds were debited from your bank account.
	TransferDate time.Time `json:"transfer_date" api:"required" format:"date"`
	// Updated at.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status        string                                     `json:"status"`
	StatusDetails FundingEventSummaryItemV1DataStatusDetails `json:"status_details"`
	// The trace number of the funding event.
	TraceNumber string `json:"trace_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Amount        respjson.Field
		CreatedAt     respjson.Field
		Direction     respjson.Field
		EventType     respjson.Field
		PaymentCount  respjson.Field
		TraceIDs      respjson.Field
		TraceNumbers  respjson.Field
		TransferDate  respjson.Field
		UpdatedAt     respjson.Field
		Status        respjson.Field
		StatusDetails respjson.Field
		TraceNumber   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryItemV1Data) RawJSON

Returns the unmodified JSON received from the API

func (*FundingEventSummaryItemV1Data) UnmarshalJSON

func (r *FundingEventSummaryItemV1Data) UnmarshalJSON(data []byte) error

type FundingEventSummaryItemV1DataStatusDetails

type FundingEventSummaryItemV1DataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryItemV1DataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*FundingEventSummaryItemV1DataStatusDetails) UnmarshalJSON

func (r *FundingEventSummaryItemV1DataStatusDetails) UnmarshalJSON(data []byte) error

type FundingEventSummaryItemV1ResponseType

type FundingEventSummaryItemV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	FundingEventSummaryItemV1ResponseTypeObject FundingEventSummaryItemV1ResponseType = "object"
	FundingEventSummaryItemV1ResponseTypeArray  FundingEventSummaryItemV1ResponseType = "array"
	FundingEventSummaryItemV1ResponseTypeError  FundingEventSummaryItemV1ResponseType = "error"
	FundingEventSummaryItemV1ResponseTypeNone   FundingEventSummaryItemV1ResponseType = "none"
)

type FundingEventSummaryPagedV1

type FundingEventSummaryPagedV1 struct {
	Data []FundingEventSummaryPagedV1Data `json:"data" api:"required"`
	Meta FundingEventSummaryPagedV1Meta   `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType FundingEventSummaryPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryPagedV1) RawJSON

func (r FundingEventSummaryPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*FundingEventSummaryPagedV1) UnmarshalJSON

func (r *FundingEventSummaryPagedV1) UnmarshalJSON(data []byte) error

type FundingEventSummaryPagedV1Data

type FundingEventSummaryPagedV1Data struct {
	// Unique identifier for the funding event.
	ID string `json:"id" api:"required" format:"uuid"`
	// The amount of the funding event in cents.
	Amount int64 `json:"amount" api:"required"`
	// Created at.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Describes the direction of the funding event from the perspective of the
	// `linked_bank_account`.
	//
	// Any of "deposit", "withdrawal".
	Direction string `json:"direction" api:"required"`
	// The funding event types describes the direction and reason for the funding
	// event.
	//
	// Any of "charge_deposit", "charge_reversal", "payout_return",
	// "payout_withdrawal".
	EventType string `json:"event_type" api:"required"`
	// The number of payments associated with the funding event.
	PaymentCount int64 `json:"payment_count" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// Trace number.
	TraceNumbers []string `json:"trace_numbers" api:"required"`
	// The date on which the funding event occurred. For `deposits` and `returns`, this
	// is the date the funds were credited to your bank account. For `withdrawals` and
	// `reversals`, this is the date the funds were debited from your bank account.
	TransferDate time.Time `json:"transfer_date" api:"required" format:"date"`
	// Updated at.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status        string                                      `json:"status"`
	StatusDetails FundingEventSummaryPagedV1DataStatusDetails `json:"status_details"`
	// The trace number of the funding event.
	TraceNumber string `json:"trace_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Amount        respjson.Field
		CreatedAt     respjson.Field
		Direction     respjson.Field
		EventType     respjson.Field
		PaymentCount  respjson.Field
		TraceIDs      respjson.Field
		TraceNumbers  respjson.Field
		TransferDate  respjson.Field
		UpdatedAt     respjson.Field
		Status        respjson.Field
		StatusDetails respjson.Field
		TraceNumber   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryPagedV1Data) RawJSON

Returns the unmodified JSON received from the API

func (*FundingEventSummaryPagedV1Data) UnmarshalJSON

func (r *FundingEventSummaryPagedV1Data) UnmarshalJSON(data []byte) error

type FundingEventSummaryPagedV1DataStatusDetails

type FundingEventSummaryPagedV1DataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryPagedV1DataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*FundingEventSummaryPagedV1DataStatusDetails) UnmarshalJSON

func (r *FundingEventSummaryPagedV1DataStatusDetails) UnmarshalJSON(data []byte) error

type FundingEventSummaryPagedV1Meta

type FundingEventSummaryPagedV1Meta struct {
	// Unique identifier for this API request, useful for troubleshooting.
	APIRequestID string `json:"api_request_id" api:"required" format:"uuid"`
	// Timestamp for this API request, useful for troubleshooting.
	APIRequestTimestamp time.Time `json:"api_request_timestamp" api:"required" format:"date-time"`
	// Maximum allowed page size for this endpoint.
	MaxPageSize int64 `json:"max_page_size" api:"required"`
	// Page number for paginated results.
	PageNumber int64 `json:"page_number" api:"required"`
	// Number of items per page in this response.
	PageSize int64 `json:"page_size" api:"required"`
	// The field that the results were sorted by.
	SortBy string `json:"sort_by" api:"required"`
	// Any of "asc", "desc".
	SortOrder  string `json:"sort_order" api:"required"`
	TotalItems int64  `json:"total_items" api:"required"`
	// The number of pages available.
	TotalPages int64 `json:"total_pages" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIRequestID        respjson.Field
		APIRequestTimestamp respjson.Field
		MaxPageSize         respjson.Field
		PageNumber          respjson.Field
		PageSize            respjson.Field
		SortBy              respjson.Field
		SortOrder           respjson.Field
		TotalItems          respjson.Field
		TotalPages          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FundingEventSummaryPagedV1Meta) RawJSON

Returns the unmodified JSON received from the API

func (*FundingEventSummaryPagedV1Meta) UnmarshalJSON

func (r *FundingEventSummaryPagedV1Meta) UnmarshalJSON(data []byte) error

type FundingEventSummaryPagedV1ResponseType

type FundingEventSummaryPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	FundingEventSummaryPagedV1ResponseTypeObject FundingEventSummaryPagedV1ResponseType = "object"
	FundingEventSummaryPagedV1ResponseTypeArray  FundingEventSummaryPagedV1ResponseType = "array"
	FundingEventSummaryPagedV1ResponseTypeError  FundingEventSummaryPagedV1ResponseType = "error"
	FundingEventSummaryPagedV1ResponseTypeNone   FundingEventSummaryPagedV1ResponseType = "none"
)

type IdentityVerificationBreakdownV1

type IdentityVerificationBreakdownV1 struct {
	// List of specific result codes from the fraud and risk screening.
	Codes []string `json:"codes" api:"nullable"`
	// Any of "low_confidence", "potential_match", "likely_match", "high_confidence".
	Correlation IdentityVerificationBreakdownV1Correlation `json:"correlation"`
	// Represents the strength of the correlation between provided and known
	// information. A higher score indicates a stronger correlation.
	CorrelationScore float64 `json:"correlation_score" api:"nullable"`
	// Any of "accept", "reject", "review".
	Decision IdentityVerificationBreakdownV1Decision `json:"decision"`
	// Predicts the inherent risk associated with the customer for a given module. A
	// higher score indicates a greater likelihood of fraud.
	RiskScore float64 `json:"risk_score" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes            respjson.Field
		Correlation      respjson.Field
		CorrelationScore respjson.Field
		Decision         respjson.Field
		RiskScore        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IdentityVerificationBreakdownV1) RawJSON

Returns the unmodified JSON received from the API

func (*IdentityVerificationBreakdownV1) UnmarshalJSON

func (r *IdentityVerificationBreakdownV1) UnmarshalJSON(data []byte) error

type IdentityVerificationBreakdownV1Correlation

type IdentityVerificationBreakdownV1Correlation string
const (
	IdentityVerificationBreakdownV1CorrelationLowConfidence  IdentityVerificationBreakdownV1Correlation = "low_confidence"
	IdentityVerificationBreakdownV1CorrelationPotentialMatch IdentityVerificationBreakdownV1Correlation = "potential_match"
	IdentityVerificationBreakdownV1CorrelationLikelyMatch    IdentityVerificationBreakdownV1Correlation = "likely_match"
	IdentityVerificationBreakdownV1CorrelationHighConfidence IdentityVerificationBreakdownV1Correlation = "high_confidence"
)

type IdentityVerificationBreakdownV1Decision

type IdentityVerificationBreakdownV1Decision string
const (
	IdentityVerificationBreakdownV1DecisionAccept IdentityVerificationBreakdownV1Decision = "accept"
	IdentityVerificationBreakdownV1DecisionReject IdentityVerificationBreakdownV1Decision = "reject"
	IdentityVerificationBreakdownV1DecisionReview IdentityVerificationBreakdownV1Decision = "review"
)

type IndustryV1

type IndustryV1 struct {
	// The general category of the industry. Required if not providing MCC.
	Category string `json:"category" api:"nullable"`
	// The Merchant Category Code (MCC) that best describes the business. Optional.
	Mcc string `json:"mcc" api:"nullable"`
	// The specific sector within the industry category. Required if not providing MCC.
	Sector string `json:"sector" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Category    respjson.Field
		Mcc         respjson.Field
		Sector      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryV1) RawJSON

func (r IndustryV1) RawJSON() string

Returns the unmodified JSON received from the API

func (IndustryV1) ToParam

func (r IndustryV1) ToParam() IndustryV1Param

ToParam converts this IndustryV1 to a IndustryV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with IndustryV1Param.Overrides()

func (*IndustryV1) UnmarshalJSON

func (r *IndustryV1) UnmarshalJSON(data []byte) error

type IndustryV1Param

type IndustryV1Param struct {
	// The general category of the industry. Required if not providing MCC.
	Category param.Opt[string] `json:"category,omitzero"`
	// The Merchant Category Code (MCC) that best describes the business. Optional.
	Mcc param.Opt[string] `json:"mcc,omitzero"`
	// The specific sector within the industry category. Required if not providing MCC.
	Sector param.Opt[string] `json:"sector,omitzero"`
	// contains filtered or unexported fields
}

func (IndustryV1Param) MarshalJSON

func (r IndustryV1Param) MarshalJSON() (data []byte, err error)

func (*IndustryV1Param) UnmarshalJSON

func (r *IndustryV1Param) UnmarshalJSON(data []byte) error

type LinkedBankAccountPagedV1

type LinkedBankAccountPagedV1 struct {
	Data []LinkedBankAccountPagedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier, timestamp, and
	// pagination details.
	Meta shared.PagedResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType LinkedBankAccountPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountPagedV1) RawJSON

func (r LinkedBankAccountPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*LinkedBankAccountPagedV1) UnmarshalJSON

func (r *LinkedBankAccountPagedV1) UnmarshalJSON(data []byte) error

type LinkedBankAccountPagedV1Data

type LinkedBankAccountPagedV1Data struct {
	// Unique identifier for the linked bank account.
	ID string `json:"id" api:"required" format:"uuid"`
	// The unique identifier of the Straddle account related to this bank account.
	AccountID   string                                  `json:"account_id" api:"required" format:"uuid"`
	BankAccount LinkedBankAccountPagedV1DataBankAccount `json:"bank_account" api:"required"`
	// Timestamp of when the bank account object was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The purposes for the linked bank account.
	//
	// Any of "charges", "payouts", "billing".
	Purposes []string `json:"purposes" api:"required"`
	// The current status of the linked bank account.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive", "canceled".
	Status       string                                   `json:"status" api:"required"`
	StatusDetail LinkedBankAccountPagedV1DataStatusDetail `json:"status_detail" api:"required"`
	// Timestamp of the most recent update to the linked bank account.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Optional description for the bank account.
	Description string `json:"description" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the linked bank account in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// The unique identifier of the Straddle Platform relatd to this bank account.
	PlatformID string `json:"platform_id" api:"nullable" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AccountID    respjson.Field
		BankAccount  respjson.Field
		CreatedAt    respjson.Field
		Purposes     respjson.Field
		Status       respjson.Field
		StatusDetail respjson.Field
		UpdatedAt    respjson.Field
		Description  respjson.Field
		Metadata     respjson.Field
		PlatformID   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountPagedV1Data) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountPagedV1Data) UnmarshalJSON

func (r *LinkedBankAccountPagedV1Data) UnmarshalJSON(data []byte) error

type LinkedBankAccountPagedV1DataBankAccount

type LinkedBankAccountPagedV1DataBankAccount struct {
	AccountHolder   string `json:"account_holder" api:"required"`
	AccountMask     string `json:"account_mask" api:"required"`
	InstitutionName string `json:"institution_name" api:"required"`
	RoutingNumber   string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountHolder   respjson.Field
		AccountMask     respjson.Field
		InstitutionName respjson.Field
		RoutingNumber   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountPagedV1DataBankAccount) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountPagedV1DataBankAccount) UnmarshalJSON

func (r *LinkedBankAccountPagedV1DataBankAccount) UnmarshalJSON(data []byte) error

type LinkedBankAccountPagedV1DataStatusDetail

type LinkedBankAccountPagedV1DataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `watchtower`). This helps in
	// tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountPagedV1DataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountPagedV1DataStatusDetail) UnmarshalJSON

func (r *LinkedBankAccountPagedV1DataStatusDetail) UnmarshalJSON(data []byte) error

type LinkedBankAccountPagedV1ResponseType

type LinkedBankAccountPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	LinkedBankAccountPagedV1ResponseTypeObject LinkedBankAccountPagedV1ResponseType = "object"
	LinkedBankAccountPagedV1ResponseTypeArray  LinkedBankAccountPagedV1ResponseType = "array"
	LinkedBankAccountPagedV1ResponseTypeError  LinkedBankAccountPagedV1ResponseType = "error"
	LinkedBankAccountPagedV1ResponseTypeNone   LinkedBankAccountPagedV1ResponseType = "none"
)

type LinkedBankAccountUnmaskV1

type LinkedBankAccountUnmaskV1 struct {
	Data LinkedBankAccountUnmaskV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType LinkedBankAccountUnmaskV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountUnmaskV1) RawJSON

func (r LinkedBankAccountUnmaskV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*LinkedBankAccountUnmaskV1) UnmarshalJSON

func (r *LinkedBankAccountUnmaskV1) UnmarshalJSON(data []byte) error

type LinkedBankAccountUnmaskV1Data

type LinkedBankAccountUnmaskV1Data struct {
	// Unique identifier for the linked bank account.
	ID string `json:"id" api:"required" format:"uuid"`
	// Unique identifier for the Straddle account related to this bank account.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// The bank account details associated with the linked bank account.
	BankAccount LinkedBankAccountUnmaskV1DataBankAccount `json:"bank_account" api:"required"`
	// Timestamp of when the linked bank account was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The current status of the linked bank account.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive", "canceled".
	Status string `json:"status" api:"required"`
	// Additional details about the current status of the linked bank account.
	StatusDetail LinkedBankAccountUnmaskV1DataStatusDetail `json:"status_detail" api:"required"`
	// Timestamp of when the linked bank account was last updated.
	UpdatedAt time.Time         `json:"updated_at" api:"required" format:"date-time"`
	Metadata  map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AccountID    respjson.Field
		BankAccount  respjson.Field
		CreatedAt    respjson.Field
		Status       respjson.Field
		StatusDetail respjson.Field
		UpdatedAt    respjson.Field
		Metadata     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountUnmaskV1Data) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountUnmaskV1Data) UnmarshalJSON

func (r *LinkedBankAccountUnmaskV1Data) UnmarshalJSON(data []byte) error

type LinkedBankAccountUnmaskV1DataBankAccount

type LinkedBankAccountUnmaskV1DataBankAccount struct {
	AccountHolder   string `json:"account_holder" api:"required"`
	AccountNumber   string `json:"account_number" api:"required"`
	InstitutionName string `json:"institution_name" api:"required"`
	RoutingNumber   string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountHolder   respjson.Field
		AccountNumber   respjson.Field
		InstitutionName respjson.Field
		RoutingNumber   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The bank account details associated with the linked bank account.

func (LinkedBankAccountUnmaskV1DataBankAccount) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountUnmaskV1DataBankAccount) UnmarshalJSON

func (r *LinkedBankAccountUnmaskV1DataBankAccount) UnmarshalJSON(data []byte) error

type LinkedBankAccountUnmaskV1DataStatusDetail

type LinkedBankAccountUnmaskV1DataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `watchtower`). This helps in
	// tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Additional details about the current status of the linked bank account.

func (LinkedBankAccountUnmaskV1DataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountUnmaskV1DataStatusDetail) UnmarshalJSON

func (r *LinkedBankAccountUnmaskV1DataStatusDetail) UnmarshalJSON(data []byte) error

type LinkedBankAccountUnmaskV1ResponseType

type LinkedBankAccountUnmaskV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	LinkedBankAccountUnmaskV1ResponseTypeObject LinkedBankAccountUnmaskV1ResponseType = "object"
	LinkedBankAccountUnmaskV1ResponseTypeArray  LinkedBankAccountUnmaskV1ResponseType = "array"
	LinkedBankAccountUnmaskV1ResponseTypeError  LinkedBankAccountUnmaskV1ResponseType = "error"
	LinkedBankAccountUnmaskV1ResponseTypeNone   LinkedBankAccountUnmaskV1ResponseType = "none"
)

type LinkedBankAccountV1

type LinkedBankAccountV1 struct {
	Data LinkedBankAccountV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType LinkedBankAccountV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountV1) RawJSON

func (r LinkedBankAccountV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*LinkedBankAccountV1) UnmarshalJSON

func (r *LinkedBankAccountV1) UnmarshalJSON(data []byte) error

type LinkedBankAccountV1Data

type LinkedBankAccountV1Data struct {
	// Unique identifier for the linked bank account.
	ID string `json:"id" api:"required" format:"uuid"`
	// The unique identifier of the Straddle account related to this bank account.
	AccountID   string                             `json:"account_id" api:"required" format:"uuid"`
	BankAccount LinkedBankAccountV1DataBankAccount `json:"bank_account" api:"required"`
	// Timestamp of when the bank account object was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The purposes for the linked bank account.
	//
	// Any of "charges", "payouts", "billing".
	Purposes []string `json:"purposes" api:"required"`
	// The current status of the linked bank account.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive", "canceled".
	Status       string                              `json:"status" api:"required"`
	StatusDetail LinkedBankAccountV1DataStatusDetail `json:"status_detail" api:"required"`
	// Timestamp of the most recent update to the linked bank account.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Optional description for the bank account.
	Description string `json:"description" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the linked bank account in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// The unique identifier of the Straddle Platform relatd to this bank account.
	PlatformID string `json:"platform_id" api:"nullable" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AccountID    respjson.Field
		BankAccount  respjson.Field
		CreatedAt    respjson.Field
		Purposes     respjson.Field
		Status       respjson.Field
		StatusDetail respjson.Field
		UpdatedAt    respjson.Field
		Description  respjson.Field
		Metadata     respjson.Field
		PlatformID   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountV1Data) RawJSON

func (r LinkedBankAccountV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*LinkedBankAccountV1Data) UnmarshalJSON

func (r *LinkedBankAccountV1Data) UnmarshalJSON(data []byte) error

type LinkedBankAccountV1DataBankAccount

type LinkedBankAccountV1DataBankAccount struct {
	AccountHolder   string `json:"account_holder" api:"required"`
	AccountMask     string `json:"account_mask" api:"required"`
	InstitutionName string `json:"institution_name" api:"required"`
	RoutingNumber   string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountHolder   respjson.Field
		AccountMask     respjson.Field
		InstitutionName respjson.Field
		RoutingNumber   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountV1DataBankAccount) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountV1DataBankAccount) UnmarshalJSON

func (r *LinkedBankAccountV1DataBankAccount) UnmarshalJSON(data []byte) error

type LinkedBankAccountV1DataStatusDetail

type LinkedBankAccountV1DataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `watchtower`). This helps in
	// tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedBankAccountV1DataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*LinkedBankAccountV1DataStatusDetail) UnmarshalJSON

func (r *LinkedBankAccountV1DataStatusDetail) UnmarshalJSON(data []byte) error

type LinkedBankAccountV1ResponseType

type LinkedBankAccountV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	LinkedBankAccountV1ResponseTypeObject LinkedBankAccountV1ResponseType = "object"
	LinkedBankAccountV1ResponseTypeArray  LinkedBankAccountV1ResponseType = "array"
	LinkedBankAccountV1ResponseTypeError  LinkedBankAccountV1ResponseType = "error"
	LinkedBankAccountV1ResponseTypeNone   LinkedBankAccountV1ResponseType = "none"
)

type OrganizationPagedV1

type OrganizationPagedV1 struct {
	Data []OrganizationPagedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier, timestamp, and
	// pagination details.
	Meta shared.PagedResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType OrganizationPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationPagedV1) RawJSON

func (r OrganizationPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationPagedV1) UnmarshalJSON

func (r *OrganizationPagedV1) UnmarshalJSON(data []byte) error

type OrganizationPagedV1Data

type OrganizationPagedV1Data struct {
	// Straddle's unique identifier for the organization.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the organization was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The name of the organization.
	Name string `json:"name" api:"required"`
	// Timestamp of the most recent update to the organization.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Unique identifier for the organization in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the organization in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		UpdatedAt   respjson.Field
		ExternalID  respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationPagedV1Data) RawJSON

func (r OrganizationPagedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationPagedV1Data) UnmarshalJSON

func (r *OrganizationPagedV1Data) UnmarshalJSON(data []byte) error

type OrganizationPagedV1ResponseType

type OrganizationPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	OrganizationPagedV1ResponseTypeObject OrganizationPagedV1ResponseType = "object"
	OrganizationPagedV1ResponseTypeArray  OrganizationPagedV1ResponseType = "array"
	OrganizationPagedV1ResponseTypeError  OrganizationPagedV1ResponseType = "error"
	OrganizationPagedV1ResponseTypeNone   OrganizationPagedV1ResponseType = "none"
)

type OrganizationV1

type OrganizationV1 struct {
	Data OrganizationV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType OrganizationV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationV1) RawJSON

func (r OrganizationV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationV1) UnmarshalJSON

func (r *OrganizationV1) UnmarshalJSON(data []byte) error

type OrganizationV1Data

type OrganizationV1Data struct {
	// Straddle's unique identifier for the organization.
	ID string `json:"id" api:"required" format:"uuid"`
	// Timestamp of when the organization was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The name of the organization.
	Name string `json:"name" api:"required"`
	// Timestamp of the most recent update to the organization.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Unique identifier for the organization in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the organization in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		UpdatedAt   respjson.Field
		ExternalID  respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationV1Data) RawJSON

func (r OrganizationV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationV1Data) UnmarshalJSON

func (r *OrganizationV1Data) UnmarshalJSON(data []byte) error

type OrganizationV1ResponseType

type OrganizationV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	OrganizationV1ResponseTypeObject OrganizationV1ResponseType = "object"
	OrganizationV1ResponseTypeArray  OrganizationV1ResponseType = "array"
	OrganizationV1ResponseTypeError  OrganizationV1ResponseType = "error"
	OrganizationV1ResponseTypeNone   OrganizationV1ResponseType = "none"
)

type PagedResponseMetadata

type PagedResponseMetadata = shared.PagedResponseMetadata

Metadata about the API request, including an identifier, timestamp, and pagination details.

This is an alias to an internal type.

type PagedResponseMetadataSortOrder

type PagedResponseMetadataSortOrder = shared.PagedResponseMetadataSortOrder

This is an alias to an internal type.

type PaykeyCancelParams

type PaykeyCancelParams struct {
	Reason            param.Opt[string] `json:"reason,omitzero"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (PaykeyCancelParams) MarshalJSON

func (r PaykeyCancelParams) MarshalJSON() (data []byte, err error)

func (*PaykeyCancelParams) UnmarshalJSON

func (r *PaykeyCancelParams) UnmarshalJSON(data []byte) error

type PaykeyDetailsV1

type PaykeyDetailsV1 = shared.PaykeyDetailsV1

This is an alias to an internal type.

type PaykeyGetParams

type PaykeyGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyListParams

type PaykeyListParams struct {
	// Filter paykeys by related customer ID.
	CustomerID param.Opt[string] `query:"customer_id,omitzero" format:"uuid" json:"-"`
	// Page number for paginated results. Starts at 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Number of results per page. Maximum: 1000.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// General search term to filter paykeys.
	SearchText param.Opt[string] `query:"search_text,omitzero" json:"-"`
	// Filter paykeys by unblock eligibility. When true, returns only blocked paykeys
	// eligible for client-initiated unblocking (blocked due to R29 returns and not
	// previously unblocked). When false, returns only blocked paykeys that are not
	// eligible for unblocking.
	UnblockEligible   param.Opt[bool]   `query:"unblock_eligible,omitzero" json:"-"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Any of "institution_name", "expires_at", "created_at".
	SortBy PaykeyListParamsSortBy `query:"sort_by,omitzero" json:"-"`
	// Any of "asc", "desc".
	SortOrder PaykeyListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// Filter paykeys by their source.
	//
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source []string `query:"source,omitzero" json:"-"`
	// Filter paykeys by their current status.
	//
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status []string `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (PaykeyListParams) URLQuery

func (r PaykeyListParams) URLQuery() (v url.Values, err error)

URLQuery serializes PaykeyListParams's query parameters as `url.Values`.

type PaykeyListParamsSortBy

type PaykeyListParamsSortBy string
const (
	PaykeyListParamsSortByInstitutionName PaykeyListParamsSortBy = "institution_name"
	PaykeyListParamsSortByExpiresAt       PaykeyListParamsSortBy = "expires_at"
	PaykeyListParamsSortByCreatedAt       PaykeyListParamsSortBy = "created_at"
)

type PaykeyListParamsSortOrder

type PaykeyListParamsSortOrder string
const (
	PaykeyListParamsSortOrderAsc  PaykeyListParamsSortOrder = "asc"
	PaykeyListParamsSortOrderDesc PaykeyListParamsSortOrder = "desc"
)

type PaykeyRevealParams

type PaykeyRevealParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyRevealResponse

type PaykeyRevealResponse struct {
	Data PaykeyRevealResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaykeyRevealResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponse) RawJSON

func (r PaykeyRevealResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponse) UnmarshalJSON

func (r *PaykeyRevealResponse) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseData

type PaykeyRevealResponseData struct {
	// Unique identifier for the paykey.
	ID     string                         `json:"id" api:"required" format:"uuid"`
	Config PaykeyRevealResponseDataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label that combines the bank name and masked account number to
	// help easility represent this paykey in a UI
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This token is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                        `json:"updated_at" api:"required" format:"date-time"`
	Balance   PaykeyRevealResponseDataBalance  `json:"balance"`
	BankData  PaykeyRevealResponseDataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string                     `json:"metadata" api:"nullable"`
	StatusDetails PaykeyRevealResponseDataStatusDetails `json:"status_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponseData) RawJSON

func (r PaykeyRevealResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponseData) UnmarshalJSON

func (r *PaykeyRevealResponseData) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseDataBalance

type PaykeyRevealResponseDataBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponseDataBalance) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponseDataBalance) UnmarshalJSON

func (r *PaykeyRevealResponseDataBalance) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseDataBankData

type PaykeyRevealResponseDataBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponseDataBankData) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponseDataBankData) UnmarshalJSON

func (r *PaykeyRevealResponseDataBankData) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseDataConfig

type PaykeyRevealResponseDataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponseDataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponseDataConfig) UnmarshalJSON

func (r *PaykeyRevealResponseDataConfig) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseDataStatusDetails

type PaykeyRevealResponseDataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyRevealResponseDataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyRevealResponseDataStatusDetails) UnmarshalJSON

func (r *PaykeyRevealResponseDataStatusDetails) UnmarshalJSON(data []byte) error

type PaykeyRevealResponseResponseType

type PaykeyRevealResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaykeyRevealResponseResponseTypeObject PaykeyRevealResponseResponseType = "object"
	PaykeyRevealResponseResponseTypeArray  PaykeyRevealResponseResponseType = "array"
	PaykeyRevealResponseResponseTypeError  PaykeyRevealResponseResponseType = "error"
	PaykeyRevealResponseResponseTypeNone   PaykeyRevealResponseResponseType = "none"
)

type PaykeyReviewDecisionParams

type PaykeyReviewDecisionParams struct {
	// Any of "active", "rejected".
	Status            PaykeyReviewDecisionParamsStatus `json:"status,omitzero" api:"required"`
	CorrelationID     param.Opt[string]                `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string]                `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string]                `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string]                `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (PaykeyReviewDecisionParams) MarshalJSON

func (r PaykeyReviewDecisionParams) MarshalJSON() (data []byte, err error)

func (*PaykeyReviewDecisionParams) UnmarshalJSON

func (r *PaykeyReviewDecisionParams) UnmarshalJSON(data []byte) error

type PaykeyReviewDecisionParamsStatus

type PaykeyReviewDecisionParamsStatus string
const (
	PaykeyReviewDecisionParamsStatusActive   PaykeyReviewDecisionParamsStatus = "active"
	PaykeyReviewDecisionParamsStatusRejected PaykeyReviewDecisionParamsStatus = "rejected"
)

type PaykeyReviewGetParams

type PaykeyReviewGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyReviewGetResponse

type PaykeyReviewGetResponse struct {
	Data PaykeyReviewGetResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaykeyReviewGetResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponse) RawJSON

func (r PaykeyReviewGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponse) UnmarshalJSON

func (r *PaykeyReviewGetResponse) UnmarshalJSON(data []byte) error

type PaykeyReviewGetResponseData

type PaykeyReviewGetResponseData struct {
	PaykeyDetails       PaykeyReviewGetResponseDataPaykeyDetails       `json:"paykey_details" api:"required"`
	VerificationDetails PaykeyReviewGetResponseDataVerificationDetails `json:"verification_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PaykeyDetails       respjson.Field
		VerificationDetails respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseData) RawJSON

func (r PaykeyReviewGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseData) UnmarshalJSON

func (r *PaykeyReviewGetResponseData) UnmarshalJSON(data []byte) error

type PaykeyReviewGetResponseDataPaykeyDetails

type PaykeyReviewGetResponseDataPaykeyDetails struct {
	// Unique identifier for the paykey.
	ID     string                                         `json:"id" api:"required" format:"uuid"`
	Config PaykeyReviewGetResponseDataPaykeyDetailsConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label used to represent this paykey in a UI.
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This value is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                                        `json:"updated_at" api:"required" format:"date-time"`
	Balance   PaykeyReviewGetResponseDataPaykeyDetailsBalance  `json:"balance"`
	BankData  PaykeyReviewGetResponseDataPaykeyDetailsBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string                                     `json:"metadata" api:"nullable"`
	StatusDetails PaykeyReviewGetResponseDataPaykeyDetailsStatusDetails `json:"status_details"`
	// Indicates whether this paykey is eligible for client-initiated unblocking. Only
	// present for blocked paykeys. True when blocked due to R29 returns and not
	// previously unblocked, false otherwise. Null when paykey is not blocked.
	UnblockEligible bool `json:"unblock_eligible" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		UnblockEligible respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataPaykeyDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataPaykeyDetails) UnmarshalJSON

func (r *PaykeyReviewGetResponseDataPaykeyDetails) UnmarshalJSON(data []byte) error

type PaykeyReviewGetResponseDataPaykeyDetailsBalance

type PaykeyReviewGetResponseDataPaykeyDetailsBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataPaykeyDetailsBalance) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataPaykeyDetailsBalance) UnmarshalJSON

type PaykeyReviewGetResponseDataPaykeyDetailsBankData

type PaykeyReviewGetResponseDataPaykeyDetailsBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataPaykeyDetailsBankData) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataPaykeyDetailsBankData) UnmarshalJSON

type PaykeyReviewGetResponseDataPaykeyDetailsConfig

type PaykeyReviewGetResponseDataPaykeyDetailsConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataPaykeyDetailsConfig) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataPaykeyDetailsConfig) UnmarshalJSON

type PaykeyReviewGetResponseDataPaykeyDetailsStatusDetails

type PaykeyReviewGetResponseDataPaykeyDetailsStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataPaykeyDetailsStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataPaykeyDetailsStatusDetails) UnmarshalJSON

type PaykeyReviewGetResponseDataVerificationDetails

type PaykeyReviewGetResponseDataVerificationDetails struct {
	// Unique identifier for the verification details.
	ID        string                                                  `json:"id" api:"required" format:"uuid"`
	Breakdown PaykeyReviewGetResponseDataVerificationDetailsBreakdown `json:"breakdown" api:"required"`
	// Timestamp of when the verification was initiated.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision" api:"required"`
	// Dictionary of all messages from the paykey verification process.
	Messages map[string]string `json:"messages" api:"required"`
	// Timestamp of the most recent update to the verification details.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Breakdown   respjson.Field
		CreatedAt   respjson.Field
		Decision    respjson.Field
		Messages    respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataVerificationDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataVerificationDetails) UnmarshalJSON

type PaykeyReviewGetResponseDataVerificationDetailsBreakdown

type PaykeyReviewGetResponseDataVerificationDetailsBreakdown struct {
	AccountValidation PaykeyReviewGetResponseDataVerificationDetailsBreakdownAccountValidation `json:"account_validation"`
	NameMatch         PaykeyReviewGetResponseDataVerificationDetailsBreakdownNameMatch         `json:"name_match"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountValidation respjson.Field
		NameMatch         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataVerificationDetailsBreakdown) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataVerificationDetailsBreakdown) UnmarshalJSON

type PaykeyReviewGetResponseDataVerificationDetailsBreakdownAccountValidation

type PaykeyReviewGetResponseDataVerificationDetailsBreakdownAccountValidation struct {
	Codes []string `json:"codes" api:"required"`
	// Any of "accept", "reject", "review".
	Decision string `json:"decision" api:"required"`
	Reason   string `json:"reason" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Decision    respjson.Field
		Reason      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataVerificationDetailsBreakdownAccountValidation) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataVerificationDetailsBreakdownAccountValidation) UnmarshalJSON

type PaykeyReviewGetResponseDataVerificationDetailsBreakdownNameMatch

type PaykeyReviewGetResponseDataVerificationDetailsBreakdownNameMatch struct {
	Codes []string `json:"codes" api:"required"`
	// Any of "accept", "reject", "review".
	Decision         string   `json:"decision" api:"required"`
	CorrelationScore float64  `json:"correlation_score" api:"nullable"`
	CustomerName     string   `json:"customer_name" api:"nullable"`
	MatchedName      string   `json:"matched_name" api:"nullable"`
	NamesOnAccount   []string `json:"names_on_account" api:"nullable"`
	Reason           string   `json:"reason" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes            respjson.Field
		Decision         respjson.Field
		CorrelationScore respjson.Field
		CustomerName     respjson.Field
		MatchedName      respjson.Field
		NamesOnAccount   respjson.Field
		Reason           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyReviewGetResponseDataVerificationDetailsBreakdownNameMatch) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyReviewGetResponseDataVerificationDetailsBreakdownNameMatch) UnmarshalJSON

type PaykeyReviewGetResponseResponseType

type PaykeyReviewGetResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaykeyReviewGetResponseResponseTypeObject PaykeyReviewGetResponseResponseType = "object"
	PaykeyReviewGetResponseResponseTypeArray  PaykeyReviewGetResponseResponseType = "array"
	PaykeyReviewGetResponseResponseTypeError  PaykeyReviewGetResponseResponseType = "error"
	PaykeyReviewGetResponseResponseTypeNone   PaykeyReviewGetResponseResponseType = "none"
)

type PaykeyReviewRefreshReviewParams

type PaykeyReviewRefreshReviewParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyReviewService

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

Paykeys are secure tokens that link verified customer identities to their bank accounts. Each Paykey includes built-in balance checking, fraud detection through LSTM machine learning models, and can be reused for subscriptions and recurring payments without storing sensitive data. Paykeys eliminate fraud by ensuring the person initiating payment owns the funding account.

PaykeyReviewService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaykeyReviewService method instead.

func NewPaykeyReviewService

func NewPaykeyReviewService(opts ...option.RequestOption) (r PaykeyReviewService)

NewPaykeyReviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PaykeyReviewService) Decision

func (r *PaykeyReviewService) Decision(ctx context.Context, id string, params PaykeyReviewDecisionParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Update the status of a paykey when in review status

func (*PaykeyReviewService) Get

Get additional details about a paykey.

func (*PaykeyReviewService) RefreshReview

func (r *PaykeyReviewService) RefreshReview(ctx context.Context, id string, body PaykeyReviewRefreshReviewParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Updates the decision of a paykey's review validation. This endpoint allows you to refresh the outcome of a paykey's decision and is useful for correcting or updating the status of a paykey's verification.

type PaykeyService

type PaykeyService struct {

	// Paykeys are secure tokens that link verified customer identities to their bank
	// accounts. Each Paykey includes built-in balance checking, fraud detection
	// through LSTM machine learning models, and can be reused for subscriptions and
	// recurring payments without storing sensitive data. Paykeys eliminate fraud by
	// ensuring the person initiating payment owns the funding account.
	Review PaykeyReviewService
	// contains filtered or unexported fields
}

Paykeys are secure tokens that link verified customer identities to their bank accounts. Each Paykey includes built-in balance checking, fraud detection through LSTM machine learning models, and can be reused for subscriptions and recurring payments without storing sensitive data. Paykeys eliminate fraud by ensuring the person initiating payment owns the funding account.

PaykeyService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaykeyService method instead.

func NewPaykeyService

func NewPaykeyService(opts ...option.RequestOption) (r PaykeyService)

NewPaykeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PaykeyService) Cancel

func (r *PaykeyService) Cancel(ctx context.Context, id string, params PaykeyCancelParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

func (*PaykeyService) Get

func (r *PaykeyService) Get(ctx context.Context, id string, query PaykeyGetParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Retrieves the details of an existing paykey. Supply the unique paykey `id` and Straddle will return the corresponding paykey record , including the `paykey` token value and masked bank account details.

func (*PaykeyService) List

Returns a list of paykeys associated with a Straddle account. This endpoint supports advanced sorting and filtering options.

func (*PaykeyService) ListAutoPaging

Returns a list of paykeys associated with a Straddle account. This endpoint supports advanced sorting and filtering options.

func (*PaykeyService) Reveal

func (r *PaykeyService) Reveal(ctx context.Context, id string, query PaykeyRevealParams, opts ...option.RequestOption) (res *PaykeyRevealResponse, err error)

Retrieves the details of a paykey that has previously been created. Supply the unique paykey ID that was returned from your previous request, and Straddle will return the corresponding paykey information including the unmasked token.

func (*PaykeyService) Unmasked

func (r *PaykeyService) Unmasked(ctx context.Context, id string, query PaykeyUnmaskedParams, opts ...option.RequestOption) (res *PaykeyUnmaskedV1, err error)

Retrieves the unmasked details of an existing paykey. Supply the unique paykey `id` and Straddle will return the corresponding paykey record, including the unmasked bank account details. This endpoint needs to be enabled by Straddle for your account and should only be used when absolutely necessary.

func (*PaykeyService) UpdateBalance

func (r *PaykeyService) UpdateBalance(ctx context.Context, id string, body PaykeyUpdateBalanceParams, opts ...option.RequestOption) (res *PaykeyV1, err error)

Updates the balance of a paykey. This endpoint allows you to refresh the balance of a paykey.

type PaykeySummaryPagedV1

type PaykeySummaryPagedV1 struct {
	Data []PaykeySummaryPagedV1Data `json:"data" api:"required"`
	Meta PaykeySummaryPagedV1Meta   `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaykeySummaryPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1) RawJSON

func (r PaykeySummaryPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1) UnmarshalJSON

func (r *PaykeySummaryPagedV1) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1Data

type PaykeySummaryPagedV1Data struct {
	// Unique identifier for the paykey.
	ID     string                         `json:"id" api:"required" format:"uuid"`
	Config PaykeySummaryPagedV1DataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label that combines the bank name and masked account number to
	// help easility represent this paykey in a UI
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This value is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                        `json:"updated_at" api:"required" format:"date-time"`
	BankData  PaykeySummaryPagedV1DataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string                                `json:"institution_name" api:"nullable"`
	StatusDetails   PaykeySummaryPagedV1DataStatusDetails `json:"status_details"`
	// Indicates whether this paykey is eligible for client-initiated unblocking. Only
	// present for blocked paykeys. True when blocked due to R29 returns and not
	// previously unblocked, false otherwise. Null when paykey is not blocked.
	UnblockEligible bool `json:"unblock_eligible" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		StatusDetails   respjson.Field
		UnblockEligible respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1Data) RawJSON

func (r PaykeySummaryPagedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1Data) UnmarshalJSON

func (r *PaykeySummaryPagedV1Data) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1DataBankData

type PaykeySummaryPagedV1DataBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1DataBankData) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1DataBankData) UnmarshalJSON

func (r *PaykeySummaryPagedV1DataBankData) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1DataConfig

type PaykeySummaryPagedV1DataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1DataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1DataConfig) UnmarshalJSON

func (r *PaykeySummaryPagedV1DataConfig) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1DataStatusDetails

type PaykeySummaryPagedV1DataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1DataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1DataStatusDetails) UnmarshalJSON

func (r *PaykeySummaryPagedV1DataStatusDetails) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1Meta

type PaykeySummaryPagedV1Meta struct {
	// Unique identifier for this API request, useful for troubleshooting.
	APIRequestID string `json:"api_request_id" api:"required" format:"uuid"`
	// Timestamp for this API request, useful for troubleshooting.
	APIRequestTimestamp time.Time `json:"api_request_timestamp" api:"required" format:"date-time"`
	// Maximum allowed page size for this endpoint.
	MaxPageSize int64 `json:"max_page_size" api:"required"`
	// Page number for paginated results.
	PageNumber int64 `json:"page_number" api:"required"`
	// Number of items per page in this response.
	PageSize int64 `json:"page_size" api:"required"`
	// The field that the results were sorted by.
	SortBy string `json:"sort_by" api:"required"`
	// Any of "asc", "desc".
	SortOrder  string `json:"sort_order" api:"required"`
	TotalItems int64  `json:"total_items" api:"required"`
	// The number of pages available.
	TotalPages int64 `json:"total_pages" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIRequestID        respjson.Field
		APIRequestTimestamp respjson.Field
		MaxPageSize         respjson.Field
		PageNumber          respjson.Field
		PageSize            respjson.Field
		SortBy              respjson.Field
		SortOrder           respjson.Field
		TotalItems          respjson.Field
		TotalPages          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeySummaryPagedV1Meta) RawJSON

func (r PaykeySummaryPagedV1Meta) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeySummaryPagedV1Meta) UnmarshalJSON

func (r *PaykeySummaryPagedV1Meta) UnmarshalJSON(data []byte) error

type PaykeySummaryPagedV1ResponseType

type PaykeySummaryPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaykeySummaryPagedV1ResponseTypeObject PaykeySummaryPagedV1ResponseType = "object"
	PaykeySummaryPagedV1ResponseTypeArray  PaykeySummaryPagedV1ResponseType = "array"
	PaykeySummaryPagedV1ResponseTypeError  PaykeySummaryPagedV1ResponseType = "error"
	PaykeySummaryPagedV1ResponseTypeNone   PaykeySummaryPagedV1ResponseType = "none"
)

type PaykeyUnmaskedParams

type PaykeyUnmaskedParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyUnmaskedV1

type PaykeyUnmaskedV1 struct {
	Data PaykeyUnmaskedV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaykeyUnmaskedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1) RawJSON

func (r PaykeyUnmaskedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1) UnmarshalJSON

func (r *PaykeyUnmaskedV1) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1Data

type PaykeyUnmaskedV1Data struct {
	// Unique identifier for the paykey.
	ID     string                     `json:"id" api:"required" format:"uuid"`
	Config PaykeyUnmaskedV1DataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label used to represent this paykey in a UI.
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This value is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time                    `json:"updated_at" api:"required" format:"date-time"`
	Balance   PaykeyUnmaskedV1DataBalance  `json:"balance"`
	BankData  PaykeyUnmaskedV1DataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string                 `json:"metadata" api:"nullable"`
	StatusDetails PaykeyUnmaskedV1DataStatusDetails `json:"status_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1Data) RawJSON

func (r PaykeyUnmaskedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1Data) UnmarshalJSON

func (r *PaykeyUnmaskedV1Data) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1DataBalance

type PaykeyUnmaskedV1DataBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1DataBalance) RawJSON

func (r PaykeyUnmaskedV1DataBalance) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1DataBalance) UnmarshalJSON

func (r *PaykeyUnmaskedV1DataBalance) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1DataBankData

type PaykeyUnmaskedV1DataBankData struct {
	// The bank account number
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1DataBankData) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1DataBankData) UnmarshalJSON

func (r *PaykeyUnmaskedV1DataBankData) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1DataConfig

type PaykeyUnmaskedV1DataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1DataConfig) RawJSON

func (r PaykeyUnmaskedV1DataConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1DataConfig) UnmarshalJSON

func (r *PaykeyUnmaskedV1DataConfig) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1DataStatusDetails

type PaykeyUnmaskedV1DataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyUnmaskedV1DataStatusDetails) RawJSON

Returns the unmodified JSON received from the API

func (*PaykeyUnmaskedV1DataStatusDetails) UnmarshalJSON

func (r *PaykeyUnmaskedV1DataStatusDetails) UnmarshalJSON(data []byte) error

type PaykeyUnmaskedV1ResponseType

type PaykeyUnmaskedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaykeyUnmaskedV1ResponseTypeObject PaykeyUnmaskedV1ResponseType = "object"
	PaykeyUnmaskedV1ResponseTypeArray  PaykeyUnmaskedV1ResponseType = "array"
	PaykeyUnmaskedV1ResponseTypeError  PaykeyUnmaskedV1ResponseType = "error"
	PaykeyUnmaskedV1ResponseTypeNone   PaykeyUnmaskedV1ResponseType = "none"
)

type PaykeyUpdateBalanceParams

type PaykeyUpdateBalanceParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PaykeyV1

type PaykeyV1 struct {
	Data PaykeyV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaykeyV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1) RawJSON

func (r PaykeyV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1) UnmarshalJSON

func (r *PaykeyV1) UnmarshalJSON(data []byte) error

type PaykeyV1Data

type PaykeyV1Data struct {
	// Unique identifier for the paykey.
	ID     string             `json:"id" api:"required" format:"uuid"`
	Config PaykeyV1DataConfig `json:"config" api:"required"`
	// Timestamp of when the paykey was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable label used to represent this paykey in a UI.
	Label string `json:"label" api:"required"`
	// The tokenized paykey value. This value is used to create payments and should be
	// stored securely.
	Paykey string `json:"paykey" api:"required"`
	// Any of "bank_account", "straddle", "mx", "plaid", "tan", "quiltt".
	Source string `json:"source" api:"required"`
	// Any of "pending", "active", "inactive", "rejected", "review", "blocked".
	Status string `json:"status" api:"required"`
	// Timestamp of the most recent update to the paykey.
	UpdatedAt time.Time            `json:"updated_at" api:"required" format:"date-time"`
	Balance   PaykeyV1DataBalance  `json:"balance"`
	BankData  PaykeyV1DataBankData `json:"bank_data"`
	// Unique identifier of the related customer object.
	CustomerID string `json:"customer_id" api:"nullable" format:"uuid"`
	// Expiration date and time of the paykey, if applicable.
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// Unique identifier for the paykey in your database, used for cross-referencing
	// between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Name of the financial institution.
	InstitutionName string `json:"institution_name" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the paykey in a structured format.
	Metadata      map[string]string         `json:"metadata" api:"nullable"`
	StatusDetails PaykeyV1DataStatusDetails `json:"status_details"`
	// Indicates whether this paykey is eligible for client-initiated unblocking. Only
	// present for blocked paykeys. True when blocked due to R29 returns and not
	// previously unblocked, false otherwise. Null when paykey is not blocked.
	UnblockEligible bool `json:"unblock_eligible" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Config          respjson.Field
		CreatedAt       respjson.Field
		Label           respjson.Field
		Paykey          respjson.Field
		Source          respjson.Field
		Status          respjson.Field
		UpdatedAt       respjson.Field
		Balance         respjson.Field
		BankData        respjson.Field
		CustomerID      respjson.Field
		ExpiresAt       respjson.Field
		ExternalID      respjson.Field
		InstitutionName respjson.Field
		Metadata        respjson.Field
		StatusDetails   respjson.Field
		UnblockEligible respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1Data) RawJSON

func (r PaykeyV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1Data) UnmarshalJSON

func (r *PaykeyV1Data) UnmarshalJSON(data []byte) error

type PaykeyV1DataBalance

type PaykeyV1DataBalance struct {
	// Any of "pending", "completed", "failed".
	Status string `json:"status" api:"required"`
	// Account Balance when last retrieved
	AccountBalance int64 `json:"account_balance" api:"nullable"`
	// Last time account balance was updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		AccountBalance respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1DataBalance) RawJSON

func (r PaykeyV1DataBalance) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1DataBalance) UnmarshalJSON

func (r *PaykeyV1DataBalance) UnmarshalJSON(data []byte) error

type PaykeyV1DataBankData

type PaykeyV1DataBankData struct {
	// Bank account number. This value is masked by default for security reasons. Use
	// the /unmask endpoint to access the unmasked value.
	AccountNumber string `json:"account_number" api:"required"`
	// Any of "checking", "savings".
	AccountType string `json:"account_type" api:"required"`
	// The routing number of the bank account.
	RoutingNumber string `json:"routing_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountNumber respjson.Field
		AccountType   respjson.Field
		RoutingNumber respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1DataBankData) RawJSON

func (r PaykeyV1DataBankData) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1DataBankData) UnmarshalJSON

func (r *PaykeyV1DataBankData) UnmarshalJSON(data []byte) error

type PaykeyV1DataConfig

type PaykeyV1DataConfig struct {
	// Any of "inline", "background", "skip".
	ProcessingMethod string `json:"processing_method"`
	// Any of "standard", "active", "rejected", "review".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProcessingMethod respjson.Field
		SandboxOutcome   respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1DataConfig) RawJSON

func (r PaykeyV1DataConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1DataConfig) UnmarshalJSON

func (r *PaykeyV1DataConfig) UnmarshalJSON(data []byte) error

type PaykeyV1DataStatusDetails

type PaykeyV1DataStatusDetails struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the current status.
	Message string `json:"message" api:"required"`
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaykeyV1DataStatusDetails) RawJSON

func (r PaykeyV1DataStatusDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaykeyV1DataStatusDetails) UnmarshalJSON

func (r *PaykeyV1DataStatusDetails) UnmarshalJSON(data []byte) error

type PaykeyV1ResponseType

type PaykeyV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaykeyV1ResponseTypeObject PaykeyV1ResponseType = "object"
	PaykeyV1ResponseTypeArray  PaykeyV1ResponseType = "array"
	PaykeyV1ResponseTypeError  PaykeyV1ResponseType = "error"
	PaykeyV1ResponseTypeNone   PaykeyV1ResponseType = "none"
)

type PaymentListParams

type PaymentListParams struct {
	// Search using the `customer_id` of a `charge` or `payout`.
	CustomerID      param.Opt[string] `query:"customer_id,omitzero" format:"uuid" json:"-"`
	DefaultPageSize param.Opt[int64]  `query:"default_page_size,omitzero" json:"-"`
	// Search using the `external_id` of a `charge` or `payout`.
	ExternalID param.Opt[string] `query:"external_id,omitzero" json:"-"`
	// Search using the `funding_id` of a `charge` or `payout`.
	FundingID param.Opt[string] `query:"funding_id,omitzero" format:"uuid" json:"-"`
	// Include the metadata for payments in the returned data.
	IncludeMetadata param.Opt[bool] `query:"include_metadata,omitzero" json:"-"`
	// Search using a maximum `amount` of a `charge` or `payout`.
	MaxAmount param.Opt[int64] `query:"max_amount,omitzero" json:"-"`
	// Search using the latest `created_at` date of a `charge` or `payout`.
	MaxCreatedAt param.Opt[time.Time] `query:"max_created_at,omitzero" format:"date-time" json:"-"`
	// Search using the latest `effective_date` of a `charge` or `payout`.
	MaxEffectiveAt param.Opt[time.Time] `query:"max_effective_at,omitzero" format:"date-time" json:"-"`
	// Search using the latest `payment_date` of a `charge` or `payout`.
	MaxPaymentDate param.Opt[time.Time] `query:"max_payment_date,omitzero" format:"date" json:"-"`
	// Search using the minimum `amount of a `charge`or`payout`.
	MinAmount param.Opt[int64] `query:"min_amount,omitzero" json:"-"`
	// Search using the earliest `created_at` date of a `charge` or `payout`.
	MinCreatedAt param.Opt[time.Time] `query:"min_created_at,omitzero" format:"date-time" json:"-"`
	// Search using the earliest `effective_date` of a `charge` or `payout`.
	MinEffectiveAt param.Opt[time.Time] `query:"min_effective_at,omitzero" format:"date-time" json:"-"`
	// Search using the earliest ` `of a `charge` or `payout`.
	MinPaymentDate param.Opt[time.Time] `query:"min_payment_date,omitzero" format:"date" json:"-"`
	// Results page number. Starts at page 1.
	PageNumber param.Opt[int64] `query:"page_number,omitzero" json:"-"`
	// Results page size. Max value: 1000
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Search using the `paykey` of a `charge` or `payout`.
	Paykey param.Opt[string] `query:"paykey,omitzero" json:"-"`
	// Search using the `paykey_id` of a `charge` or `payout`.
	PaykeyID param.Opt[string] `query:"paykey_id,omitzero" format:"uuid" json:"-"`
	// Search using the `id` of a `charge` or `payout`.
	PaymentID param.Opt[string] `query:"payment_id,omitzero" format:"uuid" json:"-"`
	// Search using a text string associated with a `charge` or `payout`.
	SearchText        param.Opt[string] `query:"search_text,omitzero" json:"-"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// The field to sort the results by.
	//
	// Any of "created_at", "payment_date", "effective_at", "id", "amount".
	DefaultSort PaymentListParamsDefaultSort `query:"default_sort,omitzero" json:"-"`
	// Any of "asc", "desc".
	DefaultSortOrder PaymentListParamsDefaultSortOrder `query:"default_sort_order,omitzero" json:"-"`
	// Search by the status of a `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	PaymentStatus []string `query:"payment_status,omitzero" json:"-"`
	// Search by the type of a `charge` or `payout`.
	//
	// Any of "charge", "payout".
	PaymentType []string `query:"payment_type,omitzero" json:"-"`
	// The field to sort the results by.
	//
	// Any of "created_at", "payment_date", "effective_at", "id", "amount".
	SortBy PaymentListParamsSortBy `query:"sort_by,omitzero" json:"-"`
	// Any of "asc", "desc".
	SortOrder PaymentListParamsSortOrder `query:"sort_order,omitzero" json:"-"`
	// Reason for latest payment status change.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	StatusReason []string `query:"status_reason,omitzero" json:"-"`
	// Source of latest payment status change.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	StatusSource []string `query:"status_source,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (PaymentListParams) URLQuery

func (r PaymentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes PaymentListParams's query parameters as `url.Values`.

type PaymentListParamsDefaultSort

type PaymentListParamsDefaultSort string

The field to sort the results by.

const (
	PaymentListParamsDefaultSortCreatedAt   PaymentListParamsDefaultSort = "created_at"
	PaymentListParamsDefaultSortPaymentDate PaymentListParamsDefaultSort = "payment_date"
	PaymentListParamsDefaultSortEffectiveAt PaymentListParamsDefaultSort = "effective_at"
	PaymentListParamsDefaultSortID          PaymentListParamsDefaultSort = "id"
	PaymentListParamsDefaultSortAmount      PaymentListParamsDefaultSort = "amount"
)

type PaymentListParamsDefaultSortOrder

type PaymentListParamsDefaultSortOrder string
const (
	PaymentListParamsDefaultSortOrderAsc  PaymentListParamsDefaultSortOrder = "asc"
	PaymentListParamsDefaultSortOrderDesc PaymentListParamsDefaultSortOrder = "desc"
)

type PaymentListParamsSortBy

type PaymentListParamsSortBy string

The field to sort the results by.

const (
	PaymentListParamsSortByCreatedAt   PaymentListParamsSortBy = "created_at"
	PaymentListParamsSortByPaymentDate PaymentListParamsSortBy = "payment_date"
	PaymentListParamsSortByEffectiveAt PaymentListParamsSortBy = "effective_at"
	PaymentListParamsSortByID          PaymentListParamsSortBy = "id"
	PaymentListParamsSortByAmount      PaymentListParamsSortBy = "amount"
)

type PaymentListParamsSortOrder

type PaymentListParamsSortOrder string
const (
	PaymentListParamsSortOrderAsc  PaymentListParamsSortOrder = "asc"
	PaymentListParamsSortOrderDesc PaymentListParamsSortOrder = "desc"
)

type PaymentService

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

Payments provide endpoints to filter both Charges and Payouts with multiple different parameters.

PaymentService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentService method instead.

func NewPaymentService

func NewPaymentService(opts ...option.RequestOption) (r PaymentService)

NewPaymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PaymentService) List

Search for payments, including `charges` and `payouts`, using a variety of criteria. This endpoint supports advanced sorting and filtering options.

func (*PaymentService) ListAutoPaging

Search for payments, including `charges` and `payouts`, using a variety of criteria. This endpoint supports advanced sorting and filtering options.

type PaymentSummaryPagedV1

type PaymentSummaryPagedV1 struct {
	Data []PaymentSummaryPagedV1Data `json:"data" api:"required"`
	Meta PaymentSummaryPagedV1Meta   `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PaymentSummaryPagedV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaymentSummaryPagedV1) RawJSON

func (r PaymentSummaryPagedV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentSummaryPagedV1) UnmarshalJSON

func (r *PaymentSummaryPagedV1) UnmarshalJSON(data []byte) error

type PaymentSummaryPagedV1Data

type PaymentSummaryPagedV1Data struct {
	// Unique identifier for the `charge` or `payout`.
	ID string `json:"id" api:"required" format:"uuid"`
	// The amount of the `charge` or `payout` in cents.
	Amount int64 `json:"amount" api:"required"`
	// The time the `charge` or `payout` was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The currency of the `charge` or `payout`. Only USD is supported.
	Currency string `json:"currency" api:"required"`
	// An arbitrary description for the `charge` or `payout`.
	Description string `json:"description" api:"required"`
	// Unique identifier for the `charge` or `payout` in your database. This value must
	// be unique across all charges or payouts.
	ExternalID string `json:"external_id" api:"required"`
	// Funding ids.
	FundingIDs []string `json:"funding_ids" api:"required" format:"uuid"`
	// Value of the `paykey` used for the `charge` or `payout`.
	Paykey string `json:"paykey" api:"required"`
	// The desired date on which the payment should be occur. For charges, this means
	// the date you want the customer to be debited on. For payouts, this means the
	// date you want the funds to be sent from your bank account.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// The type of payment. Valid values are `charge` or `payout`.
	//
	// Any of "charge", "payout".
	PaymentType string `json:"payment_type" api:"required"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// Details about the current status of the `charge` or `payout`.
	StatusDetails shared.StatusDetailsV1 `json:"status_details" api:"required"`
	// Trace ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// The time the `charge` or `payout` was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Information about the customer associated with the charge or payout.
	CustomerDetails shared.CustomerDetailsV1 `json:"customer_details"`
	// The actual date on which the payment occurred. For charges, this is the date the
	// customer was debited. For payouts, this is the date the funds were sent from
	// your bank account.
	EffectiveAt time.Time `json:"effective_at" api:"nullable" format:"date-time"`
	// Unique identifier for the funding event associated with the `charge` or
	// `payout`.
	FundingID string `json:"funding_id" api:"nullable" format:"uuid"`
	// Metadata for payment - only included if requested.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// Information about the paykey used for the `charge` or `payout`.
	PaykeyDetails shared.PaykeyDetailsV1 `json:"paykey_details"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Amount          respjson.Field
		CreatedAt       respjson.Field
		Currency        respjson.Field
		Description     respjson.Field
		ExternalID      respjson.Field
		FundingIDs      respjson.Field
		Paykey          respjson.Field
		PaymentDate     respjson.Field
		PaymentType     respjson.Field
		Status          respjson.Field
		StatusDetails   respjson.Field
		TraceIDs        respjson.Field
		UpdatedAt       respjson.Field
		CustomerDetails respjson.Field
		EffectiveAt     respjson.Field
		FundingID       respjson.Field
		Metadata        respjson.Field
		PaykeyDetails   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaymentSummaryPagedV1Data) RawJSON

func (r PaymentSummaryPagedV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentSummaryPagedV1Data) UnmarshalJSON

func (r *PaymentSummaryPagedV1Data) UnmarshalJSON(data []byte) error

type PaymentSummaryPagedV1Meta

type PaymentSummaryPagedV1Meta struct {
	// Unique identifier for this API request, useful for troubleshooting.
	APIRequestID string `json:"api_request_id" api:"required" format:"uuid"`
	// Timestamp for this API request, useful for troubleshooting.
	APIRequestTimestamp time.Time `json:"api_request_timestamp" api:"required" format:"date-time"`
	// Maximum allowed page size for this endpoint.
	MaxPageSize int64 `json:"max_page_size" api:"required"`
	// Page number for paginated results.
	PageNumber int64 `json:"page_number" api:"required"`
	// Number of items per page in this response.
	PageSize int64 `json:"page_size" api:"required"`
	// The field that the results were sorted by.
	SortBy string `json:"sort_by" api:"required"`
	// Any of "asc", "desc".
	SortOrder  string `json:"sort_order" api:"required"`
	TotalItems int64  `json:"total_items" api:"required"`
	// The number of pages available.
	TotalPages int64 `json:"total_pages" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIRequestID        respjson.Field
		APIRequestTimestamp respjson.Field
		MaxPageSize         respjson.Field
		PageNumber          respjson.Field
		PageSize            respjson.Field
		SortBy              respjson.Field
		SortOrder           respjson.Field
		TotalItems          respjson.Field
		TotalPages          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaymentSummaryPagedV1Meta) RawJSON

func (r PaymentSummaryPagedV1Meta) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentSummaryPagedV1Meta) UnmarshalJSON

func (r *PaymentSummaryPagedV1Meta) UnmarshalJSON(data []byte) error

type PaymentSummaryPagedV1ResponseType

type PaymentSummaryPagedV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PaymentSummaryPagedV1ResponseTypeObject PaymentSummaryPagedV1ResponseType = "object"
	PaymentSummaryPagedV1ResponseTypeArray  PaymentSummaryPagedV1ResponseType = "array"
	PaymentSummaryPagedV1ResponseTypeError  PaymentSummaryPagedV1ResponseType = "error"
	PaymentSummaryPagedV1ResponseTypeNone   PaymentSummaryPagedV1ResponseType = "none"
)

type PayoutCancelParams

type PayoutCancelParams struct {
	// Details about why the payout status was updated.
	Reason            string            `json:"reason" api:"required"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (PayoutCancelParams) MarshalJSON

func (r PayoutCancelParams) MarshalJSON() (data []byte, err error)

func (*PayoutCancelParams) UnmarshalJSON

func (r *PayoutCancelParams) UnmarshalJSON(data []byte) error

type PayoutGetParams

type PayoutGetParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PayoutHoldParams

type PayoutHoldParams struct {
	// Details about why the payout status was updated.
	Reason            string            `json:"reason" api:"required"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (PayoutHoldParams) MarshalJSON

func (r PayoutHoldParams) MarshalJSON() (data []byte, err error)

func (*PayoutHoldParams) UnmarshalJSON

func (r *PayoutHoldParams) UnmarshalJSON(data []byte) error

type PayoutNewParams

type PayoutNewParams struct {
	// An arbitrary description for the payout.
	Description param.Opt[string] `json:"description,omitzero" api:"required"`
	// The amount of the payout in cents.
	Amount int64 `json:"amount" api:"required"`
	// The currency of the payout. Only USD is supported.
	Currency string `json:"currency" api:"required"`
	// Information about the device used when the customer authorized the payout.
	Device shared.DeviceInfoV1Param `json:"device,omitzero" api:"required"`
	// Unique identifier for the payout in your database. This value must be unique
	// across all payouts.
	ExternalID string `json:"external_id" api:"required"`
	// Value of the `paykey` used for the payout.
	Paykey string `json:"paykey" api:"required"`
	// The desired date on which the payout should be occur. For payouts, this means
	// the date you want the funds to be sent from your bank account.
	PaymentDate       time.Time         `json:"payment_date" api:"required" format:"date"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the payout in a structured format.
	Metadata map[string]string     `json:"metadata,omitzero"`
	Config   PayoutNewParamsConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

func (PayoutNewParams) MarshalJSON

func (r PayoutNewParams) MarshalJSON() (data []byte, err error)

func (*PayoutNewParams) UnmarshalJSON

func (r *PayoutNewParams) UnmarshalJSON(data []byte) error

type PayoutNewParamsConfig

type PayoutNewParamsConfig struct {
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold param.Opt[bool] `json:"auto_hold,omitzero"`
	// The reason the payout is being automatically held on creation.
	AutoHoldMessage param.Opt[string] `json:"auto_hold_message,omitzero"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome,omitzero"`
	// contains filtered or unexported fields
}

func (PayoutNewParamsConfig) MarshalJSON

func (r PayoutNewParamsConfig) MarshalJSON() (data []byte, err error)

func (*PayoutNewParamsConfig) UnmarshalJSON

func (r *PayoutNewParamsConfig) UnmarshalJSON(data []byte) error

type PayoutReleaseParams

type PayoutReleaseParams struct {
	// Details about why the payout status was updated.
	Reason            string            `json:"reason" api:"required"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (PayoutReleaseParams) MarshalJSON

func (r PayoutReleaseParams) MarshalJSON() (data []byte, err error)

func (*PayoutReleaseParams) UnmarshalJSON

func (r *PayoutReleaseParams) UnmarshalJSON(data []byte) error

type PayoutService

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

Payouts represent transfers from Straddle to customer bank accounts. Create payouts to handle disbursements, process refunds, or manage marketplace settlements. Use payouts to send money quickly and securely with the most cost-effective rail automatically selected.

PayoutService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPayoutService method instead.

func NewPayoutService

func NewPayoutService(opts ...option.RequestOption) (r PayoutService)

NewPayoutService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PayoutService) Cancel

func (r *PayoutService) Cancel(ctx context.Context, id string, params PayoutCancelParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Cancel a payout to prevent it from being processed. The status of the payout must be `created`, `scheduled`, or `on_hold`.

func (*PayoutService) Get

func (r *PayoutService) Get(ctx context.Context, id string, query PayoutGetParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Retrieves the details of an existing payout. Supply the unique payout `id` to retrieve the corresponding payout information.

func (*PayoutService) Hold

func (r *PayoutService) Hold(ctx context.Context, id string, params PayoutHoldParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Hold a payout to prevent it from being processed. The status of the payout must be `created`, `scheduled`, or `on_hold`.

func (*PayoutService) New

func (r *PayoutService) New(ctx context.Context, params PayoutNewParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Use payouts to send money to your customers.

func (*PayoutService) Release

func (r *PayoutService) Release(ctx context.Context, id string, params PayoutReleaseParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Release a payout from a `hold` status to allow it to be rescheduled for processing.

func (*PayoutService) Unmask

func (r *PayoutService) Unmask(ctx context.Context, id string, query PayoutUnmaskParams, opts ...option.RequestOption) (res *PayoutUnmaskResponse, err error)

Get a payout by id.

func (*PayoutService) Update

func (r *PayoutService) Update(ctx context.Context, id string, params PayoutUpdateParams, opts ...option.RequestOption) (res *PayoutV1, err error)

Update the details of a payout prior to processing. The status of the payout must be `created`, `scheduled`, or `on_hold`.

type PayoutUnmaskParams

type PayoutUnmaskParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type PayoutUnmaskResponse

type PayoutUnmaskResponse struct {
	Data PayoutUnmaskResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PayoutUnmaskResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutUnmaskResponse) RawJSON

func (r PayoutUnmaskResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutUnmaskResponse) UnmarshalJSON

func (r *PayoutUnmaskResponse) UnmarshalJSON(data []byte) error

type PayoutUnmaskResponseData

type PayoutUnmaskResponseData struct {
	// Id.
	ID string `json:"id" api:"required" format:"uuid"`
	// Amount.
	Amount int64                          `json:"amount" api:"required"`
	Config PayoutUnmaskResponseDataConfig `json:"config" api:"required"`
	// Currency.
	Currency string `json:"currency" api:"required"`
	// Description.
	Description string                         `json:"description" api:"required"`
	Device      PayoutUnmaskResponseDataDevice `json:"device" api:"required"`
	// External id.
	ExternalID string `json:"external_id" api:"required"`
	// Funding Ids
	FundingIDs []string `json:"funding_ids" api:"required" format:"uuid"`
	// Paykey.
	Paykey string `json:"paykey" api:"required"`
	// Payment date.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status        string                 `json:"status" api:"required"`
	StatusDetails shared.StatusDetailsV1 `json:"status_details" api:"required"`
	// Status history.
	StatusHistory []PayoutUnmaskResponseDataStatusHistory `json:"status_history" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// Created at.
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Information about the customer associated with the charge or payout.
	CustomerDetails shared.CustomerDetailsV1 `json:"customer_details"`
	// Effective at.
	EffectiveAt time.Time `json:"effective_at" api:"nullable" format:"date-time"`
	// Metadata.
	Metadata      map[string]string      `json:"metadata" api:"nullable"`
	PaykeyDetails shared.PaykeyDetailsV1 `json:"paykey_details"`
	// The payment rail used for the charge or payout.
	//
	// Any of "ach".
	PaymentRail string `json:"payment_rail"`
	// Processed at.
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Related payments.
	//
	// Any of "original", "resubmit", "refund".
	RelatedPayments map[string]string `json:"related_payments" api:"nullable"`
	// Updated at.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Amount          respjson.Field
		Config          respjson.Field
		Currency        respjson.Field
		Description     respjson.Field
		Device          respjson.Field
		ExternalID      respjson.Field
		FundingIDs      respjson.Field
		Paykey          respjson.Field
		PaymentDate     respjson.Field
		Status          respjson.Field
		StatusDetails   respjson.Field
		StatusHistory   respjson.Field
		TraceIDs        respjson.Field
		CreatedAt       respjson.Field
		CustomerDetails respjson.Field
		EffectiveAt     respjson.Field
		Metadata        respjson.Field
		PaykeyDetails   respjson.Field
		PaymentRail     respjson.Field
		ProcessedAt     respjson.Field
		RelatedPayments respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutUnmaskResponseData) RawJSON

func (r PayoutUnmaskResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutUnmaskResponseData) UnmarshalJSON

func (r *PayoutUnmaskResponseData) UnmarshalJSON(data []byte) error

type PayoutUnmaskResponseDataConfig

type PayoutUnmaskResponseDataConfig struct {
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold bool `json:"auto_hold" api:"nullable"`
	// The reason the payout is being automatically held on creation.
	AutoHoldMessage string `json:"auto_hold_message" api:"nullable"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AutoHold        respjson.Field
		AutoHoldMessage respjson.Field
		SandboxOutcome  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutUnmaskResponseDataConfig) RawJSON

Returns the unmodified JSON received from the API

func (*PayoutUnmaskResponseDataConfig) UnmarshalJSON

func (r *PayoutUnmaskResponseDataConfig) UnmarshalJSON(data []byte) error

type PayoutUnmaskResponseDataDevice

type PayoutUnmaskResponseDataDevice struct {
	// Ip address.
	IPAddress string `json:"ip_address" api:"required" format:"**.**.**.**"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutUnmaskResponseDataDevice) RawJSON

Returns the unmodified JSON received from the API

func (*PayoutUnmaskResponseDataDevice) UnmarshalJSON

func (r *PayoutUnmaskResponseDataDevice) UnmarshalJSON(data []byte) error

type PayoutUnmaskResponseDataStatusHistory

type PayoutUnmaskResponseDataStatusHistory struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Status      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutUnmaskResponseDataStatusHistory) RawJSON

Returns the unmodified JSON received from the API

func (*PayoutUnmaskResponseDataStatusHistory) UnmarshalJSON

func (r *PayoutUnmaskResponseDataStatusHistory) UnmarshalJSON(data []byte) error

type PayoutUnmaskResponseResponseType

type PayoutUnmaskResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PayoutUnmaskResponseResponseTypeObject PayoutUnmaskResponseResponseType = "object"
	PayoutUnmaskResponseResponseTypeArray  PayoutUnmaskResponseResponseType = "array"
	PayoutUnmaskResponseResponseTypeError  PayoutUnmaskResponseResponseType = "error"
	PayoutUnmaskResponseResponseTypeNone   PayoutUnmaskResponseResponseType = "none"
)

type PayoutUpdateParams

type PayoutUpdateParams struct {
	// An arbitrary description for the payout.
	Description param.Opt[string] `json:"description,omitzero" api:"required"`
	// The amount of the payout in cents.
	Amount int64 `json:"amount" api:"required"`
	// The desired date on which the payment should be occur. For payouts, this means
	// the date you want the funds to be sent from your bank account.
	PaymentDate       time.Time         `json:"payment_date" api:"required" format:"date"`
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	IdempotencyKey    param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the payout in a structured format.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (PayoutUpdateParams) MarshalJSON

func (r PayoutUpdateParams) MarshalJSON() (data []byte, err error)

func (*PayoutUpdateParams) UnmarshalJSON

func (r *PayoutUpdateParams) UnmarshalJSON(data []byte) error

type PayoutV1

type PayoutV1 struct {
	Data PayoutV1Data `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType PayoutV1ResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutV1) RawJSON

func (r PayoutV1) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutV1) UnmarshalJSON

func (r *PayoutV1) UnmarshalJSON(data []byte) error

type PayoutV1Data

type PayoutV1Data struct {
	// Unique identifier for the payout.
	ID string `json:"id" api:"required" format:"uuid"`
	// The amount of the payout in cents.
	Amount int64 `json:"amount" api:"required"`
	// Configuration for the payout.
	Config PayoutV1DataConfig `json:"config" api:"required"`
	// The currency of the payout. Only USD is supported.
	Currency string `json:"currency" api:"required"`
	// An arbitrary description for the payout.
	Description string `json:"description" api:"required"`
	// Information about the device used when the customer authorized the payout.
	Device shared.DeviceInfoV1 `json:"device" api:"required"`
	// Unique identifier for the payout in your database. This value must be unique
	// across all payouts.
	ExternalID string `json:"external_id" api:"required"`
	// Funding Ids
	FundingIDs []string `json:"funding_ids" api:"required" format:"uuid"`
	// Value of the `paykey` used for the payout.
	Paykey string `json:"paykey" api:"required"`
	// The desired date on which the payment should be occur. For payouts, this means
	// the date you want the funds to be sent from your bank account.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// The current status of the payout.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// Details about the current status of the payout.
	StatusDetails shared.StatusDetailsV1 `json:"status_details" api:"required"`
	// History of the status changes for the payout.
	StatusHistory []PayoutV1DataStatusHistory `json:"status_history" api:"required"`
	// Trace Ids.
	TraceIDs map[string]string `json:"trace_ids" api:"required"`
	// The time the payout was created.
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Information about the customer associated with the payout.
	CustomerDetails shared.CustomerDetailsV1 `json:"customer_details"`
	// The actual date on which the payment occurred. For payouts, this is the date the
	// funds were sent from your bank account.
	EffectiveAt time.Time `json:"effective_at" api:"nullable" format:"date-time"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the payout in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	// Information about the paykey used for the payout.
	PaykeyDetails shared.PaykeyDetailsV1 `json:"paykey_details"`
	// The payment rail used for the payout.
	//
	// Any of "ach".
	PaymentRail string `json:"payment_rail"`
	// The time the payout was processed by Straddle and originated to the payment
	// rail.
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Related payments.
	//
	// Any of "original", "resubmit", "refund".
	RelatedPayments map[string]string `json:"related_payments" api:"nullable"`
	// The time the payout was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Amount          respjson.Field
		Config          respjson.Field
		Currency        respjson.Field
		Description     respjson.Field
		Device          respjson.Field
		ExternalID      respjson.Field
		FundingIDs      respjson.Field
		Paykey          respjson.Field
		PaymentDate     respjson.Field
		Status          respjson.Field
		StatusDetails   respjson.Field
		StatusHistory   respjson.Field
		TraceIDs        respjson.Field
		CreatedAt       respjson.Field
		CustomerDetails respjson.Field
		EffectiveAt     respjson.Field
		Metadata        respjson.Field
		PaykeyDetails   respjson.Field
		PaymentRail     respjson.Field
		ProcessedAt     respjson.Field
		RelatedPayments respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutV1Data) RawJSON

func (r PayoutV1Data) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutV1Data) UnmarshalJSON

func (r *PayoutV1Data) UnmarshalJSON(data []byte) error

type PayoutV1DataConfig

type PayoutV1DataConfig struct {
	// Defines whether to automatically place this charge on hold after being created.
	AutoHold bool `json:"auto_hold" api:"nullable"`
	// The reason the payout is being automatically held on creation.
	AutoHoldMessage string `json:"auto_hold_message" api:"nullable"`
	// Payment will simulate processing if not Standard.
	//
	// Any of "standard", "paid", "on_hold_daily_limit", "cancelled_for_fraud_risk",
	// "cancelled_for_balance_check", "failed_insufficient_funds",
	// "reversed_insufficient_funds", "failed_customer_dispute",
	// "reversed_customer_dispute", "failed_closed_bank_account",
	// "reversed_closed_bank_account".
	SandboxOutcome string `json:"sandbox_outcome"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AutoHold        respjson.Field
		AutoHoldMessage respjson.Field
		SandboxOutcome  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for the payout.

func (PayoutV1DataConfig) RawJSON

func (r PayoutV1DataConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutV1DataConfig) UnmarshalJSON

func (r *PayoutV1DataConfig) UnmarshalJSON(data []byte) error

type PayoutV1DataStatusHistory

type PayoutV1DataStatusHistory struct {
	// The time the status change occurred.
	ChangedAt time.Time `json:"changed_at" api:"required" format:"date-time"`
	// A human-readable description of the status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "insufficient_funds", "closed_bank_account", "invalid_bank_account",
	// "invalid_routing", "disputed", "payment_stopped", "owner_deceased",
	// "frozen_bank_account", "risk_review", "fraudulent", "duplicate_entry",
	// "invalid_paykey", "payment_blocked", "amount_too_large", "too_many_attempts",
	// "internal_system_error", "user_request", "ok", "other_network_return",
	// "payout_refused", "cancel_request", "failed_verification", "require_review",
	// "blocked_by_system", "watchtower_review", "validating", "auto_hold".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`).
	// This helps in tracking the cause of status updates.
	//
	// Any of "watchtower", "bank_decline", "customer_dispute", "user_action",
	// "system".
	Source string `json:"source" api:"required"`
	// The current status of the `charge` or `payout`.
	//
	// Any of "created", "scheduled", "failed", "cancelled", "on_hold", "pending",
	// "paid", "reversed", "validating".
	Status string `json:"status" api:"required"`
	// The status code if applicable.
	Code string `json:"code" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChangedAt   respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		Status      respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PayoutV1DataStatusHistory) RawJSON

func (r PayoutV1DataStatusHistory) RawJSON() string

Returns the unmodified JSON received from the API

func (*PayoutV1DataStatusHistory) UnmarshalJSON

func (r *PayoutV1DataStatusHistory) UnmarshalJSON(data []byte) error

type PayoutV1ResponseType

type PayoutV1ResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	PayoutV1ResponseTypeObject PayoutV1ResponseType = "object"
	PayoutV1ResponseTypeArray  PayoutV1ResponseType = "array"
	PayoutV1ResponseTypeError  PayoutV1ResponseType = "error"
	PayoutV1ResponseTypeNone   PayoutV1ResponseType = "none"
)

type ReportNewTotalCustomersByStatusParams

type ReportNewTotalCustomersByStatusParams struct {
	CorrelationID     param.Opt[string] `header:"Correlation-Id,omitzero" json:"-"`
	RequestID         param.Opt[string] `header:"Request-Id,omitzero" json:"-"`
	StraddleAccountID param.Opt[string] `header:"Straddle-Account-Id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ReportNewTotalCustomersByStatusResponse

type ReportNewTotalCustomersByStatusResponse struct {
	Data ReportNewTotalCustomersByStatusResponseData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType ReportNewTotalCustomersByStatusResponseResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportNewTotalCustomersByStatusResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ReportNewTotalCustomersByStatusResponse) UnmarshalJSON

func (r *ReportNewTotalCustomersByStatusResponse) UnmarshalJSON(data []byte) error

type ReportNewTotalCustomersByStatusResponseData

type ReportNewTotalCustomersByStatusResponseData struct {
	Inactive int64 `json:"inactive" api:"required"`
	Pending  int64 `json:"pending" api:"required"`
	Rejected int64 `json:"rejected" api:"required"`
	Review   int64 `json:"review" api:"required"`
	Verified int64 `json:"verified" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Inactive    respjson.Field
		Pending     respjson.Field
		Rejected    respjson.Field
		Review      respjson.Field
		Verified    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportNewTotalCustomersByStatusResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*ReportNewTotalCustomersByStatusResponseData) UnmarshalJSON

func (r *ReportNewTotalCustomersByStatusResponseData) UnmarshalJSON(data []byte) error

type ReportNewTotalCustomersByStatusResponseResponseType

type ReportNewTotalCustomersByStatusResponseResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	ReportNewTotalCustomersByStatusResponseResponseTypeObject ReportNewTotalCustomersByStatusResponseResponseType = "object"
	ReportNewTotalCustomersByStatusResponseResponseTypeArray  ReportNewTotalCustomersByStatusResponseResponseType = "array"
	ReportNewTotalCustomersByStatusResponseResponseTypeError  ReportNewTotalCustomersByStatusResponseResponseType = "error"
	ReportNewTotalCustomersByStatusResponseResponseTypeNone   ReportNewTotalCustomersByStatusResponseResponseType = "none"
)

type ReportService

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

ReportService contains methods and other services that help with interacting with the straddle API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReportService method instead.

func NewReportService

func NewReportService(opts ...option.RequestOption) (r ReportService)

NewReportService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Representative

type Representative struct {
	Data RepresentativeData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier and timestamp.
	Meta shared.ResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType RepresentativeResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Representative) RawJSON

func (r Representative) RawJSON() string

Returns the unmodified JSON received from the API

func (*Representative) UnmarshalJSON

func (r *Representative) UnmarshalJSON(data []byte) error

type RepresentativeData

type RepresentativeData struct {
	// Unique identifier for the representative.
	ID string `json:"id" api:"required" format:"uuid"`
	// The unique identifier of the account this representative is associated with.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Timestamp of when the representative was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The date of birth of the representative, in ISO 8601 format (YYYY-MM-DD).
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// The email address of the representative.
	Email string `json:"email" api:"required" format:"email"`
	// The first name of the representative.
	FirstName string `json:"first_name" api:"required"`
	// The last name of the representative.
	LastName string `json:"last_name" api:"required"`
	// The mobile phone number of the representative.
	MobileNumber string                         `json:"mobile_number" api:"required"`
	Name         string                         `json:"name" api:"required"`
	Relationship RepresentativeDataRelationship `json:"relationship" api:"required"`
	// The last 4 digits of the representative's Social Security Number.
	SsnLast4 string `json:"ssn_last4" api:"required"`
	// The current status of the representative.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive".
	Status       string                         `json:"status" api:"required"`
	StatusDetail RepresentativeDataStatusDetail `json:"status_detail" api:"required"`
	// Timestamp of the most recent update to the representative.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Unique identifier for the representative in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the represetative in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	Phone    string            `json:"phone" api:"nullable"`
	// The unique identifier of the user account associated with this representative,
	// if applicable.
	UserID string `json:"user_id" api:"nullable" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AccountID    respjson.Field
		CreatedAt    respjson.Field
		Dob          respjson.Field
		Email        respjson.Field
		FirstName    respjson.Field
		LastName     respjson.Field
		MobileNumber respjson.Field
		Name         respjson.Field
		Relationship respjson.Field
		SsnLast4     respjson.Field
		Status       respjson.Field
		StatusDetail respjson.Field
		UpdatedAt    respjson.Field
		ExternalID   respjson.Field
		Metadata     respjson.Field
		Phone        respjson.Field
		UserID       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativeData) RawJSON

func (r RepresentativeData) RawJSON() string

Returns the unmodified JSON received from the API

func (*RepresentativeData) UnmarshalJSON

func (r *RepresentativeData) UnmarshalJSON(data []byte) error

type RepresentativeDataRelationship

type RepresentativeDataRelationship struct {
	// Whether the representative has significant responsibility to control, manage, or
	// direct the organization. One representative must be identified under the control
	// prong for each legal entity.
	Control bool `json:"control" api:"required"`
	// Whether the representative owns any percentage of of the equity interests of the
	// legal entity.
	Owner bool `json:"owner" api:"required"`
	// Whether the person is authorized as the primary representative of the account.
	// This is the person chosen by the business to provide information about
	// themselves, general information about the account, and who consented to the
	// services agreement.
	//
	// There can be only one primary representative for an account at a time.
	Primary bool `json:"primary" api:"required"`
	// The percentage of ownership the representative has. Required if 'Owner' is true.
	PercentOwnership float64 `json:"percent_ownership" api:"nullable"`
	// The job title of the representative.
	Title string `json:"title" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Control          respjson.Field
		Owner            respjson.Field
		Primary          respjson.Field
		PercentOwnership respjson.Field
		Title            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativeDataRelationship) RawJSON

Returns the unmodified JSON received from the API

func (*RepresentativeDataRelationship) UnmarshalJSON

func (r *RepresentativeDataRelationship) UnmarshalJSON(data []byte) error

type RepresentativeDataStatusDetail

type RepresentativeDataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `watchtower`). This helps in
	// tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativeDataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*RepresentativeDataStatusDetail) UnmarshalJSON

func (r *RepresentativeDataStatusDetail) UnmarshalJSON(data []byte) error

type RepresentativePaged

type RepresentativePaged struct {
	Data []RepresentativePagedData `json:"data" api:"required"`
	// Metadata about the API request, including an identifier, timestamp, and
	// pagination details.
	Meta shared.PagedResponseMetadata `json:"meta" api:"required"`
	// Indicates the structure of the returned content.
	//
	//   - "object" means the `data` field contains a single JSON object.
	//   - "array" means the `data` field contains an array of objects.
	//   - "error" means the `data` field contains an error object with details of the
	//     issue.
	//   - "none" means no data is returned.
	//
	// Any of "object", "array", "error", "none".
	ResponseType RepresentativePagedResponseType `json:"response_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Meta         respjson.Field
		ResponseType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativePaged) RawJSON

func (r RepresentativePaged) RawJSON() string

Returns the unmodified JSON received from the API

func (*RepresentativePaged) UnmarshalJSON

func (r *RepresentativePaged) UnmarshalJSON(data []byte) error

type RepresentativePagedData

type RepresentativePagedData struct {
	// Unique identifier for the representative.
	ID string `json:"id" api:"required" format:"uuid"`
	// The unique identifier of the account this representative is associated with.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Timestamp of when the representative was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The date of birth of the representative, in ISO 8601 format (YYYY-MM-DD).
	Dob time.Time `json:"dob" api:"required" format:"date"`
	// The email address of the representative.
	Email string `json:"email" api:"required" format:"email"`
	// The first name of the representative.
	FirstName string `json:"first_name" api:"required"`
	// The last name of the representative.
	LastName string `json:"last_name" api:"required"`
	// The mobile phone number of the representative.
	MobileNumber string                              `json:"mobile_number" api:"required"`
	Name         string                              `json:"name" api:"required"`
	Relationship RepresentativePagedDataRelationship `json:"relationship" api:"required"`
	// The last 4 digits of the representative's Social Security Number.
	SsnLast4 string `json:"ssn_last4" api:"required"`
	// The current status of the representative.
	//
	// Any of "created", "onboarding", "active", "rejected", "inactive".
	Status       string                              `json:"status" api:"required"`
	StatusDetail RepresentativePagedDataStatusDetail `json:"status_detail" api:"required"`
	// Timestamp of the most recent update to the representative.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Unique identifier for the representative in your database, used for
	// cross-referencing between Straddle and your systems.
	ExternalID string `json:"external_id" api:"nullable"`
	// Up to 20 additional user-defined key-value pairs. Useful for storing additional
	// information about the represetative in a structured format.
	Metadata map[string]string `json:"metadata" api:"nullable"`
	Phone    string            `json:"phone" api:"nullable"`
	// The unique identifier of the user account associated with this representative,
	// if applicable.
	UserID string `json:"user_id" api:"nullable" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AccountID    respjson.Field
		CreatedAt    respjson.Field
		Dob          respjson.Field
		Email        respjson.Field
		FirstName    respjson.Field
		LastName     respjson.Field
		MobileNumber respjson.Field
		Name         respjson.Field
		Relationship respjson.Field
		SsnLast4     respjson.Field
		Status       respjson.Field
		StatusDetail respjson.Field
		UpdatedAt    respjson.Field
		ExternalID   respjson.Field
		Metadata     respjson.Field
		Phone        respjson.Field
		UserID       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativePagedData) RawJSON

func (r RepresentativePagedData) RawJSON() string

Returns the unmodified JSON received from the API

func (*RepresentativePagedData) UnmarshalJSON

func (r *RepresentativePagedData) UnmarshalJSON(data []byte) error

type RepresentativePagedDataRelationship

type RepresentativePagedDataRelationship struct {
	// Whether the representative has significant responsibility to control, manage, or
	// direct the organization. One representative must be identified under the control
	// prong for each legal entity.
	Control bool `json:"control" api:"required"`
	// Whether the representative owns any percentage of of the equity interests of the
	// legal entity.
	Owner bool `json:"owner" api:"required"`
	// Whether the person is authorized as the primary representative of the account.
	// This is the person chosen by the business to provide information about
	// themselves, general information about the account, and who consented to the
	// services agreement.
	//
	// There can be only one primary representative for an account at a time.
	Primary bool `json:"primary" api:"required"`
	// The percentage of ownership the representative has. Required if 'Owner' is true.
	PercentOwnership float64 `json:"percent_ownership" api:"nullable"`
	// The job title of the representative.
	Title string `json:"title" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Control          respjson.Field
		Owner            respjson.Field
		Primary          respjson.Field
		PercentOwnership respjson.Field
		Title            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativePagedDataRelationship) RawJSON

Returns the unmodified JSON received from the API

func (*RepresentativePagedDataRelationship) UnmarshalJSON

func (r *RepresentativePagedDataRelationship) UnmarshalJSON(data []byte) error

type RepresentativePagedDataStatusDetail

type RepresentativePagedDataStatusDetail struct {
	// A machine-readable code for the specific status, useful for programmatic
	// handling.
	Code string `json:"code" api:"required"`
	// A human-readable message describing the current status.
	Message string `json:"message" api:"required"`
	// A machine-readable identifier for the specific status, useful for programmatic
	// handling.
	//
	// Any of "unverified", "in_review", "pending", "stuck", "verified",
	// "failed_verification", "disabled", "new".
	Reason string `json:"reason" api:"required"`
	// Identifies the origin of the status change (e.g., `watchtower`). This helps in
	// tracking the cause of status updates.
	//
	// Any of "watchtower".
	Source string `json:"source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Reason      respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RepresentativePagedDataStatusDetail) RawJSON

Returns the unmodified JSON received from the API

func (*RepresentativePagedDataStatusDetail) UnmarshalJSON

func (r *RepresentativePagedDataStatusDetail) UnmarshalJSON(data []byte) error

type RepresentativePagedResponseType

type RepresentativePagedResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	RepresentativePagedResponseTypeObject RepresentativePagedResponseType = "object"
	RepresentativePagedResponseTypeArray  RepresentativePagedResponseType = "array"
	RepresentativePagedResponseTypeError  RepresentativePagedResponseType = "error"
	RepresentativePagedResponseTypeNone   RepresentativePagedResponseType = "none"
)

type RepresentativeResponseType

type RepresentativeResponseType string

Indicates the structure of the returned content.

  • "object" means the `data` field contains a single JSON object.
  • "array" means the `data` field contains an array of objects.
  • "error" means the `data` field contains an error object with details of the issue.
  • "none" means no data is returned.
const (
	RepresentativeResponseTypeObject RepresentativeResponseType = "object"
	RepresentativeResponseTypeArray  RepresentativeResponseType = "array"
	RepresentativeResponseTypeError  RepresentativeResponseType = "error"
	RepresentativeResponseTypeNone   RepresentativeResponseType = "none"
)

type ResponseMetadata

type ResponseMetadata = shared.ResponseMetadata

Metadata about the API request, including an identifier and timestamp.

This is an alias to an internal type.

type StatusDetailsV1

type StatusDetailsV1 = shared.StatusDetailsV1

This is an alias to an internal type.

type StatusDetailsV1Reason

type StatusDetailsV1Reason = shared.StatusDetailsV1Reason

A machine-readable identifier for the specific status, useful for programmatic handling.

This is an alias to an internal type.

type StatusDetailsV1Source

type StatusDetailsV1Source = shared.StatusDetailsV1Source

Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates.

This is an alias to an internal type.

type SupportChannelsV1

type SupportChannelsV1 struct {
	// The email address for customer support inquiries.
	Email string `json:"email" api:"nullable" format:"email"`
	// The phone number for customer support.
	Phone string `json:"phone" api:"nullable"`
	// The URL of the business's customer support page or contact form.
	URL string `json:"url" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Email       respjson.Field
		Phone       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SupportChannelsV1) RawJSON

func (r SupportChannelsV1) RawJSON() string

Returns the unmodified JSON received from the API

func (SupportChannelsV1) ToParam

ToParam converts this SupportChannelsV1 to a SupportChannelsV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with SupportChannelsV1Param.Overrides()

func (*SupportChannelsV1) UnmarshalJSON

func (r *SupportChannelsV1) UnmarshalJSON(data []byte) error

type SupportChannelsV1Param

type SupportChannelsV1Param struct {
	// The email address for customer support inquiries.
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// The phone number for customer support.
	Phone param.Opt[string] `json:"phone,omitzero"`
	// The URL of the business's customer support page or contact form.
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// contains filtered or unexported fields
}

func (SupportChannelsV1Param) MarshalJSON

func (r SupportChannelsV1Param) MarshalJSON() (data []byte, err error)

func (*SupportChannelsV1Param) UnmarshalJSON

func (r *SupportChannelsV1Param) UnmarshalJSON(data []byte) error

type TermsOfServiceV1

type TermsOfServiceV1 struct {
	// The datetime of when the terms of service were accepted, in ISO 8601 format.
	AcceptedDate time.Time `json:"accepted_date" api:"required" format:"date-time"`
	// The type or version of the agreement accepted. Use `embedded` unless your
	// platform was specifically enabled for `direct` agreements.
	//
	// Any of "embedded", "direct".
	AgreementType TermsOfServiceV1AgreementType `json:"agreement_type" api:"required"`
	// The URL where the full text of the accepted agreement can be found.
	AgreementURL string `json:"agreement_url" api:"required"`
	// The IP address from which the terms of service were accepted.
	AcceptedIP string `json:"accepted_ip" api:"nullable"`
	// The user agent string of the browser or application used to accept the terms.
	AcceptedUserAgent string `json:"accepted_user_agent" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AcceptedDate      respjson.Field
		AgreementType     respjson.Field
		AgreementURL      respjson.Field
		AcceptedIP        respjson.Field
		AcceptedUserAgent respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TermsOfServiceV1) RawJSON

func (r TermsOfServiceV1) RawJSON() string

Returns the unmodified JSON received from the API

func (TermsOfServiceV1) ToParam

ToParam converts this TermsOfServiceV1 to a TermsOfServiceV1Param.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TermsOfServiceV1Param.Overrides()

func (*TermsOfServiceV1) UnmarshalJSON

func (r *TermsOfServiceV1) UnmarshalJSON(data []byte) error

type TermsOfServiceV1AgreementType

type TermsOfServiceV1AgreementType string

The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements.

const (
	TermsOfServiceV1AgreementTypeEmbedded TermsOfServiceV1AgreementType = "embedded"
	TermsOfServiceV1AgreementTypeDirect   TermsOfServiceV1AgreementType = "direct"
)

type TermsOfServiceV1Param

type TermsOfServiceV1Param struct {
	// The URL where the full text of the accepted agreement can be found.
	AgreementURL param.Opt[string] `json:"agreement_url,omitzero" api:"required"`
	// The datetime of when the terms of service were accepted, in ISO 8601 format.
	AcceptedDate time.Time `json:"accepted_date" api:"required" format:"date-time"`
	// The type or version of the agreement accepted. Use `embedded` unless your
	// platform was specifically enabled for `direct` agreements.
	//
	// Any of "embedded", "direct".
	AgreementType TermsOfServiceV1AgreementType `json:"agreement_type,omitzero" api:"required"`
	// The IP address from which the terms of service were accepted.
	AcceptedIP param.Opt[string] `json:"accepted_ip,omitzero"`
	// The user agent string of the browser or application used to accept the terms.
	AcceptedUserAgent param.Opt[string] `json:"accepted_user_agent,omitzero"`
	// contains filtered or unexported fields
}

The properties AcceptedDate, AgreementType, AgreementURL are required.

func (TermsOfServiceV1Param) MarshalJSON

func (r TermsOfServiceV1Param) MarshalJSON() (data []byte, err error)

func (*TermsOfServiceV1Param) UnmarshalJSON

func (r *TermsOfServiceV1Param) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL