fragment

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

README

Fragment Go API Library

Go Reference

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

It is generated with Stainless.

Installation

import (
	"github.com/fragment-dev/golang" // imported as fragment
)

Or to pin the version:

go get -u 'github.com/fragment-dev/golang@v0.0.3'

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"

	"github.com/fragment-dev/golang"
	"github.com/fragment-dev/golang/option"
)

func main() {
	client := fragment.NewClient(
		option.WithClientID("My Client ID"),         // defaults to os.LookupEnv("FRAGMENT_CLIENT_ID")
		option.WithClientSecret("My Client Secret"), // defaults to os.LookupEnv("FRAGMENT_CLIENT_SECRET")
	)
	externalAccount, err := client.ExternalAccounts.New(context.TODO(), fragment.ExternalAccountNewParams{
		ExternalID: "ext_acc_123",
		Name:       "Checking Account",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", externalAccount.Data)
}

Request fields

The fragment 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 `api:"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, fragment.String(string), fragment.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 := fragment.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: fragment.String("..."), // optional property

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

	Origin: fragment.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[fragment.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 := fragment.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.ExternalAccounts.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:

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.:

Errors

When the API returns a non-success status code, we return an error with type *fragment.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.ExternalAccounts.New(context.TODO(), fragment.ExternalAccountNewParams{
	ExternalID: "ext_acc_123",
	Name:       "Checking Account",
})
if err != nil {
	var apierr *fragment.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 "/external-accounts": 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.ExternalAccounts.New(
	ctx,
	fragment.ExternalAccountNewParams{
		ExternalID: "ext_acc_123",
		Name:       "Checking Account",
	},
	// 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 fragment.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 := fragment.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.ExternalAccounts.New(
	context.TODO(),
	fragment.ExternalAccountNewParams{
		ExternalID: "ext_acc_123",
		Name:       "Checking Account",
	},
	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
externalAccount, err := client.ExternalAccounts.New(
	context.TODO(),
	fragment.ExternalAccountNewParams{
		ExternalID: "ext_acc_123",
		Name:       "Checking Account",
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", externalAccount)

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: fragment.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 := fragment.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

This section is empty.

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 (FRAGMENT_CLIENT_ID, FRAGMENT_CLIENT_SECRET, FRAGMENT_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 Client

type Client struct {
	Experimental ExperimentalService
	// External account management operations
	ExternalAccounts ExternalAccountService
	// Invoice management operations
	Invoices InvoiceService
	// Product management operations
	Products ProductService
	// Role management operations
	Roles RoleService
	// Transaction sync operations
	Transactions TransactionService
	// User management operations
	Users UserService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the fragment 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 (FRAGMENT_CLIENT_ID, FRAGMENT_CLIENT_SECRET, FRAGMENT_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 Error

type Error = apierror.Error

type ExperimentalPaymentFlowGetResponse

type ExperimentalPaymentFlowGetResponse struct {
	// Payment flow object.
	Data PaymentFlow `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExperimentalPaymentFlowGetResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ExperimentalPaymentFlowGetResponse) UnmarshalJSON

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

type ExperimentalPaymentFlowNewParams

type ExperimentalPaymentFlowNewParams struct {
	// User-provided unique external ID.
	ExternalID string `json:"external_id" api:"required"`
	// Invoice to settle.
	Invoice ExperimentalPaymentFlowNewParamsInvoiceUnion `json:"invoice,omitzero" api:"required"`
	// Type of payment flow.
	//
	// Any of "single_invoice_settlement".
	Type ExperimentalPaymentFlowNewParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (ExperimentalPaymentFlowNewParams) MarshalJSON

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

func (*ExperimentalPaymentFlowNewParams) UnmarshalJSON

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

type ExperimentalPaymentFlowNewParamsInvoiceExternalID

type ExperimentalPaymentFlowNewParamsInvoiceExternalID struct {
	// Invoice external ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (ExperimentalPaymentFlowNewParamsInvoiceExternalID) MarshalJSON

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

func (*ExperimentalPaymentFlowNewParamsInvoiceExternalID) UnmarshalJSON

type ExperimentalPaymentFlowNewParamsInvoiceID

type ExperimentalPaymentFlowNewParamsInvoiceID struct {
	// Fragment invoice ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (ExperimentalPaymentFlowNewParamsInvoiceID) MarshalJSON

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

func (*ExperimentalPaymentFlowNewParamsInvoiceID) UnmarshalJSON

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

type ExperimentalPaymentFlowNewParamsInvoiceUnion

type ExperimentalPaymentFlowNewParamsInvoiceUnion struct {
	OfExperimentalPaymentFlowNewsInvoiceID         *ExperimentalPaymentFlowNewParamsInvoiceID         `json:",omitzero,inline"`
	OfExperimentalPaymentFlowNewsInvoiceExternalID *ExperimentalPaymentFlowNewParamsInvoiceExternalID `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 (ExperimentalPaymentFlowNewParamsInvoiceUnion) MarshalJSON

func (*ExperimentalPaymentFlowNewParamsInvoiceUnion) UnmarshalJSON

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

type ExperimentalPaymentFlowNewParamsType

type ExperimentalPaymentFlowNewParamsType string

Type of payment flow.

const (
	ExperimentalPaymentFlowNewParamsTypeSingleInvoiceSettlement ExperimentalPaymentFlowNewParamsType = "single_invoice_settlement"
)

type ExperimentalPaymentFlowNewResponse

type ExperimentalPaymentFlowNewResponse struct {
	// Payment flow object.
	Data PaymentFlow `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExperimentalPaymentFlowNewResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ExperimentalPaymentFlowNewResponse) UnmarshalJSON

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

type ExperimentalPaymentFlowSearchParams

type ExperimentalPaymentFlowSearchParams struct {
	// Filter by invoice ID.
	InvoiceID param.Opt[string] `json:"invoice_id,omitzero"`
	// Pagination parameters.
	PageInfo ExperimentalPaymentFlowSearchParamsPageInfo `json:"page_info,omitzero"`
	// contains filtered or unexported fields
}

func (ExperimentalPaymentFlowSearchParams) MarshalJSON

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

func (*ExperimentalPaymentFlowSearchParams) UnmarshalJSON

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

type ExperimentalPaymentFlowSearchParamsPageInfo

type ExperimentalPaymentFlowSearchParamsPageInfo struct {
	// Pagination cursor.
	After param.Opt[string] `json:"after,omitzero"`
	// Maximum number of results.
	Limit param.Opt[float64] `json:"limit,omitzero"`
	// contains filtered or unexported fields
}

Pagination parameters.

func (ExperimentalPaymentFlowSearchParamsPageInfo) MarshalJSON

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

func (*ExperimentalPaymentFlowSearchParamsPageInfo) UnmarshalJSON

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

type ExperimentalPaymentFlowSearchResponse

type ExperimentalPaymentFlowSearchResponse struct {
	Data []PaymentFlow `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of payment flows.

func (ExperimentalPaymentFlowSearchResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ExperimentalPaymentFlowSearchResponse) UnmarshalJSON

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

type ExperimentalPaymentFlowService

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

Payment flow operations

ExperimentalPaymentFlowService contains methods and other services that help with interacting with the fragment 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 NewExperimentalPaymentFlowService method instead.

func NewExperimentalPaymentFlowService

func NewExperimentalPaymentFlowService(opts ...option.RequestOption) (r ExperimentalPaymentFlowService)

NewExperimentalPaymentFlowService 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 (*ExperimentalPaymentFlowService) Get

Gets a payment flow by ID or external ID.

func (*ExperimentalPaymentFlowService) New

Creates a new payment flow.

func (*ExperimentalPaymentFlowService) Search

Searches payment flows.

type ExperimentalPaymentGetResponse

type ExperimentalPaymentGetResponse struct {
	// Payment object.
	Data Payment `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExperimentalPaymentGetResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ExperimentalPaymentGetResponse) UnmarshalJSON

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

type ExperimentalPaymentSearchParams

type ExperimentalPaymentSearchParams struct {
	// Filter by payment flow ID.
	PaymentFlowID param.Opt[string] `json:"payment_flow_id,omitzero"`
	// Pagination parameters.
	PageInfo ExperimentalPaymentSearchParamsPageInfo `json:"page_info,omitzero"`
	// contains filtered or unexported fields
}

func (ExperimentalPaymentSearchParams) MarshalJSON

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

func (*ExperimentalPaymentSearchParams) UnmarshalJSON

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

type ExperimentalPaymentSearchParamsPageInfo

type ExperimentalPaymentSearchParamsPageInfo struct {
	// Pagination cursor.
	After param.Opt[string] `json:"after,omitzero"`
	// Maximum number of results.
	Limit param.Opt[float64] `json:"limit,omitzero"`
	// contains filtered or unexported fields
}

Pagination parameters.

func (ExperimentalPaymentSearchParamsPageInfo) MarshalJSON

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

func (*ExperimentalPaymentSearchParamsPageInfo) UnmarshalJSON

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

type ExperimentalPaymentSearchResponse

type ExperimentalPaymentSearchResponse struct {
	Data []Payment `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of payments.

func (ExperimentalPaymentSearchResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ExperimentalPaymentSearchResponse) UnmarshalJSON

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

type ExperimentalPaymentService

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

Payment operations

ExperimentalPaymentService contains methods and other services that help with interacting with the fragment 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 NewExperimentalPaymentService method instead.

func NewExperimentalPaymentService

func NewExperimentalPaymentService(opts ...option.RequestOption) (r ExperimentalPaymentService)

NewExperimentalPaymentService 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 (*ExperimentalPaymentService) Get

Gets a payment by ID or external ID.

func (*ExperimentalPaymentService) Search

Searches payments.

type ExperimentalService

type ExperimentalService struct {

	// Payment flow operations
	PaymentFlows ExperimentalPaymentFlowService
	// Payment operations
	Payments ExperimentalPaymentService
	// contains filtered or unexported fields
}

ExperimentalService contains methods and other services that help with interacting with the fragment 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 NewExperimentalService method instead.

func NewExperimentalService

func NewExperimentalService(opts ...option.RequestOption) (r ExperimentalService)

NewExperimentalService 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 ExternalAccount

type ExternalAccount struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Name of the account.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

External account object.

func (ExternalAccount) RawJSON

func (r ExternalAccount) RawJSON() string

Returns the unmodified JSON received from the API

func (*ExternalAccount) UnmarshalJSON

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

type ExternalAccountListResponse

type ExternalAccountListResponse struct {
	Data []ExternalAccount `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of external accounts.

func (ExternalAccountListResponse) RawJSON

func (r ExternalAccountListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ExternalAccountListResponse) UnmarshalJSON

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

type ExternalAccountNewParams

type ExternalAccountNewParams struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Name of the account.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (ExternalAccountNewParams) MarshalJSON

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

func (*ExternalAccountNewParams) UnmarshalJSON

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

type ExternalAccountNewResponse

type ExternalAccountNewResponse struct {
	// External account object.
	Data ExternalAccount `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExternalAccountNewResponse) RawJSON

func (r ExternalAccountNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ExternalAccountNewResponse) UnmarshalJSON

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

type ExternalAccountService

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

External account management operations

ExternalAccountService contains methods and other services that help with interacting with the fragment 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 NewExternalAccountService method instead.

func NewExternalAccountService

func NewExternalAccountService(opts ...option.RequestOption) (r ExternalAccountService)

NewExternalAccountService 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 (*ExternalAccountService) List

Lists all external accounts.

func (*ExternalAccountService) New

Creates an external account.

type Invoice

type Invoice struct {
	// Unique invoice ID.
	ID string `json:"id" api:"required"`
	// Timestamp when the invoice was created. Uses ISO 8601 format.
	Created time.Time `json:"created" api:"required" format:"date-time"`
	// Status of the invoice. Deprecated.
	//
	// Any of "active".
	//
	// Deprecated: deprecated
	Status InvoiceStatus `json:"status" api:"required"`
	// Tags for the invoice.
	Tags []InvoiceTag `json:"tags" api:"required"`
	// Current version of the invoice.
	Version float64 `json:"version" api:"required"`
	// Workspace the invoice belongs to.
	WorkspaceID string `json:"workspace_id" api:"required"`
	// Line items for the invoice.
	LineItems []InvoiceLineItem `json:"line_items"`
	// Timestamp when the invoice was last modified. Uses ISO 8601 format.
	Modified time.Time `json:"modified" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Status      respjson.Field
		Tags        respjson.Field
		Version     respjson.Field
		WorkspaceID respjson.Field
		LineItems   respjson.Field
		Modified    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Invoice object.

func (Invoice) RawJSON

func (r Invoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*Invoice) UnmarshalJSON

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

type InvoiceGetResponse

type InvoiceGetResponse struct {
	// Invoice with balance details.
	Data InvoiceGetResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceGetResponse) RawJSON

func (r InvoiceGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceGetResponse) UnmarshalJSON

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

type InvoiceGetResponseData

type InvoiceGetResponseData struct {
	// Invoice-level balances by currency.
	Balances []InvoiceGetResponseDataBalance `json:"balances" api:"required"`
	// Payments allocated to the invoice.
	Payments []InvoiceGetResponseDataPayment `json:"payments" api:"required"`
	// Users involved in the invoice.
	Users []InvoiceGetResponseDataUser `json:"users" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Balances    respjson.Field
		Payments    respjson.Field
		Users       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	Invoice
}

Invoice with balance details.

func (InvoiceGetResponseData) RawJSON

func (r InvoiceGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseData) UnmarshalJSON

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

type InvoiceGetResponseDataBalance

type InvoiceGetResponseDataBalance struct {
	// ISO 4217 or crypto currency code.
	Currency string `json:"currency" api:"required"`
	// Net balance breakdown.
	Net InvoiceGetResponseDataBalanceNet `json:"net" api:"required"`
	// Payins balance breakdown.
	Payins InvoiceGetResponseDataBalancePayins `json:"payins" api:"required"`
	// Payouts balance breakdown.
	Payouts InvoiceGetResponseDataBalancePayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Net         respjson.Field
		Payins      respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceGetResponseDataBalance) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataBalance) UnmarshalJSON

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

type InvoiceGetResponseDataBalanceNet

type InvoiceGetResponseDataBalanceNet struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Net balance breakdown.

func (InvoiceGetResponseDataBalanceNet) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataBalanceNet) UnmarshalJSON

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

type InvoiceGetResponseDataBalancePayins

type InvoiceGetResponseDataBalancePayins struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payins balance breakdown.

func (InvoiceGetResponseDataBalancePayins) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataBalancePayins) UnmarshalJSON

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

type InvoiceGetResponseDataBalancePayouts

type InvoiceGetResponseDataBalancePayouts struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payouts balance breakdown.

func (InvoiceGetResponseDataBalancePayouts) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataBalancePayouts) UnmarshalJSON

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

type InvoiceGetResponseDataPayment

type InvoiceGetResponseDataPayment struct {
	// Amount allocated as a string in the smallest currency unit, such as cents for
	// USD.
	Amount string `json:"amount" api:"required"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	Currency string `json:"currency" api:"required"`
	// Timestamp when the parent transaction was posted. Uses ISO 8601 format.
	Posted time.Time `json:"posted" api:"required" format:"date-time"`
	// Transaction the payment is applied to.
	Transaction InvoiceGetResponseDataPaymentTransaction `json:"transaction" api:"required"`
	// Type of the payment.
	//
	// Any of "payin", "payout".
	Type string `json:"type" api:"required"`
	// User associated with the payment.
	User InvoiceGetResponseDataPaymentUser `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		Posted      respjson.Field
		Transaction respjson.Field
		Type        respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A payment allocated to the invoice.

func (InvoiceGetResponseDataPayment) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataPayment) UnmarshalJSON

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

type InvoiceGetResponseDataPaymentTransaction

type InvoiceGetResponseDataPaymentTransaction struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Tags from the parent transaction.
	Tags []InvoiceGetResponseDataPaymentTransactionTag `json:"tags" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		Tags        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transaction the payment is applied to.

func (InvoiceGetResponseDataPaymentTransaction) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataPaymentTransaction) UnmarshalJSON

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

type InvoiceGetResponseDataPaymentTransactionTag

type InvoiceGetResponseDataPaymentTransactionTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (InvoiceGetResponseDataPaymentTransactionTag) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataPaymentTransactionTag) UnmarshalJSON

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

type InvoiceGetResponseDataPaymentUser

type InvoiceGetResponseDataPaymentUser struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User associated with the payment.

func (InvoiceGetResponseDataPaymentUser) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataPaymentUser) UnmarshalJSON

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

type InvoiceGetResponseDataUser

type InvoiceGetResponseDataUser struct {
	// User-provided unique external ID.
	ID string `json:"id" api:"required"`
	// Per-currency balance breakdown for the user.
	Balances []InvoiceGetResponseDataUserBalance `json:"balances" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Balances    respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceGetResponseDataUser) RawJSON

func (r InvoiceGetResponseDataUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataUser) UnmarshalJSON

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

type InvoiceGetResponseDataUserBalance

type InvoiceGetResponseDataUserBalance struct {
	// ISO 4217 or crypto currency code.
	Currency string `json:"currency" api:"required"`
	// Net balance breakdown.
	Net InvoiceGetResponseDataUserBalanceNet `json:"net" api:"required"`
	// Payins balance breakdown.
	Payins InvoiceGetResponseDataUserBalancePayins `json:"payins" api:"required"`
	// Payouts balance breakdown.
	Payouts InvoiceGetResponseDataUserBalancePayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Net         respjson.Field
		Payins      respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceGetResponseDataUserBalance) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataUserBalance) UnmarshalJSON

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

type InvoiceGetResponseDataUserBalanceNet

type InvoiceGetResponseDataUserBalanceNet struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Net balance breakdown.

func (InvoiceGetResponseDataUserBalanceNet) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataUserBalanceNet) UnmarshalJSON

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

type InvoiceGetResponseDataUserBalancePayins

type InvoiceGetResponseDataUserBalancePayins struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payins balance breakdown.

func (InvoiceGetResponseDataUserBalancePayins) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataUserBalancePayins) UnmarshalJSON

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

type InvoiceGetResponseDataUserBalancePayouts

type InvoiceGetResponseDataUserBalancePayouts struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payouts balance breakdown.

func (InvoiceGetResponseDataUserBalancePayouts) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceGetResponseDataUserBalancePayouts) UnmarshalJSON

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

type InvoiceLineItem

type InvoiceLineItem struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	// Deprecated, use price.amount instead.
	//
	// Deprecated: deprecated
	Amount string `json:"amount" api:"required"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	CurrencyCode string `json:"currency_code" api:"required"`
	// Description of the line item.
	Description string `json:"description" api:"required"`
	// Price breakdown.
	Price InvoiceLineItemPrice `json:"price" api:"required"`
	// Unique identifier for the product.
	ProductID string `json:"product_id" api:"required"`
	// Tags for the line item.
	Tags []InvoiceLineItemTag `json:"tags" api:"required"`
	// Type of the line item.
	//
	// Any of "payin", "payout".
	Type string `json:"type" api:"required"`
	// User-provided unique external ID.
	UserID string `json:"user_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Amount       respjson.Field
		CurrencyCode respjson.Field
		Description  respjson.Field
		Price        respjson.Field
		ProductID    respjson.Field
		Tags         respjson.Field
		Type         respjson.Field
		UserID       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Invoice line item.

func (InvoiceLineItem) RawJSON

func (r InvoiceLineItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceLineItem) UnmarshalJSON

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

type InvoiceLineItemPrice

type InvoiceLineItemPrice struct {
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	Amount string `json:"amount" api:"required"`
	// Number of units.
	Quantity int64 `json:"quantity" api:"required"`
	// Unit price as a string in the smallest currency unit, such as cents for USD.
	UnitPrice string `json:"unit_price" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Quantity    respjson.Field
		UnitPrice   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Price breakdown.

func (InvoiceLineItemPrice) RawJSON

func (r InvoiceLineItemPrice) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceLineItemPrice) UnmarshalJSON

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

type InvoiceLineItemTag

type InvoiceLineItemTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (InvoiceLineItemTag) RawJSON

func (r InvoiceLineItemTag) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceLineItemTag) UnmarshalJSON

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

type InvoiceListHistoryResponse

type InvoiceListHistoryResponse struct {
	// Version history of the invoice.
	Data []Invoice `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceListHistoryResponse) RawJSON

func (r InvoiceListHistoryResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceListHistoryResponse) UnmarshalJSON

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

type InvoiceListResponse

type InvoiceListResponse struct {
	// List of invoices.
	Data []Invoice `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceListResponse) RawJSON

func (r InvoiceListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceListResponse) UnmarshalJSON

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

type InvoiceNewParams

type InvoiceNewParams struct {
	// Unique ID for the invoice.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Line items to create with the invoice.
	LineItems []InvoiceNewParamsLineItem `json:"line_items,omitzero" api:"required"`
	// Tags for the invoice.
	Tags []InvoiceNewParamsTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (InvoiceNewParams) MarshalJSON

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

func (*InvoiceNewParams) UnmarshalJSON

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

type InvoiceNewParamsLineItem

type InvoiceNewParamsLineItem struct {
	// Description of the line item.
	Description string `json:"description" api:"required"`
	// Unique identifier for the product.
	ProductID string `json:"product_id" api:"required"`
	// Type of the line item.
	//
	// Any of "payin", "payout".
	Type string `json:"type,omitzero" api:"required"`
	// Identifies a user by `id` or `external_id`.
	User InvoiceNewParamsLineItemUserUnion `json:"user,omitzero" api:"required"`
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	// Deprecated, use price instead.
	//
	// Deprecated: deprecated
	Amount param.Opt[string] `json:"amount,omitzero"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	CurrencyCode string `json:"currency_code,omitzero"`
	// Price breakdown. Provide amount, or unit_price and quantity, or all three.
	Price InvoiceNewParamsLineItemPrice `json:"price,omitzero"`
	// Tags for the line item.
	Tags []InvoiceNewParamsLineItemTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

Data to create a line item.

The properties Description, ProductID, Type, User are required.

func (InvoiceNewParamsLineItem) MarshalJSON

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

func (*InvoiceNewParamsLineItem) UnmarshalJSON

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

type InvoiceNewParamsLineItemPrice

type InvoiceNewParamsLineItemPrice struct {
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	// Required if unit_price and quantity are not provided.
	Amount param.Opt[string] `json:"amount,omitzero"`
	// Number of units for the line item.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// Price per unit as a string in the smallest currency unit, such as cents for USD.
	UnitPrice param.Opt[string] `json:"unit_price,omitzero"`
	// contains filtered or unexported fields
}

Price breakdown. Provide amount, or unit_price and quantity, or all three.

func (InvoiceNewParamsLineItemPrice) MarshalJSON

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

func (*InvoiceNewParamsLineItemPrice) UnmarshalJSON

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

type InvoiceNewParamsLineItemTag

type InvoiceNewParamsLineItemTag struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceNewParamsLineItemTag) MarshalJSON

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

func (*InvoiceNewParamsLineItemTag) UnmarshalJSON

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

type InvoiceNewParamsLineItemUserExternalID

type InvoiceNewParamsLineItemUserExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (InvoiceNewParamsLineItemUserExternalID) MarshalJSON

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

func (*InvoiceNewParamsLineItemUserExternalID) UnmarshalJSON

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

type InvoiceNewParamsLineItemUserID

type InvoiceNewParamsLineItemUserID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (InvoiceNewParamsLineItemUserID) MarshalJSON

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

func (*InvoiceNewParamsLineItemUserID) UnmarshalJSON

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

type InvoiceNewParamsLineItemUserUnion

type InvoiceNewParamsLineItemUserUnion struct {
	OfInvoiceNewsLineItemUserID         *InvoiceNewParamsLineItemUserID         `json:",omitzero,inline"`
	OfInvoiceNewsLineItemUserExternalID *InvoiceNewParamsLineItemUserExternalID `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 (InvoiceNewParamsLineItemUserUnion) MarshalJSON

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

func (*InvoiceNewParamsLineItemUserUnion) UnmarshalJSON

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

type InvoiceNewParamsTag

type InvoiceNewParamsTag struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceNewParamsTag) MarshalJSON

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

func (*InvoiceNewParamsTag) UnmarshalJSON

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

type InvoiceNewResponse

type InvoiceNewResponse struct {
	// Invoice object.
	Data Invoice `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceNewResponse) RawJSON

func (r InvoiceNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceNewResponse) UnmarshalJSON

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

type InvoiceSearchParams

type InvoiceSearchParams struct {
	// Filter criteria for the search.
	Filter InvoiceSearchParamsFilter `json:"filter,omitzero" api:"required"`
	// Pagination parameters.
	PageInfo InvoiceSearchParamsPageInfo `json:"page_info,omitzero"`
	// contains filtered or unexported fields
}

func (InvoiceSearchParams) MarshalJSON

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

func (*InvoiceSearchParams) UnmarshalJSON

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

type InvoiceSearchParamsFilter

type InvoiceSearchParamsFilter struct {
	// Filter by invoice status. `open` returns invoices with non-zero clearing account
	// balances.
	//
	// Any of "open".
	Status string `json:"status,omitzero"`
	// Tag-based filter criteria. When both `any` and `all` are provided, results must
	// match every entry in `all` AND at least one entry in `any`.
	Tags InvoiceSearchParamsFilterTags `json:"tags,omitzero"`
	// Filter invoices by tags on transactions allocated to them. Returns invoices that
	// have at least one allocated transaction matching the specified tags.
	TransactionTags InvoiceSearchParamsFilterTransactionTags `json:"transaction_tags,omitzero"`
	// Line item user filter criteria. When both `any` and `all` are provided, results
	// must match every entry in `all` AND at least one entry in `any`.
	Users InvoiceSearchParamsFilterUsers `json:"users,omitzero"`
	// contains filtered or unexported fields
}

Filter criteria for the search.

func (InvoiceSearchParamsFilter) MarshalJSON

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

func (*InvoiceSearchParamsFilter) UnmarshalJSON

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

type InvoiceSearchParamsFilterTags

type InvoiceSearchParamsFilterTags struct {
	// Returns invoices matching every specified tag, using AND logic.
	All []InvoiceSearchParamsFilterTagsAll `json:"all,omitzero"`
	// Returns invoices matching at least one of the specified tags, using OR logic.
	Any []InvoiceSearchParamsFilterTagsAny `json:"any,omitzero"`
	// contains filtered or unexported fields
}

Tag-based filter criteria. When both `any` and `all` are provided, results must match every entry in `all` AND at least one entry in `any`.

func (InvoiceSearchParamsFilterTags) MarshalJSON

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

func (*InvoiceSearchParamsFilterTags) UnmarshalJSON

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

type InvoiceSearchParamsFilterTagsAll

type InvoiceSearchParamsFilterTagsAll struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (InvoiceSearchParamsFilterTagsAll) MarshalJSON

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

func (*InvoiceSearchParamsFilterTagsAll) UnmarshalJSON

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

type InvoiceSearchParamsFilterTagsAny

type InvoiceSearchParamsFilterTagsAny struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (InvoiceSearchParamsFilterTagsAny) MarshalJSON

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

func (*InvoiceSearchParamsFilterTagsAny) UnmarshalJSON

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

type InvoiceSearchParamsFilterTransactionTags

type InvoiceSearchParamsFilterTransactionTags struct {
	// Returns transactions matching every specified tag, using AND logic.
	All []InvoiceSearchParamsFilterTransactionTagsAll `json:"all,omitzero"`
	// Returns transactions matching at least one of the specified tags, using OR
	// logic.
	Any []InvoiceSearchParamsFilterTransactionTagsAny `json:"any,omitzero"`
	// contains filtered or unexported fields
}

Filter invoices by tags on transactions allocated to them. Returns invoices that have at least one allocated transaction matching the specified tags.

func (InvoiceSearchParamsFilterTransactionTags) MarshalJSON

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

func (*InvoiceSearchParamsFilterTransactionTags) UnmarshalJSON

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

type InvoiceSearchParamsFilterTransactionTagsAll

type InvoiceSearchParamsFilterTransactionTagsAll struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (InvoiceSearchParamsFilterTransactionTagsAll) MarshalJSON

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

func (*InvoiceSearchParamsFilterTransactionTagsAll) UnmarshalJSON

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

type InvoiceSearchParamsFilterTransactionTagsAny

type InvoiceSearchParamsFilterTransactionTagsAny struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (InvoiceSearchParamsFilterTransactionTagsAny) MarshalJSON

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

func (*InvoiceSearchParamsFilterTransactionTagsAny) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsers

type InvoiceSearchParamsFilterUsers struct {
	// Returns invoices matching every specified line item user, using AND logic.
	All []InvoiceSearchParamsFilterUsersAllUnion `json:"all,omitzero"`
	// Returns invoices matching at least one of the specified line item users, using
	// OR logic.
	Any []InvoiceSearchParamsFilterUsersAnyUnion `json:"any,omitzero"`
	// contains filtered or unexported fields
}

Line item user filter criteria. When both `any` and `all` are provided, results must match every entry in `all` AND at least one entry in `any`.

func (InvoiceSearchParamsFilterUsers) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsers) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAllExternalID

type InvoiceSearchParamsFilterUsersAllExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (InvoiceSearchParamsFilterUsersAllExternalID) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAllExternalID) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAllID

type InvoiceSearchParamsFilterUsersAllID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (InvoiceSearchParamsFilterUsersAllID) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAllID) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAllUnion

type InvoiceSearchParamsFilterUsersAllUnion struct {
	OfInvoiceSearchsFilterUsersAllID         *InvoiceSearchParamsFilterUsersAllID         `json:",omitzero,inline"`
	OfInvoiceSearchsFilterUsersAllExternalID *InvoiceSearchParamsFilterUsersAllExternalID `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 (InvoiceSearchParamsFilterUsersAllUnion) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAllUnion) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAnyExternalID

type InvoiceSearchParamsFilterUsersAnyExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (InvoiceSearchParamsFilterUsersAnyExternalID) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAnyExternalID) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAnyID

type InvoiceSearchParamsFilterUsersAnyID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (InvoiceSearchParamsFilterUsersAnyID) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAnyID) UnmarshalJSON

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

type InvoiceSearchParamsFilterUsersAnyUnion

type InvoiceSearchParamsFilterUsersAnyUnion struct {
	OfInvoiceSearchsFilterUsersAnyID         *InvoiceSearchParamsFilterUsersAnyID         `json:",omitzero,inline"`
	OfInvoiceSearchsFilterUsersAnyExternalID *InvoiceSearchParamsFilterUsersAnyExternalID `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 (InvoiceSearchParamsFilterUsersAnyUnion) MarshalJSON

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

func (*InvoiceSearchParamsFilterUsersAnyUnion) UnmarshalJSON

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

type InvoiceSearchParamsPageInfo

type InvoiceSearchParamsPageInfo struct {
	// Cursor for fetching the next page of results.
	After param.Opt[string] `json:"after,omitzero"`
	// Number of results to return. Defaults to 20.
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// contains filtered or unexported fields
}

Pagination parameters.

func (InvoiceSearchParamsPageInfo) MarshalJSON

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

func (*InvoiceSearchParamsPageInfo) UnmarshalJSON

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

type InvoiceSearchResponse

type InvoiceSearchResponse struct {
	// Search results for invoices.
	Data InvoiceSearchResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Search results for invoices.

func (InvoiceSearchResponse) RawJSON

func (r InvoiceSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponse) UnmarshalJSON

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

type InvoiceSearchResponseData

type InvoiceSearchResponseData struct {
	// Invoices matching the search criteria.
	Invoices []InvoiceSearchResponseDataInvoice `json:"invoices" api:"required"`
	// Pagination cursors.
	PageInfo InvoiceSearchResponseDataPageInfo `json:"page_info" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Invoices    respjson.Field
		PageInfo    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Search results for invoices.

func (InvoiceSearchResponseData) RawJSON

func (r InvoiceSearchResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseData) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoice

type InvoiceSearchResponseDataInvoice struct {
	// Invoice-level balances by currency.
	Balances []InvoiceSearchResponseDataInvoiceBalance `json:"balances" api:"required"`
	// Payments allocated to the invoice.
	Payments []InvoiceSearchResponseDataInvoicePayment `json:"payments" api:"required"`
	// Users involved in the invoice.
	Users []InvoiceSearchResponseDataInvoiceUser `json:"users" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Balances    respjson.Field
		Payments    respjson.Field
		Users       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	Invoice
}

Invoice with balance details.

func (InvoiceSearchResponseDataInvoice) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoice) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceBalance

type InvoiceSearchResponseDataInvoiceBalance struct {
	// ISO 4217 or crypto currency code.
	Currency string `json:"currency" api:"required"`
	// Net balance breakdown.
	Net InvoiceSearchResponseDataInvoiceBalanceNet `json:"net" api:"required"`
	// Payins balance breakdown.
	Payins InvoiceSearchResponseDataInvoiceBalancePayins `json:"payins" api:"required"`
	// Payouts balance breakdown.
	Payouts InvoiceSearchResponseDataInvoiceBalancePayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Net         respjson.Field
		Payins      respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceSearchResponseDataInvoiceBalance) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceBalance) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceBalanceNet

type InvoiceSearchResponseDataInvoiceBalanceNet struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Net balance breakdown.

func (InvoiceSearchResponseDataInvoiceBalanceNet) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceBalanceNet) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceBalancePayins

type InvoiceSearchResponseDataInvoiceBalancePayins struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payins balance breakdown.

func (InvoiceSearchResponseDataInvoiceBalancePayins) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceBalancePayins) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceBalancePayouts

type InvoiceSearchResponseDataInvoiceBalancePayouts struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payouts balance breakdown.

func (InvoiceSearchResponseDataInvoiceBalancePayouts) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceBalancePayouts) UnmarshalJSON

type InvoiceSearchResponseDataInvoicePayment

type InvoiceSearchResponseDataInvoicePayment struct {
	// Amount allocated as a string in the smallest currency unit, such as cents for
	// USD.
	Amount string `json:"amount" api:"required"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	Currency string `json:"currency" api:"required"`
	// Timestamp when the parent transaction was posted. Uses ISO 8601 format.
	Posted time.Time `json:"posted" api:"required" format:"date-time"`
	// Transaction the payment is applied to.
	Transaction InvoiceSearchResponseDataInvoicePaymentTransaction `json:"transaction" api:"required"`
	// Type of the payment.
	//
	// Any of "payin", "payout".
	Type string `json:"type" api:"required"`
	// User associated with the payment.
	User InvoiceSearchResponseDataInvoicePaymentUser `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		Posted      respjson.Field
		Transaction respjson.Field
		Type        respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A payment allocated to the invoice.

func (InvoiceSearchResponseDataInvoicePayment) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoicePayment) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoicePaymentTransaction

type InvoiceSearchResponseDataInvoicePaymentTransaction struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Tags from the parent transaction.
	Tags []InvoiceSearchResponseDataInvoicePaymentTransactionTag `json:"tags" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		Tags        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transaction the payment is applied to.

func (InvoiceSearchResponseDataInvoicePaymentTransaction) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoicePaymentTransaction) UnmarshalJSON

type InvoiceSearchResponseDataInvoicePaymentTransactionTag

type InvoiceSearchResponseDataInvoicePaymentTransactionTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (InvoiceSearchResponseDataInvoicePaymentTransactionTag) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoicePaymentTransactionTag) UnmarshalJSON

type InvoiceSearchResponseDataInvoicePaymentUser

type InvoiceSearchResponseDataInvoicePaymentUser struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User associated with the payment.

func (InvoiceSearchResponseDataInvoicePaymentUser) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoicePaymentUser) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceUser

type InvoiceSearchResponseDataInvoiceUser struct {
	// User-provided unique external ID.
	ID string `json:"id" api:"required"`
	// Per-currency balance breakdown for the user.
	Balances []InvoiceSearchResponseDataInvoiceUserBalance `json:"balances" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Balances    respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceSearchResponseDataInvoiceUser) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceUser) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceUserBalance

type InvoiceSearchResponseDataInvoiceUserBalance struct {
	// ISO 4217 or crypto currency code.
	Currency string `json:"currency" api:"required"`
	// Net balance breakdown.
	Net InvoiceSearchResponseDataInvoiceUserBalanceNet `json:"net" api:"required"`
	// Payins balance breakdown.
	Payins InvoiceSearchResponseDataInvoiceUserBalancePayins `json:"payins" api:"required"`
	// Payouts balance breakdown.
	Payouts InvoiceSearchResponseDataInvoiceUserBalancePayouts `json:"payouts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Net         respjson.Field
		Payins      respjson.Field
		Payouts     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceSearchResponseDataInvoiceUserBalance) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceUserBalance) UnmarshalJSON

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

type InvoiceSearchResponseDataInvoiceUserBalanceNet

type InvoiceSearchResponseDataInvoiceUserBalanceNet struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Net balance breakdown.

func (InvoiceSearchResponseDataInvoiceUserBalanceNet) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceUserBalanceNet) UnmarshalJSON

type InvoiceSearchResponseDataInvoiceUserBalancePayins

type InvoiceSearchResponseDataInvoiceUserBalancePayins struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payins balance breakdown.

func (InvoiceSearchResponseDataInvoiceUserBalancePayins) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceUserBalancePayins) UnmarshalJSON

type InvoiceSearchResponseDataInvoiceUserBalancePayouts

type InvoiceSearchResponseDataInvoiceUserBalancePayouts struct {
	// Actual amount as a string in the smallest currency unit, such as cents for USD.
	Actual string `json:"actual" api:"required"`
	// Expected amount as a string in the smallest currency unit, such as cents for
	// USD.
	Expected string `json:"expected" api:"required"`
	// Remaining amount as a string in the smallest currency unit, such as cents for
	// USD.
	Remaining string `json:"remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Actual      respjson.Field
		Expected    respjson.Field
		Remaining   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payouts balance breakdown.

func (InvoiceSearchResponseDataInvoiceUserBalancePayouts) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataInvoiceUserBalancePayouts) UnmarshalJSON

type InvoiceSearchResponseDataPageInfo

type InvoiceSearchResponseDataPageInfo struct {
	// Cursor to fetch the next page of results.
	NextCursor string `json:"next_cursor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination cursors.

func (InvoiceSearchResponseDataPageInfo) RawJSON

Returns the unmodified JSON received from the API

func (*InvoiceSearchResponseDataPageInfo) UnmarshalJSON

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

type InvoiceService

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

Invoice management operations

InvoiceService contains methods and other services that help with interacting with the fragment 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 NewInvoiceService method instead.

func NewInvoiceService

func NewInvoiceService(opts ...option.RequestOption) (r InvoiceService)

NewInvoiceService 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 (*InvoiceService) Get

func (r *InvoiceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *InvoiceGetResponse, err error)

Retrieves an invoice.

func (*InvoiceService) List

func (r *InvoiceService) List(ctx context.Context, opts ...option.RequestOption) (res *InvoiceListResponse, err error)

Lists all invoices.

func (*InvoiceService) ListHistory

func (r *InvoiceService) ListHistory(ctx context.Context, id string, opts ...option.RequestOption) (res *InvoiceListHistoryResponse, err error)

Retrieves the version history of an invoice.

func (*InvoiceService) New

Creates an invoice.

func (*InvoiceService) Search

Searches invoices.

func (*InvoiceService) Update

Updates an invoice.

type InvoiceStatus

type InvoiceStatus string

Status of the invoice. Deprecated.

const (
	InvoiceStatusActive InvoiceStatus = "active"
)

type InvoiceTag

type InvoiceTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (InvoiceTag) RawJSON

func (r InvoiceTag) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceTag) UnmarshalJSON

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

type InvoiceUpdateParams

type InvoiceUpdateParams struct {
	// Current version of the invoice. Must match the stored version.
	CurrentInvoiceVersion float64 `json:"current_invoice_version" api:"required"`
	// Line item updates.
	LineItems InvoiceUpdateParamsLineItems `json:"line_items,omitzero"`
	// Tag updates.
	Tags InvoiceUpdateParamsTags `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (InvoiceUpdateParams) MarshalJSON

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

func (*InvoiceUpdateParams) UnmarshalJSON

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

type InvoiceUpdateParamsLineItems

type InvoiceUpdateParamsLineItems struct {
	// Line items to add to the invoice.
	Create []InvoiceUpdateParamsLineItemsCreate `json:"create,omitzero"`
	// Line items to remove from the invoice.
	Delete []InvoiceUpdateParamsLineItemsDelete `json:"delete,omitzero"`
	// Existing line items to update.
	Update []InvoiceUpdateParamsLineItemsUpdate `json:"update,omitzero"`
	// contains filtered or unexported fields
}

Line item updates.

func (InvoiceUpdateParamsLineItems) MarshalJSON

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

func (*InvoiceUpdateParamsLineItems) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsCreate

type InvoiceUpdateParamsLineItemsCreate struct {
	// Description of the line item.
	Description string `json:"description" api:"required"`
	// Unique identifier for the product.
	ProductID string `json:"product_id" api:"required"`
	// Type of the line item.
	//
	// Any of "payin", "payout".
	Type string `json:"type,omitzero" api:"required"`
	// Identifies a user by `id` or `external_id`.
	User InvoiceUpdateParamsLineItemsCreateUserUnion `json:"user,omitzero" api:"required"`
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	// Deprecated, use price instead.
	//
	// Deprecated: deprecated
	Amount param.Opt[string] `json:"amount,omitzero"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	CurrencyCode string `json:"currency_code,omitzero"`
	// Price breakdown. Provide amount, or unit_price and quantity, or all three.
	Price InvoiceUpdateParamsLineItemsCreatePrice `json:"price,omitzero"`
	// Tags for the line item.
	Tags []InvoiceUpdateParamsLineItemsCreateTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

Data to create a line item.

The properties Description, ProductID, Type, User are required.

func (InvoiceUpdateParamsLineItemsCreate) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsCreate) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsCreatePrice

type InvoiceUpdateParamsLineItemsCreatePrice struct {
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	// Required if unit_price and quantity are not provided.
	Amount param.Opt[string] `json:"amount,omitzero"`
	// Number of units for the line item.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// Price per unit as a string in the smallest currency unit, such as cents for USD.
	UnitPrice param.Opt[string] `json:"unit_price,omitzero"`
	// contains filtered or unexported fields
}

Price breakdown. Provide amount, or unit_price and quantity, or all three.

func (InvoiceUpdateParamsLineItemsCreatePrice) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsCreatePrice) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsCreateTag

type InvoiceUpdateParamsLineItemsCreateTag struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsLineItemsCreateTag) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsCreateTag) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsCreateUserExternalID

type InvoiceUpdateParamsLineItemsCreateUserExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (InvoiceUpdateParamsLineItemsCreateUserExternalID) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsCreateUserExternalID) UnmarshalJSON

type InvoiceUpdateParamsLineItemsCreateUserID

type InvoiceUpdateParamsLineItemsCreateUserID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (InvoiceUpdateParamsLineItemsCreateUserID) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsCreateUserID) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsCreateUserUnion

type InvoiceUpdateParamsLineItemsCreateUserUnion struct {
	OfInvoiceUpdatesLineItemsCreateUserID         *InvoiceUpdateParamsLineItemsCreateUserID         `json:",omitzero,inline"`
	OfInvoiceUpdatesLineItemsCreateUserExternalID *InvoiceUpdateParamsLineItemsCreateUserExternalID `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 (InvoiceUpdateParamsLineItemsCreateUserUnion) MarshalJSON

func (*InvoiceUpdateParamsLineItemsCreateUserUnion) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsDelete

type InvoiceUpdateParamsLineItemsDelete struct {
	// Unique identifier for the line item to delete.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (InvoiceUpdateParamsLineItemsDelete) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsDelete) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdate

type InvoiceUpdateParamsLineItemsUpdate struct {
	// Unique identifier for the line item to update.
	ID          string                                  `json:"id" api:"required"`
	Description param.Opt[string]                       `json:"description,omitzero"`
	Price       InvoiceUpdateParamsLineItemsUpdatePrice `json:"price,omitzero"`
	// Tag updates.
	Tags InvoiceUpdateParamsLineItemsUpdateTags `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

Data for updating a line item.

The property ID is required.

func (InvoiceUpdateParamsLineItemsUpdate) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdate) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdatePrice

type InvoiceUpdateParamsLineItemsUpdatePrice struct {
	// Number of units for the line item.
	Quantity int64 `json:"quantity" api:"required"`
	// Price per unit as a string in the smallest currency unit, such as cents for USD.
	UnitPrice string `json:"unit_price" api:"required"`
	// Total amount as a string in the smallest currency unit, such as cents for USD.
	Amount param.Opt[string] `json:"amount,omitzero"`
	// contains filtered or unexported fields
}

The properties Quantity, UnitPrice are required.

func (InvoiceUpdateParamsLineItemsUpdatePrice) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdatePrice) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdateTags

type InvoiceUpdateParamsLineItemsUpdateTags struct {
	// Tags to create. The tag key must not already exist.
	Create []InvoiceUpdateParamsLineItemsUpdateTagsCreate `json:"create,omitzero"`
	// Tags to remove.
	Delete []InvoiceUpdateParamsLineItemsUpdateTagsDelete `json:"delete,omitzero"`
	// Tags to set. Creates a new tag or updates an existing tag.
	Set []InvoiceUpdateParamsLineItemsUpdateTagsSet `json:"set,omitzero"`
	// Tags to update. The tag key must already exist.
	Update []InvoiceUpdateParamsLineItemsUpdateTagsUpdate `json:"update,omitzero"`
	// contains filtered or unexported fields
}

Tag updates.

func (InvoiceUpdateParamsLineItemsUpdateTags) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdateTags) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdateTagsCreate

type InvoiceUpdateParamsLineItemsUpdateTagsCreate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsLineItemsUpdateTagsCreate) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdateTagsCreate) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdateTagsDelete

type InvoiceUpdateParamsLineItemsUpdateTagsDelete struct {
	// Tag key to delete.
	Key string `json:"key" api:"required"`
	// contains filtered or unexported fields
}

The property Key is required.

func (InvoiceUpdateParamsLineItemsUpdateTagsDelete) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdateTagsDelete) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdateTagsSet

type InvoiceUpdateParamsLineItemsUpdateTagsSet struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsLineItemsUpdateTagsSet) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdateTagsSet) UnmarshalJSON

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

type InvoiceUpdateParamsLineItemsUpdateTagsUpdate

type InvoiceUpdateParamsLineItemsUpdateTagsUpdate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsLineItemsUpdateTagsUpdate) MarshalJSON

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

func (*InvoiceUpdateParamsLineItemsUpdateTagsUpdate) UnmarshalJSON

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

type InvoiceUpdateParamsTags

type InvoiceUpdateParamsTags struct {
	// Tags to create. The tag key must not already exist.
	Create []InvoiceUpdateParamsTagsCreate `json:"create,omitzero"`
	// Tags to remove.
	Delete []InvoiceUpdateParamsTagsDelete `json:"delete,omitzero"`
	// Tags to set. Creates a new tag or updates an existing tag.
	Set []InvoiceUpdateParamsTagsSet `json:"set,omitzero"`
	// Tags to update. The tag key must already exist.
	Update []InvoiceUpdateParamsTagsUpdate `json:"update,omitzero"`
	// contains filtered or unexported fields
}

Tag updates.

func (InvoiceUpdateParamsTags) MarshalJSON

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

func (*InvoiceUpdateParamsTags) UnmarshalJSON

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

type InvoiceUpdateParamsTagsCreate

type InvoiceUpdateParamsTagsCreate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsTagsCreate) MarshalJSON

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

func (*InvoiceUpdateParamsTagsCreate) UnmarshalJSON

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

type InvoiceUpdateParamsTagsDelete

type InvoiceUpdateParamsTagsDelete struct {
	// Tag key to delete.
	Key string `json:"key" api:"required"`
	// contains filtered or unexported fields
}

The property Key is required.

func (InvoiceUpdateParamsTagsDelete) MarshalJSON

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

func (*InvoiceUpdateParamsTagsDelete) UnmarshalJSON

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

type InvoiceUpdateParamsTagsSet

type InvoiceUpdateParamsTagsSet struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsTagsSet) MarshalJSON

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

func (*InvoiceUpdateParamsTagsSet) UnmarshalJSON

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

type InvoiceUpdateParamsTagsUpdate

type InvoiceUpdateParamsTagsUpdate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (InvoiceUpdateParamsTagsUpdate) MarshalJSON

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

func (*InvoiceUpdateParamsTagsUpdate) UnmarshalJSON

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

type InvoiceUpdateResponse

type InvoiceUpdateResponse struct {
	// Invoice object.
	Data Invoice `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InvoiceUpdateResponse) RawJSON

func (r InvoiceUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InvoiceUpdateResponse) UnmarshalJSON

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

type Payment

type Payment struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Amount in smallest currency unit.
	Amount string `json:"amount" api:"required"`
	// Timestamp when the payment was created.
	Created string `json:"created" api:"required"`
	// Currency code.
	Currency string `json:"currency" api:"required"`
	// Direction of the payment.
	Direction string `json:"direction" api:"required"`
	// Timestamp when the payment was last modified.
	Modified string `json:"modified" api:"required"`
	// Payment account ID.
	PaymentAccountID string `json:"payment_account_id" api:"required"`
	// Payment flow ID.
	PaymentFlowID string `json:"payment_flow_id" api:"required"`
	// Status of the payment.
	Status string `json:"status" api:"required"`
	// Associated transaction IDs.
	TransactionIDs []string `json:"transaction_ids" api:"required"`
	// User-provided unique ID when the payment was created with one.
	ExternalID string `json:"external_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Amount           respjson.Field
		Created          respjson.Field
		Currency         respjson.Field
		Direction        respjson.Field
		Modified         respjson.Field
		PaymentAccountID respjson.Field
		PaymentFlowID    respjson.Field
		Status           respjson.Field
		TransactionIDs   respjson.Field
		ExternalID       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payment object.

func (Payment) RawJSON

func (r Payment) RawJSON() string

Returns the unmodified JSON received from the API

func (*Payment) UnmarshalJSON

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

type PaymentFlow

type PaymentFlow struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Timestamp when the payment flow was created.
	Created string `json:"created" api:"required"`
	// User-provided unique external ID.
	ExternalID string `json:"external_id" api:"required"`
	// Invoice being settled.
	Invoice PaymentFlowInvoice `json:"invoice" api:"required"`
	// Timestamp when the payment flow was last modified.
	Modified string `json:"modified" api:"required"`
	// Payment plan for UI rendering.
	PaymentPlan PaymentFlowPaymentPlan `json:"payment_plan" api:"required"`
	// Status of the payment flow.
	Status string `json:"status" api:"required"`
	// Type of payment flow.
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		ExternalID  respjson.Field
		Invoice     respjson.Field
		Modified    respjson.Field
		PaymentPlan respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payment flow object.

func (PaymentFlow) RawJSON

func (r PaymentFlow) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentFlow) UnmarshalJSON

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

type PaymentFlowInvoice

type PaymentFlowInvoice struct {
	// Invoice identifier.
	ID string `json:"id" api:"required"`
	// Invoice external ID.
	ExternalID string `json:"external_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Invoice being settled.

func (PaymentFlowInvoice) RawJSON

func (r PaymentFlowInvoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentFlowInvoice) UnmarshalJSON

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

type PaymentFlowPaymentPlan

type PaymentFlowPaymentPlan struct {
	// Payment batches.
	Batches []PaymentFlowPaymentPlanBatch `json:"batches" api:"required"`
	// When the plan was generated.
	GeneratedAt string `json:"generated_at" api:"required"`
	// Invoice identifier.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Plan version.
	Version float64 `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Batches     respjson.Field
		GeneratedAt respjson.Field
		InvoiceID   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payment plan for UI rendering.

func (PaymentFlowPaymentPlan) RawJSON

func (r PaymentFlowPaymentPlan) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentFlowPaymentPlan) UnmarshalJSON

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

type PaymentFlowPaymentPlanBatch

type PaymentFlowPaymentPlanBatch struct {
	// Batch identifier.
	BatchID string `json:"batch_id" api:"required"`
	// Batches this one depends on.
	DependsOn []string `json:"depends_on" api:"required"`
	// Human-readable batch label.
	Label string `json:"label" api:"required"`
	// Payments in this batch.
	Payments []PaymentFlowPaymentPlanBatchPayment `json:"payments" api:"required"`
	// Batch status.
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BatchID     respjson.Field
		DependsOn   respjson.Field
		Label       respjson.Field
		Payments    respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaymentFlowPaymentPlanBatch) RawJSON

func (r PaymentFlowPaymentPlanBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentFlowPaymentPlanBatch) UnmarshalJSON

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

type PaymentFlowPaymentPlanBatchPayment

type PaymentFlowPaymentPlanBatchPayment struct {
	// Amount in smallest currency unit.
	Amount string `json:"amount" api:"required"`
	// Currency code.
	Currency string `json:"currency" api:"required"`
	// Direction of the payment.
	Direction string `json:"direction" api:"required"`
	// FRAGMENT generated unique ID.
	PaymentID string `json:"payment_id" api:"required"`
	// Status of the payment.
	Status string `json:"status" api:"required"`
	// User associated with the payment.
	User PaymentFlowPaymentPlanBatchPaymentUser `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		Direction   respjson.Field
		PaymentID   respjson.Field
		Status      respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaymentFlowPaymentPlanBatchPayment) RawJSON

Returns the unmodified JSON received from the API

func (*PaymentFlowPaymentPlanBatchPayment) UnmarshalJSON

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

type PaymentFlowPaymentPlanBatchPaymentUser

type PaymentFlowPaymentPlanBatchPaymentUser struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User associated with the payment.

func (PaymentFlowPaymentPlanBatchPaymentUser) RawJSON

Returns the unmodified JSON received from the API

func (*PaymentFlowPaymentPlanBatchPaymentUser) UnmarshalJSON

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

type Product

type Product struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Product code.
	Code string `json:"code" api:"required"`
	// Timestamp when the product was created. Uses ISO 8601 format.
	Created time.Time `json:"created" api:"required" format:"date-time"`
	// Roles that can pay for the product.
	PaidByRoles []ProductPaidByRole `json:"paid_by_roles" api:"required"`
	// Roles that can receive payment for the product.
	PaidToRoles []ProductPaidToRole `json:"paid_to_roles" api:"required"`
	// Current version of the product.
	UpdateVersion float64 `json:"update_version" api:"required"`
	// Workspace ID of the product.
	WorkspaceID string `json:"workspace_id" api:"required"`
	// Product description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Code          respjson.Field
		Created       respjson.Field
		PaidByRoles   respjson.Field
		PaidToRoles   respjson.Field
		UpdateVersion respjson.Field
		WorkspaceID   respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Product object.

func (Product) RawJSON

func (r Product) RawJSON() string

Returns the unmodified JSON received from the API

func (*Product) UnmarshalJSON

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

type ProductGetResponse

type ProductGetResponse struct {
	// Product object.
	Data Product `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProductGetResponse) RawJSON

func (r ProductGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProductGetResponse) UnmarshalJSON

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

type ProductListResponse

type ProductListResponse struct {
	// List of products.
	Data []Product `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProductListResponse) RawJSON

func (r ProductListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProductListResponse) UnmarshalJSON

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

type ProductNewParams

type ProductNewParams struct {
	// Unique product code.
	Code string `json:"code" api:"required"`
	// Product description.
	Description param.Opt[string] `json:"description,omitzero"`
	// Roles that can pay for the product. Reference roles by `id` or `name`. At least
	// one of `paid_by_roles` or `paid_to_roles` must be provided.
	PaidByRoles []ProductNewParamsPaidByRoleUnion `json:"paid_by_roles,omitzero"`
	// Roles that can receive payment for the product. Reference roles by `id` or
	// `name`. At least one of `paid_by_roles` or `paid_to_roles` must be provided.
	PaidToRoles []ProductNewParamsPaidToRoleUnion `json:"paid_to_roles,omitzero"`
	// contains filtered or unexported fields
}

func (ProductNewParams) MarshalJSON

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

func (*ProductNewParams) UnmarshalJSON

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

type ProductNewParamsPaidByRoleID

type ProductNewParamsPaidByRoleID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (ProductNewParamsPaidByRoleID) MarshalJSON

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

func (*ProductNewParamsPaidByRoleID) UnmarshalJSON

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

type ProductNewParamsPaidByRoleName

type ProductNewParamsPaidByRoleName struct {
	// Name of the role.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The property Name is required.

func (ProductNewParamsPaidByRoleName) MarshalJSON

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

func (*ProductNewParamsPaidByRoleName) UnmarshalJSON

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

type ProductNewParamsPaidByRoleUnion

type ProductNewParamsPaidByRoleUnion struct {
	OfProductNewsPaidByRoleID   *ProductNewParamsPaidByRoleID   `json:",omitzero,inline"`
	OfProductNewsPaidByRoleName *ProductNewParamsPaidByRoleName `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 (ProductNewParamsPaidByRoleUnion) MarshalJSON

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

func (*ProductNewParamsPaidByRoleUnion) UnmarshalJSON

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

type ProductNewParamsPaidToRoleID

type ProductNewParamsPaidToRoleID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (ProductNewParamsPaidToRoleID) MarshalJSON

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

func (*ProductNewParamsPaidToRoleID) UnmarshalJSON

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

type ProductNewParamsPaidToRoleName

type ProductNewParamsPaidToRoleName struct {
	// Name of the role.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The property Name is required.

func (ProductNewParamsPaidToRoleName) MarshalJSON

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

func (*ProductNewParamsPaidToRoleName) UnmarshalJSON

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

type ProductNewParamsPaidToRoleUnion

type ProductNewParamsPaidToRoleUnion struct {
	OfProductNewsPaidToRoleID   *ProductNewParamsPaidToRoleID   `json:",omitzero,inline"`
	OfProductNewsPaidToRoleName *ProductNewParamsPaidToRoleName `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 (ProductNewParamsPaidToRoleUnion) MarshalJSON

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

func (*ProductNewParamsPaidToRoleUnion) UnmarshalJSON

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

type ProductNewResponse

type ProductNewResponse struct {
	// Product object.
	Data Product `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProductNewResponse) RawJSON

func (r ProductNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProductNewResponse) UnmarshalJSON

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

type ProductPaidByRole

type ProductPaidByRole struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Name of the role.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Role reference in product API responses.

func (ProductPaidByRole) RawJSON

func (r ProductPaidByRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProductPaidByRole) UnmarshalJSON

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

type ProductPaidToRole

type ProductPaidToRole struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Name of the role.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Role reference in product API responses.

func (ProductPaidToRole) RawJSON

func (r ProductPaidToRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProductPaidToRole) UnmarshalJSON

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

type ProductService

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

Product management operations

ProductService contains methods and other services that help with interacting with the fragment 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 NewProductService method instead.

func NewProductService

func NewProductService(opts ...option.RequestOption) (r ProductService)

NewProductService 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 (*ProductService) Get

func (r *ProductService) Get(ctx context.Context, code string, opts ...option.RequestOption) (res *ProductGetResponse, err error)

Retrieves a product by code.

func (*ProductService) List

func (r *ProductService) List(ctx context.Context, opts ...option.RequestOption) (res *ProductListResponse, err error)

Lists all products.

func (*ProductService) New

Creates a product.

type Role deprecated

type Role struct {
	// FRAGMENT generated unique ID. Deprecated.
	//
	// Deprecated: deprecated
	ID string `json:"id" api:"required"`
	// Name of the role. Deprecated, use user tags instead.
	//
	// Deprecated: deprecated
	Role string `json:"role" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Role        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Role object. Deprecated, use user tags instead.

Deprecated: deprecated

func (Role) RawJSON

func (r Role) RawJSON() string

Returns the unmodified JSON received from the API

func (*Role) UnmarshalJSON

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

type RoleListResponse deprecated

type RoleListResponse struct {
	// List of roles. Deprecated, use user tags instead.
	//
	// Deprecated: deprecated
	Data []Role `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of roles. Deprecated, use user tags instead.

Deprecated: deprecated

func (RoleListResponse) RawJSON

func (r RoleListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*RoleListResponse) UnmarshalJSON

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

type RoleNewParams

type RoleNewParams struct {
	// Name of the role. Deprecated, use user tags instead.
	Role string `json:"role" api:"required"`
	// contains filtered or unexported fields
}

func (RoleNewParams) MarshalJSON

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

func (*RoleNewParams) UnmarshalJSON

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

type RoleNewResponse deprecated

type RoleNewResponse struct {
	// Role object. Deprecated, use user tags instead.
	//
	// Deprecated: deprecated
	Data Role `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deprecated: deprecated

func (RoleNewResponse) RawJSON

func (r RoleNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*RoleNewResponse) UnmarshalJSON

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

type RoleService

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

Role management operations

RoleService contains methods and other services that help with interacting with the fragment 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 NewRoleService method instead.

func NewRoleService

func NewRoleService(opts ...option.RequestOption) (r RoleService)

NewRoleService 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 (*RoleService) List deprecated

func (r *RoleService) List(ctx context.Context, opts ...option.RequestOption) (res *RoleListResponse, err error)

Lists all roles. Deprecated, use user tags instead.

Deprecated: deprecated

func (*RoleService) New deprecated

func (r *RoleService) New(ctx context.Context, body RoleNewParams, opts ...option.RequestOption) (res *RoleNewResponse, err error)

Creates a role. Deprecated, use user tags instead.

Deprecated: deprecated

type Transaction

type Transaction struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// External account for the transaction.
	Account TransactionAccount `json:"account" api:"required"`
	// Allocations applied to the transaction.
	Allocations []TransactionAllocation `json:"allocations" api:"required"`
	// Transaction amount, as a string in the smallest currency unit, such as cents for
	// USD. Can be positive or negative.
	Amount string `json:"amount" api:"required"`
	// Timestamp when the transaction was created. Uses ISO 8601 format.
	Created time.Time `json:"created" api:"required" format:"date-time"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	Currency TransactionCurrency `json:"currency" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Timestamp when the transaction was posted. Uses ISO 8601 format.
	Posted time.Time `json:"posted" api:"required" format:"date-time"`
	// Tags for the transaction.
	Tags []TransactionTag `json:"tags" api:"required"`
	// Amount not yet allocated, as a string.
	UnallocatedAmount string `json:"unallocated_amount" api:"required"`
	// Current version of the transaction.
	Version int64 `json:"version" api:"required"`
	// Timestamp when the transaction was last modified. Uses ISO 8601 format.
	Modified time.Time `json:"modified" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Account           respjson.Field
		Allocations       respjson.Field
		Amount            respjson.Field
		Created           respjson.Field
		Currency          respjson.Field
		ExternalID        respjson.Field
		Posted            respjson.Field
		Tags              respjson.Field
		UnallocatedAmount respjson.Field
		Version           respjson.Field
		Modified          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transaction object.

func (Transaction) RawJSON

func (r Transaction) RawJSON() string

Returns the unmodified JSON received from the API

func (*Transaction) UnmarshalJSON

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

type TransactionAccount

type TransactionAccount struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

External account for the transaction.

func (TransactionAccount) RawJSON

func (r TransactionAccount) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionAccount) UnmarshalJSON

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

type TransactionAllocation

type TransactionAllocation struct {
	// Allocated amount, as a positive string in the smallest currency unit, such as
	// cents for USD.
	Amount string `json:"amount" api:"required"`
	// Invoice the allocation is applied against.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Type of allocation.
	//
	// Any of "invoice_payin", "invoice_payout".
	Type string `json:"type" api:"required"`
	// User associated with the allocation.
	User TransactionAllocationUser `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		InvoiceID   respjson.Field
		Type        respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An allocation linking a transaction to an invoice.

func (TransactionAllocation) RawJSON

func (r TransactionAllocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionAllocation) UnmarshalJSON

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

type TransactionAllocationUser

type TransactionAllocationUser struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User associated with the allocation.

func (TransactionAllocationUser) RawJSON

func (r TransactionAllocationUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionAllocationUser) UnmarshalJSON

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

type TransactionCurrency

type TransactionCurrency string

ISO 4217 or crypto currency code.

const (
	TransactionCurrencyAda     TransactionCurrency = "ADA"
	TransactionCurrencyBtc     TransactionCurrency = "BTC"
	TransactionCurrencyDai     TransactionCurrency = "DAI"
	TransactionCurrencyEth     TransactionCurrency = "ETH"
	TransactionCurrencySol     TransactionCurrency = "SOL"
	TransactionCurrencyUsdc    TransactionCurrency = "USDC"
	TransactionCurrencyUsdt    TransactionCurrency = "USDT"
	TransactionCurrencyUsdg    TransactionCurrency = "USDG"
	TransactionCurrencyEurc    TransactionCurrency = "EURC"
	TransactionCurrencyCadc    TransactionCurrency = "CADC"
	TransactionCurrencyCadt    TransactionCurrency = "CADT"
	TransactionCurrencyXlm     TransactionCurrency = "XLM"
	TransactionCurrencyUni     TransactionCurrency = "UNI"
	TransactionCurrencyBch     TransactionCurrency = "BCH"
	TransactionCurrencyLtc     TransactionCurrency = "LTC"
	TransactionCurrencyAave    TransactionCurrency = "AAVE"
	TransactionCurrencyLink    TransactionCurrency = "LINK"
	TransactionCurrencyMatic   TransactionCurrency = "MATIC"
	TransactionCurrencyPts     TransactionCurrency = "PTS"
	TransactionCurrencyAed     TransactionCurrency = "AED"
	TransactionCurrencyAfn     TransactionCurrency = "AFN"
	TransactionCurrencyAll     TransactionCurrency = "ALL"
	TransactionCurrencyAmd     TransactionCurrency = "AMD"
	TransactionCurrencyAng     TransactionCurrency = "ANG"
	TransactionCurrencyAoa     TransactionCurrency = "AOA"
	TransactionCurrencyArs     TransactionCurrency = "ARS"
	TransactionCurrencyAud     TransactionCurrency = "AUD"
	TransactionCurrencyAwg     TransactionCurrency = "AWG"
	TransactionCurrencyAzn     TransactionCurrency = "AZN"
	TransactionCurrencyBam     TransactionCurrency = "BAM"
	TransactionCurrencyBbd     TransactionCurrency = "BBD"
	TransactionCurrencyBdt     TransactionCurrency = "BDT"
	TransactionCurrencyBgn     TransactionCurrency = "BGN"
	TransactionCurrencyBhd     TransactionCurrency = "BHD"
	TransactionCurrencyBif     TransactionCurrency = "BIF"
	TransactionCurrencyBmd     TransactionCurrency = "BMD"
	TransactionCurrencyBnd     TransactionCurrency = "BND"
	TransactionCurrencyBob     TransactionCurrency = "BOB"
	TransactionCurrencyBrl     TransactionCurrency = "BRL"
	TransactionCurrencyBsd     TransactionCurrency = "BSD"
	TransactionCurrencyBtn     TransactionCurrency = "BTN"
	TransactionCurrencyBwp     TransactionCurrency = "BWP"
	TransactionCurrencyByr     TransactionCurrency = "BYR"
	TransactionCurrencyBzd     TransactionCurrency = "BZD"
	TransactionCurrencyCad     TransactionCurrency = "CAD"
	TransactionCurrencyCdf     TransactionCurrency = "CDF"
	TransactionCurrencyChf     TransactionCurrency = "CHF"
	TransactionCurrencyClp     TransactionCurrency = "CLP"
	TransactionCurrencyCny     TransactionCurrency = "CNY"
	TransactionCurrencyCop     TransactionCurrency = "COP"
	TransactionCurrencyCrc     TransactionCurrency = "CRC"
	TransactionCurrencyCuc     TransactionCurrency = "CUC"
	TransactionCurrencyCup     TransactionCurrency = "CUP"
	TransactionCurrencyCve     TransactionCurrency = "CVE"
	TransactionCurrencyCzk     TransactionCurrency = "CZK"
	TransactionCurrencyDjf     TransactionCurrency = "DJF"
	TransactionCurrencyDkk     TransactionCurrency = "DKK"
	TransactionCurrencyDop     TransactionCurrency = "DOP"
	TransactionCurrencyDzd     TransactionCurrency = "DZD"
	TransactionCurrencyEgp     TransactionCurrency = "EGP"
	TransactionCurrencyErn     TransactionCurrency = "ERN"
	TransactionCurrencyEtb     TransactionCurrency = "ETB"
	TransactionCurrencyEur     TransactionCurrency = "EUR"
	TransactionCurrencyFjd     TransactionCurrency = "FJD"
	TransactionCurrencyFkp     TransactionCurrency = "FKP"
	TransactionCurrencyGbp     TransactionCurrency = "GBP"
	TransactionCurrencyGel     TransactionCurrency = "GEL"
	TransactionCurrencyGgp     TransactionCurrency = "GGP"
	TransactionCurrencyGhs     TransactionCurrency = "GHS"
	TransactionCurrencyGip     TransactionCurrency = "GIP"
	TransactionCurrencyGmd     TransactionCurrency = "GMD"
	TransactionCurrencyGnf     TransactionCurrency = "GNF"
	TransactionCurrencyGtq     TransactionCurrency = "GTQ"
	TransactionCurrencyGyd     TransactionCurrency = "GYD"
	TransactionCurrencyHkd     TransactionCurrency = "HKD"
	TransactionCurrencyHnl     TransactionCurrency = "HNL"
	TransactionCurrencyHrk     TransactionCurrency = "HRK"
	TransactionCurrencyHtg     TransactionCurrency = "HTG"
	TransactionCurrencyHuf     TransactionCurrency = "HUF"
	TransactionCurrencyIdr     TransactionCurrency = "IDR"
	TransactionCurrencyIls     TransactionCurrency = "ILS"
	TransactionCurrencyImp     TransactionCurrency = "IMP"
	TransactionCurrencyInr     TransactionCurrency = "INR"
	TransactionCurrencyIqd     TransactionCurrency = "IQD"
	TransactionCurrencyIrr     TransactionCurrency = "IRR"
	TransactionCurrencyIsk     TransactionCurrency = "ISK"
	TransactionCurrencyJmd     TransactionCurrency = "JMD"
	TransactionCurrencyJod     TransactionCurrency = "JOD"
	TransactionCurrencyJpy     TransactionCurrency = "JPY"
	TransactionCurrencyKes     TransactionCurrency = "KES"
	TransactionCurrencyKgs     TransactionCurrency = "KGS"
	TransactionCurrencyKhr     TransactionCurrency = "KHR"
	TransactionCurrencyKmf     TransactionCurrency = "KMF"
	TransactionCurrencyKpw     TransactionCurrency = "KPW"
	TransactionCurrencyKrw     TransactionCurrency = "KRW"
	TransactionCurrencyKwd     TransactionCurrency = "KWD"
	TransactionCurrencyKyd     TransactionCurrency = "KYD"
	TransactionCurrencyKzt     TransactionCurrency = "KZT"
	TransactionCurrencyLak     TransactionCurrency = "LAK"
	TransactionCurrencyLbp     TransactionCurrency = "LBP"
	TransactionCurrencyLkr     TransactionCurrency = "LKR"
	TransactionCurrencyLrd     TransactionCurrency = "LRD"
	TransactionCurrencyLsl     TransactionCurrency = "LSL"
	TransactionCurrencyLyd     TransactionCurrency = "LYD"
	TransactionCurrencyMad     TransactionCurrency = "MAD"
	TransactionCurrencyMdl     TransactionCurrency = "MDL"
	TransactionCurrencyMga     TransactionCurrency = "MGA"
	TransactionCurrencyMkd     TransactionCurrency = "MKD"
	TransactionCurrencyMmk     TransactionCurrency = "MMK"
	TransactionCurrencyMnt     TransactionCurrency = "MNT"
	TransactionCurrencyMop     TransactionCurrency = "MOP"
	TransactionCurrencyMur     TransactionCurrency = "MUR"
	TransactionCurrencyMvr     TransactionCurrency = "MVR"
	TransactionCurrencyMwk     TransactionCurrency = "MWK"
	TransactionCurrencyMxn     TransactionCurrency = "MXN"
	TransactionCurrencyMyr     TransactionCurrency = "MYR"
	TransactionCurrencyMzn     TransactionCurrency = "MZN"
	TransactionCurrencyNad     TransactionCurrency = "NAD"
	TransactionCurrencyNgn     TransactionCurrency = "NGN"
	TransactionCurrencyNio     TransactionCurrency = "NIO"
	TransactionCurrencyNok     TransactionCurrency = "NOK"
	TransactionCurrencyNpr     TransactionCurrency = "NPR"
	TransactionCurrencyNzd     TransactionCurrency = "NZD"
	TransactionCurrencyOmr     TransactionCurrency = "OMR"
	TransactionCurrencyPab     TransactionCurrency = "PAB"
	TransactionCurrencyPen     TransactionCurrency = "PEN"
	TransactionCurrencyPgk     TransactionCurrency = "PGK"
	TransactionCurrencyPhp     TransactionCurrency = "PHP"
	TransactionCurrencyPkr     TransactionCurrency = "PKR"
	TransactionCurrencyPln     TransactionCurrency = "PLN"
	TransactionCurrencyPyg     TransactionCurrency = "PYG"
	TransactionCurrencyQar     TransactionCurrency = "QAR"
	TransactionCurrencyRon     TransactionCurrency = "RON"
	TransactionCurrencyRsd     TransactionCurrency = "RSD"
	TransactionCurrencyRub     TransactionCurrency = "RUB"
	TransactionCurrencyRwf     TransactionCurrency = "RWF"
	TransactionCurrencySar     TransactionCurrency = "SAR"
	TransactionCurrencySbd     TransactionCurrency = "SBD"
	TransactionCurrencyScr     TransactionCurrency = "SCR"
	TransactionCurrencySdg     TransactionCurrency = "SDG"
	TransactionCurrencySek     TransactionCurrency = "SEK"
	TransactionCurrencySgd     TransactionCurrency = "SGD"
	TransactionCurrencyShp     TransactionCurrency = "SHP"
	TransactionCurrencySll     TransactionCurrency = "SLL"
	TransactionCurrencySos     TransactionCurrency = "SOS"
	TransactionCurrencySpl     TransactionCurrency = "SPL"
	TransactionCurrencySrd     TransactionCurrency = "SRD"
	TransactionCurrencySvc     TransactionCurrency = "SVC"
	TransactionCurrencySyp     TransactionCurrency = "SYP"
	TransactionCurrencyStn     TransactionCurrency = "STN"
	TransactionCurrencySzl     TransactionCurrency = "SZL"
	TransactionCurrencyThb     TransactionCurrency = "THB"
	TransactionCurrencyTjs     TransactionCurrency = "TJS"
	TransactionCurrencyTmt     TransactionCurrency = "TMT"
	TransactionCurrencyTnd     TransactionCurrency = "TND"
	TransactionCurrencyTop     TransactionCurrency = "TOP"
	TransactionCurrencyTry     TransactionCurrency = "TRY"
	TransactionCurrencyTtd     TransactionCurrency = "TTD"
	TransactionCurrencyTvd     TransactionCurrency = "TVD"
	TransactionCurrencyTwd     TransactionCurrency = "TWD"
	TransactionCurrencyTzs     TransactionCurrency = "TZS"
	TransactionCurrencyUah     TransactionCurrency = "UAH"
	TransactionCurrencyUgx     TransactionCurrency = "UGX"
	TransactionCurrencyUsd     TransactionCurrency = "USD"
	TransactionCurrencyUyu     TransactionCurrency = "UYU"
	TransactionCurrencyUzs     TransactionCurrency = "UZS"
	TransactionCurrencyVef     TransactionCurrency = "VEF"
	TransactionCurrencyVnd     TransactionCurrency = "VND"
	TransactionCurrencyVuv     TransactionCurrency = "VUV"
	TransactionCurrencyWst     TransactionCurrency = "WST"
	TransactionCurrencyXaf     TransactionCurrency = "XAF"
	TransactionCurrencyXcd     TransactionCurrency = "XCD"
	TransactionCurrencyXof     TransactionCurrency = "XOF"
	TransactionCurrencyXpf     TransactionCurrency = "XPF"
	TransactionCurrencyYer     TransactionCurrency = "YER"
	TransactionCurrencyZar     TransactionCurrency = "ZAR"
	TransactionCurrencyZmw     TransactionCurrency = "ZMW"
	TransactionCurrencyLogical TransactionCurrency = "LOGICAL"
	TransactionCurrencyCustom  TransactionCurrency = "CUSTOM"
)

type TransactionGetResponse

type TransactionGetResponse struct {
	// Transaction object.
	Data Transaction `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionGetResponse) RawJSON

func (r TransactionGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionGetResponse) UnmarshalJSON

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

type TransactionListHistoryResponse

type TransactionListHistoryResponse struct {
	// List of transaction versions over time, ordered by version, oldest first.
	Data []Transaction `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionListHistoryResponse) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionListHistoryResponse) UnmarshalJSON

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

type TransactionListParams

type TransactionListParams struct {
	// Filter by account `id` or `external_id`. If the account does not exist, returns
	// an empty list.
	Account param.Opt[string] `query:"account,omitzero" json:"-"`
	// Filter by reconciliation status. `reconciled` returns transactions where
	// unallocated_amount is 0. `unreconciled` returns transactions where
	// unallocated_amount is not 0. Omit for all transactions.
	//
	// Any of "reconciled", "unreconciled".
	ReconciliationStatus TransactionListParamsReconciliationStatus `query:"reconciliation_status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TransactionListParams) URLQuery

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

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

type TransactionListParamsReconciliationStatus

type TransactionListParamsReconciliationStatus string

Filter by reconciliation status. `reconciled` returns transactions where unallocated_amount is 0. `unreconciled` returns transactions where unallocated_amount is not 0. Omit for all transactions.

const (
	TransactionListParamsReconciliationStatusReconciled   TransactionListParamsReconciliationStatus = "reconciled"
	TransactionListParamsReconciliationStatusUnreconciled TransactionListParamsReconciliationStatus = "unreconciled"
)

type TransactionListResponse

type TransactionListResponse struct {
	// List of transaction objects matching the filter criteria.
	Data []Transaction `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionListResponse) RawJSON

func (r TransactionListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionListResponse) UnmarshalJSON

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

type TransactionNewParams

type TransactionNewParams struct {
	// External account for the transaction. Identify it by `id`, `external_id`, or
	// both.
	Account TransactionNewParamsAccount `json:"account,omitzero" api:"required"`
	// Allocations for the transaction. An empty array indicates unreconciled funds.
	Allocations []TransactionNewParamsAllocation `json:"allocations,omitzero" api:"required"`
	// Transaction amount, as a string in the smallest currency unit, such as cents for
	// USD. Can be positive or negative.
	Amount string `json:"amount" api:"required"`
	// ISO 4217 or crypto currency code.
	//
	// Any of "ADA", "BTC", "DAI", "ETH", "SOL", "USDC", "USDT", "USDG", "EURC",
	// "CADC", "CADT", "XLM", "UNI", "BCH", "LTC", "AAVE", "LINK", "MATIC", "PTS",
	// "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM",
	// "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN",
	// "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC",
	// "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR",
	// "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
	// "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR",
	// "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD",
	// "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA",
	// "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD",
	// "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR",
	// "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	// "SEK", "SGD", "SHP", "SLL", "SOS", "SPL", "SRD", "SVC", "SYP", "STN", "SZL",
	// "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH",
	// "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XOF",
	// "XPF", "YER", "ZAR", "ZMW", "LOGICAL", "CUSTOM".
	Currency TransactionNewParamsCurrency `json:"currency,omitzero" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Timestamp when the transaction was posted. Uses ISO 8601 format.
	Posted time.Time `json:"posted" api:"required" format:"date-time"`
	// Tags for the transaction.
	Tags []TransactionNewParamsTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (TransactionNewParams) MarshalJSON

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

func (*TransactionNewParams) UnmarshalJSON

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

type TransactionNewParamsAccount

type TransactionNewParamsAccount struct {
	// FRAGMENT generated unique ID.
	ID param.Opt[string] `json:"id,omitzero"`
	// User-provided unique ID.
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// contains filtered or unexported fields
}

External account for the transaction. Identify it by `id`, `external_id`, or both.

func (TransactionNewParamsAccount) MarshalJSON

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

func (*TransactionNewParamsAccount) UnmarshalJSON

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

type TransactionNewParamsAllocation

type TransactionNewParamsAllocation struct {
	// Allocation amount, as a positive string in the smallest currency unit, such as
	// cents for USD.
	Amount string `json:"amount" api:"required"`
	// Invoice to allocate against.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Type of allocation.
	//
	// Any of "invoice_payin", "invoice_payout".
	Type string `json:"type,omitzero" api:"required"`
	// Identifies a user by `id` or `external_id`.
	User TransactionNewParamsAllocationUserUnion `json:"user,omitzero" api:"required"`
	// contains filtered or unexported fields
}

An allocation linking a transaction to an invoice.

The properties Amount, InvoiceID, Type, User are required.

func (TransactionNewParamsAllocation) MarshalJSON

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

func (*TransactionNewParamsAllocation) UnmarshalJSON

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

type TransactionNewParamsAllocationUserExternalID

type TransactionNewParamsAllocationUserExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (TransactionNewParamsAllocationUserExternalID) MarshalJSON

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

func (*TransactionNewParamsAllocationUserExternalID) UnmarshalJSON

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

type TransactionNewParamsAllocationUserID

type TransactionNewParamsAllocationUserID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TransactionNewParamsAllocationUserID) MarshalJSON

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

func (*TransactionNewParamsAllocationUserID) UnmarshalJSON

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

type TransactionNewParamsAllocationUserUnion

type TransactionNewParamsAllocationUserUnion struct {
	OfTransactionNewsAllocationUserID         *TransactionNewParamsAllocationUserID         `json:",omitzero,inline"`
	OfTransactionNewsAllocationUserExternalID *TransactionNewParamsAllocationUserExternalID `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 (TransactionNewParamsAllocationUserUnion) MarshalJSON

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

func (*TransactionNewParamsAllocationUserUnion) UnmarshalJSON

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

type TransactionNewParamsCurrency

type TransactionNewParamsCurrency string

ISO 4217 or crypto currency code.

const (
	TransactionNewParamsCurrencyAda     TransactionNewParamsCurrency = "ADA"
	TransactionNewParamsCurrencyBtc     TransactionNewParamsCurrency = "BTC"
	TransactionNewParamsCurrencyDai     TransactionNewParamsCurrency = "DAI"
	TransactionNewParamsCurrencyEth     TransactionNewParamsCurrency = "ETH"
	TransactionNewParamsCurrencySol     TransactionNewParamsCurrency = "SOL"
	TransactionNewParamsCurrencyUsdc    TransactionNewParamsCurrency = "USDC"
	TransactionNewParamsCurrencyUsdt    TransactionNewParamsCurrency = "USDT"
	TransactionNewParamsCurrencyUsdg    TransactionNewParamsCurrency = "USDG"
	TransactionNewParamsCurrencyEurc    TransactionNewParamsCurrency = "EURC"
	TransactionNewParamsCurrencyCadc    TransactionNewParamsCurrency = "CADC"
	TransactionNewParamsCurrencyCadt    TransactionNewParamsCurrency = "CADT"
	TransactionNewParamsCurrencyXlm     TransactionNewParamsCurrency = "XLM"
	TransactionNewParamsCurrencyUni     TransactionNewParamsCurrency = "UNI"
	TransactionNewParamsCurrencyBch     TransactionNewParamsCurrency = "BCH"
	TransactionNewParamsCurrencyLtc     TransactionNewParamsCurrency = "LTC"
	TransactionNewParamsCurrencyAave    TransactionNewParamsCurrency = "AAVE"
	TransactionNewParamsCurrencyLink    TransactionNewParamsCurrency = "LINK"
	TransactionNewParamsCurrencyMatic   TransactionNewParamsCurrency = "MATIC"
	TransactionNewParamsCurrencyPts     TransactionNewParamsCurrency = "PTS"
	TransactionNewParamsCurrencyAed     TransactionNewParamsCurrency = "AED"
	TransactionNewParamsCurrencyAfn     TransactionNewParamsCurrency = "AFN"
	TransactionNewParamsCurrencyAll     TransactionNewParamsCurrency = "ALL"
	TransactionNewParamsCurrencyAmd     TransactionNewParamsCurrency = "AMD"
	TransactionNewParamsCurrencyAng     TransactionNewParamsCurrency = "ANG"
	TransactionNewParamsCurrencyAoa     TransactionNewParamsCurrency = "AOA"
	TransactionNewParamsCurrencyArs     TransactionNewParamsCurrency = "ARS"
	TransactionNewParamsCurrencyAud     TransactionNewParamsCurrency = "AUD"
	TransactionNewParamsCurrencyAwg     TransactionNewParamsCurrency = "AWG"
	TransactionNewParamsCurrencyAzn     TransactionNewParamsCurrency = "AZN"
	TransactionNewParamsCurrencyBam     TransactionNewParamsCurrency = "BAM"
	TransactionNewParamsCurrencyBbd     TransactionNewParamsCurrency = "BBD"
	TransactionNewParamsCurrencyBdt     TransactionNewParamsCurrency = "BDT"
	TransactionNewParamsCurrencyBgn     TransactionNewParamsCurrency = "BGN"
	TransactionNewParamsCurrencyBhd     TransactionNewParamsCurrency = "BHD"
	TransactionNewParamsCurrencyBif     TransactionNewParamsCurrency = "BIF"
	TransactionNewParamsCurrencyBmd     TransactionNewParamsCurrency = "BMD"
	TransactionNewParamsCurrencyBnd     TransactionNewParamsCurrency = "BND"
	TransactionNewParamsCurrencyBob     TransactionNewParamsCurrency = "BOB"
	TransactionNewParamsCurrencyBrl     TransactionNewParamsCurrency = "BRL"
	TransactionNewParamsCurrencyBsd     TransactionNewParamsCurrency = "BSD"
	TransactionNewParamsCurrencyBtn     TransactionNewParamsCurrency = "BTN"
	TransactionNewParamsCurrencyBwp     TransactionNewParamsCurrency = "BWP"
	TransactionNewParamsCurrencyByr     TransactionNewParamsCurrency = "BYR"
	TransactionNewParamsCurrencyBzd     TransactionNewParamsCurrency = "BZD"
	TransactionNewParamsCurrencyCad     TransactionNewParamsCurrency = "CAD"
	TransactionNewParamsCurrencyCdf     TransactionNewParamsCurrency = "CDF"
	TransactionNewParamsCurrencyChf     TransactionNewParamsCurrency = "CHF"
	TransactionNewParamsCurrencyClp     TransactionNewParamsCurrency = "CLP"
	TransactionNewParamsCurrencyCny     TransactionNewParamsCurrency = "CNY"
	TransactionNewParamsCurrencyCop     TransactionNewParamsCurrency = "COP"
	TransactionNewParamsCurrencyCrc     TransactionNewParamsCurrency = "CRC"
	TransactionNewParamsCurrencyCuc     TransactionNewParamsCurrency = "CUC"
	TransactionNewParamsCurrencyCup     TransactionNewParamsCurrency = "CUP"
	TransactionNewParamsCurrencyCve     TransactionNewParamsCurrency = "CVE"
	TransactionNewParamsCurrencyCzk     TransactionNewParamsCurrency = "CZK"
	TransactionNewParamsCurrencyDjf     TransactionNewParamsCurrency = "DJF"
	TransactionNewParamsCurrencyDkk     TransactionNewParamsCurrency = "DKK"
	TransactionNewParamsCurrencyDop     TransactionNewParamsCurrency = "DOP"
	TransactionNewParamsCurrencyDzd     TransactionNewParamsCurrency = "DZD"
	TransactionNewParamsCurrencyEgp     TransactionNewParamsCurrency = "EGP"
	TransactionNewParamsCurrencyErn     TransactionNewParamsCurrency = "ERN"
	TransactionNewParamsCurrencyEtb     TransactionNewParamsCurrency = "ETB"
	TransactionNewParamsCurrencyEur     TransactionNewParamsCurrency = "EUR"
	TransactionNewParamsCurrencyFjd     TransactionNewParamsCurrency = "FJD"
	TransactionNewParamsCurrencyFkp     TransactionNewParamsCurrency = "FKP"
	TransactionNewParamsCurrencyGbp     TransactionNewParamsCurrency = "GBP"
	TransactionNewParamsCurrencyGel     TransactionNewParamsCurrency = "GEL"
	TransactionNewParamsCurrencyGgp     TransactionNewParamsCurrency = "GGP"
	TransactionNewParamsCurrencyGhs     TransactionNewParamsCurrency = "GHS"
	TransactionNewParamsCurrencyGip     TransactionNewParamsCurrency = "GIP"
	TransactionNewParamsCurrencyGmd     TransactionNewParamsCurrency = "GMD"
	TransactionNewParamsCurrencyGnf     TransactionNewParamsCurrency = "GNF"
	TransactionNewParamsCurrencyGtq     TransactionNewParamsCurrency = "GTQ"
	TransactionNewParamsCurrencyGyd     TransactionNewParamsCurrency = "GYD"
	TransactionNewParamsCurrencyHkd     TransactionNewParamsCurrency = "HKD"
	TransactionNewParamsCurrencyHnl     TransactionNewParamsCurrency = "HNL"
	TransactionNewParamsCurrencyHrk     TransactionNewParamsCurrency = "HRK"
	TransactionNewParamsCurrencyHtg     TransactionNewParamsCurrency = "HTG"
	TransactionNewParamsCurrencyHuf     TransactionNewParamsCurrency = "HUF"
	TransactionNewParamsCurrencyIdr     TransactionNewParamsCurrency = "IDR"
	TransactionNewParamsCurrencyIls     TransactionNewParamsCurrency = "ILS"
	TransactionNewParamsCurrencyImp     TransactionNewParamsCurrency = "IMP"
	TransactionNewParamsCurrencyInr     TransactionNewParamsCurrency = "INR"
	TransactionNewParamsCurrencyIqd     TransactionNewParamsCurrency = "IQD"
	TransactionNewParamsCurrencyIrr     TransactionNewParamsCurrency = "IRR"
	TransactionNewParamsCurrencyIsk     TransactionNewParamsCurrency = "ISK"
	TransactionNewParamsCurrencyJmd     TransactionNewParamsCurrency = "JMD"
	TransactionNewParamsCurrencyJod     TransactionNewParamsCurrency = "JOD"
	TransactionNewParamsCurrencyJpy     TransactionNewParamsCurrency = "JPY"
	TransactionNewParamsCurrencyKes     TransactionNewParamsCurrency = "KES"
	TransactionNewParamsCurrencyKgs     TransactionNewParamsCurrency = "KGS"
	TransactionNewParamsCurrencyKhr     TransactionNewParamsCurrency = "KHR"
	TransactionNewParamsCurrencyKmf     TransactionNewParamsCurrency = "KMF"
	TransactionNewParamsCurrencyKpw     TransactionNewParamsCurrency = "KPW"
	TransactionNewParamsCurrencyKrw     TransactionNewParamsCurrency = "KRW"
	TransactionNewParamsCurrencyKwd     TransactionNewParamsCurrency = "KWD"
	TransactionNewParamsCurrencyKyd     TransactionNewParamsCurrency = "KYD"
	TransactionNewParamsCurrencyKzt     TransactionNewParamsCurrency = "KZT"
	TransactionNewParamsCurrencyLak     TransactionNewParamsCurrency = "LAK"
	TransactionNewParamsCurrencyLbp     TransactionNewParamsCurrency = "LBP"
	TransactionNewParamsCurrencyLkr     TransactionNewParamsCurrency = "LKR"
	TransactionNewParamsCurrencyLrd     TransactionNewParamsCurrency = "LRD"
	TransactionNewParamsCurrencyLsl     TransactionNewParamsCurrency = "LSL"
	TransactionNewParamsCurrencyLyd     TransactionNewParamsCurrency = "LYD"
	TransactionNewParamsCurrencyMad     TransactionNewParamsCurrency = "MAD"
	TransactionNewParamsCurrencyMdl     TransactionNewParamsCurrency = "MDL"
	TransactionNewParamsCurrencyMga     TransactionNewParamsCurrency = "MGA"
	TransactionNewParamsCurrencyMkd     TransactionNewParamsCurrency = "MKD"
	TransactionNewParamsCurrencyMmk     TransactionNewParamsCurrency = "MMK"
	TransactionNewParamsCurrencyMnt     TransactionNewParamsCurrency = "MNT"
	TransactionNewParamsCurrencyMop     TransactionNewParamsCurrency = "MOP"
	TransactionNewParamsCurrencyMur     TransactionNewParamsCurrency = "MUR"
	TransactionNewParamsCurrencyMvr     TransactionNewParamsCurrency = "MVR"
	TransactionNewParamsCurrencyMwk     TransactionNewParamsCurrency = "MWK"
	TransactionNewParamsCurrencyMxn     TransactionNewParamsCurrency = "MXN"
	TransactionNewParamsCurrencyMyr     TransactionNewParamsCurrency = "MYR"
	TransactionNewParamsCurrencyMzn     TransactionNewParamsCurrency = "MZN"
	TransactionNewParamsCurrencyNad     TransactionNewParamsCurrency = "NAD"
	TransactionNewParamsCurrencyNgn     TransactionNewParamsCurrency = "NGN"
	TransactionNewParamsCurrencyNio     TransactionNewParamsCurrency = "NIO"
	TransactionNewParamsCurrencyNok     TransactionNewParamsCurrency = "NOK"
	TransactionNewParamsCurrencyNpr     TransactionNewParamsCurrency = "NPR"
	TransactionNewParamsCurrencyNzd     TransactionNewParamsCurrency = "NZD"
	TransactionNewParamsCurrencyOmr     TransactionNewParamsCurrency = "OMR"
	TransactionNewParamsCurrencyPab     TransactionNewParamsCurrency = "PAB"
	TransactionNewParamsCurrencyPen     TransactionNewParamsCurrency = "PEN"
	TransactionNewParamsCurrencyPgk     TransactionNewParamsCurrency = "PGK"
	TransactionNewParamsCurrencyPhp     TransactionNewParamsCurrency = "PHP"
	TransactionNewParamsCurrencyPkr     TransactionNewParamsCurrency = "PKR"
	TransactionNewParamsCurrencyPln     TransactionNewParamsCurrency = "PLN"
	TransactionNewParamsCurrencyPyg     TransactionNewParamsCurrency = "PYG"
	TransactionNewParamsCurrencyQar     TransactionNewParamsCurrency = "QAR"
	TransactionNewParamsCurrencyRon     TransactionNewParamsCurrency = "RON"
	TransactionNewParamsCurrencyRsd     TransactionNewParamsCurrency = "RSD"
	TransactionNewParamsCurrencyRub     TransactionNewParamsCurrency = "RUB"
	TransactionNewParamsCurrencyRwf     TransactionNewParamsCurrency = "RWF"
	TransactionNewParamsCurrencySar     TransactionNewParamsCurrency = "SAR"
	TransactionNewParamsCurrencySbd     TransactionNewParamsCurrency = "SBD"
	TransactionNewParamsCurrencyScr     TransactionNewParamsCurrency = "SCR"
	TransactionNewParamsCurrencySdg     TransactionNewParamsCurrency = "SDG"
	TransactionNewParamsCurrencySek     TransactionNewParamsCurrency = "SEK"
	TransactionNewParamsCurrencySgd     TransactionNewParamsCurrency = "SGD"
	TransactionNewParamsCurrencyShp     TransactionNewParamsCurrency = "SHP"
	TransactionNewParamsCurrencySll     TransactionNewParamsCurrency = "SLL"
	TransactionNewParamsCurrencySos     TransactionNewParamsCurrency = "SOS"
	TransactionNewParamsCurrencySpl     TransactionNewParamsCurrency = "SPL"
	TransactionNewParamsCurrencySrd     TransactionNewParamsCurrency = "SRD"
	TransactionNewParamsCurrencySvc     TransactionNewParamsCurrency = "SVC"
	TransactionNewParamsCurrencySyp     TransactionNewParamsCurrency = "SYP"
	TransactionNewParamsCurrencyStn     TransactionNewParamsCurrency = "STN"
	TransactionNewParamsCurrencySzl     TransactionNewParamsCurrency = "SZL"
	TransactionNewParamsCurrencyThb     TransactionNewParamsCurrency = "THB"
	TransactionNewParamsCurrencyTjs     TransactionNewParamsCurrency = "TJS"
	TransactionNewParamsCurrencyTmt     TransactionNewParamsCurrency = "TMT"
	TransactionNewParamsCurrencyTnd     TransactionNewParamsCurrency = "TND"
	TransactionNewParamsCurrencyTop     TransactionNewParamsCurrency = "TOP"
	TransactionNewParamsCurrencyTry     TransactionNewParamsCurrency = "TRY"
	TransactionNewParamsCurrencyTtd     TransactionNewParamsCurrency = "TTD"
	TransactionNewParamsCurrencyTvd     TransactionNewParamsCurrency = "TVD"
	TransactionNewParamsCurrencyTwd     TransactionNewParamsCurrency = "TWD"
	TransactionNewParamsCurrencyTzs     TransactionNewParamsCurrency = "TZS"
	TransactionNewParamsCurrencyUah     TransactionNewParamsCurrency = "UAH"
	TransactionNewParamsCurrencyUgx     TransactionNewParamsCurrency = "UGX"
	TransactionNewParamsCurrencyUsd     TransactionNewParamsCurrency = "USD"
	TransactionNewParamsCurrencyUyu     TransactionNewParamsCurrency = "UYU"
	TransactionNewParamsCurrencyUzs     TransactionNewParamsCurrency = "UZS"
	TransactionNewParamsCurrencyVef     TransactionNewParamsCurrency = "VEF"
	TransactionNewParamsCurrencyVnd     TransactionNewParamsCurrency = "VND"
	TransactionNewParamsCurrencyVuv     TransactionNewParamsCurrency = "VUV"
	TransactionNewParamsCurrencyWst     TransactionNewParamsCurrency = "WST"
	TransactionNewParamsCurrencyXaf     TransactionNewParamsCurrency = "XAF"
	TransactionNewParamsCurrencyXcd     TransactionNewParamsCurrency = "XCD"
	TransactionNewParamsCurrencyXof     TransactionNewParamsCurrency = "XOF"
	TransactionNewParamsCurrencyXpf     TransactionNewParamsCurrency = "XPF"
	TransactionNewParamsCurrencyYer     TransactionNewParamsCurrency = "YER"
	TransactionNewParamsCurrencyZar     TransactionNewParamsCurrency = "ZAR"
	TransactionNewParamsCurrencyZmw     TransactionNewParamsCurrency = "ZMW"
	TransactionNewParamsCurrencyLogical TransactionNewParamsCurrency = "LOGICAL"
	TransactionNewParamsCurrencyCustom  TransactionNewParamsCurrency = "CUSTOM"
)

type TransactionNewParamsTag

type TransactionNewParamsTag struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (TransactionNewParamsTag) MarshalJSON

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

func (*TransactionNewParamsTag) UnmarshalJSON

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

type TransactionNewResponse

type TransactionNewResponse struct {
	// Transaction object.
	Data Transaction `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionNewResponse) RawJSON

func (r TransactionNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionNewResponse) UnmarshalJSON

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

type TransactionSearchAllocationsParams

type TransactionSearchAllocationsParams struct {
	// Filter for searching transaction allocations.
	Filter TransactionSearchAllocationsParamsFilter `json:"filter,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (TransactionSearchAllocationsParams) MarshalJSON

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

func (*TransactionSearchAllocationsParams) UnmarshalJSON

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

type TransactionSearchAllocationsParamsFilter

type TransactionSearchAllocationsParamsFilter struct {
	// Invoice ID filter.
	InvoiceID TransactionSearchAllocationsParamsFilterInvoiceID `json:"invoice_id,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Filter for searching transaction allocations.

The property InvoiceID is required.

func (TransactionSearchAllocationsParamsFilter) MarshalJSON

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

func (*TransactionSearchAllocationsParamsFilter) UnmarshalJSON

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

type TransactionSearchAllocationsParamsFilterInvoiceID

type TransactionSearchAllocationsParamsFilterInvoiceID struct {
	// Match allocations where invoice_id is any of these values, using OR logic.
	Any []string `json:"any,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Invoice ID filter.

The property Any is required.

func (TransactionSearchAllocationsParamsFilterInvoiceID) MarshalJSON

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

func (*TransactionSearchAllocationsParamsFilterInvoiceID) UnmarshalJSON

type TransactionSearchAllocationsResponse

type TransactionSearchAllocationsResponse struct {
	// List of allocation search results.
	Data []TransactionSearchAllocationsResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionSearchAllocationsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchAllocationsResponse) UnmarshalJSON

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

type TransactionSearchAllocationsResponseData

type TransactionSearchAllocationsResponseData struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// Allocated amount, as a positive string in the smallest currency unit, such as
	// cents for USD.
	Amount string `json:"amount" api:"required"`
	// Invoice the allocation is applied against.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Timestamp when the parent transaction was posted. Uses ISO 8601 format.
	Posted time.Time `json:"posted" api:"required" format:"date-time"`
	// Transaction the allocation is applied to.
	Transaction TransactionSearchAllocationsResponseDataTransaction `json:"transaction" api:"required"`
	// Type of allocation.
	//
	// Any of "invoice_payin", "invoice_payout".
	Type string `json:"type" api:"required"`
	// User associated with the allocation.
	User TransactionSearchAllocationsResponseDataUser `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Amount      respjson.Field
		InvoiceID   respjson.Field
		Posted      respjson.Field
		Transaction respjson.Field
		Type        respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An allocation with a reference to its parent transaction.

func (TransactionSearchAllocationsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchAllocationsResponseData) UnmarshalJSON

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

type TransactionSearchAllocationsResponseDataTransaction

type TransactionSearchAllocationsResponseDataTransaction struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transaction the allocation is applied to.

func (TransactionSearchAllocationsResponseDataTransaction) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchAllocationsResponseDataTransaction) UnmarshalJSON

type TransactionSearchAllocationsResponseDataUser

type TransactionSearchAllocationsResponseDataUser struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User associated with the allocation.

func (TransactionSearchAllocationsResponseDataUser) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchAllocationsResponseDataUser) UnmarshalJSON

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

type TransactionSearchParams

type TransactionSearchParams struct {
	// Filter for searching transactions.
	Filter TransactionSearchParamsFilter `json:"filter,omitzero" api:"required"`
	// Pagination parameters.
	PageInfo TransactionSearchParamsPageInfo `json:"page_info,omitzero"`
	// contains filtered or unexported fields
}

func (TransactionSearchParams) MarshalJSON

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

func (*TransactionSearchParams) UnmarshalJSON

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

type TransactionSearchParamsFilter

type TransactionSearchParamsFilter struct {
	// Account filter.
	Account TransactionSearchParamsFilterAccount `json:"account,omitzero"`
	// Tag-based filter criteria. When both `any` and `all` are provided, results must
	// match every entry in `all` AND at least one entry in `any`.
	Tags TransactionSearchParamsFilterTags `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

Filter for searching transactions.

func (TransactionSearchParamsFilter) MarshalJSON

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

func (*TransactionSearchParamsFilter) UnmarshalJSON

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

type TransactionSearchParamsFilterAccount

type TransactionSearchParamsFilterAccount struct {
	// Match transactions belonging to any of these accounts, using OR logic.
	Any []TransactionSearchParamsFilterAccountAny `json:"any,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Account filter.

The property Any is required.

func (TransactionSearchParamsFilterAccount) MarshalJSON

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

func (*TransactionSearchParamsFilterAccount) UnmarshalJSON

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

type TransactionSearchParamsFilterAccountAny

type TransactionSearchParamsFilterAccountAny struct {
	// FRAGMENT generated unique ID.
	ID param.Opt[string] `json:"id,omitzero"`
	// User-provided unique ID.
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// contains filtered or unexported fields
}

External account for the transaction. Identify it by `id`, `external_id`, or both.

func (TransactionSearchParamsFilterAccountAny) MarshalJSON

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

func (*TransactionSearchParamsFilterAccountAny) UnmarshalJSON

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

type TransactionSearchParamsFilterTags

type TransactionSearchParamsFilterTags struct {
	// Returns transactions matching every specified tag, using AND logic.
	All []TransactionSearchParamsFilterTagsAll `json:"all,omitzero"`
	// Returns transactions matching at least one of the specified tags, using OR
	// logic.
	Any []TransactionSearchParamsFilterTagsAny `json:"any,omitzero"`
	// contains filtered or unexported fields
}

Tag-based filter criteria. When both `any` and `all` are provided, results must match every entry in `all` AND at least one entry in `any`.

func (TransactionSearchParamsFilterTags) MarshalJSON

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

func (*TransactionSearchParamsFilterTags) UnmarshalJSON

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

type TransactionSearchParamsFilterTagsAll

type TransactionSearchParamsFilterTagsAll struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (TransactionSearchParamsFilterTagsAll) MarshalJSON

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

func (*TransactionSearchParamsFilterTagsAll) UnmarshalJSON

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

type TransactionSearchParamsFilterTagsAny

type TransactionSearchParamsFilterTagsAny struct {
	// Tag key to filter on. Must be an exact match; wildcards are not supported.
	Key string `json:"key" api:"required"`
	// Tag value pattern to filter on. Supports wildcards: `*` matches any characters,
	// `?` matches a single character. Use `\*` or `\?` to match literal asterisks or
	// question marks. Use `*` to match any value for the given key.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A tag filter.

The properties Key, Value are required.

func (TransactionSearchParamsFilterTagsAny) MarshalJSON

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

func (*TransactionSearchParamsFilterTagsAny) UnmarshalJSON

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

type TransactionSearchParamsPageInfo

type TransactionSearchParamsPageInfo struct {
	// Cursor for fetching the next page of results.
	After param.Opt[string] `json:"after,omitzero"`
	// Number of results to return. Defaults to 20.
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// contains filtered or unexported fields
}

Pagination parameters.

func (TransactionSearchParamsPageInfo) MarshalJSON

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

func (*TransactionSearchParamsPageInfo) UnmarshalJSON

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

type TransactionSearchResponse

type TransactionSearchResponse struct {
	// Deprecated. Use `data_v2.transactions` instead. Returns the full unpaginated
	// list of matching transactions.
	//
	// Deprecated: deprecated
	Data   []Transaction                   `json:"data" api:"required"`
	DataV2 TransactionSearchResponseDataV2 `json:"data_v2" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		DataV2      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionSearchResponse) RawJSON

func (r TransactionSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionSearchResponse) UnmarshalJSON

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

type TransactionSearchResponseDataV2

type TransactionSearchResponseDataV2 struct {
	// Pagination cursors.
	PageInfo TransactionSearchResponseDataV2PageInfo `json:"page_info" api:"required"`
	// Transactions matching the search criteria.
	Transactions []Transaction `json:"transactions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PageInfo     respjson.Field
		Transactions respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionSearchResponseDataV2) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchResponseDataV2) UnmarshalJSON

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

type TransactionSearchResponseDataV2PageInfo

type TransactionSearchResponseDataV2PageInfo struct {
	// Cursor to fetch the next page of results.
	NextCursor string `json:"next_cursor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination cursors.

func (TransactionSearchResponseDataV2PageInfo) RawJSON

Returns the unmodified JSON received from the API

func (*TransactionSearchResponseDataV2PageInfo) UnmarshalJSON

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

type TransactionService

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

Transaction sync operations

TransactionService contains methods and other services that help with interacting with the fragment 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 NewTransactionService method instead.

func NewTransactionService

func NewTransactionService(opts ...option.RequestOption) (r TransactionService)

NewTransactionService 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 (*TransactionService) Get

func (r *TransactionService) Get(ctx context.Context, transactionRef string, opts ...option.RequestOption) (res *TransactionGetResponse, err error)

Retrieves a transaction by ID or external ID.

func (*TransactionService) List

Lists all transactions.

func (*TransactionService) ListHistory

func (r *TransactionService) ListHistory(ctx context.Context, transactionRef string, opts ...option.RequestOption) (res *TransactionListHistoryResponse, err error)

Retrieves the version history of a transaction.

func (*TransactionService) New

Creates a transaction.

func (*TransactionService) Search

Searches transactions.

func (*TransactionService) SearchAllocations

Searches transaction allocations.

func (*TransactionService) Update

func (r *TransactionService) Update(ctx context.Context, transactionRef string, body TransactionUpdateParams, opts ...option.RequestOption) (res *TransactionUpdateResponse, err error)

Updates a transaction.

type TransactionTag

type TransactionTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (TransactionTag) RawJSON

func (r TransactionTag) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionTag) UnmarshalJSON

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

type TransactionUpdateParams

type TransactionUpdateParams struct {
	// Current version of the transaction. Must match the stored version.
	CurrentTransactionVersion int64 `json:"current_transaction_version" api:"required"`
	// Allocation updates.
	Allocations TransactionUpdateParamsAllocations `json:"allocations,omitzero"`
	// Tag updates.
	Tags TransactionUpdateParamsTags `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (TransactionUpdateParams) MarshalJSON

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

func (*TransactionUpdateParams) UnmarshalJSON

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

type TransactionUpdateParamsAllocations

type TransactionUpdateParamsAllocations struct {
	// Allocations to create.
	Create []TransactionUpdateParamsAllocationsCreate `json:"create,omitzero"`
	// Allocations to update.
	Update []TransactionUpdateParamsAllocationsUpdate `json:"update,omitzero"`
	// contains filtered or unexported fields
}

Allocation updates.

func (TransactionUpdateParamsAllocations) MarshalJSON

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

func (*TransactionUpdateParamsAllocations) UnmarshalJSON

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

type TransactionUpdateParamsAllocationsCreate

type TransactionUpdateParamsAllocationsCreate struct {
	// Allocation amount, as a positive string in the smallest currency unit, such as
	// cents for USD.
	Amount string `json:"amount" api:"required"`
	// Invoice to allocate against.
	InvoiceID string `json:"invoice_id" api:"required"`
	// Type of allocation.
	//
	// Any of "invoice_payin", "invoice_payout".
	Type string `json:"type,omitzero" api:"required"`
	// Identifies a user by `id` or `external_id`.
	User TransactionUpdateParamsAllocationsCreateUserUnion `json:"user,omitzero" api:"required"`
	// contains filtered or unexported fields
}

An allocation linking a transaction to an invoice.

The properties Amount, InvoiceID, Type, User are required.

func (TransactionUpdateParamsAllocationsCreate) MarshalJSON

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

func (*TransactionUpdateParamsAllocationsCreate) UnmarshalJSON

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

type TransactionUpdateParamsAllocationsCreateUserExternalID

type TransactionUpdateParamsAllocationsCreateUserExternalID struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// contains filtered or unexported fields
}

The property ExternalID is required.

func (TransactionUpdateParamsAllocationsCreateUserExternalID) MarshalJSON

func (*TransactionUpdateParamsAllocationsCreateUserExternalID) UnmarshalJSON

type TransactionUpdateParamsAllocationsCreateUserID

type TransactionUpdateParamsAllocationsCreateUserID struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TransactionUpdateParamsAllocationsCreateUserID) MarshalJSON

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

func (*TransactionUpdateParamsAllocationsCreateUserID) UnmarshalJSON

type TransactionUpdateParamsAllocationsCreateUserUnion

type TransactionUpdateParamsAllocationsCreateUserUnion struct {
	OfTransactionUpdatesAllocationsCreateUserID         *TransactionUpdateParamsAllocationsCreateUserID         `json:",omitzero,inline"`
	OfTransactionUpdatesAllocationsCreateUserExternalID *TransactionUpdateParamsAllocationsCreateUserExternalID `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 (TransactionUpdateParamsAllocationsCreateUserUnion) MarshalJSON

func (*TransactionUpdateParamsAllocationsCreateUserUnion) UnmarshalJSON

type TransactionUpdateParamsAllocationsUpdate

type TransactionUpdateParamsAllocationsUpdate struct {
	// Allocation to update.
	ID string `json:"id" api:"required"`
	// Updated allocation amount, as a positive string in the smallest currency unit,
	// such as cents for USD.
	Amount string `json:"amount" api:"required"`
	// contains filtered or unexported fields
}

The properties ID, Amount are required.

func (TransactionUpdateParamsAllocationsUpdate) MarshalJSON

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

func (*TransactionUpdateParamsAllocationsUpdate) UnmarshalJSON

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

type TransactionUpdateParamsTags

type TransactionUpdateParamsTags struct {
	// Tags to create. The tag key must not already exist.
	Create []TransactionUpdateParamsTagsCreate `json:"create,omitzero"`
	// Tags to remove.
	Delete []TransactionUpdateParamsTagsDelete `json:"delete,omitzero"`
	// Tags to set. Creates a new tag or updates an existing tag.
	Set []TransactionUpdateParamsTagsSet `json:"set,omitzero"`
	// Tags to update. The tag key must already exist.
	Update []TransactionUpdateParamsTagsUpdate `json:"update,omitzero"`
	// contains filtered or unexported fields
}

Tag updates.

func (TransactionUpdateParamsTags) MarshalJSON

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

func (*TransactionUpdateParamsTags) UnmarshalJSON

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

type TransactionUpdateParamsTagsCreate

type TransactionUpdateParamsTagsCreate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (TransactionUpdateParamsTagsCreate) MarshalJSON

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

func (*TransactionUpdateParamsTagsCreate) UnmarshalJSON

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

type TransactionUpdateParamsTagsDelete

type TransactionUpdateParamsTagsDelete struct {
	// Tag key to delete.
	Key string `json:"key" api:"required"`
	// contains filtered or unexported fields
}

The property Key is required.

func (TransactionUpdateParamsTagsDelete) MarshalJSON

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

func (*TransactionUpdateParamsTagsDelete) UnmarshalJSON

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

type TransactionUpdateParamsTagsSet

type TransactionUpdateParamsTagsSet struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (TransactionUpdateParamsTagsSet) MarshalJSON

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

func (*TransactionUpdateParamsTagsSet) UnmarshalJSON

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

type TransactionUpdateParamsTagsUpdate

type TransactionUpdateParamsTagsUpdate struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (TransactionUpdateParamsTagsUpdate) MarshalJSON

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

func (*TransactionUpdateParamsTagsUpdate) UnmarshalJSON

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

type TransactionUpdateResponse

type TransactionUpdateResponse struct {
	// Transaction object.
	Data Transaction `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TransactionUpdateResponse) RawJSON

func (r TransactionUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TransactionUpdateResponse) UnmarshalJSON

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

type User

type User struct {
	// FRAGMENT generated unique ID.
	ID string `json:"id" api:"required"`
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Name of the user's role. Deprecated, use tags instead.
	//
	// Deprecated: deprecated
	Role string `json:"role" api:"required"`
	// Tags for the user.
	Tags []UserTag `json:"tags" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExternalID  respjson.Field
		Role        respjson.Field
		Tags        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User object.

func (User) RawJSON

func (r User) RawJSON() string

Returns the unmodified JSON received from the API

func (*User) UnmarshalJSON

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

type UserListResponse

type UserListResponse struct {
	// List of users.
	Data []User `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of users.

func (UserListResponse) RawJSON

func (r UserListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponse) UnmarshalJSON

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

type UserNewParams

type UserNewParams struct {
	// User-provided unique ID.
	ExternalID string `json:"external_id" api:"required"`
	// Name of the role to assign. Deprecated, use tags instead.
	Role param.Opt[string] `json:"role,omitzero"`
	// Tags for the user.
	Tags []UserNewParamsTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (UserNewParams) MarshalJSON

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

func (*UserNewParams) UnmarshalJSON

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

type UserNewParamsTag

type UserNewParamsTag struct {
	// Tag key. Must not contain #, /, or :. Max 50 characters.
	Key string `json:"key" api:"required"`
	// Tag value. Must not contain #, /, or :. Max 200 characters.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

A key-value tag pair for metadata.

The properties Key, Value are required.

func (UserNewParamsTag) MarshalJSON

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

func (*UserNewParamsTag) UnmarshalJSON

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

type UserNewResponse

type UserNewResponse struct {
	// User object.
	Data User `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserNewResponse) RawJSON

func (r UserNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserNewResponse) UnmarshalJSON

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

type UserService

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

User management operations

UserService contains methods and other services that help with interacting with the fragment 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 NewUserService method instead.

func NewUserService

func NewUserService(opts ...option.RequestOption) (r UserService)

NewUserService 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 (*UserService) List

func (r *UserService) List(ctx context.Context, opts ...option.RequestOption) (res *UserListResponse, err error)

Lists all users.

func (*UserService) New

func (r *UserService) New(ctx context.Context, body UserNewParams, opts ...option.RequestOption) (res *UserNewResponse, err error)

Creates a user.

type UserTag

type UserTag struct {
	// Tag key.
	Key string `json:"key" api:"required"`
	// Tag value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A key-value tag pair.

func (UserTag) RawJSON

func (r UserTag) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserTag) UnmarshalJSON

func (r *UserTag) 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
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL