moderntreasury

package module
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 24 Imported by: 0

README

Modern Treasury Go API Library

Go Reference

The Modern Treasury Go library provides convenient access to the Modern Treasury REST API from applications written in Go. The full API of this library can be found in api.md.

Installation

import (
	"github.com/Modern-Treasury/modern-treasury-go/v2" // imported as moderntreasury
)

Or to pin the version:

go get -u 'github.com/Modern-Treasury/modern-treasury-go/v2@v2.16.0'

Requirements

This library requires Go 1.18+.

Usage

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

package main

import (
	"context"
	"fmt"

	"github.com/Modern-Treasury/modern-treasury-go/v2"
	"github.com/Modern-Treasury/modern-treasury-go/v2/option"
)

func main() {
	client := moderntreasury.NewClient(
		option.WithAPIKey("My API Key"),                 // defaults to os.LookupEnv("MODERN_TREASURY_API_KEY")
		option.WithOrganizationID("my-organization-ID"), // defaults to os.LookupEnv("MODERN_TREASURY_ORGANIZATION_ID")
	)
	counterparty, err := client.Counterparties.New(context.TODO(), moderntreasury.CounterpartyNewParams{
		Name: moderntreasury.F("my first counterparty"),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", counterparty.ID)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: moderntreasury.F("hello"),

	// Explicitly send `"description": null`
	Description: moderntreasury.Null[string](),

	Point: moderntreasury.F(moderntreasury.Point{
		X: moderntreasury.Int(0),
		Y: moderntreasury.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: moderntreasury.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the repsonse JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras 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()
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 := moderntreasury.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Counterparties.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"}),
)

See the full list of request options.

Pagination

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

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

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

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

page, err := client.Counterparties.List(context.TODO(), moderntreasury.CounterpartyListParams{})
for page != nil {
	for _, counterparty := range page.Items {
		fmt.Printf("%+v\n", counterparty)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *moderntreasury.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(), moderntreasury.ExternalAccountNewParams{
	CounterpartyID: moderntreasury.F("missing"),
})
if err != nil {
	var apierr *moderntreasury.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 "/api/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.Counterparties.New(
	ctx,
	moderntreasury.CounterpartyNewParams{
		Name: moderntreasury.F("my first counterparty"),
	},
	// 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 param.Field[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 moderntreasury.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("my/file.txt")
moderntreasury.DocumentNewParams{
	DocumentableID:   moderntreasury.F("24c6b7a3-02..."),
	DocumentableType: moderntreasury.F(moderntreasury.DocumentNewParamsDocumentableTypeCounterparties),
	File:             moderntreasury.F[io.Reader](file),
}

// A file from a string
moderntreasury.DocumentNewParams{
	DocumentableID:   moderntreasury.F("24c6b7a3-02..."),
	DocumentableType: moderntreasury.F(moderntreasury.DocumentNewParamsDocumentableTypeCounterparties),
	File:             moderntreasury.F[io.Reader](strings.NewReader("my file contents")),
}

// With a custom filename and contentType
moderntreasury.DocumentNewParams{
	DocumentableID:   moderntreasury.F("24c6b7a3-02..."),
	DocumentableType: moderntreasury.F(moderntreasury.DocumentNewParamsDocumentableTypeCounterparties),
	File:             moderntreasury.FileParam(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}

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 := moderntreasury.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Counterparties.New(
	context.TODO(),
	moderntreasury.CounterpartyNewParams{
		Name: moderntreasury.F("my first counterparty"),
	},
	option.WithMaxRetries(5),
)
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 := moderntreasury.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.

Documentation

Index

Constants

View Source
const AccountsTypeExternalAccounts = shared.AccountsTypeExternalAccounts

This is an alias to an internal value.

View Source
const AccountsTypeInternalAccounts = shared.AccountsTypeInternalAccounts

This is an alias to an internal value.

View Source
const CurrencyAed = shared.CurrencyAed

This is an alias to an internal value.

View Source
const CurrencyAfn = shared.CurrencyAfn

This is an alias to an internal value.

View Source
const CurrencyAll = shared.CurrencyAll

This is an alias to an internal value.

View Source
const CurrencyAmd = shared.CurrencyAmd

This is an alias to an internal value.

View Source
const CurrencyAng = shared.CurrencyAng

This is an alias to an internal value.

View Source
const CurrencyAoa = shared.CurrencyAoa

This is an alias to an internal value.

View Source
const CurrencyArs = shared.CurrencyArs

This is an alias to an internal value.

View Source
const CurrencyAud = shared.CurrencyAud

This is an alias to an internal value.

View Source
const CurrencyAwg = shared.CurrencyAwg

This is an alias to an internal value.

View Source
const CurrencyAzn = shared.CurrencyAzn

This is an alias to an internal value.

View Source
const CurrencyBam = shared.CurrencyBam

This is an alias to an internal value.

View Source
const CurrencyBbd = shared.CurrencyBbd

This is an alias to an internal value.

View Source
const CurrencyBch = shared.CurrencyBch

This is an alias to an internal value.

View Source
const CurrencyBdt = shared.CurrencyBdt

This is an alias to an internal value.

View Source
const CurrencyBgn = shared.CurrencyBgn

This is an alias to an internal value.

View Source
const CurrencyBhd = shared.CurrencyBhd

This is an alias to an internal value.

View Source
const CurrencyBif = shared.CurrencyBif

This is an alias to an internal value.

View Source
const CurrencyBmd = shared.CurrencyBmd

This is an alias to an internal value.

View Source
const CurrencyBnd = shared.CurrencyBnd

This is an alias to an internal value.

View Source
const CurrencyBob = shared.CurrencyBob

This is an alias to an internal value.

View Source
const CurrencyBrl = shared.CurrencyBrl

This is an alias to an internal value.

View Source
const CurrencyBsd = shared.CurrencyBsd

This is an alias to an internal value.

View Source
const CurrencyBtc = shared.CurrencyBtc

This is an alias to an internal value.

View Source
const CurrencyBtn = shared.CurrencyBtn

This is an alias to an internal value.

View Source
const CurrencyBwp = shared.CurrencyBwp

This is an alias to an internal value.

View Source
const CurrencyByn = shared.CurrencyByn

This is an alias to an internal value.

View Source
const CurrencyByr = shared.CurrencyByr

This is an alias to an internal value.

View Source
const CurrencyBzd = shared.CurrencyBzd

This is an alias to an internal value.

View Source
const CurrencyCad = shared.CurrencyCad

This is an alias to an internal value.

View Source
const CurrencyCdf = shared.CurrencyCdf

This is an alias to an internal value.

View Source
const CurrencyChf = shared.CurrencyChf

This is an alias to an internal value.

View Source
const CurrencyClf = shared.CurrencyClf

This is an alias to an internal value.

View Source
const CurrencyClp = shared.CurrencyClp

This is an alias to an internal value.

View Source
const CurrencyCnh = shared.CurrencyCnh

This is an alias to an internal value.

View Source
const CurrencyCny = shared.CurrencyCny

This is an alias to an internal value.

View Source
const CurrencyCop = shared.CurrencyCop

This is an alias to an internal value.

View Source
const CurrencyCrc = shared.CurrencyCrc

This is an alias to an internal value.

View Source
const CurrencyCuc = shared.CurrencyCuc

This is an alias to an internal value.

View Source
const CurrencyCup = shared.CurrencyCup

This is an alias to an internal value.

View Source
const CurrencyCve = shared.CurrencyCve

This is an alias to an internal value.

View Source
const CurrencyCzk = shared.CurrencyCzk

This is an alias to an internal value.

View Source
const CurrencyDjf = shared.CurrencyDjf

This is an alias to an internal value.

View Source
const CurrencyDkk = shared.CurrencyDkk

This is an alias to an internal value.

View Source
const CurrencyDop = shared.CurrencyDop

This is an alias to an internal value.

View Source
const CurrencyDzd = shared.CurrencyDzd

This is an alias to an internal value.

View Source
const CurrencyEek = shared.CurrencyEek

This is an alias to an internal value.

View Source
const CurrencyEgp = shared.CurrencyEgp

This is an alias to an internal value.

View Source
const CurrencyErn = shared.CurrencyErn

This is an alias to an internal value.

View Source
const CurrencyEtb = shared.CurrencyEtb

This is an alias to an internal value.

View Source
const CurrencyEur = shared.CurrencyEur

This is an alias to an internal value.

View Source
const CurrencyFjd = shared.CurrencyFjd

This is an alias to an internal value.

View Source
const CurrencyFkp = shared.CurrencyFkp

This is an alias to an internal value.

View Source
const CurrencyGbp = shared.CurrencyGbp

This is an alias to an internal value.

View Source
const CurrencyGbx = shared.CurrencyGbx

This is an alias to an internal value.

View Source
const CurrencyGel = shared.CurrencyGel

This is an alias to an internal value.

View Source
const CurrencyGgp = shared.CurrencyGgp

This is an alias to an internal value.

View Source
const CurrencyGhs = shared.CurrencyGhs

This is an alias to an internal value.

View Source
const CurrencyGip = shared.CurrencyGip

This is an alias to an internal value.

View Source
const CurrencyGmd = shared.CurrencyGmd

This is an alias to an internal value.

View Source
const CurrencyGnf = shared.CurrencyGnf

This is an alias to an internal value.

View Source
const CurrencyGtq = shared.CurrencyGtq

This is an alias to an internal value.

View Source
const CurrencyGyd = shared.CurrencyGyd

This is an alias to an internal value.

View Source
const CurrencyHkd = shared.CurrencyHkd

This is an alias to an internal value.

View Source
const CurrencyHnl = shared.CurrencyHnl

This is an alias to an internal value.

View Source
const CurrencyHrk = shared.CurrencyHrk

This is an alias to an internal value.

View Source
const CurrencyHtg = shared.CurrencyHtg

This is an alias to an internal value.

View Source
const CurrencyHuf = shared.CurrencyHuf

This is an alias to an internal value.

View Source
const CurrencyIdr = shared.CurrencyIdr

This is an alias to an internal value.

View Source
const CurrencyIls = shared.CurrencyIls

This is an alias to an internal value.

View Source
const CurrencyImp = shared.CurrencyImp

This is an alias to an internal value.

View Source
const CurrencyInr = shared.CurrencyInr

This is an alias to an internal value.

View Source
const CurrencyIqd = shared.CurrencyIqd

This is an alias to an internal value.

View Source
const CurrencyIrr = shared.CurrencyIrr

This is an alias to an internal value.

View Source
const CurrencyIsk = shared.CurrencyIsk

This is an alias to an internal value.

View Source
const CurrencyJep = shared.CurrencyJep

This is an alias to an internal value.

View Source
const CurrencyJmd = shared.CurrencyJmd

This is an alias to an internal value.

View Source
const CurrencyJod = shared.CurrencyJod

This is an alias to an internal value.

View Source
const CurrencyJpy = shared.CurrencyJpy

This is an alias to an internal value.

View Source
const CurrencyKes = shared.CurrencyKes

This is an alias to an internal value.

View Source
const CurrencyKgs = shared.CurrencyKgs

This is an alias to an internal value.

View Source
const CurrencyKhr = shared.CurrencyKhr

This is an alias to an internal value.

View Source
const CurrencyKmf = shared.CurrencyKmf

This is an alias to an internal value.

View Source
const CurrencyKpw = shared.CurrencyKpw

This is an alias to an internal value.

View Source
const CurrencyKrw = shared.CurrencyKrw

This is an alias to an internal value.

View Source
const CurrencyKwd = shared.CurrencyKwd

This is an alias to an internal value.

View Source
const CurrencyKyd = shared.CurrencyKyd

This is an alias to an internal value.

View Source
const CurrencyKzt = shared.CurrencyKzt

This is an alias to an internal value.

View Source
const CurrencyLak = shared.CurrencyLak

This is an alias to an internal value.

View Source
const CurrencyLbp = shared.CurrencyLbp

This is an alias to an internal value.

View Source
const CurrencyLkr = shared.CurrencyLkr

This is an alias to an internal value.

View Source
const CurrencyLrd = shared.CurrencyLrd

This is an alias to an internal value.

View Source
const CurrencyLsl = shared.CurrencyLsl

This is an alias to an internal value.

View Source
const CurrencyLtl = shared.CurrencyLtl

This is an alias to an internal value.

View Source
const CurrencyLvl = shared.CurrencyLvl

This is an alias to an internal value.

View Source
const CurrencyLyd = shared.CurrencyLyd

This is an alias to an internal value.

View Source
const CurrencyMad = shared.CurrencyMad

This is an alias to an internal value.

View Source
const CurrencyMdl = shared.CurrencyMdl

This is an alias to an internal value.

View Source
const CurrencyMga = shared.CurrencyMga

This is an alias to an internal value.

View Source
const CurrencyMkd = shared.CurrencyMkd

This is an alias to an internal value.

View Source
const CurrencyMmk = shared.CurrencyMmk

This is an alias to an internal value.

View Source
const CurrencyMnt = shared.CurrencyMnt

This is an alias to an internal value.

View Source
const CurrencyMop = shared.CurrencyMop

This is an alias to an internal value.

View Source
const CurrencyMro = shared.CurrencyMro

This is an alias to an internal value.

View Source
const CurrencyMru = shared.CurrencyMru

This is an alias to an internal value.

View Source
const CurrencyMtl = shared.CurrencyMtl

This is an alias to an internal value.

View Source
const CurrencyMur = shared.CurrencyMur

This is an alias to an internal value.

View Source
const CurrencyMvr = shared.CurrencyMvr

This is an alias to an internal value.

View Source
const CurrencyMwk = shared.CurrencyMwk

This is an alias to an internal value.

View Source
const CurrencyMxn = shared.CurrencyMxn

This is an alias to an internal value.

View Source
const CurrencyMyr = shared.CurrencyMyr

This is an alias to an internal value.

View Source
const CurrencyMzn = shared.CurrencyMzn

This is an alias to an internal value.

View Source
const CurrencyNad = shared.CurrencyNad

This is an alias to an internal value.

View Source
const CurrencyNgn = shared.CurrencyNgn

This is an alias to an internal value.

View Source
const CurrencyNio = shared.CurrencyNio

This is an alias to an internal value.

View Source
const CurrencyNok = shared.CurrencyNok

This is an alias to an internal value.

View Source
const CurrencyNpr = shared.CurrencyNpr

This is an alias to an internal value.

View Source
const CurrencyNzd = shared.CurrencyNzd

This is an alias to an internal value.

View Source
const CurrencyOmr = shared.CurrencyOmr

This is an alias to an internal value.

View Source
const CurrencyPab = shared.CurrencyPab

This is an alias to an internal value.

View Source
const CurrencyPen = shared.CurrencyPen

This is an alias to an internal value.

View Source
const CurrencyPgk = shared.CurrencyPgk

This is an alias to an internal value.

View Source
const CurrencyPhp = shared.CurrencyPhp

This is an alias to an internal value.

View Source
const CurrencyPkr = shared.CurrencyPkr

This is an alias to an internal value.

View Source
const CurrencyPln = shared.CurrencyPln

This is an alias to an internal value.

View Source
const CurrencyPyg = shared.CurrencyPyg

This is an alias to an internal value.

View Source
const CurrencyQar = shared.CurrencyQar

This is an alias to an internal value.

View Source
const CurrencyRon = shared.CurrencyRon

This is an alias to an internal value.

View Source
const CurrencyRsd = shared.CurrencyRsd

This is an alias to an internal value.

View Source
const CurrencyRub = shared.CurrencyRub

This is an alias to an internal value.

View Source
const CurrencyRwf = shared.CurrencyRwf

This is an alias to an internal value.

View Source
const CurrencySar = shared.CurrencySar

This is an alias to an internal value.

View Source
const CurrencySbd = shared.CurrencySbd

This is an alias to an internal value.

View Source
const CurrencyScr = shared.CurrencyScr

This is an alias to an internal value.

View Source
const CurrencySdg = shared.CurrencySdg

This is an alias to an internal value.

View Source
const CurrencySek = shared.CurrencySek

This is an alias to an internal value.

View Source
const CurrencySgd = shared.CurrencySgd

This is an alias to an internal value.

View Source
const CurrencyShp = shared.CurrencyShp

This is an alias to an internal value.

View Source
const CurrencySkk = shared.CurrencySkk

This is an alias to an internal value.

View Source
const CurrencySll = shared.CurrencySll

This is an alias to an internal value.

View Source
const CurrencySos = shared.CurrencySos

This is an alias to an internal value.

View Source
const CurrencySrd = shared.CurrencySrd

This is an alias to an internal value.

View Source
const CurrencySsp = shared.CurrencySsp

This is an alias to an internal value.

View Source
const CurrencyStd = shared.CurrencyStd

This is an alias to an internal value.

View Source
const CurrencySvc = shared.CurrencySvc

This is an alias to an internal value.

View Source
const CurrencySyp = shared.CurrencySyp

This is an alias to an internal value.

View Source
const CurrencySzl = shared.CurrencySzl

This is an alias to an internal value.

View Source
const CurrencyThb = shared.CurrencyThb

This is an alias to an internal value.

View Source
const CurrencyTjs = shared.CurrencyTjs

This is an alias to an internal value.

View Source
const CurrencyTmm = shared.CurrencyTmm

This is an alias to an internal value.

View Source
const CurrencyTmt = shared.CurrencyTmt

This is an alias to an internal value.

View Source
const CurrencyTnd = shared.CurrencyTnd

This is an alias to an internal value.

View Source
const CurrencyTop = shared.CurrencyTop

This is an alias to an internal value.

View Source
const CurrencyTry = shared.CurrencyTry

This is an alias to an internal value.

View Source
const CurrencyTtd = shared.CurrencyTtd

This is an alias to an internal value.

View Source
const CurrencyTwd = shared.CurrencyTwd

This is an alias to an internal value.

View Source
const CurrencyTzs = shared.CurrencyTzs

This is an alias to an internal value.

View Source
const CurrencyUah = shared.CurrencyUah

This is an alias to an internal value.

View Source
const CurrencyUgx = shared.CurrencyUgx

This is an alias to an internal value.

View Source
const CurrencyUsd = shared.CurrencyUsd

This is an alias to an internal value.

View Source
const CurrencyUyu = shared.CurrencyUyu

This is an alias to an internal value.

View Source
const CurrencyUzs = shared.CurrencyUzs

This is an alias to an internal value.

View Source
const CurrencyVef = shared.CurrencyVef

This is an alias to an internal value.

View Source
const CurrencyVes = shared.CurrencyVes

This is an alias to an internal value.

View Source
const CurrencyVnd = shared.CurrencyVnd

This is an alias to an internal value.

View Source
const CurrencyVuv = shared.CurrencyVuv

This is an alias to an internal value.

View Source
const CurrencyWst = shared.CurrencyWst

This is an alias to an internal value.

View Source
const CurrencyXaf = shared.CurrencyXaf

This is an alias to an internal value.

View Source
const CurrencyXag = shared.CurrencyXag

This is an alias to an internal value.

View Source
const CurrencyXau = shared.CurrencyXau

This is an alias to an internal value.

View Source
const CurrencyXba = shared.CurrencyXba

This is an alias to an internal value.

View Source
const CurrencyXbb = shared.CurrencyXbb

This is an alias to an internal value.

View Source
const CurrencyXbc = shared.CurrencyXbc

This is an alias to an internal value.

View Source
const CurrencyXbd = shared.CurrencyXbd

This is an alias to an internal value.

View Source
const CurrencyXcd = shared.CurrencyXcd

This is an alias to an internal value.

View Source
const CurrencyXdr = shared.CurrencyXdr

This is an alias to an internal value.

View Source
const CurrencyXfu = shared.CurrencyXfu

This is an alias to an internal value.

View Source
const CurrencyXof = shared.CurrencyXof

This is an alias to an internal value.

View Source
const CurrencyXpd = shared.CurrencyXpd

This is an alias to an internal value.

View Source
const CurrencyXpf = shared.CurrencyXpf

This is an alias to an internal value.

View Source
const CurrencyXpt = shared.CurrencyXpt

This is an alias to an internal value.

View Source
const CurrencyXts = shared.CurrencyXts

This is an alias to an internal value.

View Source
const CurrencyYer = shared.CurrencyYer

This is an alias to an internal value.

View Source
const CurrencyZar = shared.CurrencyZar

This is an alias to an internal value.

View Source
const CurrencyZmk = shared.CurrencyZmk

This is an alias to an internal value.

View Source
const CurrencyZmw = shared.CurrencyZmw

This is an alias to an internal value.

View Source
const CurrencyZwd = shared.CurrencyZwd

This is an alias to an internal value.

View Source
const CurrencyZwl = shared.CurrencyZwl

This is an alias to an internal value.

View Source
const CurrencyZwn = shared.CurrencyZwn

This is an alias to an internal value.

View Source
const CurrencyZwr = shared.CurrencyZwr

This is an alias to an internal value.

View Source
const TransactionDirectionCredit = shared.TransactionDirectionCredit

This is an alias to an internal value.

View Source
const TransactionDirectionDebit = shared.TransactionDirectionDebit

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam added in v2.10.0

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AccountCollectionFlow

type AccountCollectionFlow struct {
	// The ID of a counterparty. An external account created with this flow will be
	// associated with this counterparty.
	CounterpartyID string                             `json:"counterparty_id,required" format:"uuid"`
	PaymentTypes   []AccountCollectionFlowPaymentType `json:"payment_types,required"`
	ID             string                             `json:"id" format:"uuid"`
	// The client token of the account collection flow. This token can be used to embed
	// account collection in your client-side application.
	ClientToken string    `json:"client_token"`
	CreatedAt   time.Time `json:"created_at" format:"date-time"`
	// If present, the ID of the external account created using this flow.
	ExternalAccountID string `json:"external_account_id,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode           bool                                    `json:"live_mode"`
	Object             string                                  `json:"object"`
	ReceivingCountries []AccountCollectionFlowReceivingCountry `json:"receiving_countries"`
	// The current status of the account collection flow. One of `pending`,
	// `completed`, `expired`, or `cancelled`.
	Status    AccountCollectionFlowStatus `json:"status"`
	UpdatedAt time.Time                   `json:"updated_at" format:"date-time"`
	JSON      accountCollectionFlowJSON   `json:"-"`
}

func (*AccountCollectionFlow) UnmarshalJSON

func (r *AccountCollectionFlow) UnmarshalJSON(data []byte) (err error)

type AccountCollectionFlowListParams

type AccountCollectionFlowListParams struct {
	AfterCursor       param.Field[string] `query:"after_cursor"`
	ClientToken       param.Field[string] `query:"client_token"`
	CounterpartyID    param.Field[string] `query:"counterparty_id"`
	ExternalAccountID param.Field[string] `query:"external_account_id"`
	PerPage           param.Field[int64]  `query:"per_page"`
	Status            param.Field[string] `query:"status"`
}

func (AccountCollectionFlowListParams) URLQuery

func (r AccountCollectionFlowListParams) URLQuery() (v url.Values)

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

type AccountCollectionFlowNewParams

type AccountCollectionFlowNewParams struct {
	// Required.
	CounterpartyID     param.Field[string]                                           `json:"counterparty_id,required" format:"uuid"`
	PaymentTypes       param.Field[[]string]                                         `json:"payment_types,required"`
	ReceivingCountries param.Field[[]AccountCollectionFlowNewParamsReceivingCountry] `json:"receiving_countries"`
}

func (AccountCollectionFlowNewParams) MarshalJSON

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

type AccountCollectionFlowNewParamsReceivingCountry

type AccountCollectionFlowNewParamsReceivingCountry string

Optional. Array of 3-digit ISO country codes.

const (
	AccountCollectionFlowNewParamsReceivingCountryUsa AccountCollectionFlowNewParamsReceivingCountry = "USA"
	AccountCollectionFlowNewParamsReceivingCountryAus AccountCollectionFlowNewParamsReceivingCountry = "AUS"
	AccountCollectionFlowNewParamsReceivingCountryBel AccountCollectionFlowNewParamsReceivingCountry = "BEL"
	AccountCollectionFlowNewParamsReceivingCountryCan AccountCollectionFlowNewParamsReceivingCountry = "CAN"
	AccountCollectionFlowNewParamsReceivingCountryChl AccountCollectionFlowNewParamsReceivingCountry = "CHL"
	AccountCollectionFlowNewParamsReceivingCountryChn AccountCollectionFlowNewParamsReceivingCountry = "CHN"
	AccountCollectionFlowNewParamsReceivingCountryCol AccountCollectionFlowNewParamsReceivingCountry = "COL"
	AccountCollectionFlowNewParamsReceivingCountryFra AccountCollectionFlowNewParamsReceivingCountry = "FRA"
	AccountCollectionFlowNewParamsReceivingCountryDeu AccountCollectionFlowNewParamsReceivingCountry = "DEU"
	AccountCollectionFlowNewParamsReceivingCountryHkg AccountCollectionFlowNewParamsReceivingCountry = "HKG"
	AccountCollectionFlowNewParamsReceivingCountryInd AccountCollectionFlowNewParamsReceivingCountry = "IND"
	AccountCollectionFlowNewParamsReceivingCountryIrl AccountCollectionFlowNewParamsReceivingCountry = "IRL"
	AccountCollectionFlowNewParamsReceivingCountryIta AccountCollectionFlowNewParamsReceivingCountry = "ITA"
	AccountCollectionFlowNewParamsReceivingCountryMex AccountCollectionFlowNewParamsReceivingCountry = "MEX"
	AccountCollectionFlowNewParamsReceivingCountryNld AccountCollectionFlowNewParamsReceivingCountry = "NLD"
	AccountCollectionFlowNewParamsReceivingCountryPer AccountCollectionFlowNewParamsReceivingCountry = "PER"
	AccountCollectionFlowNewParamsReceivingCountryEsp AccountCollectionFlowNewParamsReceivingCountry = "ESP"
	AccountCollectionFlowNewParamsReceivingCountryGbr AccountCollectionFlowNewParamsReceivingCountry = "GBR"
)

func (AccountCollectionFlowNewParamsReceivingCountry) IsKnown added in v2.10.0

type AccountCollectionFlowPaymentType

type AccountCollectionFlowPaymentType string

An account created with this flow will support payments of one of these types.

const (
	AccountCollectionFlowPaymentTypeACH  AccountCollectionFlowPaymentType = "ach"
	AccountCollectionFlowPaymentTypeWire AccountCollectionFlowPaymentType = "wire"
)

func (AccountCollectionFlowPaymentType) IsKnown added in v2.10.0

type AccountCollectionFlowReceivingCountry

type AccountCollectionFlowReceivingCountry string

An account created with this flow will support wires from the US to these countries.

const (
	AccountCollectionFlowReceivingCountryUsa AccountCollectionFlowReceivingCountry = "USA"
	AccountCollectionFlowReceivingCountryAus AccountCollectionFlowReceivingCountry = "AUS"
	AccountCollectionFlowReceivingCountryBel AccountCollectionFlowReceivingCountry = "BEL"
	AccountCollectionFlowReceivingCountryCan AccountCollectionFlowReceivingCountry = "CAN"
	AccountCollectionFlowReceivingCountryChl AccountCollectionFlowReceivingCountry = "CHL"
	AccountCollectionFlowReceivingCountryChn AccountCollectionFlowReceivingCountry = "CHN"
	AccountCollectionFlowReceivingCountryCol AccountCollectionFlowReceivingCountry = "COL"
	AccountCollectionFlowReceivingCountryFra AccountCollectionFlowReceivingCountry = "FRA"
	AccountCollectionFlowReceivingCountryDeu AccountCollectionFlowReceivingCountry = "DEU"
	AccountCollectionFlowReceivingCountryHkg AccountCollectionFlowReceivingCountry = "HKG"
	AccountCollectionFlowReceivingCountryInd AccountCollectionFlowReceivingCountry = "IND"
	AccountCollectionFlowReceivingCountryIrl AccountCollectionFlowReceivingCountry = "IRL"
	AccountCollectionFlowReceivingCountryIta AccountCollectionFlowReceivingCountry = "ITA"
	AccountCollectionFlowReceivingCountryMex AccountCollectionFlowReceivingCountry = "MEX"
	AccountCollectionFlowReceivingCountryNld AccountCollectionFlowReceivingCountry = "NLD"
	AccountCollectionFlowReceivingCountryPer AccountCollectionFlowReceivingCountry = "PER"
	AccountCollectionFlowReceivingCountryEsp AccountCollectionFlowReceivingCountry = "ESP"
	AccountCollectionFlowReceivingCountryGbr AccountCollectionFlowReceivingCountry = "GBR"
)

func (AccountCollectionFlowReceivingCountry) IsKnown added in v2.10.0

type AccountCollectionFlowService

type AccountCollectionFlowService struct {
	Options []option.RequestOption
}

AccountCollectionFlowService contains methods and other services that help with interacting with the Modern Treasury 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 NewAccountCollectionFlowService method instead.

func NewAccountCollectionFlowService

func NewAccountCollectionFlowService(opts ...option.RequestOption) (r *AccountCollectionFlowService)

NewAccountCollectionFlowService 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 (*AccountCollectionFlowService) Get

get account_collection_flow

func (*AccountCollectionFlowService) List

list account_collection_flows

func (*AccountCollectionFlowService) ListAutoPaging

list account_collection_flows

func (*AccountCollectionFlowService) New

create account_collection_flow

func (*AccountCollectionFlowService) Update

update account_collection_flow

type AccountCollectionFlowStatus

type AccountCollectionFlowStatus string

The current status of the account collection flow. One of `pending`, `completed`, `expired`, or `cancelled`.

const (
	AccountCollectionFlowStatusCancelled AccountCollectionFlowStatus = "cancelled"
	AccountCollectionFlowStatusCompleted AccountCollectionFlowStatus = "completed"
	AccountCollectionFlowStatusExpired   AccountCollectionFlowStatus = "expired"
	AccountCollectionFlowStatusPending   AccountCollectionFlowStatus = "pending"
)

func (AccountCollectionFlowStatus) IsKnown added in v2.10.0

func (r AccountCollectionFlowStatus) IsKnown() bool

type AccountCollectionFlowUpdateParams

type AccountCollectionFlowUpdateParams struct {
	// Required. The updated status of the account collection flow. Can only be used to
	// mark a flow as `cancelled`.
	Status param.Field[AccountCollectionFlowUpdateParamsStatus] `json:"status,required"`
}

func (AccountCollectionFlowUpdateParams) MarshalJSON

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

type AccountCollectionFlowUpdateParamsStatus

type AccountCollectionFlowUpdateParamsStatus string

Required. The updated status of the account collection flow. Can only be used to mark a flow as `cancelled`.

const (
	AccountCollectionFlowUpdateParamsStatusCancelled AccountCollectionFlowUpdateParamsStatus = "cancelled"
)

func (AccountCollectionFlowUpdateParamsStatus) IsKnown added in v2.10.0

type AccountDetail

type AccountDetail struct {
	ID string `json:"id,required" format:"uuid"`
	// The last 4 digits of the account_number.
	AccountNumberSafe string `json:"account_number_safe,required"`
	// One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank
	// account number is in a generic format.
	AccountNumberType AccountDetailAccountNumberType `json:"account_number_type,required"`
	CreatedAt         time.Time                      `json:"created_at,required" format:"date-time"`
	DiscardedAt       time.Time                      `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool      `json:"live_mode,required"`
	Object    string    `json:"object,required"`
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// The account number for the bank account.
	AccountNumber string            `json:"account_number"`
	JSON          accountDetailJSON `json:"-"`
}

func (*AccountDetail) UnmarshalJSON

func (r *AccountDetail) UnmarshalJSON(data []byte) (err error)

type AccountDetailAccountNumberType

type AccountDetailAccountNumberType string

One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format.

const (
	AccountDetailAccountNumberTypeAuNumber      AccountDetailAccountNumberType = "au_number"
	AccountDetailAccountNumberTypeClabe         AccountDetailAccountNumberType = "clabe"
	AccountDetailAccountNumberTypeHkNumber      AccountDetailAccountNumberType = "hk_number"
	AccountDetailAccountNumberTypeIban          AccountDetailAccountNumberType = "iban"
	AccountDetailAccountNumberTypeIDNumber      AccountDetailAccountNumberType = "id_number"
	AccountDetailAccountNumberTypeNzNumber      AccountDetailAccountNumberType = "nz_number"
	AccountDetailAccountNumberTypeOther         AccountDetailAccountNumberType = "other"
	AccountDetailAccountNumberTypePan           AccountDetailAccountNumberType = "pan"
	AccountDetailAccountNumberTypeSgNumber      AccountDetailAccountNumberType = "sg_number"
	AccountDetailAccountNumberTypeWalletAddress AccountDetailAccountNumberType = "wallet_address"
)

func (AccountDetailAccountNumberType) IsKnown added in v2.10.0

type AccountDetailDeleteParamsAccountsType

type AccountDetailDeleteParamsAccountsType string
const (
	AccountDetailDeleteParamsAccountsTypeExternalAccounts AccountDetailDeleteParamsAccountsType = "external_accounts"
)

func (AccountDetailDeleteParamsAccountsType) IsKnown added in v2.10.0

type AccountDetailListParams

type AccountDetailListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (AccountDetailListParams) URLQuery

func (r AccountDetailListParams) URLQuery() (v url.Values)

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

type AccountDetailNewParams

type AccountDetailNewParams struct {
	// The account number for the bank account.
	AccountNumber param.Field[string] `json:"account_number,required"`
	// One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank
	// account number is in a generic format.
	AccountNumberType param.Field[AccountDetailNewParamsAccountNumberType] `json:"account_number_type"`
}

func (AccountDetailNewParams) MarshalJSON

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

type AccountDetailNewParamsAccountNumberType

type AccountDetailNewParamsAccountNumberType string

One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format.

const (
	AccountDetailNewParamsAccountNumberTypeAuNumber      AccountDetailNewParamsAccountNumberType = "au_number"
	AccountDetailNewParamsAccountNumberTypeClabe         AccountDetailNewParamsAccountNumberType = "clabe"
	AccountDetailNewParamsAccountNumberTypeHkNumber      AccountDetailNewParamsAccountNumberType = "hk_number"
	AccountDetailNewParamsAccountNumberTypeIban          AccountDetailNewParamsAccountNumberType = "iban"
	AccountDetailNewParamsAccountNumberTypeIDNumber      AccountDetailNewParamsAccountNumberType = "id_number"
	AccountDetailNewParamsAccountNumberTypeNzNumber      AccountDetailNewParamsAccountNumberType = "nz_number"
	AccountDetailNewParamsAccountNumberTypeOther         AccountDetailNewParamsAccountNumberType = "other"
	AccountDetailNewParamsAccountNumberTypePan           AccountDetailNewParamsAccountNumberType = "pan"
	AccountDetailNewParamsAccountNumberTypeSgNumber      AccountDetailNewParamsAccountNumberType = "sg_number"
	AccountDetailNewParamsAccountNumberTypeWalletAddress AccountDetailNewParamsAccountNumberType = "wallet_address"
)

func (AccountDetailNewParamsAccountNumberType) IsKnown added in v2.10.0

type AccountDetailNewParamsAccountsType

type AccountDetailNewParamsAccountsType string
const (
	AccountDetailNewParamsAccountsTypeExternalAccounts AccountDetailNewParamsAccountsType = "external_accounts"
)

func (AccountDetailNewParamsAccountsType) IsKnown added in v2.10.0

type AccountDetailService

type AccountDetailService struct {
	Options []option.RequestOption
}

AccountDetailService contains methods and other services that help with interacting with the Modern Treasury 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 NewAccountDetailService method instead.

func NewAccountDetailService

func NewAccountDetailService(opts ...option.RequestOption) (r *AccountDetailService)

NewAccountDetailService 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 (*AccountDetailService) Delete

func (r *AccountDetailService) Delete(ctx context.Context, accountsType AccountDetailDeleteParamsAccountsType, accountID string, id string, opts ...option.RequestOption) (err error)

Delete a single account detail for an external account.

func (*AccountDetailService) Get

func (r *AccountDetailService) Get(ctx context.Context, accountsType shared.AccountsType, accountID string, id string, opts ...option.RequestOption) (res *AccountDetail, err error)

Get a single account detail for a single internal or external account.

func (*AccountDetailService) List

func (r *AccountDetailService) List(ctx context.Context, accountsType shared.AccountsType, accountID string, query AccountDetailListParams, opts ...option.RequestOption) (res *pagination.Page[AccountDetail], err error)

Get a list of account details for a single internal or external account.

func (*AccountDetailService) ListAutoPaging

Get a list of account details for a single internal or external account.

func (*AccountDetailService) New

Create an account detail for an external account.

type AccountsType

type AccountsType = shared.AccountsType

This is an alias to an internal type.

type AsyncResponse

type AsyncResponse = shared.AsyncResponse

This is an alias to an internal type.

type BalanceReport

type BalanceReport struct {
	ID string `json:"id,required" format:"uuid"`
	// The date of the balance report in local time.
	AsOfDate time.Time `json:"as_of_date,required" format:"date"`
	// The time (24-hour clock) of the balance report in local time.
	AsOfTime string `json:"as_of_time,required,nullable" format:"time"`
	// The specific type of balance report. One of `intraday`, `previous_day`,
	// `real_time`, or `other`.
	BalanceReportType BalanceReportBalanceReportType `json:"balance_report_type,required"`
	// An array of `Balance` objects.
	Balances  []BalanceReportBalance `json:"balances,required"`
	CreatedAt time.Time              `json:"created_at,required" format:"date-time"`
	// The ID of one of your organization's Internal Accounts.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool              `json:"live_mode,required"`
	Object    string            `json:"object,required"`
	UpdatedAt time.Time         `json:"updated_at,required" format:"date-time"`
	JSON      balanceReportJSON `json:"-"`
}

func (*BalanceReport) UnmarshalJSON

func (r *BalanceReport) UnmarshalJSON(data []byte) (err error)

type BalanceReportBalance

type BalanceReportBalance struct {
	ID string `json:"id,required" format:"uuid"`
	// The balance amount.
	Amount int64 `json:"amount,required"`
	// The specific type of balance reported. One of `opening_ledger`,
	// `closing_ledger`, `current_ledger`, `opening_available`,
	// `opening_available_next_business_day`, `closing_available`, `current_available`,
	// or `other`.
	BalanceType BalanceReportBalancesBalanceType `json:"balance_type,required"`
	CreatedAt   time.Time                        `json:"created_at,required" format:"date-time"`
	// The currency of the balance.
	Currency shared.Currency `json:"currency,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool      `json:"live_mode,required"`
	Object    string    `json:"object,required"`
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// The code used by the bank when reporting this specific balance.
	VendorCode string `json:"vendor_code,required"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, or `us_bank`.
	VendorCodeType string                   `json:"vendor_code_type,required,nullable"`
	JSON           balanceReportBalanceJSON `json:"-"`
}

func (*BalanceReportBalance) UnmarshalJSON

func (r *BalanceReportBalance) UnmarshalJSON(data []byte) (err error)

type BalanceReportBalanceReportType

type BalanceReportBalanceReportType string

The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`.

const (
	BalanceReportBalanceReportTypeIntraday    BalanceReportBalanceReportType = "intraday"
	BalanceReportBalanceReportTypeOther       BalanceReportBalanceReportType = "other"
	BalanceReportBalanceReportTypePreviousDay BalanceReportBalanceReportType = "previous_day"
	BalanceReportBalanceReportTypeRealTime    BalanceReportBalanceReportType = "real_time"
)

func (BalanceReportBalanceReportType) IsKnown added in v2.10.0

type BalanceReportBalancesBalanceType

type BalanceReportBalancesBalanceType string

The specific type of balance reported. One of `opening_ledger`, `closing_ledger`, `current_ledger`, `opening_available`, `opening_available_next_business_day`, `closing_available`, `current_available`, or `other`.

const (
	BalanceReportBalancesBalanceTypeClosingAvailable                BalanceReportBalancesBalanceType = "closing_available"
	BalanceReportBalancesBalanceTypeClosingLedger                   BalanceReportBalancesBalanceType = "closing_ledger"
	BalanceReportBalancesBalanceTypeCurrentAvailable                BalanceReportBalancesBalanceType = "current_available"
	BalanceReportBalancesBalanceTypeCurrentLedger                   BalanceReportBalancesBalanceType = "current_ledger"
	BalanceReportBalancesBalanceTypeOpeningAvailable                BalanceReportBalancesBalanceType = "opening_available"
	BalanceReportBalancesBalanceTypeOpeningAvailableNextBusinessDay BalanceReportBalancesBalanceType = "opening_available_next_business_day"
	BalanceReportBalancesBalanceTypeOpeningLedger                   BalanceReportBalancesBalanceType = "opening_ledger"
	BalanceReportBalancesBalanceTypeOther                           BalanceReportBalancesBalanceType = "other"
)

func (BalanceReportBalancesBalanceType) IsKnown added in v2.10.0

type BalanceReportListParams

type BalanceReportListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// The date of the balance report in local time.
	AsOfDate param.Field[time.Time] `query:"as_of_date" format:"date"`
	// The specific type of balance report. One of `intraday`, `previous_day`,
	// `real_time`, or `other`.
	BalanceReportType param.Field[BalanceReportListParamsBalanceReportType] `query:"balance_report_type"`
	PerPage           param.Field[int64]                                    `query:"per_page"`
}

func (BalanceReportListParams) URLQuery

func (r BalanceReportListParams) URLQuery() (v url.Values)

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

type BalanceReportListParamsBalanceReportType

type BalanceReportListParamsBalanceReportType string

The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`.

const (
	BalanceReportListParamsBalanceReportTypeIntraday    BalanceReportListParamsBalanceReportType = "intraday"
	BalanceReportListParamsBalanceReportTypeOther       BalanceReportListParamsBalanceReportType = "other"
	BalanceReportListParamsBalanceReportTypePreviousDay BalanceReportListParamsBalanceReportType = "previous_day"
	BalanceReportListParamsBalanceReportTypeRealTime    BalanceReportListParamsBalanceReportType = "real_time"
)

func (BalanceReportListParamsBalanceReportType) IsKnown added in v2.10.0

type BalanceReportNewParams added in v2.6.0

type BalanceReportNewParams struct {
	// The date of the balance report in local time.
	AsOfDate param.Field[time.Time] `json:"as_of_date,required" format:"date"`
	// The time (24-hour clock) of the balance report in local time.
	AsOfTime param.Field[string] `json:"as_of_time,required"`
	// The specific type of balance report. One of `intraday`, `previous_day`,
	// `real_time`, or `other`.
	BalanceReportType param.Field[BalanceReportNewParamsBalanceReportType] `json:"balance_report_type,required"`
	// An array of `Balance` objects.
	Balances param.Field[[]BalanceReportNewParamsBalance] `json:"balances,required"`
}

func (BalanceReportNewParams) MarshalJSON added in v2.6.0

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

type BalanceReportNewParamsBalance added in v2.6.0

type BalanceReportNewParamsBalance struct {
	// The balance amount.
	Amount param.Field[int64] `json:"amount,required"`
	// The specific type of balance reported. One of `opening_ledger`,
	// `closing_ledger`, `current_ledger`, `opening_available`,
	// `opening_available_next_business_day`, `closing_available`, `current_available`,
	// or `other`.
	BalanceType param.Field[BalanceReportNewParamsBalancesBalanceType] `json:"balance_type,required"`
	// The code used by the bank when reporting this specific balance.
	VendorCode param.Field[string] `json:"vendor_code,required"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, or `us_bank`.
	VendorCodeType param.Field[string] `json:"vendor_code_type,required"`
}

func (BalanceReportNewParamsBalance) MarshalJSON added in v2.6.0

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

type BalanceReportNewParamsBalanceReportType added in v2.6.0

type BalanceReportNewParamsBalanceReportType string

The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`.

const (
	BalanceReportNewParamsBalanceReportTypeIntraday    BalanceReportNewParamsBalanceReportType = "intraday"
	BalanceReportNewParamsBalanceReportTypeOther       BalanceReportNewParamsBalanceReportType = "other"
	BalanceReportNewParamsBalanceReportTypePreviousDay BalanceReportNewParamsBalanceReportType = "previous_day"
	BalanceReportNewParamsBalanceReportTypeRealTime    BalanceReportNewParamsBalanceReportType = "real_time"
)

func (BalanceReportNewParamsBalanceReportType) IsKnown added in v2.10.0

type BalanceReportNewParamsBalancesBalanceType added in v2.6.0

type BalanceReportNewParamsBalancesBalanceType string

The specific type of balance reported. One of `opening_ledger`, `closing_ledger`, `current_ledger`, `opening_available`, `opening_available_next_business_day`, `closing_available`, `current_available`, or `other`.

const (
	BalanceReportNewParamsBalancesBalanceTypeClosingAvailable                BalanceReportNewParamsBalancesBalanceType = "closing_available"
	BalanceReportNewParamsBalancesBalanceTypeClosingLedger                   BalanceReportNewParamsBalancesBalanceType = "closing_ledger"
	BalanceReportNewParamsBalancesBalanceTypeCurrentAvailable                BalanceReportNewParamsBalancesBalanceType = "current_available"
	BalanceReportNewParamsBalancesBalanceTypeCurrentLedger                   BalanceReportNewParamsBalancesBalanceType = "current_ledger"
	BalanceReportNewParamsBalancesBalanceTypeOpeningAvailable                BalanceReportNewParamsBalancesBalanceType = "opening_available"
	BalanceReportNewParamsBalancesBalanceTypeOpeningAvailableNextBusinessDay BalanceReportNewParamsBalancesBalanceType = "opening_available_next_business_day"
	BalanceReportNewParamsBalancesBalanceTypeOpeningLedger                   BalanceReportNewParamsBalancesBalanceType = "opening_ledger"
	BalanceReportNewParamsBalancesBalanceTypeOther                           BalanceReportNewParamsBalancesBalanceType = "other"
)

func (BalanceReportNewParamsBalancesBalanceType) IsKnown added in v2.10.0

type BulkRequest added in v2.3.0

type BulkRequest struct {
	ID string `json:"id,required" format:"uuid"`
	// One of create, or update.
	ActionType BulkRequestActionType `json:"action_type,required"`
	CreatedAt  time.Time             `json:"created_at,required" format:"date-time"`
	// Total number of failed bulk results so far for this request
	FailedResultCount int64 `json:"failed_result_count,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// One of payment_order, expected_payment, or ledger_transaction.
	ResourceType BulkRequestResourceType `json:"resource_type,required"`
	// One of pending, processing, or completed.
	Status BulkRequestStatus `json:"status,required"`
	// Total number of successful bulk results so far for this request
	SuccessResultCount int64 `json:"success_result_count,required"`
	// Total number of items in the `resources` array. Once a bulk request is
	// completed, `success_result_count` + `failed_result_count` will be equal to
	// `total_result_count`.
	TotalResourceCount int64           `json:"total_resource_count,required"`
	UpdatedAt          time.Time       `json:"updated_at,required" format:"date-time"`
	JSON               bulkRequestJSON `json:"-"`
}

func (*BulkRequest) UnmarshalJSON added in v2.3.0

func (r *BulkRequest) UnmarshalJSON(data []byte) (err error)

type BulkRequestActionType added in v2.3.0

type BulkRequestActionType string

One of create, or update.

const (
	BulkRequestActionTypeCreate BulkRequestActionType = "create"
	BulkRequestActionTypeUpdate BulkRequestActionType = "update"
)

func (BulkRequestActionType) IsKnown added in v2.10.0

func (r BulkRequestActionType) IsKnown() bool

type BulkRequestListParams added in v2.3.0

type BulkRequestListParams struct {
	// One of create, or update.
	ActionType  param.Field[BulkRequestListParamsActionType] `query:"action_type"`
	AfterCursor param.Field[string]                          `query:"after_cursor"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
	// One of payment_order, expected_payment, or ledger_transaction.
	ResourceType param.Field[BulkRequestListParamsResourceType] `query:"resource_type"`
	// One of pending, processing, or completed.
	Status param.Field[BulkRequestListParamsStatus] `query:"status"`
}

func (BulkRequestListParams) URLQuery added in v2.3.0

func (r BulkRequestListParams) URLQuery() (v url.Values)

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

type BulkRequestListParamsActionType added in v2.3.0

type BulkRequestListParamsActionType string

One of create, or update.

const (
	BulkRequestListParamsActionTypeCreate BulkRequestListParamsActionType = "create"
	BulkRequestListParamsActionTypeUpdate BulkRequestListParamsActionType = "update"
)

func (BulkRequestListParamsActionType) IsKnown added in v2.10.0

type BulkRequestListParamsResourceType added in v2.3.0

type BulkRequestListParamsResourceType string

One of payment_order, expected_payment, or ledger_transaction.

const (
	BulkRequestListParamsResourceTypePaymentOrder      BulkRequestListParamsResourceType = "payment_order"
	BulkRequestListParamsResourceTypeLedgerTransaction BulkRequestListParamsResourceType = "ledger_transaction"
	BulkRequestListParamsResourceTypeTransaction       BulkRequestListParamsResourceType = "transaction"
	BulkRequestListParamsResourceTypeExpectedPayment   BulkRequestListParamsResourceType = "expected_payment"
)

func (BulkRequestListParamsResourceType) IsKnown added in v2.10.0

type BulkRequestListParamsStatus added in v2.3.0

type BulkRequestListParamsStatus string

One of pending, processing, or completed.

const (
	BulkRequestListParamsStatusPending    BulkRequestListParamsStatus = "pending"
	BulkRequestListParamsStatusProcessing BulkRequestListParamsStatus = "processing"
	BulkRequestListParamsStatusCompleted  BulkRequestListParamsStatus = "completed"
)

func (BulkRequestListParamsStatus) IsKnown added in v2.10.0

func (r BulkRequestListParamsStatus) IsKnown() bool

type BulkRequestNewParams added in v2.3.0

type BulkRequestNewParams struct {
	// One of create, or update.
	ActionType param.Field[BulkRequestNewParamsActionType] `json:"action_type,required"`
	// One of payment_order, expected_payment, or ledger_transaction.
	ResourceType param.Field[BulkRequestNewParamsResourceType] `json:"resource_type,required"`
	// An array of objects where each object contains the input params for a single
	// `action_type` request on a `resource_type` resource
	Resources param.Field[[]BulkRequestNewParamsResourceUnion] `json:"resources,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (BulkRequestNewParams) MarshalJSON added in v2.4.0

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

type BulkRequestNewParamsActionType added in v2.3.0

type BulkRequestNewParamsActionType string

One of create, or update.

const (
	BulkRequestNewParamsActionTypeCreate BulkRequestNewParamsActionType = "create"
	BulkRequestNewParamsActionTypeUpdate BulkRequestNewParamsActionType = "update"
)

func (BulkRequestNewParamsActionType) IsKnown added in v2.10.0

type BulkRequestNewParamsResource added in v2.3.0

type BulkRequestNewParamsResource struct {
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type param.Field[PaymentOrderType] `json:"type"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[string] `json:"direction"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[BulkRequestNewParamsResourcesPriority] `json:"priority"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id" format:"uuid"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string]      `json:"receiving_account_id" format:"uuid"`
	Accounting         param.Field[interface{}] `json:"accounting,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose  param.Field[string]      `json:"purpose"`
	Metadata param.Field[interface{}] `json:"metadata,required"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[BulkRequestNewParamsResourcesChargeBearer] `json:"charge_bearer"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[BulkRequestNewParamsResourcesForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// Name of the ultimate funds recipient.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
	// Identifier of the ultimate funds recipient.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType      param.Field[BulkRequestNewParamsResourcesFallbackType] `json:"fallback_type"`
	ReceivingAccount  param.Field[interface{}]                               `json:"receiving_account,required"`
	LedgerTransaction param.Field[interface{}]                               `json:"ledger_transaction,required"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon payment order creation. Once the
	// payment order is created, the status of the ledger transaction tracks the
	// payment order automatically.
	LedgerTransactionID param.Field[string]      `json:"ledger_transaction_id" format:"uuid"`
	LineItems           param.Field[interface{}] `json:"line_items,required"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled param.Field[bool] `json:"transaction_monitoring_enabled"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound param.Field[int64] `json:"amount_upper_bound"`
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound param.Field[int64] `json:"amount_lower_bound"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID param.Field[string] `json:"internal_account_id" format:"uuid"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound param.Field[time.Time] `json:"date_upper_bound" format:"date"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound param.Field[time.Time] `json:"date_lower_bound" format:"date"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID              param.Field[string]      `json:"counterparty_id" format:"uuid"`
	ReconciliationGroups        param.Field[interface{}] `json:"reconciliation_groups,required"`
	ReconciliationFilters       param.Field[interface{}] `json:"reconciliation_filters,required"`
	ReconciliationRuleVariables param.Field[interface{}] `json:"reconciliation_rule_variables,required"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[BulkRequestNewParamsResourcesStatus] `json:"status"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt   param.Field[time.Time]   `json:"effective_at" format:"date-time"`
	LedgerEntries param.Field[interface{}] `json:"ledger_entries,required"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesLedgerableType] `json:"ledgerable_type"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// The transaction detail text that often appears in on your bank statement and in
	// your banking portal.
	VendorDescription param.Field[string] `json:"vendor_description"`
	// When applicable, the bank-given code that determines the transaction's category.
	// For most banks this is the BAI2/BTRS transaction code.
	VendorCode param.Field[string] `json:"vendor_code"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, `us_bank`, or others.
	VendorCodeType param.Field[string] `json:"vendor_code_type"`
	// The date on which the transaction occurred.
	AsOfDate param.Field[time.Time] `json:"as_of_date" format:"date"`
	// This field will be `true` if the transaction has posted to the account.
	Posted param.Field[bool]   `json:"posted"`
	ID     param.Field[string] `json:"id" format:"uuid"`
}

func (BulkRequestNewParamsResource) MarshalJSON added in v2.11.0

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

type BulkRequestNewParamsResourceType added in v2.3.0

type BulkRequestNewParamsResourceType string

One of payment_order, expected_payment, or ledger_transaction.

const (
	BulkRequestNewParamsResourceTypePaymentOrder      BulkRequestNewParamsResourceType = "payment_order"
	BulkRequestNewParamsResourceTypeLedgerTransaction BulkRequestNewParamsResourceType = "ledger_transaction"
	BulkRequestNewParamsResourceTypeTransaction       BulkRequestNewParamsResourceType = "transaction"
	BulkRequestNewParamsResourceTypeExpectedPayment   BulkRequestNewParamsResourceType = "expected_payment"
)

func (BulkRequestNewParamsResourceType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesChargeBearer added in v2.11.0

type BulkRequestNewParamsResourcesChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	BulkRequestNewParamsResourcesChargeBearerShared   BulkRequestNewParamsResourcesChargeBearer = "shared"
	BulkRequestNewParamsResourcesChargeBearerSender   BulkRequestNewParamsResourcesChargeBearer = "sender"
	BulkRequestNewParamsResourcesChargeBearerReceiver BulkRequestNewParamsResourcesChargeBearer = "receiver"
)

func (BulkRequestNewParamsResourcesChargeBearer) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequest added in v2.3.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequest struct {
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound param.Field[int64] `json:"amount_lower_bound,required"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound param.Field[int64] `json:"amount_upper_bound,required"`
	// One of credit or debit. When you are receiving money, use credit. When you are
	// being charged, use debit.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Must conform to ISO 4217. Defaults to the currency of the internal account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound param.Field[time.Time] `json:"date_lower_bound" format:"date"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound param.Field[time.Time] `json:"date_upper_bound" format:"date"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// Specifies a ledger transaction object that will be created with the expected
	// payment. If the ledger transaction cannot be created, then the expected payment
	// creation will fail. The resulting ledger transaction will mirror the status of
	// the expected payment.
	LedgerTransaction param.Field[BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransaction] `json:"ledger_transaction"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon expected payment creation. Once
	// the expected payment is created, the status of the ledger transaction tracks the
	// expected payment automatically.
	LedgerTransactionID param.Field[string]                                                              `json:"ledger_transaction_id" format:"uuid"`
	LineItems           param.Field[[]BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The reconciliation filters you have for this payment.
	ReconciliationFilters param.Field[interface{}] `json:"reconciliation_filters"`
	// The reconciliation groups you have for this payment.
	ReconciliationGroups param.Field[interface{}] `json:"reconciliation_groups"`
	// An array of reconciliation rule variables for this payment.
	ReconciliationRuleVariables param.Field[[]map[string]string] `json:"reconciliation_rule_variables"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// The statement description you expect to see on the transaction. For ACH
	// payments, this will be the full line item passed from the bank. For wire
	// payments, this will be the OBI field on the wire. For check payments, this will
	// be the memo field.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen,
	// sepa, signet, wire.
	Type param.Field[ExpectedPaymentType] `json:"type"`
}

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequest) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransaction added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the expected payment. If the ledger transaction cannot be created, then the expected payment creation will fail. The resulting ledger transaction will mirror the status of the expected payment.

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransaction) MarshalJSON added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerEntry added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerEntry) MarshalJSON added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypePaperItem             BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypeReturn                BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "return"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableTypeReversal              BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType = "reversal"
)

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus added in v2.6.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatusArchived BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus = "archived"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatusPending  BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus = "pending"
	BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatusPosted   BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus = "posted"
)

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLedgerTransactionStatus) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLineItem added in v2.3.0

type BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (BulkRequestNewParamsResourcesExpectedPaymentCreateRequestLineItem) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithID added in v2.16.0

type BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithID struct {
	ID param.Field[string] `json:"id" format:"uuid"`
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound param.Field[int64] `json:"amount_lower_bound"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound param.Field[int64] `json:"amount_upper_bound"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Must conform to ISO 4217. Defaults to the currency of the internal account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound param.Field[time.Time] `json:"date_lower_bound" format:"date"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound param.Field[time.Time] `json:"date_upper_bound" format:"date"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// One of credit or debit. When you are receiving money, use credit. When you are
	// being charged, use debit.
	Direction param.Field[shared.TransactionDirection] `json:"direction"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID param.Field[string] `json:"internal_account_id" format:"uuid"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The reconciliation filters you have for this payment.
	ReconciliationFilters param.Field[interface{}] `json:"reconciliation_filters"`
	// The reconciliation groups you have for this payment.
	ReconciliationGroups param.Field[interface{}] `json:"reconciliation_groups"`
	// An array of reconciliation rule variables for this payment.
	ReconciliationRuleVariables param.Field[[]map[string]string] `json:"reconciliation_rule_variables"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// The statement description you expect to see on the transaction. For ACH
	// payments, this will be the full line item passed from the bank. For wire
	// payments, this will be the OBI field on the wire. For check payments, this will
	// be the memo field.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// The Expected Payment's status can be updated from partially_reconciled to
	// reconciled.
	Status param.Field[BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatus] `json:"status"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen,
	// sepa, signet, wire.
	Type param.Field[ExpectedPaymentType] `json:"type"`
}

func (BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithID) MarshalJSON added in v2.16.0

type BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatus added in v2.13.0

type BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatus string

The Expected Payment's status can be updated from partially_reconciled to reconciled.

const (
	BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatusReconciled BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatus = "reconciled"
)

func (BulkRequestNewParamsResourcesExpectedPaymentUpdateRequestWithIDStatus) IsKnown added in v2.13.0

type BulkRequestNewParamsResourcesFallbackType added in v2.11.0

type BulkRequestNewParamsResourcesFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	BulkRequestNewParamsResourcesFallbackTypeACH BulkRequestNewParamsResourcesFallbackType = "ach"
)

func (BulkRequestNewParamsResourcesFallbackType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesForeignExchangeIndicator added in v2.11.0

type BulkRequestNewParamsResourcesForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	BulkRequestNewParamsResourcesForeignExchangeIndicatorFixedToVariable BulkRequestNewParamsResourcesForeignExchangeIndicator = "fixed_to_variable"
	BulkRequestNewParamsResourcesForeignExchangeIndicatorVariableToFixed BulkRequestNewParamsResourcesForeignExchangeIndicator = "variable_to_fixed"
)

func (BulkRequestNewParamsResourcesForeignExchangeIndicator) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequest added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequest struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus] `json:"status"`
}

func (BulkRequestNewParamsResourcesLedgerTransactionCreateRequest) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerEntry added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerEntry) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypePaperItem             BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeReturn                BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "return"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeReversal              BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "reversal"
)

func (BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus added in v2.3.0

type BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus string

To post a ledger transaction at creation, use `posted`.

const (
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatusArchived BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus = "archived"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatusPending  BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus = "pending"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatusPosted   BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus = "posted"
)

func (BulkRequestNewParamsResourcesLedgerTransactionCreateRequestStatus) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithID added in v2.16.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithID struct {
	ID param.Field[string] `json:"id" format:"uuid"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerEntry] `json:"ledger_entries"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus] `json:"status"`
}

func (BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithID) MarshalJSON added in v2.16.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerEntry added in v2.11.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerEntry) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType added in v2.13.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypePaperItem             BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypeReturn                BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "return"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableTypeReversal              BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType = "reversal"
)

func (BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDLedgerableType) IsKnown added in v2.13.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus added in v2.11.0

type BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus string

To post a ledger transaction at creation, use `posted`.

const (
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatusArchived BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus = "archived"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatusPending  BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus = "pending"
	BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatusPosted   BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus = "posted"
)

func (BulkRequestNewParamsResourcesLedgerTransactionUpdateRequestWithIDStatus) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesLedgerableType added in v2.11.0

type BulkRequestNewParamsResourcesLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkRequestNewParamsResourcesLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesLedgerableTypePaperItem             BulkRequestNewParamsResourcesLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesLedgerableTypeReturn                BulkRequestNewParamsResourcesLedgerableType = "return"
	BulkRequestNewParamsResourcesLedgerableTypeReversal              BulkRequestNewParamsResourcesLedgerableType = "reversal"
)

func (BulkRequestNewParamsResourcesLedgerableType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesObject added in v2.10.0

type BulkRequestNewParamsResourcesObject struct {
	ID param.Field[string] `json:"id" format:"uuid"`
}

func (BulkRequestNewParamsResourcesObject) MarshalJSON added in v2.10.0

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

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequest added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequest struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection] `json:"direction,required"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required" format:"uuid"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type       param.Field[PaymentOrderType]                                                      `json:"type,required"`
	Accounting param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestAccounting] `json:"accounting"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer] `json:"charge_bearer"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackType] `json:"fallback_type"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// Specifies a ledger transaction object that will be created with the payment
	// order. If the ledger transaction cannot be created, then the payment order
	// creation will fail. The resulting ledger transaction will mirror the status of
	// the payment order.
	LedgerTransaction param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransaction] `json:"ledger_transaction"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon payment order creation. Once the
	// payment order is created, the status of the ledger transaction tracks the
	// payment order automatically.
	LedgerTransactionID param.Field[string] `json:"ledger_transaction_id" format:"uuid"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority] `json:"priority"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose param.Field[string] `json:"purpose"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccount param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccount] `json:"receiving_account"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled param.Field[bool] `json:"transaction_monitoring_enabled"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// Identifier of the ultimate funds recipient.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// Name of the ultimate funds recipient.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequest) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestAccounting added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID param.Field[string] `json:"account_id" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID param.Field[string] `json:"class_id" format:"uuid"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestAccounting) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearerShared   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer = "shared"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearerSender   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer = "sender"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearerReceiver BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer = "receiver"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestChargeBearer) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirectionCredit BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection = "credit"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirectionDebit  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection = "debit"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestDirection) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackTypeACH BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackType = "ach"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestFallbackType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicatorFixedToVariable BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator = "fixed_to_variable"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicatorVariableToFixed BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator = "variable_to_fixed"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestForeignExchangeIndicator) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransaction added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the payment order. If the ledger transaction cannot be created, then the payment order creation will fail. The resulting ledger transaction will mirror the status of the payment order.

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransaction) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerEntry added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerEntry) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypePaperItem             BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypeReturn                BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "return"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableTypeReversal              BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType = "reversal"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatusArchived BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus = "archived"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatusPending  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus = "pending"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatusPosted   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus = "posted"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLedgerTransactionStatus) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLineItem added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestLineItem) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriorityHigh   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority = "high"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriorityNormal BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority = "normal"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestPriority) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccount added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccount struct {
	AccountDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                                                        `json:"account_type"`
	ContactDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                                                                  `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                                                                     `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail] `json:"routing_details"`
}

Either `receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccount) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetail added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetail struct {
	AccountNumber     param.Field[string]                                                                                                     `json:"account_number,required"`
	AccountNumberType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetail) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeAuNumber      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "au_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeClabe         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "clabe"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeHkNumber      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "hk_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeIban          BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "iban"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeIDNumber      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "id_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeNzNumber      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "nz_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeOther         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "other"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypePan           BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "pan"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeSgNumber      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "sg_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberTypeWalletAddress BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetail added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetail struct {
	ContactIdentifier     param.Field[string]                                                                                                         `json:"contact_identifier"`
	ContactIdentifierType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetail) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType string
const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierTypeEmail       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType = "email"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierTypePhoneNumber BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierTypeWebsite     BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType = "website"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccount added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccount) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableTypeCounterparty    BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType = "counterparty"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableTypeExternalAccount BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType = "external_account"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableTypeInternalAccount BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType = "internal_account"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableTypeVirtualAccount  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType = "virtual_account"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountLedgerAccountLedgerableType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyAddress added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyAddress) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType string

Either `individual` or `business`.

const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyTypeBusiness   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType = "business"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyTypeIndividual BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType = "individual"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountPartyType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                                                     `json:"routing_number,required"`
	RoutingNumberType param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail) MarshalJSON added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType string
const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeACH         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "ach"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeAuBecs      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "au_becs"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeBacs        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "bacs"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeBook        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "book"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeCard        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "card"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeChats       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "chats"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeCheck       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "check"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeCrossBorder BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "cross_border"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeDkNets      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeEft         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "eft"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeHuIcs       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "hu_ics"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeInterac     BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "interac"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeMasav       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "masav"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeMxCcen      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "mx_ccen"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeNeft        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "neft"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeNics        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "nics"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeNzBecs      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypePlElixir    BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "pl_elixir"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeProvxchange BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "provxchange"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeRoSent      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "ro_sent"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeRtp         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "rtp"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSeBankgirot BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSen         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "sen"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSepa        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "sepa"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSgGiro      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSic         BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "sic"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSignet      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "signet"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeSknbi       BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "sknbi"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeWire        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "wire"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentTypeZengin      BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType = "zengin"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsPaymentType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType added in v2.4.0

type BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeAba                     BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeChips                   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeHuInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeIDSknbiCode             BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "id_sknbi_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeMxBankIdentifier        BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypePlNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeZaNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (BulkRequestNewParamsResourcesPaymentOrderAsyncCreateRequestReceivingAccountRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithID added in v2.16.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithID struct {
	ID         param.Field[string]                                                                 `json:"id" format:"uuid"`
	Accounting param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDAccounting] `json:"accounting"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer] `json:"charge_bearer"`
	// Required when receiving_account_id is passed the ID of an external account.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection] `json:"direction"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackType] `json:"fallback_type"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id" format:"uuid"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority] `json:"priority"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose param.Field[string] `json:"purpose"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccount param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccount] `json:"receiving_account"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// To cancel a payment order, use `cancelled`. To redraft a returned payment order,
	// use `approved`. To undo approval on a denied or approved payment order, use
	// `needs_approval`.
	Status param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus] `json:"status"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type param.Field[PaymentOrderType] `json:"type"`
	// This represents the identifier by which the person is known to the receiver when
	// using the CIE subtype for ACH payments. Only the first 22 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// This represents the name of the person that the payment is on behalf of when
	// using the CIE subtype for ACH payments. Only the first 15 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// This represents the name of the merchant that the payment is being sent to when
	// using the CIE subtype for ACH payments. Only the first 22 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// This represents the identifier by which the merchant is known to the person
	// initiating an ACH payment with CIE subtype. Only the first 15 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithID) MarshalJSON added in v2.16.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDAccounting added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID param.Field[string] `json:"account_id" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID param.Field[string] `json:"class_id" format:"uuid"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDAccounting) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearerShared   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer = "shared"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearerSender   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer = "sender"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearerReceiver BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer = "receiver"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDChargeBearer) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirectionCredit BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection = "credit"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirectionDebit  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection = "debit"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDDirection) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackTypeACH BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackType = "ach"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDFallbackType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicatorFixedToVariable BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator = "fixed_to_variable"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicatorVariableToFixed BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator = "variable_to_fixed"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDForeignExchangeIndicator) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDLineItem added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDLineItem) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriorityHigh   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority = "high"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriorityNormal BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority = "normal"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDPriority) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccount added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccount struct {
	AccountDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                                                         `json:"account_type"`
	ContactDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                                                                   `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                                                                      `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail] `json:"routing_details"`
}

Either `receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccount) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail struct {
	AccountNumber     param.Field[string]                                                                                                      `json:"account_number,required"`
	AccountNumberType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeAuNumber      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "au_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeClabe         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "clabe"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeHkNumber      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "hk_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeIban          BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "iban"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeIDNumber      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "id_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeNzNumber      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "nz_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeOther         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "other"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypePan           BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "pan"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeSgNumber      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "sg_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberTypeWalletAddress BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetailsAccountNumberType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetail added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetail struct {
	ContactIdentifier     param.Field[string]                                                                                                          `json:"contact_identifier"`
	ContactIdentifierType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetail) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType string
const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierTypeEmail       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType = "email"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierTypePhoneNumber BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierTypeWebsite     BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType = "website"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountContactDetailsContactIdentifierType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccount added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccount) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableTypeCounterparty    BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType = "counterparty"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableTypeExternalAccount BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType = "external_account"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableTypeInternalAccount BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType = "internal_account"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableTypeVirtualAccount  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType = "virtual_account"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountLedgerAccountLedgerableType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyAddress added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyAddress) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType string

Either `individual` or `business`.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyTypeBusiness   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType = "business"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyTypeIndividual BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType = "individual"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountPartyType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                                                      `json:"routing_number,required"`
	RoutingNumberType param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail) MarshalJSON added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType string
const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeACH         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "ach"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeAuBecs      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "au_becs"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeBacs        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "bacs"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeBook        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "book"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeCard        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "card"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeChats       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "chats"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeCheck       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "check"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeCrossBorder BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "cross_border"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeDkNets      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeEft         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "eft"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeHuIcs       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "hu_ics"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeInterac     BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "interac"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeMasav       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "masav"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeMxCcen      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "mx_ccen"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeNeft        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "neft"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeNics        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "nics"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeNzBecs      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypePlElixir    BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "pl_elixir"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeProvxchange BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "provxchange"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeRoSent      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "ro_sent"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeRtp         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "rtp"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSeBankgirot BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSen         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "sen"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSepa        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "sepa"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSgGiro      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSic         BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "sic"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSignet      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "signet"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeSknbi       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "sknbi"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeWire        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "wire"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentTypeZengin      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType = "zengin"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsPaymentType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeAba                     BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeChips                   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeHuInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeIDSknbiCode             BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "id_sknbi_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeMxBankIdentifier        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypePlNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberTypeZaNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetailsRoutingNumberType) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus added in v2.11.0

type BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus string

To cancel a payment order, use `cancelled`. To redraft a returned payment order, use `approved`. To undo approval on a denied or approved payment order, use `needs_approval`.

const (
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusApproved      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "approved"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusCancelled     BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "cancelled"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusCompleted     BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "completed"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusDenied        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "denied"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusFailed        BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "failed"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusNeedsApproval BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "needs_approval"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusPending       BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "pending"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusProcessing    BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "processing"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusReturned      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "returned"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusReversed      BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "reversed"
	BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatusSent          BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus = "sent"
)

func (BulkRequestNewParamsResourcesPaymentOrderUpdateRequestWithIDStatus) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesPriority added in v2.11.0

type BulkRequestNewParamsResourcesPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	BulkRequestNewParamsResourcesPriorityHigh   BulkRequestNewParamsResourcesPriority = "high"
	BulkRequestNewParamsResourcesPriorityNormal BulkRequestNewParamsResourcesPriority = "normal"
)

func (BulkRequestNewParamsResourcesPriority) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesStatus added in v2.11.0

type BulkRequestNewParamsResourcesStatus string

To post a ledger transaction at creation, use `posted`.

const (
	BulkRequestNewParamsResourcesStatusArchived      BulkRequestNewParamsResourcesStatus = "archived"
	BulkRequestNewParamsResourcesStatusPending       BulkRequestNewParamsResourcesStatus = "pending"
	BulkRequestNewParamsResourcesStatusPosted        BulkRequestNewParamsResourcesStatus = "posted"
	BulkRequestNewParamsResourcesStatusApproved      BulkRequestNewParamsResourcesStatus = "approved"
	BulkRequestNewParamsResourcesStatusCancelled     BulkRequestNewParamsResourcesStatus = "cancelled"
	BulkRequestNewParamsResourcesStatusCompleted     BulkRequestNewParamsResourcesStatus = "completed"
	BulkRequestNewParamsResourcesStatusDenied        BulkRequestNewParamsResourcesStatus = "denied"
	BulkRequestNewParamsResourcesStatusFailed        BulkRequestNewParamsResourcesStatus = "failed"
	BulkRequestNewParamsResourcesStatusNeedsApproval BulkRequestNewParamsResourcesStatus = "needs_approval"
	BulkRequestNewParamsResourcesStatusProcessing    BulkRequestNewParamsResourcesStatus = "processing"
	BulkRequestNewParamsResourcesStatusReturned      BulkRequestNewParamsResourcesStatus = "returned"
	BulkRequestNewParamsResourcesStatusReversed      BulkRequestNewParamsResourcesStatus = "reversed"
	BulkRequestNewParamsResourcesStatusSent          BulkRequestNewParamsResourcesStatus = "sent"
	BulkRequestNewParamsResourcesStatusReconciled    BulkRequestNewParamsResourcesStatus = "reconciled"
)

func (BulkRequestNewParamsResourcesStatus) IsKnown added in v2.11.0

type BulkRequestNewParamsResourcesTransactionCreateRequest added in v2.10.0

type BulkRequestNewParamsResourcesTransactionCreateRequest struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The date on which the transaction occurred.
	AsOfDate param.Field[time.Time] `json:"as_of_date,required" format:"date"`
	// Either `credit` or `debit`.
	Direction param.Field[string] `json:"direction,required"`
	// The ID of the relevant Internal Account.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// When applicable, the bank-given code that determines the transaction's category.
	// For most banks this is the BAI2/BTRS transaction code.
	VendorCode param.Field[string] `json:"vendor_code,required"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, `us_bank`, or others.
	VendorCodeType param.Field[string] `json:"vendor_code_type,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// This field will be `true` if the transaction has posted to the account.
	Posted param.Field[bool] `json:"posted"`
	// The type of the transaction. Examples could be
	// `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.
	Type param.Field[BulkRequestNewParamsResourcesTransactionCreateRequestType] `json:"type"`
	// The transaction detail text that often appears in on your bank statement and in
	// your banking portal.
	VendorDescription param.Field[string] `json:"vendor_description"`
}

func (BulkRequestNewParamsResourcesTransactionCreateRequest) MarshalJSON added in v2.10.0

type BulkRequestNewParamsResourcesTransactionCreateRequestType added in v2.13.0

type BulkRequestNewParamsResourcesTransactionCreateRequestType string

The type of the transaction. Examples could be `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.

const (
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeACH         BulkRequestNewParamsResourcesTransactionCreateRequestType = "ach"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeAuBecs      BulkRequestNewParamsResourcesTransactionCreateRequestType = "au_becs"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeBacs        BulkRequestNewParamsResourcesTransactionCreateRequestType = "bacs"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeBook        BulkRequestNewParamsResourcesTransactionCreateRequestType = "book"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeCard        BulkRequestNewParamsResourcesTransactionCreateRequestType = "card"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeChats       BulkRequestNewParamsResourcesTransactionCreateRequestType = "chats"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeCheck       BulkRequestNewParamsResourcesTransactionCreateRequestType = "check"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeCrossBorder BulkRequestNewParamsResourcesTransactionCreateRequestType = "cross_border"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeDkNets      BulkRequestNewParamsResourcesTransactionCreateRequestType = "dk_nets"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeEft         BulkRequestNewParamsResourcesTransactionCreateRequestType = "eft"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeHuIcs       BulkRequestNewParamsResourcesTransactionCreateRequestType = "hu_ics"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeInterac     BulkRequestNewParamsResourcesTransactionCreateRequestType = "interac"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeMasav       BulkRequestNewParamsResourcesTransactionCreateRequestType = "masav"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeMxCcen      BulkRequestNewParamsResourcesTransactionCreateRequestType = "mx_ccen"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeNeft        BulkRequestNewParamsResourcesTransactionCreateRequestType = "neft"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeNics        BulkRequestNewParamsResourcesTransactionCreateRequestType = "nics"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeNzBecs      BulkRequestNewParamsResourcesTransactionCreateRequestType = "nz_becs"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypePlElixir    BulkRequestNewParamsResourcesTransactionCreateRequestType = "pl_elixir"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeProvxchange BulkRequestNewParamsResourcesTransactionCreateRequestType = "provxchange"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeRoSent      BulkRequestNewParamsResourcesTransactionCreateRequestType = "ro_sent"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeRtp         BulkRequestNewParamsResourcesTransactionCreateRequestType = "rtp"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSeBankgirot BulkRequestNewParamsResourcesTransactionCreateRequestType = "se_bankgirot"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSen         BulkRequestNewParamsResourcesTransactionCreateRequestType = "sen"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSepa        BulkRequestNewParamsResourcesTransactionCreateRequestType = "sepa"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSgGiro      BulkRequestNewParamsResourcesTransactionCreateRequestType = "sg_giro"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSic         BulkRequestNewParamsResourcesTransactionCreateRequestType = "sic"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSignet      BulkRequestNewParamsResourcesTransactionCreateRequestType = "signet"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeSknbi       BulkRequestNewParamsResourcesTransactionCreateRequestType = "sknbi"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeWire        BulkRequestNewParamsResourcesTransactionCreateRequestType = "wire"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeZengin      BulkRequestNewParamsResourcesTransactionCreateRequestType = "zengin"
	BulkRequestNewParamsResourcesTransactionCreateRequestTypeOther       BulkRequestNewParamsResourcesTransactionCreateRequestType = "other"
)

func (BulkRequestNewParamsResourcesTransactionCreateRequestType) IsKnown added in v2.13.0

type BulkRequestNewParamsResourcesTransactionUpdateRequestWithID added in v2.16.0

type BulkRequestNewParamsResourcesTransactionUpdateRequestWithID struct {
	ID param.Field[string] `json:"id" format:"uuid"`
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (BulkRequestNewParamsResourcesTransactionUpdateRequestWithID) MarshalJSON added in v2.16.0

type BulkRequestResourceType added in v2.3.0

type BulkRequestResourceType string

One of payment_order, expected_payment, or ledger_transaction.

const (
	BulkRequestResourceTypePaymentOrder      BulkRequestResourceType = "payment_order"
	BulkRequestResourceTypeLedgerTransaction BulkRequestResourceType = "ledger_transaction"
	BulkRequestResourceTypeTransaction       BulkRequestResourceType = "transaction"
	BulkRequestResourceTypeExpectedPayment   BulkRequestResourceType = "expected_payment"
)

func (BulkRequestResourceType) IsKnown added in v2.10.0

func (r BulkRequestResourceType) IsKnown() bool

type BulkRequestService added in v2.3.0

type BulkRequestService struct {
	Options []option.RequestOption
}

BulkRequestService contains methods and other services that help with interacting with the Modern Treasury 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 NewBulkRequestService method instead.

func NewBulkRequestService added in v2.3.0

func NewBulkRequestService(opts ...option.RequestOption) (r *BulkRequestService)

NewBulkRequestService 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 (*BulkRequestService) Get added in v2.3.0

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

get bulk_request

func (*BulkRequestService) List added in v2.3.0

list bulk_requests

func (*BulkRequestService) ListAutoPaging added in v2.3.0

list bulk_requests

func (*BulkRequestService) New added in v2.3.0

create bulk_request

type BulkRequestStatus added in v2.3.0

type BulkRequestStatus string

One of pending, processing, or completed.

const (
	BulkRequestStatusPending    BulkRequestStatus = "pending"
	BulkRequestStatusProcessing BulkRequestStatus = "processing"
	BulkRequestStatusCompleted  BulkRequestStatus = "completed"
)

func (BulkRequestStatus) IsKnown added in v2.10.0

func (r BulkRequestStatus) IsKnown() bool

type BulkResult added in v2.3.0

type BulkResult struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// An object with type as indicated by `entity_type`. This is the result object
	// that is generated by performing the requested action on the provided input
	// `request_params`.
	Entity BulkResultEntity `json:"entity,required"`
	// Unique identifier for the result entity object.
	EntityID string `json:"entity_id,required" format:"uuid"`
	// The type of the result entity object. For a successful bulk result, this is the
	// same as the `resource_type` of the bulk request. For a failed bulk result, this
	// is always bulk_error
	EntityType BulkResultEntityType `json:"entity_type,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// Unique identifier for the request that created this bulk result. This is the ID
	// of the bulk request when `request_type` is bulk_request
	RequestID string `json:"request_id,required" format:"uuid"`
	// An optional object that contains the provided input params for the request that
	// created this result. This is an item in the `resources` array for the
	// bulk_request
	RequestParams map[string]string `json:"request_params,required,nullable"`
	// The type of the request that created this result. bulk_request is the only
	// supported `request_type`
	RequestType BulkResultRequestType `json:"request_type,required"`
	// One of successful or failed.
	Status    BulkResultStatus `json:"status,required"`
	UpdatedAt time.Time        `json:"updated_at,required" format:"date-time"`
	JSON      bulkResultJSON   `json:"-"`
}

func (*BulkResult) UnmarshalJSON added in v2.3.0

func (r *BulkResult) UnmarshalJSON(data []byte) (err error)

type BulkResultEntity added in v2.3.0

type BulkResultEntity struct {
	ID     string `json:"id,required" format:"uuid"`
	Object string `json:"object,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool      `json:"live_mode,required"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type PaymentOrderType `json:"type,nullable"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype PaymentOrderSubtype `json:"subtype,nullable"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount int64 `json:"amount"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction string `json:"direction"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority BulkResultEntityPriority `json:"priority"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID string `json:"originating_account_id" format:"uuid"`
	// The receiving account ID. Can be an `external_account` or `internal_account`.
	ReceivingAccountID string `json:"receiving_account_id" format:"uuid"`
	// This field can have the runtime type of [PaymentOrderAccounting].
	Accounting interface{} `json:"accounting,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID string `json:"accounting_category_id,nullable" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID string `json:"accounting_ledger_class_id,nullable" format:"uuid"`
	// Defaults to the currency of the originating account.
	Currency shared.Currency `json:"currency"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate time.Time `json:"effective_date" format:"date"`
	// An optional description for internal use.
	Description string `json:"description,nullable"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor string `json:"statement_descriptor,nullable"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation string `json:"remittance_information,nullable"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter time.Time `json:"process_after,nullable" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose string `json:"purpose,nullable"`
	// This field can have the runtime type of [map[string]string].
	Metadata interface{} `json:"metadata,required"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer BulkResultEntityChargeBearer `json:"charge_bearer,nullable"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator BulkResultEntityForeignExchangeIndicator `json:"foreign_exchange_indicator,nullable"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract string `json:"foreign_exchange_contract,nullable"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected bool `json:"nsf_protected"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName string `json:"originating_party_name,nullable"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName string `json:"ultimate_originating_party_name,nullable"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier string `json:"ultimate_originating_party_identifier,nullable"`
	UltimateReceivingPartyName         string `json:"ultimate_receiving_party_name,nullable"`
	UltimateReceivingPartyIdentifier   string `json:"ultimate_receiving_party_identifier,nullable"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice bool `json:"send_remittance_advice,nullable"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt time.Time `json:"expires_at,nullable" format:"date-time"`
	// The current status of the payment order.
	Status               BulkResultEntityStatus               `json:"status"`
	ReceivingAccountType BulkResultEntityReceivingAccountType `json:"receiving_account_type"`
	// This field can have the runtime type of
	// [PaymentOrderUltimateOriginatingAccount].
	UltimateOriginatingAccount interface{} `json:"ultimate_originating_account,required"`
	// The ultimate originating account ID. Can be a `virtual_account` or
	// `internal_account`.
	UltimateOriginatingAccountID   string                                         `json:"ultimate_originating_account_id,nullable" format:"uuid"`
	UltimateOriginatingAccountType BulkResultEntityUltimateOriginatingAccountType `json:"ultimate_originating_account_type,nullable"`
	// If the payment order is tied to a specific Counterparty, their id will appear,
	// otherwise `null`.
	CounterpartyID string `json:"counterparty_id,nullable" format:"uuid"`
	// This field can have the runtime type of [[]string].
	TransactionIDs interface{} `json:"transaction_ids,required"`
	// The ID of the ledger transaction linked to the payment order.
	LedgerTransactionID string `json:"ledger_transaction_id,nullable" format:"uuid"`
	// If the payment order's status is `returned`, this will include the return
	// object's data.
	CurrentReturn ReturnObject `json:"current_return,nullable"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled bool `json:"transaction_monitoring_enabled"`
	// This field can have the runtime type of [map[string]interface{}].
	ComplianceRuleMetadata interface{} `json:"compliance_rule_metadata,required"`
	// This field can have the runtime type of [[]PaymentOrderReferenceNumber].
	ReferenceNumbers interface{} `json:"reference_numbers,required"`
	// This field will be populated if a vendor failure occurs. Logic shouldn't be
	// built on its value as it is free-form.
	VendorFailureReason string `json:"vendor_failure_reason,nullable"`
	// The ID of the compliance decision for the payment order, if transaction
	// monitoring is enabled.
	DecisionID string `json:"decision_id,nullable" format:"uuid"`
	// This field can have the runtime type of [PaymentOrderForeignExchangeRate],
	// [TransactionForeignExchangeRate].
	ForeignExchangeRate interface{} `json:"foreign_exchange_rate,required"`
	// This field can have the runtime type of [interface{}].
	VendorAttributes interface{} `json:"vendor_attributes,required"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound int64 `json:"amount_upper_bound"`
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound int64 `json:"amount_lower_bound"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID string `json:"internal_account_id" format:"uuid"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound time.Time `json:"date_upper_bound,nullable" format:"date"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound time.Time `json:"date_lower_bound,nullable" format:"date"`
	// This field can have the runtime type of [interface{}].
	ReconciliationGroups interface{} `json:"reconciliation_groups,required"`
	// This field can have the runtime type of [interface{}].
	ReconciliationFilters interface{} `json:"reconciliation_filters,required"`
	// This field can have the runtime type of [[]map[string]string].
	ReconciliationRuleVariables interface{} `json:"reconciliation_rule_variables,required"`
	// The ID of the Transaction this expected payment object has been matched to.
	TransactionID string `json:"transaction_id,nullable" format:"uuid"`
	// The ID of the Transaction Line Item this expected payment has been matched to.
	TransactionLineItemID string `json:"transaction_line_item_id,nullable" format:"uuid"`
	// One of manual if this expected payment was manually reconciled in the dashboard,
	// automatic if it was automatically reconciled by Modern Treasury, or null if it
	// is unreconciled.
	ReconciliationMethod BulkResultEntityReconciliationMethod `json:"reconciliation_method,nullable"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt time.Time `json:"effective_at" format:"date-time"`
	// This field can have the runtime type of [[]LedgerEntry].
	LedgerEntries interface{} `json:"ledger_entries,required"`
	// The time on which the ledger transaction posted. This is null if the ledger
	// transaction is pending.
	PostedAt time.Time `json:"posted_at,nullable" format:"date-time"`
	// The ID of the ledger this ledger transaction belongs to.
	LedgerID string `json:"ledger_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType BulkResultEntityLedgerableType `json:"ledgerable_type,nullable"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID string `json:"ledgerable_id,nullable" format:"uuid"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID string `json:"external_id,nullable"`
	// The ID of the original ledger transaction that this ledger transaction reverses.
	ReversesLedgerTransactionID string `json:"reverses_ledger_transaction_id,nullable"`
	// The ID of the ledger transaction that reversed this ledger transaction.
	ReversedByLedgerTransactionID string    `json:"reversed_by_ledger_transaction_id,nullable"`
	DiscardedAt                   time.Time `json:"discarded_at,nullable" format:"date-time"`
	// The transaction detail text that often appears in on your bank statement and in
	// your banking portal.
	VendorDescription string `json:"vendor_description,nullable"`
	// When applicable, the bank-given code that determines the transaction's category.
	// For most banks this is the BAI2/BTRS transaction code.
	VendorCode string `json:"vendor_code,nullable"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, `us_bank`, or others.
	VendorCodeType BulkResultEntityVendorCodeType `json:"vendor_code_type,nullable"`
	// An identifier given to this transaction by the bank.
	VendorID string `json:"vendor_id,nullable"`
	// The date on which the transaction occurred.
	AsOfDate time.Time `json:"as_of_date,nullable" format:"date"`
	// The time on which the transaction occurred. Depending on the granularity of the
	// timestamp information received from the bank, it may be `null`.
	AsOfTime string `json:"as_of_time,nullable" format:"time"`
	// This field will be `true` if the transaction has posted to the account.
	Posted bool `json:"posted"`
	// An identifier given to this transaction by the bank, often `null`.
	VendorCustomerID string `json:"vendor_customer_id,nullable"`
	// This field will be `true` if a transaction is reconciled by the Modern Treasury
	// system. This means that it has transaction line items that sum up to the
	// transaction's amount.
	Reconciled bool `json:"reconciled"`
	// This field can have the runtime type of [map[string]string].
	Details interface{} `json:"details,required"`
	// This field can have the runtime type of
	// [[]BulkResultEntityBulkErrorRequestError].
	RequestErrors interface{}          `json:"request_errors,required"`
	JSON          bulkResultEntityJSON `json:"-"`
	// contains filtered or unexported fields
}

An object with type as indicated by `entity_type`. This is the result object that is generated by performing the requested action on the provided input `request_params`.

func (BulkResultEntity) AsUnion added in v2.11.0

AsUnion returns a BulkResultEntityUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are PaymentOrder, ExpectedPayment, LedgerTransaction, Transaction, BulkResultEntityBulkError.

func (*BulkResultEntity) UnmarshalJSON added in v2.11.0

func (r *BulkResultEntity) UnmarshalJSON(data []byte) (err error)

type BulkResultEntityBulkError added in v2.3.0

type BulkResultEntityBulkError struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode      bool                                    `json:"live_mode,required"`
	Object        string                                  `json:"object,required"`
	RequestErrors []BulkResultEntityBulkErrorRequestError `json:"request_errors,required"`
	UpdatedAt     time.Time                               `json:"updated_at,required" format:"date-time"`
	JSON          bulkResultEntityBulkErrorJSON           `json:"-"`
}

func (*BulkResultEntityBulkError) UnmarshalJSON added in v2.3.0

func (r *BulkResultEntityBulkError) UnmarshalJSON(data []byte) (err error)

type BulkResultEntityBulkErrorRequestError added in v2.3.0

type BulkResultEntityBulkErrorRequestError struct {
	Code      string                                    `json:"code"`
	Message   string                                    `json:"message"`
	Parameter string                                    `json:"parameter"`
	JSON      bulkResultEntityBulkErrorRequestErrorJSON `json:"-"`
}

func (*BulkResultEntityBulkErrorRequestError) UnmarshalJSON added in v2.3.0

func (r *BulkResultEntityBulkErrorRequestError) UnmarshalJSON(data []byte) (err error)

type BulkResultEntityChargeBearer added in v2.11.0

type BulkResultEntityChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	BulkResultEntityChargeBearerShared   BulkResultEntityChargeBearer = "shared"
	BulkResultEntityChargeBearerSender   BulkResultEntityChargeBearer = "sender"
	BulkResultEntityChargeBearerReceiver BulkResultEntityChargeBearer = "receiver"
)

func (BulkResultEntityChargeBearer) IsKnown added in v2.11.0

func (r BulkResultEntityChargeBearer) IsKnown() bool

type BulkResultEntityForeignExchangeIndicator added in v2.11.0

type BulkResultEntityForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	BulkResultEntityForeignExchangeIndicatorFixedToVariable BulkResultEntityForeignExchangeIndicator = "fixed_to_variable"
	BulkResultEntityForeignExchangeIndicatorVariableToFixed BulkResultEntityForeignExchangeIndicator = "variable_to_fixed"
)

func (BulkResultEntityForeignExchangeIndicator) IsKnown added in v2.11.0

type BulkResultEntityLedgerableType added in v2.11.0

type BulkResultEntityLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	BulkResultEntityLedgerableTypeExpectedPayment       BulkResultEntityLedgerableType = "expected_payment"
	BulkResultEntityLedgerableTypeIncomingPaymentDetail BulkResultEntityLedgerableType = "incoming_payment_detail"
	BulkResultEntityLedgerableTypePaperItem             BulkResultEntityLedgerableType = "paper_item"
	BulkResultEntityLedgerableTypePaymentOrder          BulkResultEntityLedgerableType = "payment_order"
	BulkResultEntityLedgerableTypeReturn                BulkResultEntityLedgerableType = "return"
	BulkResultEntityLedgerableTypeReversal              BulkResultEntityLedgerableType = "reversal"
)

func (BulkResultEntityLedgerableType) IsKnown added in v2.11.0

type BulkResultEntityPriority added in v2.11.0

type BulkResultEntityPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	BulkResultEntityPriorityHigh   BulkResultEntityPriority = "high"
	BulkResultEntityPriorityNormal BulkResultEntityPriority = "normal"
)

func (BulkResultEntityPriority) IsKnown added in v2.11.0

func (r BulkResultEntityPriority) IsKnown() bool

type BulkResultEntityReceivingAccountType added in v2.11.0

type BulkResultEntityReceivingAccountType string
const (
	BulkResultEntityReceivingAccountTypeInternalAccount BulkResultEntityReceivingAccountType = "internal_account"
	BulkResultEntityReceivingAccountTypeExternalAccount BulkResultEntityReceivingAccountType = "external_account"
)

func (BulkResultEntityReceivingAccountType) IsKnown added in v2.11.0

type BulkResultEntityReconciliationMethod added in v2.11.0

type BulkResultEntityReconciliationMethod string

One of manual if this expected payment was manually reconciled in the dashboard, automatic if it was automatically reconciled by Modern Treasury, or null if it is unreconciled.

const (
	BulkResultEntityReconciliationMethodAutomatic BulkResultEntityReconciliationMethod = "automatic"
	BulkResultEntityReconciliationMethodManual    BulkResultEntityReconciliationMethod = "manual"
)

func (BulkResultEntityReconciliationMethod) IsKnown added in v2.11.0

type BulkResultEntityStatus added in v2.11.0

type BulkResultEntityStatus string

The current status of the payment order.

const (
	BulkResultEntityStatusApproved            BulkResultEntityStatus = "approved"
	BulkResultEntityStatusCancelled           BulkResultEntityStatus = "cancelled"
	BulkResultEntityStatusCompleted           BulkResultEntityStatus = "completed"
	BulkResultEntityStatusDenied              BulkResultEntityStatus = "denied"
	BulkResultEntityStatusFailed              BulkResultEntityStatus = "failed"
	BulkResultEntityStatusNeedsApproval       BulkResultEntityStatus = "needs_approval"
	BulkResultEntityStatusPending             BulkResultEntityStatus = "pending"
	BulkResultEntityStatusProcessing          BulkResultEntityStatus = "processing"
	BulkResultEntityStatusReturned            BulkResultEntityStatus = "returned"
	BulkResultEntityStatusReversed            BulkResultEntityStatus = "reversed"
	BulkResultEntityStatusSent                BulkResultEntityStatus = "sent"
	BulkResultEntityStatusArchived            BulkResultEntityStatus = "archived"
	BulkResultEntityStatusPartiallyReconciled BulkResultEntityStatus = "partially_reconciled"
	BulkResultEntityStatusReconciled          BulkResultEntityStatus = "reconciled"
	BulkResultEntityStatusUnreconciled        BulkResultEntityStatus = "unreconciled"
	BulkResultEntityStatusPosted              BulkResultEntityStatus = "posted"
)

func (BulkResultEntityStatus) IsKnown added in v2.11.0

func (r BulkResultEntityStatus) IsKnown() bool

type BulkResultEntityType added in v2.3.0

type BulkResultEntityType string

The type of the result entity object. For a successful bulk result, this is the same as the `resource_type` of the bulk request. For a failed bulk result, this is always bulk_error

const (
	BulkResultEntityTypePaymentOrder      BulkResultEntityType = "payment_order"
	BulkResultEntityTypeLedgerTransaction BulkResultEntityType = "ledger_transaction"
	BulkResultEntityTypeTransaction       BulkResultEntityType = "transaction"
	BulkResultEntityTypeExpectedPayment   BulkResultEntityType = "expected_payment"
	BulkResultEntityTypeBulkError         BulkResultEntityType = "bulk_error"
)

func (BulkResultEntityType) IsKnown added in v2.10.0

func (r BulkResultEntityType) IsKnown() bool

type BulkResultEntityUltimateOriginatingAccountType added in v2.11.0

type BulkResultEntityUltimateOriginatingAccountType string
const (
	BulkResultEntityUltimateOriginatingAccountTypeInternalAccount BulkResultEntityUltimateOriginatingAccountType = "internal_account"
	BulkResultEntityUltimateOriginatingAccountTypeVirtualAccount  BulkResultEntityUltimateOriginatingAccountType = "virtual_account"
)

func (BulkResultEntityUltimateOriginatingAccountType) IsKnown added in v2.11.0

type BulkResultEntityUnion added in v2.11.0

type BulkResultEntityUnion interface {
	// contains filtered or unexported methods
}

An object with type as indicated by `entity_type`. This is the result object that is generated by performing the requested action on the provided input `request_params`.

Union satisfied by PaymentOrder, ExpectedPayment, LedgerTransaction, Transaction or BulkResultEntityBulkError.

type BulkResultEntityVendorCodeType added in v2.11.0

type BulkResultEntityVendorCodeType string

The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`, `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`, `swift`, `us_bank`, or others.

const (
	BulkResultEntityVendorCodeTypeBai2          BulkResultEntityVendorCodeType = "bai2"
	BulkResultEntityVendorCodeTypeBankprov      BulkResultEntityVendorCodeType = "bankprov"
	BulkResultEntityVendorCodeTypeBnkDev        BulkResultEntityVendorCodeType = "bnk_dev"
	BulkResultEntityVendorCodeTypeCleartouch    BulkResultEntityVendorCodeType = "cleartouch"
	BulkResultEntityVendorCodeTypeColumn        BulkResultEntityVendorCodeType = "column"
	BulkResultEntityVendorCodeTypeCrossRiver    BulkResultEntityVendorCodeType = "cross_river"
	BulkResultEntityVendorCodeTypeCurrencycloud BulkResultEntityVendorCodeType = "currencycloud"
	BulkResultEntityVendorCodeTypeDcBank        BulkResultEntityVendorCodeType = "dc_bank"
	BulkResultEntityVendorCodeTypeDwolla        BulkResultEntityVendorCodeType = "dwolla"
	BulkResultEntityVendorCodeTypeEvolve        BulkResultEntityVendorCodeType = "evolve"
	BulkResultEntityVendorCodeTypeGoldmanSachs  BulkResultEntityVendorCodeType = "goldman_sachs"
	BulkResultEntityVendorCodeTypeIso20022      BulkResultEntityVendorCodeType = "iso20022"
	BulkResultEntityVendorCodeTypeJpmc          BulkResultEntityVendorCodeType = "jpmc"
	BulkResultEntityVendorCodeTypeMx            BulkResultEntityVendorCodeType = "mx"
	BulkResultEntityVendorCodeTypePlaid         BulkResultEntityVendorCodeType = "plaid"
	BulkResultEntityVendorCodeTypePnc           BulkResultEntityVendorCodeType = "pnc"
	BulkResultEntityVendorCodeTypeRspecVendor   BulkResultEntityVendorCodeType = "rspec_vendor"
	BulkResultEntityVendorCodeTypeSignet        BulkResultEntityVendorCodeType = "signet"
	BulkResultEntityVendorCodeTypeSilvergate    BulkResultEntityVendorCodeType = "silvergate"
	BulkResultEntityVendorCodeTypeSwift         BulkResultEntityVendorCodeType = "swift"
	BulkResultEntityVendorCodeTypeUsBank        BulkResultEntityVendorCodeType = "us_bank"
	BulkResultEntityVendorCodeTypeUser          BulkResultEntityVendorCodeType = "user"
)

func (BulkResultEntityVendorCodeType) IsKnown added in v2.11.0

type BulkResultListParams added in v2.3.0

type BulkResultListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Unique identifier for the result entity object.
	EntityID param.Field[string] `query:"entity_id"`
	// The type of the request that created this result. bulk_request is the only
	// supported `request_type`
	EntityType param.Field[BulkResultListParamsEntityType] `query:"entity_type"`
	PerPage    param.Field[int64]                          `query:"per_page"`
	// Unique identifier for the request that created this bulk result. This is the ID
	// of the bulk request when `request_type` is bulk_request
	RequestID param.Field[string] `query:"request_id"`
	// The type of the request that created this result. bulk_request is the only
	// supported `request_type`
	RequestType param.Field[BulkResultListParamsRequestType] `query:"request_type"`
	// One of successful or failed.
	Status param.Field[BulkResultListParamsStatus] `query:"status"`
}

func (BulkResultListParams) URLQuery added in v2.3.0

func (r BulkResultListParams) URLQuery() (v url.Values)

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

type BulkResultListParamsEntityType added in v2.3.0

type BulkResultListParamsEntityType string

The type of the request that created this result. bulk_request is the only supported `request_type`

const (
	BulkResultListParamsEntityTypePaymentOrder      BulkResultListParamsEntityType = "payment_order"
	BulkResultListParamsEntityTypeLedgerTransaction BulkResultListParamsEntityType = "ledger_transaction"
	BulkResultListParamsEntityTypeTransaction       BulkResultListParamsEntityType = "transaction"
	BulkResultListParamsEntityTypeExpectedPayment   BulkResultListParamsEntityType = "expected_payment"
	BulkResultListParamsEntityTypeBulkError         BulkResultListParamsEntityType = "bulk_error"
)

func (BulkResultListParamsEntityType) IsKnown added in v2.10.0

type BulkResultListParamsRequestType added in v2.3.0

type BulkResultListParamsRequestType string

The type of the request that created this result. bulk_request is the only supported `request_type`

const (
	BulkResultListParamsRequestTypeBulkRequest BulkResultListParamsRequestType = "bulk_request"
)

func (BulkResultListParamsRequestType) IsKnown added in v2.10.0

type BulkResultListParamsStatus added in v2.3.0

type BulkResultListParamsStatus string

One of successful or failed.

const (
	BulkResultListParamsStatusPending    BulkResultListParamsStatus = "pending"
	BulkResultListParamsStatusSuccessful BulkResultListParamsStatus = "successful"
	BulkResultListParamsStatusFailed     BulkResultListParamsStatus = "failed"
)

func (BulkResultListParamsStatus) IsKnown added in v2.10.0

func (r BulkResultListParamsStatus) IsKnown() bool

type BulkResultRequestType added in v2.3.0

type BulkResultRequestType string

The type of the request that created this result. bulk_request is the only supported `request_type`

const (
	BulkResultRequestTypeBulkRequest BulkResultRequestType = "bulk_request"
)

func (BulkResultRequestType) IsKnown added in v2.10.0

func (r BulkResultRequestType) IsKnown() bool

type BulkResultService added in v2.3.0

type BulkResultService struct {
	Options []option.RequestOption
}

BulkResultService contains methods and other services that help with interacting with the Modern Treasury 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 NewBulkResultService method instead.

func NewBulkResultService added in v2.3.0

func NewBulkResultService(opts ...option.RequestOption) (r *BulkResultService)

NewBulkResultService 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 (*BulkResultService) Get added in v2.3.0

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

get bulk_result

func (*BulkResultService) List added in v2.3.0

list bulk_results

func (*BulkResultService) ListAutoPaging added in v2.3.0

list bulk_results

type BulkResultStatus added in v2.3.0

type BulkResultStatus string

One of successful or failed.

const (
	BulkResultStatusPending    BulkResultStatus = "pending"
	BulkResultStatusSuccessful BulkResultStatus = "successful"
	BulkResultStatusFailed     BulkResultStatus = "failed"
)

func (BulkResultStatus) IsKnown added in v2.10.0

func (r BulkResultStatus) IsKnown() bool

type Client

type Client struct {
	Options                      []option.RequestOption
	Connections                  *ConnectionService
	Counterparties               *CounterpartyService
	Events                       *EventService
	ExpectedPayments             *ExpectedPaymentService
	ExternalAccounts             *ExternalAccountService
	IncomingPaymentDetails       *IncomingPaymentDetailService
	Invoices                     *InvoiceService
	Documents                    *DocumentService
	AccountCollectionFlows       *AccountCollectionFlowService
	AccountDetails               *AccountDetailService
	RoutingDetails               *RoutingDetailService
	InternalAccounts             *InternalAccountService
	Ledgers                      *LedgerService
	LedgerableEvents             *LedgerableEventService
	LedgerAccountCategories      *LedgerAccountCategoryService
	LedgerAccounts               *LedgerAccountService
	LedgerAccountBalanceMonitors *LedgerAccountBalanceMonitorService
	LedgerAccountStatements      *LedgerAccountStatementService
	LedgerEntries                *LedgerEntryService
	LedgerEventHandlers          *LedgerEventHandlerService
	LedgerTransactions           *LedgerTransactionService
	LineItems                    *LineItemService
	PaymentFlows                 *PaymentFlowService
	PaymentOrders                *PaymentOrderService
	PaymentReferences            *PaymentReferenceService
	Returns                      *ReturnService
	Transactions                 *TransactionService
	Validations                  *ValidationService
	PaperItems                   *PaperItemService
	Webhooks                     *WebhookService
	VirtualAccounts              *VirtualAccountService
	BulkRequests                 *BulkRequestService
	BulkResults                  *BulkResultService
	LedgerAccountSettlements     *LedgerAccountSettlementService
	ForeignExchangeQuotes        *ForeignExchangeQuoteService
	ConnectionLegalEntities      *ConnectionLegalEntityService
	LegalEntities                *LegalEntityService
	LegalEntityAssociations      *LegalEntityAssociationService
}

Client creates a struct with services and top level methods that help with interacting with the Modern Treasury 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 (MODERN_TREASURY_API_KEY, MODERN_TREASURY_ORGANIZATION_ID, MODERN_TREASURY_WEBHOOK_KEY). 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 added in v2.11.0

func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, 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 added in v2.11.0

func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, 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 added in v2.11.0

func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, 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 added in v2.11.0

func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, 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) Ping

func (r *Client) Ping(ctx context.Context, opts ...option.RequestOption) (res *PingResponse, err error)

A test endpoint often used to confirm credentials and headers are being passed in correctly.

func (*Client) Post added in v2.11.0

func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, 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 added in v2.11.0

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, 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 Connection

type Connection struct {
	ID          string    `json:"id,required" format:"uuid"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool      `json:"live_mode,required"`
	Object    string    `json:"object,required"`
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// An identifier given to this connection by the bank.
	VendorCustomerID string `json:"vendor_customer_id,required,nullable" format:"uuid"`
	// Unique identifier for the bank or vendor.
	VendorID string `json:"vendor_id,required" format:"uuid"`
	// A human-friendly name for the bank or vendor.
	VendorName string         `json:"vendor_name,required"`
	JSON       connectionJSON `json:"-"`
}

func (*Connection) UnmarshalJSON

func (r *Connection) UnmarshalJSON(data []byte) (err error)

type ConnectionLegalEntity added in v2.8.0

type ConnectionLegalEntity struct {
	ID string `json:"id,required" format:"uuid"`
	// The ID of the connection.
	ConnectionID string    `json:"connection_id,required"`
	CreatedAt    time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt  time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The ID of the legal entity.
	LegalEntityID string `json:"legal_entity_id,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The status of the connection legal entity.
	Status    ConnectionLegalEntityStatus `json:"status,required"`
	UpdatedAt time.Time                   `json:"updated_at,required" format:"date-time"`
	// The ID of the legal entity at the vendor.
	VendorID string                    `json:"vendor_id,required"`
	JSON     connectionLegalEntityJSON `json:"-"`
}

func (*ConnectionLegalEntity) UnmarshalJSON added in v2.8.0

func (r *ConnectionLegalEntity) UnmarshalJSON(data []byte) (err error)

type ConnectionLegalEntityListParams added in v2.8.0

type ConnectionLegalEntityListParams struct {
	AfterCursor   param.Field[string]                                `query:"after_cursor"`
	ConnectionID  param.Field[string]                                `query:"connection_id"`
	LegalEntityID param.Field[string]                                `query:"legal_entity_id"`
	PerPage       param.Field[int64]                                 `query:"per_page"`
	Status        param.Field[ConnectionLegalEntityListParamsStatus] `query:"status"`
}

func (ConnectionLegalEntityListParams) URLQuery added in v2.8.0

func (r ConnectionLegalEntityListParams) URLQuery() (v url.Values)

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

type ConnectionLegalEntityListParamsStatus added in v2.8.0

type ConnectionLegalEntityListParamsStatus string
const (
	ConnectionLegalEntityListParamsStatusCompleted  ConnectionLegalEntityListParamsStatus = "completed"
	ConnectionLegalEntityListParamsStatusDenied     ConnectionLegalEntityListParamsStatus = "denied"
	ConnectionLegalEntityListParamsStatusFailed     ConnectionLegalEntityListParamsStatus = "failed"
	ConnectionLegalEntityListParamsStatusProcessing ConnectionLegalEntityListParamsStatus = "processing"
)

func (ConnectionLegalEntityListParamsStatus) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParams added in v2.8.0

type ConnectionLegalEntityNewParams struct {
	// The ID of the connection.
	ConnectionID param.Field[string] `json:"connection_id,required"`
	// The legal entity.
	LegalEntity param.Field[ConnectionLegalEntityNewParamsLegalEntity] `json:"legal_entity"`
	// The ID of the legal entity.
	LegalEntityID param.Field[string] `json:"legal_entity_id"`
}

func (ConnectionLegalEntityNewParams) MarshalJSON added in v2.8.0

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

type ConnectionLegalEntityNewParamsLegalEntity added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntity struct {
	// A list of addresses for the entity.
	Addresses param.Field[[]ConnectionLegalEntityNewParamsLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]ConnectionLegalEntityNewParamsLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The legal entity associations and its child legal entities.
	LegalEntityAssociations param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociation] `json:"legal_entity_associations"`
	// The type of legal entity.
	LegalEntityType param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityType] `json:"legal_entity_type"`
	// The business's legal structure.
	LegalStructure param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                                      `json:"metadata"`
	PhoneNumbers param.Field[[]ConnectionLegalEntityNewParamsLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[ConnectionLegalEntityNewParamsLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

The legal entity.

func (ConnectionLegalEntityNewParamsLegalEntity) MarshalJSON added in v2.8.0

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

type ConnectionLegalEntityNewParamsLegalEntityAddress added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                          `json:"line2"`
}

func (ConnectionLegalEntityNewParamsLegalEntityAddress) MarshalJSON added in v2.8.0

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

type ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType added in v2.9.0

type ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType string
const (
	ConnectionLegalEntityNewParamsLegalEntityAddressesAddressTypeBusiness    ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType = "business"
	ConnectionLegalEntityNewParamsLegalEntityAddressesAddressTypeMailing     ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType = "mailing"
	ConnectionLegalEntityNewParamsLegalEntityAddressesAddressTypeOther       ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType = "other"
	ConnectionLegalEntityNewParamsLegalEntityAddressesAddressTypePoBox       ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType = "po_box"
	ConnectionLegalEntityNewParamsLegalEntityAddressesAddressTypeResidential ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType = "residential"
)

func (ConnectionLegalEntityNewParamsLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityIdentification added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (ConnectionLegalEntityNewParamsLegalEntityIdentification) MarshalJSON added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType string

The type of ID number.

const (
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeArCuil    ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "ar_cuil"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeArCuit    ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "ar_cuit"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeBrCnpj    ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "br_cnpj"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeBrCpf     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "br_cpf"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeClRut     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "cl_rut"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeCoCedulas ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "co_cedulas"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeCoNit     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "co_nit"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeHnID      ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "hn_id"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeHnRtn     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "hn_rtn"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeInLei     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "in_lei"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeKrBrn     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "kr_brn"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeKrCrn     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "kr_crn"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeKrRrn     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "kr_rrn"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypePassport  ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "passport"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeSaTin     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "sa_tin"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeSaVat     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "sa_vat"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeUsEin     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "us_ein"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeUsItin    ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "us_itin"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeUsSsn     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "us_ssn"
	ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDTypeVnTin     ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType = "vn_tin"
)

func (ConnectionLegalEntityNewParamsLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociation added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociation struct {
	RelationshipTypes param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType] `json:"relationship_types,required"`
	// The child legal entity.
	ChildLegalEntity param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity] `json:"child_legal_entity"`
	// The ID of the child legal entity.
	ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
	// The child entity's ownership percentage iff they are a beneficial owner.
	OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
	// The job title of the child entity at the parent entity.
	Title param.Field[string] `json:"title"`
}

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociation) MarshalJSON added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity struct {
	// A list of addresses for the entity.
	Addresses param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The type of legal entity.
	LegalEntityType param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
	// The business's legal structure.
	LegalStructure param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                                                                             `json:"metadata"`
	PhoneNumbers param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

The child legal entity.

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity) MarshalJSON added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                                                                 `json:"line2"`
}

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress) MarshalJSON added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType string
const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeBusiness    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "business"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeMailing     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "mailing"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeOther       ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "other"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypePoBox       ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "po_box"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeResidential ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "residential"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification) MarshalJSON added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType string

The type of ID number.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuil    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuil"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuit    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuit"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCnpj    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cnpj"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCpf     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cpf"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRut     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "cl_rut"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoCedulas ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_cedulas"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoNit     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_nit"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnID      ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_id"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnRtn     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_rtn"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeInLei     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "in_lei"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrBrn     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_brn"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrCrn     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_crn"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrRrn     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_rrn"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypePassport  ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "passport"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaTin     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_tin"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaVat     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_vat"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsEin     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ein"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsItin    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_itin"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsSsn     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ssn"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeVnTin     ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "vn_tin"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType string

The type of legal entity.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityTypeBusiness   ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType = "business"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityTypeIndividual ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType = "individual"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure string

The business's legal structure.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureCorporation        ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "corporation"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureLlc                ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "llc"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureNonProfit          ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "non_profit"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructurePartnership        ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "partnership"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureSoleProprietorship ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "sole_proprietorship"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureTrust              ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "trust"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber) MarshalJSON added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating added in v2.14.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingLow    ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "low"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingMedium ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "medium"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingHigh   ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "high"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating) IsKnown added in v2.14.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType string

A list of relationship types for how the child entity relates to parent entity.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipTypeBeneficialOwner ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType = "beneficial_owner"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipTypeControlPerson   ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType = "control_person"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityAssociationsRelationshipType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityType added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityLegalEntityType string

The type of legal entity.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityTypeBusiness   ConnectionLegalEntityNewParamsLegalEntityLegalEntityType = "business"
	ConnectionLegalEntityNewParamsLegalEntityLegalEntityTypeIndividual ConnectionLegalEntityNewParamsLegalEntityLegalEntityType = "individual"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalEntityType) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityLegalStructure added in v2.9.0

type ConnectionLegalEntityNewParamsLegalEntityLegalStructure string

The business's legal structure.

const (
	ConnectionLegalEntityNewParamsLegalEntityLegalStructureCorporation        ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "corporation"
	ConnectionLegalEntityNewParamsLegalEntityLegalStructureLlc                ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "llc"
	ConnectionLegalEntityNewParamsLegalEntityLegalStructureNonProfit          ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "non_profit"
	ConnectionLegalEntityNewParamsLegalEntityLegalStructurePartnership        ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "partnership"
	ConnectionLegalEntityNewParamsLegalEntityLegalStructureSoleProprietorship ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "sole_proprietorship"
	ConnectionLegalEntityNewParamsLegalEntityLegalStructureTrust              ConnectionLegalEntityNewParamsLegalEntityLegalStructure = "trust"
)

func (ConnectionLegalEntityNewParamsLegalEntityLegalStructure) IsKnown added in v2.10.0

type ConnectionLegalEntityNewParamsLegalEntityPhoneNumber added in v2.8.0

type ConnectionLegalEntityNewParamsLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (ConnectionLegalEntityNewParamsLegalEntityPhoneNumber) MarshalJSON added in v2.8.0

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

type ConnectionLegalEntityNewParamsLegalEntityRiskRating added in v2.14.0

type ConnectionLegalEntityNewParamsLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	ConnectionLegalEntityNewParamsLegalEntityRiskRatingLow    ConnectionLegalEntityNewParamsLegalEntityRiskRating = "low"
	ConnectionLegalEntityNewParamsLegalEntityRiskRatingMedium ConnectionLegalEntityNewParamsLegalEntityRiskRating = "medium"
	ConnectionLegalEntityNewParamsLegalEntityRiskRatingHigh   ConnectionLegalEntityNewParamsLegalEntityRiskRating = "high"
)

func (ConnectionLegalEntityNewParamsLegalEntityRiskRating) IsKnown added in v2.14.0

type ConnectionLegalEntityService added in v2.8.0

type ConnectionLegalEntityService struct {
	Options []option.RequestOption
}

ConnectionLegalEntityService contains methods and other services that help with interacting with the Modern Treasury 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 NewConnectionLegalEntityService method instead.

func NewConnectionLegalEntityService added in v2.8.0

func NewConnectionLegalEntityService(opts ...option.RequestOption) (r *ConnectionLegalEntityService)

NewConnectionLegalEntityService 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 (*ConnectionLegalEntityService) Get added in v2.8.0

Get details on a single connection legal entity.

func (*ConnectionLegalEntityService) List added in v2.8.0

Get a list of all connection legal entities.

func (*ConnectionLegalEntityService) ListAutoPaging added in v2.8.0

Get a list of all connection legal entities.

func (*ConnectionLegalEntityService) New added in v2.8.0

Create a connection legal entity.

func (*ConnectionLegalEntityService) Update added in v2.8.0

Update a connection legal entity.

type ConnectionLegalEntityStatus added in v2.8.0

type ConnectionLegalEntityStatus string

The status of the connection legal entity.

const (
	ConnectionLegalEntityStatusCompleted  ConnectionLegalEntityStatus = "completed"
	ConnectionLegalEntityStatusDenied     ConnectionLegalEntityStatus = "denied"
	ConnectionLegalEntityStatusFailed     ConnectionLegalEntityStatus = "failed"
	ConnectionLegalEntityStatusProcessing ConnectionLegalEntityStatus = "processing"
)

func (ConnectionLegalEntityStatus) IsKnown added in v2.10.0

func (r ConnectionLegalEntityStatus) IsKnown() bool

type ConnectionLegalEntityUpdateParams added in v2.8.0

type ConnectionLegalEntityUpdateParams struct {
	// The status of the connection legal entity.
	Status param.Field[ConnectionLegalEntityUpdateParamsStatus] `json:"status"`
}

func (ConnectionLegalEntityUpdateParams) MarshalJSON added in v2.8.0

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

type ConnectionLegalEntityUpdateParamsStatus added in v2.8.0

type ConnectionLegalEntityUpdateParamsStatus string

The status of the connection legal entity.

const (
	ConnectionLegalEntityUpdateParamsStatusProcessing ConnectionLegalEntityUpdateParamsStatus = "processing"
)

func (ConnectionLegalEntityUpdateParamsStatus) IsKnown added in v2.10.0

type ConnectionListParams

type ConnectionListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// A string code representing the vendor (i.e. bank).
	Entity  param.Field[string] `query:"entity"`
	PerPage param.Field[int64]  `query:"per_page"`
	// An identifier assigned by the vendor to your organization.
	VendorCustomerID param.Field[string] `query:"vendor_customer_id"`
}

func (ConnectionListParams) URLQuery

func (r ConnectionListParams) URLQuery() (v url.Values)

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

type ConnectionService

type ConnectionService struct {
	Options []option.RequestOption
}

ConnectionService contains methods and other services that help with interacting with the Modern Treasury 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 NewConnectionService method instead.

func NewConnectionService

func NewConnectionService(opts ...option.RequestOption) (r *ConnectionService)

NewConnectionService 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 (*ConnectionService) List

Get a list of all connections.

func (*ConnectionService) ListAutoPaging

Get a list of all connections.

type Counterparty

type Counterparty struct {
	ID string `json:"id,required" format:"uuid"`
	// The accounts for this counterparty.
	Accounts    []CounterpartyAccount `json:"accounts,required"`
	CreatedAt   time.Time             `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time             `json:"discarded_at,required,nullable" format:"date-time"`
	// The counterparty's email.
	Email string `json:"email,required,nullable" format:"email"`
	// The id of the legal entity.
	LegalEntityID string `json:"legal_entity_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// A human friendly name for this counterparty.
	Name   string `json:"name,required,nullable"`
	Object string `json:"object,required"`
	// Send an email to the counterparty whenever an associated payment order is sent
	// to the bank.
	SendRemittanceAdvice bool      `json:"send_remittance_advice,required"`
	UpdatedAt            time.Time `json:"updated_at,required" format:"date-time"`
	// The verification status of the counterparty.
	VerificationStatus CounterpartyVerificationStatus `json:"verification_status,required"`
	JSON               counterpartyJSON               `json:"-"`
}

func (*Counterparty) UnmarshalJSON

func (r *Counterparty) UnmarshalJSON(data []byte) (err error)

type CounterpartyAccount

type CounterpartyAccount struct {
	ID             string          `json:"id" format:"uuid"`
	AccountDetails []AccountDetail `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    ExternalAccountType                 `json:"account_type"`
	ContactDetails []CounterpartyAccountsContactDetail `json:"contact_details"`
	CreatedAt      time.Time                           `json:"created_at" format:"date-time"`
	DiscardedAt    time.Time                           `json:"discarded_at,nullable" format:"date-time"`
	// If the external account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID string `json:"ledger_account_id,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name   string `json:"name,nullable"`
	Object string `json:"object"`
	// The address associated with the owner or `null`.
	PartyAddress CounterpartyAccountsPartyAddress `json:"party_address,nullable"`
	// The legal name of the entity which owns the account.
	PartyName string `json:"party_name"`
	// Either `individual` or `business`.
	PartyType          CounterpartyAccountsPartyType          `json:"party_type,nullable"`
	RoutingDetails     []RoutingDetail                        `json:"routing_details"`
	UpdatedAt          time.Time                              `json:"updated_at" format:"date-time"`
	VerificationSource CounterpartyAccountsVerificationSource `json:"verification_source,nullable"`
	VerificationStatus CounterpartyAccountsVerificationStatus `json:"verification_status"`
	JSON               counterpartyAccountJSON                `json:"-"`
}

func (*CounterpartyAccount) UnmarshalJSON

func (r *CounterpartyAccount) UnmarshalJSON(data []byte) (err error)

type CounterpartyAccountsContactDetail

type CounterpartyAccountsContactDetail struct {
	ID                    string                                                  `json:"id,required" format:"uuid"`
	ContactIdentifier     string                                                  `json:"contact_identifier,required"`
	ContactIdentifierType CounterpartyAccountsContactDetailsContactIdentifierType `json:"contact_identifier_type,required"`
	CreatedAt             time.Time                                               `json:"created_at,required" format:"date-time"`
	DiscardedAt           time.Time                                               `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                                  `json:"live_mode,required"`
	Object    string                                `json:"object,required"`
	UpdatedAt time.Time                             `json:"updated_at,required" format:"date-time"`
	JSON      counterpartyAccountsContactDetailJSON `json:"-"`
}

func (*CounterpartyAccountsContactDetail) UnmarshalJSON

func (r *CounterpartyAccountsContactDetail) UnmarshalJSON(data []byte) (err error)

type CounterpartyAccountsContactDetailsContactIdentifierType

type CounterpartyAccountsContactDetailsContactIdentifierType string
const (
	CounterpartyAccountsContactDetailsContactIdentifierTypeEmail       CounterpartyAccountsContactDetailsContactIdentifierType = "email"
	CounterpartyAccountsContactDetailsContactIdentifierTypePhoneNumber CounterpartyAccountsContactDetailsContactIdentifierType = "phone_number"
	CounterpartyAccountsContactDetailsContactIdentifierTypeWebsite     CounterpartyAccountsContactDetailsContactIdentifierType = "website"
)

func (CounterpartyAccountsContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type CounterpartyAccountsPartyAddress

type CounterpartyAccountsPartyAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country   string    `json:"country,required,nullable"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	Line1     string    `json:"line1,required,nullable"`
	Line2     string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                               `json:"region,required,nullable"`
	UpdatedAt time.Time                            `json:"updated_at,required" format:"date-time"`
	JSON      counterpartyAccountsPartyAddressJSON `json:"-"`
}

The address associated with the owner or `null`.

func (*CounterpartyAccountsPartyAddress) UnmarshalJSON

func (r *CounterpartyAccountsPartyAddress) UnmarshalJSON(data []byte) (err error)

type CounterpartyAccountsPartyType

type CounterpartyAccountsPartyType string

Either `individual` or `business`.

const (
	CounterpartyAccountsPartyTypeBusiness   CounterpartyAccountsPartyType = "business"
	CounterpartyAccountsPartyTypeIndividual CounterpartyAccountsPartyType = "individual"
)

func (CounterpartyAccountsPartyType) IsKnown added in v2.10.0

func (r CounterpartyAccountsPartyType) IsKnown() bool

type CounterpartyAccountsVerificationSource added in v2.15.0

type CounterpartyAccountsVerificationSource string
const (
	CounterpartyAccountsVerificationSourceACHPrenote    CounterpartyAccountsVerificationSource = "ach_prenote"
	CounterpartyAccountsVerificationSourceMicrodeposits CounterpartyAccountsVerificationSource = "microdeposits"
	CounterpartyAccountsVerificationSourcePlaid         CounterpartyAccountsVerificationSource = "plaid"
)

func (CounterpartyAccountsVerificationSource) IsKnown added in v2.15.0

type CounterpartyAccountsVerificationStatus

type CounterpartyAccountsVerificationStatus string
const (
	CounterpartyAccountsVerificationStatusPendingVerification CounterpartyAccountsVerificationStatus = "pending_verification"
	CounterpartyAccountsVerificationStatusUnverified          CounterpartyAccountsVerificationStatus = "unverified"
	CounterpartyAccountsVerificationStatusVerified            CounterpartyAccountsVerificationStatus = "verified"
)

func (CounterpartyAccountsVerificationStatus) IsKnown added in v2.10.0

type CounterpartyCollectAccountParams

type CounterpartyCollectAccountParams struct {
	// One of `credit` or `debit`. Use `credit` when you want to pay a counterparty.
	// Use `debit` when you need to charge a counterparty. This field helps us send a
	// more tailored email to your counterparties."
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The URL you want your customer to visit upon filling out the form. By default,
	// they will be sent to a Modern Treasury landing page. This must be a valid HTTPS
	// URL if set.
	CustomRedirect param.Field[string] `json:"custom_redirect" format:"uri"`
	// The list of fields you want on the form. This field is optional and if it is not
	// set, will default to [\"nameOnAccount\", \"accountType\", \"accountNumber\",
	// \"routingNumber\", \"address\"]. The full list of options is [\"name\",
	// \"nameOnAccount\", \"taxpayerIdentifier\", \"accountType\", \"accountNumber\",
	// \"routingNumber\", \"address\", \"ibanNumber\", \"swiftCode\"].
	Fields param.Field[[]CounterpartyCollectAccountParamsField] `json:"fields"`
	// By default, Modern Treasury will send an email to your counterparty that
	// includes a link to the form they must fill out. However, if you would like to
	// send the counterparty the link, you can set this parameter to `false`. The JSON
	// body will include the link to the secure Modern Treasury form.
	SendEmail param.Field[bool] `json:"send_email"`
}

func (CounterpartyCollectAccountParams) MarshalJSON

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

type CounterpartyCollectAccountParamsField

type CounterpartyCollectAccountParamsField string
const (
	CounterpartyCollectAccountParamsFieldName                    CounterpartyCollectAccountParamsField = "name"
	CounterpartyCollectAccountParamsFieldNameOnAccount           CounterpartyCollectAccountParamsField = "nameOnAccount"
	CounterpartyCollectAccountParamsFieldTaxpayerIdentifier      CounterpartyCollectAccountParamsField = "taxpayerIdentifier"
	CounterpartyCollectAccountParamsFieldAccountType             CounterpartyCollectAccountParamsField = "accountType"
	CounterpartyCollectAccountParamsFieldAccountNumber           CounterpartyCollectAccountParamsField = "accountNumber"
	CounterpartyCollectAccountParamsFieldIbanNumber              CounterpartyCollectAccountParamsField = "ibanNumber"
	CounterpartyCollectAccountParamsFieldClabeNumber             CounterpartyCollectAccountParamsField = "clabeNumber"
	CounterpartyCollectAccountParamsFieldWalletAddress           CounterpartyCollectAccountParamsField = "walletAddress"
	CounterpartyCollectAccountParamsFieldPanNumber               CounterpartyCollectAccountParamsField = "panNumber"
	CounterpartyCollectAccountParamsFieldRoutingNumber           CounterpartyCollectAccountParamsField = "routingNumber"
	CounterpartyCollectAccountParamsFieldAbaWireRoutingNumber    CounterpartyCollectAccountParamsField = "abaWireRoutingNumber"
	CounterpartyCollectAccountParamsFieldSwiftCode               CounterpartyCollectAccountParamsField = "swiftCode"
	CounterpartyCollectAccountParamsFieldAuBsb                   CounterpartyCollectAccountParamsField = "auBsb"
	CounterpartyCollectAccountParamsFieldCaCpa                   CounterpartyCollectAccountParamsField = "caCpa"
	CounterpartyCollectAccountParamsFieldCnaps                   CounterpartyCollectAccountParamsField = "cnaps"
	CounterpartyCollectAccountParamsFieldGBSortCode              CounterpartyCollectAccountParamsField = "gbSortCode"
	CounterpartyCollectAccountParamsFieldInIfsc                  CounterpartyCollectAccountParamsField = "inIfsc"
	CounterpartyCollectAccountParamsFieldMyBranchCode            CounterpartyCollectAccountParamsField = "myBranchCode"
	CounterpartyCollectAccountParamsFieldBrCodigo                CounterpartyCollectAccountParamsField = "brCodigo"
	CounterpartyCollectAccountParamsFieldRoutingNumberType       CounterpartyCollectAccountParamsField = "routingNumberType"
	CounterpartyCollectAccountParamsFieldAddress                 CounterpartyCollectAccountParamsField = "address"
	CounterpartyCollectAccountParamsFieldJpZenginCode            CounterpartyCollectAccountParamsField = "jpZenginCode"
	CounterpartyCollectAccountParamsFieldSeBankgiroClearingCode  CounterpartyCollectAccountParamsField = "seBankgiroClearingCode"
	CounterpartyCollectAccountParamsFieldNzNationalClearingCode  CounterpartyCollectAccountParamsField = "nzNationalClearingCode"
	CounterpartyCollectAccountParamsFieldHkInterbankClearingCode CounterpartyCollectAccountParamsField = "hkInterbankClearingCode"
	CounterpartyCollectAccountParamsFieldHuInterbankClearingCode CounterpartyCollectAccountParamsField = "huInterbankClearingCode"
	CounterpartyCollectAccountParamsFieldDkInterbankClearingCode CounterpartyCollectAccountParamsField = "dkInterbankClearingCode"
	CounterpartyCollectAccountParamsFieldIDSknbiCode             CounterpartyCollectAccountParamsField = "idSknbiCode"
)

func (CounterpartyCollectAccountParamsField) IsKnown added in v2.10.0

type CounterpartyCollectAccountResponse

type CounterpartyCollectAccountResponse struct {
	// The id of the existing counterparty.
	ID string `json:"id,required"`
	// This is the link to the secure Modern Treasury form. By default, Modern Treasury
	// will send an email to your counterparty that includes a link to this form.
	// However, if `send_email` is passed as `false` in the body then Modern Treasury
	// will not send the email and you can send it to the counterparty directly.
	FormLink string `json:"form_link,required" format:"uri"`
	// This field will be `true` if an email requesting account details has already
	// been sent to this counterparty.
	IsResend bool                                   `json:"is_resend,required"`
	JSON     counterpartyCollectAccountResponseJSON `json:"-"`
}

func (*CounterpartyCollectAccountResponse) UnmarshalJSON

func (r *CounterpartyCollectAccountResponse) UnmarshalJSON(data []byte) (err error)

type CounterpartyListParams

type CounterpartyListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Used to return counterparties created after some datetime.
	CreatedAtLowerBound param.Field[time.Time] `query:"created_at_lower_bound" format:"date-time"`
	// Used to return counterparties created before some datetime.
	CreatedAtUpperBound param.Field[time.Time] `query:"created_at_upper_bound" format:"date-time"`
	// Performs a partial string match of the email field. This is also case
	// insensitive.
	Email param.Field[string] `query:"email" format:"email"`
	// Filters for counterparties with the given legal entity ID.
	LegalEntityID param.Field[string] `query:"legal_entity_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// Performs a partial string match of the name field. This is also case
	// insensitive.
	Name    param.Field[string] `query:"name"`
	PerPage param.Field[int64]  `query:"per_page"`
}

func (CounterpartyListParams) URLQuery

func (r CounterpartyListParams) URLQuery() (v url.Values)

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

type CounterpartyNewParams

type CounterpartyNewParams struct {
	// A human friendly name for this counterparty.
	Name       param.Field[string]                          `json:"name,required"`
	Accounting param.Field[CounterpartyNewParamsAccounting] `json:"accounting"`
	// The accounts for this counterparty.
	Accounts param.Field[[]CounterpartyNewParamsAccount] `json:"accounts"`
	// The counterparty's email.
	Email param.Field[string] `json:"email" format:"email"`
	// An optional type to auto-sync the counterparty to your ledger. Either `customer`
	// or `vendor`.
	LedgerType  param.Field[CounterpartyNewParamsLedgerType]  `json:"ledger_type"`
	LegalEntity param.Field[CounterpartyNewParamsLegalEntity] `json:"legal_entity"`
	// The id of the legal entity.
	LegalEntityID param.Field[string] `json:"legal_entity_id" format:"uuid"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Send an email to the counterparty whenever an associated payment order is sent
	// to the bank.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// Either a valid SSN or EIN.
	TaxpayerIdentifier param.Field[string] `json:"taxpayer_identifier"`
	// The verification status of the counterparty.
	VerificationStatus param.Field[CounterpartyNewParamsVerificationStatus] `json:"verification_status"`
}

func (CounterpartyNewParams) MarshalJSON

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

type CounterpartyNewParamsAccount

type CounterpartyNewParamsAccount struct {
	AccountDetails param.Field[[]CounterpartyNewParamsAccountsAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                          `json:"account_type"`
	ContactDetails param.Field[[]CounterpartyNewParamsAccountsContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[CounterpartyNewParamsAccountsLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[CounterpartyNewParamsAccountsPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                    `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[CounterpartyNewParamsAccountsPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                       `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]CounterpartyNewParamsAccountsRoutingDetail] `json:"routing_details"`
}

func (CounterpartyNewParamsAccount) MarshalJSON

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

type CounterpartyNewParamsAccounting

type CounterpartyNewParamsAccounting struct {
	// An optional type to auto-sync the counterparty to your ledger. Either `customer`
	// or `vendor`.
	Type param.Field[CounterpartyNewParamsAccountingType] `json:"type"`
}

func (CounterpartyNewParamsAccounting) MarshalJSON

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

type CounterpartyNewParamsAccountingType

type CounterpartyNewParamsAccountingType string

An optional type to auto-sync the counterparty to your ledger. Either `customer` or `vendor`.

const (
	CounterpartyNewParamsAccountingTypeCustomer CounterpartyNewParamsAccountingType = "customer"
	CounterpartyNewParamsAccountingTypeVendor   CounterpartyNewParamsAccountingType = "vendor"
)

func (CounterpartyNewParamsAccountingType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsAccountDetail

type CounterpartyNewParamsAccountsAccountDetail struct {
	AccountNumber     param.Field[string]                                                       `json:"account_number,required"`
	AccountNumberType param.Field[CounterpartyNewParamsAccountsAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (CounterpartyNewParamsAccountsAccountDetail) MarshalJSON

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

type CounterpartyNewParamsAccountsAccountDetailsAccountNumberType

type CounterpartyNewParamsAccountsAccountDetailsAccountNumberType string
const (
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeAuNumber      CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "au_number"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeClabe         CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "clabe"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeHkNumber      CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "hk_number"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeIban          CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "iban"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeIDNumber      CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "id_number"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeNzNumber      CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "nz_number"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeOther         CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "other"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypePan           CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "pan"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeSgNumber      CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "sg_number"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeWalletAddress CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "wallet_address"
)

func (CounterpartyNewParamsAccountsAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsContactDetail

type CounterpartyNewParamsAccountsContactDetail struct {
	ContactIdentifier     param.Field[string]                                                           `json:"contact_identifier"`
	ContactIdentifierType param.Field[CounterpartyNewParamsAccountsContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (CounterpartyNewParamsAccountsContactDetail) MarshalJSON

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

type CounterpartyNewParamsAccountsContactDetailsContactIdentifierType

type CounterpartyNewParamsAccountsContactDetailsContactIdentifierType string
const (
	CounterpartyNewParamsAccountsContactDetailsContactIdentifierTypeEmail       CounterpartyNewParamsAccountsContactDetailsContactIdentifierType = "email"
	CounterpartyNewParamsAccountsContactDetailsContactIdentifierTypePhoneNumber CounterpartyNewParamsAccountsContactDetailsContactIdentifierType = "phone_number"
	CounterpartyNewParamsAccountsContactDetailsContactIdentifierTypeWebsite     CounterpartyNewParamsAccountsContactDetailsContactIdentifierType = "website"
)

func (CounterpartyNewParamsAccountsContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsLedgerAccount

type CounterpartyNewParamsAccountsLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[CounterpartyNewParamsAccountsLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (CounterpartyNewParamsAccountsLedgerAccount) MarshalJSON

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

type CounterpartyNewParamsAccountsLedgerAccountLedgerableType

type CounterpartyNewParamsAccountsLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeCounterparty    CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "counterparty"
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeExternalAccount CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "external_account"
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeInternalAccount CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "internal_account"
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeVirtualAccount  CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "virtual_account"
)

func (CounterpartyNewParamsAccountsLedgerAccountLedgerableType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsPartyAddress

type CounterpartyNewParamsAccountsPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (CounterpartyNewParamsAccountsPartyAddress) MarshalJSON

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

type CounterpartyNewParamsAccountsPartyType

type CounterpartyNewParamsAccountsPartyType string

Either `individual` or `business`.

const (
	CounterpartyNewParamsAccountsPartyTypeBusiness   CounterpartyNewParamsAccountsPartyType = "business"
	CounterpartyNewParamsAccountsPartyTypeIndividual CounterpartyNewParamsAccountsPartyType = "individual"
)

func (CounterpartyNewParamsAccountsPartyType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsRoutingDetail

type CounterpartyNewParamsAccountsRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                       `json:"routing_number,required"`
	RoutingNumberType param.Field[CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[CounterpartyNewParamsAccountsRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (CounterpartyNewParamsAccountsRoutingDetail) MarshalJSON

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

type CounterpartyNewParamsAccountsRoutingDetailsPaymentType

type CounterpartyNewParamsAccountsRoutingDetailsPaymentType string
const (
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeACH         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "ach"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeAuBecs      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "au_becs"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeBacs        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "bacs"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeBook        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "book"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeCard        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "card"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeChats       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "chats"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeCheck       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "check"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeCrossBorder CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "cross_border"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeDkNets      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "dk_nets"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeEft         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "eft"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeHuIcs       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "hu_ics"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeInterac     CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "interac"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeMasav       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "masav"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeMxCcen      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "mx_ccen"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNeft        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "neft"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNics        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "nics"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNzBecs      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "nz_becs"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypePlElixir    CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "pl_elixir"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeProvxchange CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "provxchange"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeRoSent      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "ro_sent"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeRtp         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "rtp"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSeBankgirot CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "se_bankgirot"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSen         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sen"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSepa        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sepa"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSgGiro      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sg_giro"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSic         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sic"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSignet      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "signet"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSknbi       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sknbi"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeWire        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "wire"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeZengin      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "zengin"
)

func (CounterpartyNewParamsAccountsRoutingDetailsPaymentType) IsKnown added in v2.10.0

type CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType

type CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType string
const (
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeAba                     CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "aba"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeAuBsb                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "au_bsb"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeBrCodigo                CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "br_codigo"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeCaCpa                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "ca_cpa"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeChips                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "chips"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeCnaps                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "cnaps"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeDkInterbankClearingCode CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeGBSortCode              CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "gb_sort_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeHkInterbankClearingCode CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeHuInterbankClearingCode CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeIDSknbiCode             CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "id_sknbi_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeInIfsc                  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "in_ifsc"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeJpZenginCode            CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "jp_zengin_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeMyBranchCode            CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "my_branch_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeMxBankIdentifier        CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypePlNationalClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeSwift                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "swift"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeZaNationalClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type CounterpartyNewParamsLedgerType

type CounterpartyNewParamsLedgerType string

An optional type to auto-sync the counterparty to your ledger. Either `customer` or `vendor`.

const (
	CounterpartyNewParamsLedgerTypeCustomer CounterpartyNewParamsLedgerType = "customer"
	CounterpartyNewParamsLedgerTypeVendor   CounterpartyNewParamsLedgerType = "vendor"
)

func (CounterpartyNewParamsLedgerType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntity added in v2.8.0

type CounterpartyNewParamsLegalEntity struct {
	// The type of legal entity.
	LegalEntityType param.Field[CounterpartyNewParamsLegalEntityLegalEntityType] `json:"legal_entity_type,required"`
	// A list of addresses for the entity.
	Addresses param.Field[[]CounterpartyNewParamsLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]CounterpartyNewParamsLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The legal entity associations and its child legal entities.
	LegalEntityAssociations param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociation] `json:"legal_entity_associations"`
	// The business's legal structure.
	LegalStructure param.Field[CounterpartyNewParamsLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                             `json:"metadata"`
	PhoneNumbers param.Field[[]CounterpartyNewParamsLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[CounterpartyNewParamsLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

func (CounterpartyNewParamsLegalEntity) MarshalJSON added in v2.8.0

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

type CounterpartyNewParamsLegalEntityAddress added in v2.8.0

type CounterpartyNewParamsLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]CounterpartyNewParamsLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                 `json:"line2"`
}

func (CounterpartyNewParamsLegalEntityAddress) MarshalJSON added in v2.8.0

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

type CounterpartyNewParamsLegalEntityAddressesAddressType added in v2.9.0

type CounterpartyNewParamsLegalEntityAddressesAddressType string
const (
	CounterpartyNewParamsLegalEntityAddressesAddressTypeBusiness    CounterpartyNewParamsLegalEntityAddressesAddressType = "business"
	CounterpartyNewParamsLegalEntityAddressesAddressTypeMailing     CounterpartyNewParamsLegalEntityAddressesAddressType = "mailing"
	CounterpartyNewParamsLegalEntityAddressesAddressTypeOther       CounterpartyNewParamsLegalEntityAddressesAddressType = "other"
	CounterpartyNewParamsLegalEntityAddressesAddressTypePoBox       CounterpartyNewParamsLegalEntityAddressesAddressType = "po_box"
	CounterpartyNewParamsLegalEntityAddressesAddressTypeResidential CounterpartyNewParamsLegalEntityAddressesAddressType = "residential"
)

func (CounterpartyNewParamsLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityIdentification added in v2.8.0

type CounterpartyNewParamsLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[CounterpartyNewParamsLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (CounterpartyNewParamsLegalEntityIdentification) MarshalJSON added in v2.8.0

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

type CounterpartyNewParamsLegalEntityIdentificationsIDType added in v2.8.0

type CounterpartyNewParamsLegalEntityIdentificationsIDType string

The type of ID number.

const (
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeArCuil    CounterpartyNewParamsLegalEntityIdentificationsIDType = "ar_cuil"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeArCuit    CounterpartyNewParamsLegalEntityIdentificationsIDType = "ar_cuit"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeBrCnpj    CounterpartyNewParamsLegalEntityIdentificationsIDType = "br_cnpj"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeBrCpf     CounterpartyNewParamsLegalEntityIdentificationsIDType = "br_cpf"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeClRut     CounterpartyNewParamsLegalEntityIdentificationsIDType = "cl_rut"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeCoCedulas CounterpartyNewParamsLegalEntityIdentificationsIDType = "co_cedulas"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeCoNit     CounterpartyNewParamsLegalEntityIdentificationsIDType = "co_nit"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeHnID      CounterpartyNewParamsLegalEntityIdentificationsIDType = "hn_id"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeHnRtn     CounterpartyNewParamsLegalEntityIdentificationsIDType = "hn_rtn"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeInLei     CounterpartyNewParamsLegalEntityIdentificationsIDType = "in_lei"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeKrBrn     CounterpartyNewParamsLegalEntityIdentificationsIDType = "kr_brn"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeKrCrn     CounterpartyNewParamsLegalEntityIdentificationsIDType = "kr_crn"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeKrRrn     CounterpartyNewParamsLegalEntityIdentificationsIDType = "kr_rrn"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypePassport  CounterpartyNewParamsLegalEntityIdentificationsIDType = "passport"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeSaTin     CounterpartyNewParamsLegalEntityIdentificationsIDType = "sa_tin"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeSaVat     CounterpartyNewParamsLegalEntityIdentificationsIDType = "sa_vat"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeUsEin     CounterpartyNewParamsLegalEntityIdentificationsIDType = "us_ein"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeUsItin    CounterpartyNewParamsLegalEntityIdentificationsIDType = "us_itin"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeUsSsn     CounterpartyNewParamsLegalEntityIdentificationsIDType = "us_ssn"
	CounterpartyNewParamsLegalEntityIdentificationsIDTypeVnTin     CounterpartyNewParamsLegalEntityIdentificationsIDType = "vn_tin"
)

func (CounterpartyNewParamsLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociation added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociation struct {
	RelationshipTypes param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType] `json:"relationship_types,required"`
	// The child legal entity.
	ChildLegalEntity param.Field[CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity] `json:"child_legal_entity"`
	// The ID of the child legal entity.
	ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
	// The child entity's ownership percentage iff they are a beneficial owner.
	OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
	// The job title of the child entity at the parent entity.
	Title param.Field[string] `json:"title"`
}

func (CounterpartyNewParamsLegalEntityLegalEntityAssociation) MarshalJSON added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity struct {
	// A list of addresses for the entity.
	Addresses param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The type of legal entity.
	LegalEntityType param.Field[CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
	// The business's legal structure.
	LegalStructure param.Field[CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                                                                    `json:"metadata"`
	PhoneNumbers param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

The child legal entity.

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntity) MarshalJSON added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                                                        `json:"line2"`
}

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddress) MarshalJSON added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType string
const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeBusiness    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "business"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeMailing     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "mailing"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeOther       CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "other"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypePoBox       CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "po_box"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressTypeResidential CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType = "residential"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentification) MarshalJSON added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType string

The type of ID number.

const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuil    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuil"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuit    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuit"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCnpj    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cnpj"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCpf     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cpf"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRut     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "cl_rut"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoCedulas CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_cedulas"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoNit     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_nit"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnID      CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_id"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnRtn     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_rtn"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeInLei     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "in_lei"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrBrn     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_brn"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrCrn     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_crn"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrRrn     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_rrn"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypePassport  CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "passport"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaTin     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_tin"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaVat     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_vat"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsEin     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ein"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsItin    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_itin"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsSsn     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ssn"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeVnTin     CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "vn_tin"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType string

The type of legal entity.

const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityTypeBusiness   CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType = "business"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityTypeIndividual CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType = "individual"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalEntityType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure string

The business's legal structure.

const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureCorporation        CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "corporation"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureLlc                CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "llc"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureNonProfit          CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "non_profit"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructurePartnership        CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "partnership"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureSoleProprietorship CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "sole_proprietorship"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructureTrust              CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure = "trust"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityLegalStructure) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityPhoneNumber) MarshalJSON added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating added in v2.14.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingLow    CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "low"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingMedium CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "medium"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRatingHigh   CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating = "high"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsChildLegalEntityRiskRating) IsKnown added in v2.14.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType string

A list of relationship types for how the child entity relates to parent entity.

const (
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipTypeBeneficialOwner CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType = "beneficial_owner"
	CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipTypeControlPerson   CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType = "control_person"
)

func (CounterpartyNewParamsLegalEntityLegalEntityAssociationsRelationshipType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalEntityType added in v2.8.0

type CounterpartyNewParamsLegalEntityLegalEntityType string

The type of legal entity.

const (
	CounterpartyNewParamsLegalEntityLegalEntityTypeBusiness   CounterpartyNewParamsLegalEntityLegalEntityType = "business"
	CounterpartyNewParamsLegalEntityLegalEntityTypeIndividual CounterpartyNewParamsLegalEntityLegalEntityType = "individual"
)

func (CounterpartyNewParamsLegalEntityLegalEntityType) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityLegalStructure added in v2.9.0

type CounterpartyNewParamsLegalEntityLegalStructure string

The business's legal structure.

const (
	CounterpartyNewParamsLegalEntityLegalStructureCorporation        CounterpartyNewParamsLegalEntityLegalStructure = "corporation"
	CounterpartyNewParamsLegalEntityLegalStructureLlc                CounterpartyNewParamsLegalEntityLegalStructure = "llc"
	CounterpartyNewParamsLegalEntityLegalStructureNonProfit          CounterpartyNewParamsLegalEntityLegalStructure = "non_profit"
	CounterpartyNewParamsLegalEntityLegalStructurePartnership        CounterpartyNewParamsLegalEntityLegalStructure = "partnership"
	CounterpartyNewParamsLegalEntityLegalStructureSoleProprietorship CounterpartyNewParamsLegalEntityLegalStructure = "sole_proprietorship"
	CounterpartyNewParamsLegalEntityLegalStructureTrust              CounterpartyNewParamsLegalEntityLegalStructure = "trust"
)

func (CounterpartyNewParamsLegalEntityLegalStructure) IsKnown added in v2.10.0

type CounterpartyNewParamsLegalEntityPhoneNumber added in v2.8.0

type CounterpartyNewParamsLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (CounterpartyNewParamsLegalEntityPhoneNumber) MarshalJSON added in v2.8.0

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

type CounterpartyNewParamsLegalEntityRiskRating added in v2.14.0

type CounterpartyNewParamsLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	CounterpartyNewParamsLegalEntityRiskRatingLow    CounterpartyNewParamsLegalEntityRiskRating = "low"
	CounterpartyNewParamsLegalEntityRiskRatingMedium CounterpartyNewParamsLegalEntityRiskRating = "medium"
	CounterpartyNewParamsLegalEntityRiskRatingHigh   CounterpartyNewParamsLegalEntityRiskRating = "high"
)

func (CounterpartyNewParamsLegalEntityRiskRating) IsKnown added in v2.14.0

type CounterpartyNewParamsVerificationStatus

type CounterpartyNewParamsVerificationStatus string

The verification status of the counterparty.

const (
	CounterpartyNewParamsVerificationStatusDenied        CounterpartyNewParamsVerificationStatus = "denied"
	CounterpartyNewParamsVerificationStatusNeedsApproval CounterpartyNewParamsVerificationStatus = "needs_approval"
	CounterpartyNewParamsVerificationStatusUnverified    CounterpartyNewParamsVerificationStatus = "unverified"
	CounterpartyNewParamsVerificationStatusVerified      CounterpartyNewParamsVerificationStatus = "verified"
)

func (CounterpartyNewParamsVerificationStatus) IsKnown added in v2.10.0

type CounterpartyService

type CounterpartyService struct {
	Options []option.RequestOption
}

CounterpartyService contains methods and other services that help with interacting with the Modern Treasury 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 NewCounterpartyService method instead.

func NewCounterpartyService

func NewCounterpartyService(opts ...option.RequestOption) (r *CounterpartyService)

NewCounterpartyService 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 (*CounterpartyService) CollectAccount

Send an email requesting account details.

func (*CounterpartyService) Delete

func (r *CounterpartyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Deletes a given counterparty.

func (*CounterpartyService) Get

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

Get details on a single counterparty.

func (*CounterpartyService) List

Get a paginated list of all counterparties.

func (*CounterpartyService) ListAutoPaging

Get a paginated list of all counterparties.

func (*CounterpartyService) New

Create a new counterparty.

func (*CounterpartyService) Update

Updates a given counterparty with new information.

type CounterpartyUpdateParams

type CounterpartyUpdateParams struct {
	// A new email for the counterparty.
	Email param.Field[string] `json:"email" format:"email"`
	// The id of the legal entity.
	LegalEntityID param.Field[string] `json:"legal_entity_id" format:"uuid"`
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A new name for the counterparty. Will only update if passed.
	Name param.Field[string] `json:"name"`
	// If this is `true`, Modern Treasury will send an email to the counterparty
	// whenever an associated payment order is sent to the bank.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// Either a valid SSN or EIN.
	TaxpayerIdentifier param.Field[string] `json:"taxpayer_identifier"`
}

func (CounterpartyUpdateParams) MarshalJSON

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

type CounterpartyVerificationStatus

type CounterpartyVerificationStatus string

The verification status of the counterparty.

const (
	CounterpartyVerificationStatusDenied        CounterpartyVerificationStatus = "denied"
	CounterpartyVerificationStatusNeedsApproval CounterpartyVerificationStatus = "needs_approval"
	CounterpartyVerificationStatusUnverified    CounterpartyVerificationStatus = "unverified"
	CounterpartyVerificationStatusVerified      CounterpartyVerificationStatus = "verified"
)

func (CounterpartyVerificationStatus) IsKnown added in v2.10.0

type Currency

type Currency = shared.Currency

Three-letter ISO currency code.

This is an alias to an internal type.

type Document

type Document struct {
	ID              string                   `json:"id,required" format:"uuid"`
	CreatedAt       time.Time                `json:"created_at,required" format:"date-time"`
	DiscardedAt     time.Time                `json:"discarded_at,required,nullable" format:"date-time"`
	DocumentDetails []DocumentDocumentDetail `json:"document_details,required"`
	// A category given to the document, can be `null`.
	DocumentType string `json:"document_type,required,nullable"`
	// The unique identifier for the associated object.
	DocumentableID string `json:"documentable_id,required" format:"uuid"`
	// The type of the associated object. Currently can be one of `payment_order`,
	// `transaction`, `paper_item`, `expected_payment`, `counterparty`, `organization`,
	// `case`, `internal_account`, `decision`, or `external_account`.
	DocumentableType DocumentDocumentableType `json:"documentable_type,required"`
	File             DocumentFile             `json:"file,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The source of the document. Can be `vendor`, `customer`, or `modern_treasury`.
	Source    string       `json:"source,required"`
	UpdatedAt time.Time    `json:"updated_at,required" format:"date-time"`
	JSON      documentJSON `json:"-"`
}

func (*Document) UnmarshalJSON

func (r *Document) UnmarshalJSON(data []byte) (err error)

type DocumentDocumentDetail

type DocumentDocumentDetail struct {
	ID                     string    `json:"id,required" format:"uuid"`
	CreatedAt              time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt            time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	DocumentIdentifier     string    `json:"document_identifier,required"`
	DocumentIdentifierType string    `json:"document_identifier_type,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                       `json:"live_mode,required"`
	Object    string                     `json:"object,required"`
	UpdatedAt time.Time                  `json:"updated_at,required" format:"date-time"`
	JSON      documentDocumentDetailJSON `json:"-"`
}

func (*DocumentDocumentDetail) UnmarshalJSON

func (r *DocumentDocumentDetail) UnmarshalJSON(data []byte) (err error)

type DocumentDocumentableType

type DocumentDocumentableType string

The type of the associated object. Currently can be one of `payment_order`, `transaction`, `paper_item`, `expected_payment`, `counterparty`, `organization`, `case`, `internal_account`, `decision`, or `external_account`.

const (
	DocumentDocumentableTypeCase                  DocumentDocumentableType = "case"
	DocumentDocumentableTypeCounterparty          DocumentDocumentableType = "counterparty"
	DocumentDocumentableTypeExpectedPayment       DocumentDocumentableType = "expected_payment"
	DocumentDocumentableTypeExternalAccount       DocumentDocumentableType = "external_account"
	DocumentDocumentableTypeIncomingPaymentDetail DocumentDocumentableType = "incoming_payment_detail"
	DocumentDocumentableTypeInternalAccount       DocumentDocumentableType = "internal_account"
	DocumentDocumentableTypeOrganization          DocumentDocumentableType = "organization"
	DocumentDocumentableTypePaperItem             DocumentDocumentableType = "paper_item"
	DocumentDocumentableTypePaymentOrder          DocumentDocumentableType = "payment_order"
	DocumentDocumentableTypeTransaction           DocumentDocumentableType = "transaction"
	DocumentDocumentableTypeDecision              DocumentDocumentableType = "decision"
	DocumentDocumentableTypeConnection            DocumentDocumentableType = "connection"
)

func (DocumentDocumentableType) IsKnown added in v2.10.0

func (r DocumentDocumentableType) IsKnown() bool

type DocumentFile

type DocumentFile struct {
	// The MIME content type of the document.
	ContentType string `json:"content_type"`
	// The original filename of the document.
	Filename string `json:"filename"`
	// The size of the document in bytes.
	Size int64            `json:"size"`
	JSON documentFileJSON `json:"-"`
}

func (*DocumentFile) UnmarshalJSON

func (r *DocumentFile) UnmarshalJSON(data []byte) (err error)

type DocumentListParams

type DocumentListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// The unique identifier for the associated object.
	DocumentableID param.Field[string] `query:"documentable_id"`
	// The type of the associated object. Currently can be one of `payment_order`,
	// `transaction`, `paper_item`, `expected_payment`, `counterparty`, `organization`,
	// `case`, `internal_account`, `decision`, or `external_account`.
	DocumentableType param.Field[DocumentListParamsDocumentableType] `query:"documentable_type"`
	PerPage          param.Field[int64]                              `query:"per_page"`
}

func (DocumentListParams) URLQuery

func (r DocumentListParams) URLQuery() (v url.Values)

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

type DocumentListParamsDocumentableType

type DocumentListParamsDocumentableType string

The type of the associated object. Currently can be one of `payment_order`, `transaction`, `paper_item`, `expected_payment`, `counterparty`, `organization`, `case`, `internal_account`, `decision`, or `external_account`.

const (
	DocumentListParamsDocumentableTypeCases                  DocumentListParamsDocumentableType = "cases"
	DocumentListParamsDocumentableTypeCounterparties         DocumentListParamsDocumentableType = "counterparties"
	DocumentListParamsDocumentableTypeExpectedPayments       DocumentListParamsDocumentableType = "expected_payments"
	DocumentListParamsDocumentableTypeExternalAccounts       DocumentListParamsDocumentableType = "external_accounts"
	DocumentListParamsDocumentableTypeIncomingPaymentDetails DocumentListParamsDocumentableType = "incoming_payment_details"
	DocumentListParamsDocumentableTypeInternalAccounts       DocumentListParamsDocumentableType = "internal_accounts"
	DocumentListParamsDocumentableTypeOrganizations          DocumentListParamsDocumentableType = "organizations"
	DocumentListParamsDocumentableTypePaperItems             DocumentListParamsDocumentableType = "paper_items"
	DocumentListParamsDocumentableTypePaymentOrders          DocumentListParamsDocumentableType = "payment_orders"
	DocumentListParamsDocumentableTypeTransactions           DocumentListParamsDocumentableType = "transactions"
	DocumentListParamsDocumentableTypeDecisions              DocumentListParamsDocumentableType = "decisions"
	DocumentListParamsDocumentableTypeConnections            DocumentListParamsDocumentableType = "connections"
)

func (DocumentListParamsDocumentableType) IsKnown added in v2.10.0

type DocumentNewParams

type DocumentNewParams struct {
	// The unique identifier for the associated object.
	DocumentableID   param.Field[string]                            `json:"documentable_id,required"`
	DocumentableType param.Field[DocumentNewParamsDocumentableType] `json:"documentable_type,required"`
	File             param.Field[io.Reader]                         `json:"file,required" format:"binary"`
	// A category given to the document, can be `null`.
	DocumentType param.Field[string] `json:"document_type"`
}

func (DocumentNewParams) MarshalMultipart

func (r DocumentNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type DocumentNewParamsDocumentableType

type DocumentNewParamsDocumentableType string
const (
	DocumentNewParamsDocumentableTypeCases                  DocumentNewParamsDocumentableType = "cases"
	DocumentNewParamsDocumentableTypeCounterparties         DocumentNewParamsDocumentableType = "counterparties"
	DocumentNewParamsDocumentableTypeExpectedPayments       DocumentNewParamsDocumentableType = "expected_payments"
	DocumentNewParamsDocumentableTypeExternalAccounts       DocumentNewParamsDocumentableType = "external_accounts"
	DocumentNewParamsDocumentableTypeIncomingPaymentDetails DocumentNewParamsDocumentableType = "incoming_payment_details"
	DocumentNewParamsDocumentableTypeInternalAccounts       DocumentNewParamsDocumentableType = "internal_accounts"
	DocumentNewParamsDocumentableTypeOrganizations          DocumentNewParamsDocumentableType = "organizations"
	DocumentNewParamsDocumentableTypePaperItems             DocumentNewParamsDocumentableType = "paper_items"
	DocumentNewParamsDocumentableTypePaymentOrders          DocumentNewParamsDocumentableType = "payment_orders"
	DocumentNewParamsDocumentableTypeTransactions           DocumentNewParamsDocumentableType = "transactions"
	DocumentNewParamsDocumentableTypeDecisions              DocumentNewParamsDocumentableType = "decisions"
	DocumentNewParamsDocumentableTypeConnections            DocumentNewParamsDocumentableType = "connections"
)

func (DocumentNewParamsDocumentableType) IsKnown added in v2.10.0

type DocumentService

type DocumentService struct {
	Options []option.RequestOption
}

DocumentService contains methods and other services that help with interacting with the Modern Treasury 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 NewDocumentService method instead.

func NewDocumentService

func NewDocumentService(opts ...option.RequestOption) (r *DocumentService)

NewDocumentService 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 (*DocumentService) Get

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

Get an existing document.

func (*DocumentService) List

Get a list of documents.

func (*DocumentService) ListAutoPaging

Get a list of documents.

func (*DocumentService) New

func (r *DocumentService) New(ctx context.Context, body DocumentNewParams, opts ...option.RequestOption) (res *Document, err error)

Create a document.

type Error

type Error = apierror.Error

type Event

type Event struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The body of the event.
	Data map[string]interface{} `json:"data,required"`
	// The ID of the entity for the event.
	EntityID string `json:"entity_id,required" format:"uuid"`
	// The name of the event.
	EventName string `json:"event_name,required"`
	// The time of the event.
	EventTime time.Time `json:"event_time,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The type of resource for the event.
	Resource  string    `json:"resource,required"`
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	JSON      eventJSON `json:"-"`
}

func (*Event) UnmarshalJSON

func (r *Event) UnmarshalJSON(data []byte) (err error)

type EventListParams

type EventListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	EntityID    param.Field[string] `query:"entity_id"`
	EventName   param.Field[string] `query:"event_name"`
	// An inclusive upper bound for when the event occurred
	EventTimeEnd param.Field[time.Time] `query:"event_time_end" format:"date-time"`
	// An inclusive lower bound for when the event occurred
	EventTimeStart param.Field[time.Time] `query:"event_time_start" format:"date-time"`
	PerPage        param.Field[int64]     `query:"per_page"`
	Resource       param.Field[string]    `query:"resource"`
}

func (EventListParams) URLQuery

func (r EventListParams) URLQuery() (v url.Values)

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

type EventService

type EventService struct {
	Options []option.RequestOption
}

EventService contains methods and other services that help with interacting with the Modern Treasury 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 NewEventService method instead.

func NewEventService

func NewEventService(opts ...option.RequestOption) (r *EventService)

NewEventService 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 (*EventService) Get

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

get event

func (*EventService) List

func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *pagination.Page[Event], err error)

list events

func (*EventService) ListAutoPaging

list events

type ExpectedPayment

type ExpectedPayment struct {
	ID string `json:"id,required" format:"uuid"`
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound int64 `json:"amount_lower_bound,required"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound int64 `json:"amount_upper_bound,required"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID string    `json:"counterparty_id,required,nullable" format:"uuid"`
	CreatedAt      time.Time `json:"created_at,required" format:"date-time"`
	// Must conform to ISO 4217. Defaults to the currency of the internal account.
	Currency shared.Currency `json:"currency,required"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound time.Time `json:"date_lower_bound,required,nullable" format:"date"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound time.Time `json:"date_upper_bound,required,nullable" format:"date"`
	// An optional description for internal use.
	Description string `json:"description,required,nullable"`
	// One of credit or debit. When you are receiving money, use credit. When you are
	// being charged, use debit.
	Direction shared.TransactionDirection `json:"direction,required"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// The ID of the ledger transaction linked to the expected payment.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The reconciliation filters you have for this payment.
	ReconciliationFilters interface{} `json:"reconciliation_filters,required,nullable"`
	// The reconciliation groups you have for this payment.
	ReconciliationGroups interface{} `json:"reconciliation_groups,required,nullable"`
	// One of manual if this expected payment was manually reconciled in the dashboard,
	// automatic if it was automatically reconciled by Modern Treasury, or null if it
	// is unreconciled.
	ReconciliationMethod ExpectedPaymentReconciliationMethod `json:"reconciliation_method,required,nullable"`
	// An array of reconciliation rule variables for this payment.
	ReconciliationRuleVariables []map[string]string `json:"reconciliation_rule_variables,required,nullable"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation string `json:"remittance_information,required,nullable"`
	// The statement description you expect to see on the transaction. For ACH
	// payments, this will be the full line item passed from the bank. For wire
	// payments, this will be the OBI field on the wire. For check payments, this will
	// be the memo field.
	StatementDescriptor string `json:"statement_descriptor,required,nullable"`
	// One of unreconciled, partially_reconciled, reconciled, or archived.
	Status ExpectedPaymentStatus `json:"status,required"`
	// The ID of the Transaction this expected payment object has been matched to.
	TransactionID string `json:"transaction_id,required,nullable" format:"uuid"`
	// The ID of the Transaction Line Item this expected payment has been matched to.
	TransactionLineItemID string `json:"transaction_line_item_id,required,nullable" format:"uuid"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen,
	// sepa, signet, wire.
	Type      ExpectedPaymentType `json:"type,required,nullable"`
	UpdatedAt time.Time           `json:"updated_at,required" format:"date-time"`
	JSON      expectedPaymentJSON `json:"-"`
}

func (*ExpectedPayment) UnmarshalJSON

func (r *ExpectedPayment) UnmarshalJSON(data []byte) (err error)

type ExpectedPaymentListParams

type ExpectedPaymentListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Specify counterparty_id to see expected_payments for a specific account.
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// Used to return expected payments created after some datetime
	CreatedAtLowerBound param.Field[time.Time] `query:"created_at_lower_bound" format:"date-time"`
	// Used to return expected payments created before some datetime
	CreatedAtUpperBound param.Field[time.Time] `query:"created_at_upper_bound" format:"date-time"`
	// One of credit, debit
	Direction param.Field[shared.TransactionDirection] `query:"direction"`
	// Specify internal_account_id to see expected_payments for a specific account.
	InternalAccountID param.Field[string] `query:"internal_account_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
	// One of unreconciled, reconciled, or archived.
	Status param.Field[ExpectedPaymentListParamsStatus] `query:"status"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,sen,
	// sepa, signet, wire
	Type param.Field[ExpectedPaymentListParamsType] `query:"type"`
}

func (ExpectedPaymentListParams) URLQuery

func (r ExpectedPaymentListParams) URLQuery() (v url.Values)

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

type ExpectedPaymentListParamsStatus

type ExpectedPaymentListParamsStatus string

One of unreconciled, reconciled, or archived.

const (
	ExpectedPaymentListParamsStatusArchived            ExpectedPaymentListParamsStatus = "archived"
	ExpectedPaymentListParamsStatusPartiallyReconciled ExpectedPaymentListParamsStatus = "partially_reconciled"
	ExpectedPaymentListParamsStatusReconciled          ExpectedPaymentListParamsStatus = "reconciled"
	ExpectedPaymentListParamsStatusUnreconciled        ExpectedPaymentListParamsStatus = "unreconciled"
)

func (ExpectedPaymentListParamsStatus) IsKnown added in v2.10.0

type ExpectedPaymentListParamsType

type ExpectedPaymentListParamsType string

One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,sen, sepa, signet, wire

const (
	ExpectedPaymentListParamsTypeACH         ExpectedPaymentListParamsType = "ach"
	ExpectedPaymentListParamsTypeAuBecs      ExpectedPaymentListParamsType = "au_becs"
	ExpectedPaymentListParamsTypeBacs        ExpectedPaymentListParamsType = "bacs"
	ExpectedPaymentListParamsTypeBook        ExpectedPaymentListParamsType = "book"
	ExpectedPaymentListParamsTypeCard        ExpectedPaymentListParamsType = "card"
	ExpectedPaymentListParamsTypeChats       ExpectedPaymentListParamsType = "chats"
	ExpectedPaymentListParamsTypeCheck       ExpectedPaymentListParamsType = "check"
	ExpectedPaymentListParamsTypeCrossBorder ExpectedPaymentListParamsType = "cross_border"
	ExpectedPaymentListParamsTypeDkNets      ExpectedPaymentListParamsType = "dk_nets"
	ExpectedPaymentListParamsTypeEft         ExpectedPaymentListParamsType = "eft"
	ExpectedPaymentListParamsTypeHuIcs       ExpectedPaymentListParamsType = "hu_ics"
	ExpectedPaymentListParamsTypeInterac     ExpectedPaymentListParamsType = "interac"
	ExpectedPaymentListParamsTypeMasav       ExpectedPaymentListParamsType = "masav"
	ExpectedPaymentListParamsTypeMxCcen      ExpectedPaymentListParamsType = "mx_ccen"
	ExpectedPaymentListParamsTypeNeft        ExpectedPaymentListParamsType = "neft"
	ExpectedPaymentListParamsTypeNics        ExpectedPaymentListParamsType = "nics"
	ExpectedPaymentListParamsTypeNzBecs      ExpectedPaymentListParamsType = "nz_becs"
	ExpectedPaymentListParamsTypePlElixir    ExpectedPaymentListParamsType = "pl_elixir"
	ExpectedPaymentListParamsTypeProvxchange ExpectedPaymentListParamsType = "provxchange"
	ExpectedPaymentListParamsTypeRoSent      ExpectedPaymentListParamsType = "ro_sent"
	ExpectedPaymentListParamsTypeRtp         ExpectedPaymentListParamsType = "rtp"
	ExpectedPaymentListParamsTypeSeBankgirot ExpectedPaymentListParamsType = "se_bankgirot"
	ExpectedPaymentListParamsTypeSen         ExpectedPaymentListParamsType = "sen"
	ExpectedPaymentListParamsTypeSepa        ExpectedPaymentListParamsType = "sepa"
	ExpectedPaymentListParamsTypeSgGiro      ExpectedPaymentListParamsType = "sg_giro"
	ExpectedPaymentListParamsTypeSic         ExpectedPaymentListParamsType = "sic"
	ExpectedPaymentListParamsTypeSignet      ExpectedPaymentListParamsType = "signet"
	ExpectedPaymentListParamsTypeSknbi       ExpectedPaymentListParamsType = "sknbi"
	ExpectedPaymentListParamsTypeWire        ExpectedPaymentListParamsType = "wire"
	ExpectedPaymentListParamsTypeZengin      ExpectedPaymentListParamsType = "zengin"
)

func (ExpectedPaymentListParamsType) IsKnown added in v2.10.0

func (r ExpectedPaymentListParamsType) IsKnown() bool

type ExpectedPaymentNewParams

type ExpectedPaymentNewParams struct {
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound param.Field[int64] `json:"amount_lower_bound,required"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound param.Field[int64] `json:"amount_upper_bound,required"`
	// One of credit or debit. When you are receiving money, use credit. When you are
	// being charged, use debit.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Must conform to ISO 4217. Defaults to the currency of the internal account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound param.Field[time.Time] `json:"date_lower_bound" format:"date"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound param.Field[time.Time] `json:"date_upper_bound" format:"date"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// Specifies a ledger transaction object that will be created with the expected
	// payment. If the ledger transaction cannot be created, then the expected payment
	// creation will fail. The resulting ledger transaction will mirror the status of
	// the expected payment.
	LedgerTransaction param.Field[ExpectedPaymentNewParamsLedgerTransaction] `json:"ledger_transaction"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon expected payment creation. Once
	// the expected payment is created, the status of the ledger transaction tracks the
	// expected payment automatically.
	LedgerTransactionID param.Field[string]                             `json:"ledger_transaction_id" format:"uuid"`
	LineItems           param.Field[[]ExpectedPaymentNewParamsLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The reconciliation filters you have for this payment.
	ReconciliationFilters param.Field[interface{}] `json:"reconciliation_filters"`
	// The reconciliation groups you have for this payment.
	ReconciliationGroups param.Field[interface{}] `json:"reconciliation_groups"`
	// An array of reconciliation rule variables for this payment.
	ReconciliationRuleVariables param.Field[[]map[string]string] `json:"reconciliation_rule_variables"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// The statement description you expect to see on the transaction. For ACH
	// payments, this will be the full line item passed from the bank. For wire
	// payments, this will be the OBI field on the wire. For check payments, this will
	// be the memo field.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen,
	// sepa, signet, wire.
	Type param.Field[ExpectedPaymentType] `json:"type"`
}

func (ExpectedPaymentNewParams) MarshalJSON

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

type ExpectedPaymentNewParamsLedgerTransaction added in v2.6.0

type ExpectedPaymentNewParamsLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]ExpectedPaymentNewParamsLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[ExpectedPaymentNewParamsLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[ExpectedPaymentNewParamsLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the expected payment. If the ledger transaction cannot be created, then the expected payment creation will fail. The resulting ledger transaction will mirror the status of the expected payment.

func (ExpectedPaymentNewParamsLedgerTransaction) MarshalJSON added in v2.6.0

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

type ExpectedPaymentNewParamsLedgerTransactionLedgerEntry added in v2.6.0

type ExpectedPaymentNewParamsLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (ExpectedPaymentNewParamsLedgerTransactionLedgerEntry) MarshalJSON added in v2.6.0

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

type ExpectedPaymentNewParamsLedgerTransactionLedgerableType added in v2.6.0

type ExpectedPaymentNewParamsLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypeExpectedPayment       ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "expected_payment"
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypePaperItem             ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "paper_item"
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypePaymentOrder          ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "payment_order"
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypeReturn                ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "return"
	ExpectedPaymentNewParamsLedgerTransactionLedgerableTypeReversal              ExpectedPaymentNewParamsLedgerTransactionLedgerableType = "reversal"
)

func (ExpectedPaymentNewParamsLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type ExpectedPaymentNewParamsLedgerTransactionStatus added in v2.6.0

type ExpectedPaymentNewParamsLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	ExpectedPaymentNewParamsLedgerTransactionStatusArchived ExpectedPaymentNewParamsLedgerTransactionStatus = "archived"
	ExpectedPaymentNewParamsLedgerTransactionStatusPending  ExpectedPaymentNewParamsLedgerTransactionStatus = "pending"
	ExpectedPaymentNewParamsLedgerTransactionStatusPosted   ExpectedPaymentNewParamsLedgerTransactionStatus = "posted"
)

func (ExpectedPaymentNewParamsLedgerTransactionStatus) IsKnown added in v2.10.0

type ExpectedPaymentNewParamsLineItem

type ExpectedPaymentNewParamsLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (ExpectedPaymentNewParamsLineItem) MarshalJSON

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

type ExpectedPaymentReconciliationMethod

type ExpectedPaymentReconciliationMethod string

One of manual if this expected payment was manually reconciled in the dashboard, automatic if it was automatically reconciled by Modern Treasury, or null if it is unreconciled.

const (
	ExpectedPaymentReconciliationMethodAutomatic ExpectedPaymentReconciliationMethod = "automatic"
	ExpectedPaymentReconciliationMethodManual    ExpectedPaymentReconciliationMethod = "manual"
)

func (ExpectedPaymentReconciliationMethod) IsKnown added in v2.10.0

type ExpectedPaymentService

type ExpectedPaymentService struct {
	Options []option.RequestOption
}

ExpectedPaymentService contains methods and other services that help with interacting with the Modern Treasury 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 NewExpectedPaymentService method instead.

func NewExpectedPaymentService

func NewExpectedPaymentService(opts ...option.RequestOption) (r *ExpectedPaymentService)

NewExpectedPaymentService 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 (*ExpectedPaymentService) Delete

func (r *ExpectedPaymentService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *ExpectedPayment, err error)

delete expected payment

func (*ExpectedPaymentService) Get

get expected payment

func (*ExpectedPaymentService) List

list expected_payments

func (*ExpectedPaymentService) ListAutoPaging

list expected_payments

func (*ExpectedPaymentService) New

create expected payment

func (*ExpectedPaymentService) Update

update expected payment

type ExpectedPaymentStatus

type ExpectedPaymentStatus string

One of unreconciled, partially_reconciled, reconciled, or archived.

const (
	ExpectedPaymentStatusArchived            ExpectedPaymentStatus = "archived"
	ExpectedPaymentStatusPartiallyReconciled ExpectedPaymentStatus = "partially_reconciled"
	ExpectedPaymentStatusReconciled          ExpectedPaymentStatus = "reconciled"
	ExpectedPaymentStatusUnreconciled        ExpectedPaymentStatus = "unreconciled"
)

func (ExpectedPaymentStatus) IsKnown added in v2.10.0

func (r ExpectedPaymentStatus) IsKnown() bool

type ExpectedPaymentType

type ExpectedPaymentType string

One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, sepa, signet, wire.

const (
	ExpectedPaymentTypeACH         ExpectedPaymentType = "ach"
	ExpectedPaymentTypeAuBecs      ExpectedPaymentType = "au_becs"
	ExpectedPaymentTypeBacs        ExpectedPaymentType = "bacs"
	ExpectedPaymentTypeBook        ExpectedPaymentType = "book"
	ExpectedPaymentTypeCard        ExpectedPaymentType = "card"
	ExpectedPaymentTypeChats       ExpectedPaymentType = "chats"
	ExpectedPaymentTypeCheck       ExpectedPaymentType = "check"
	ExpectedPaymentTypeCrossBorder ExpectedPaymentType = "cross_border"
	ExpectedPaymentTypeDkNets      ExpectedPaymentType = "dk_nets"
	ExpectedPaymentTypeEft         ExpectedPaymentType = "eft"
	ExpectedPaymentTypeHuIcs       ExpectedPaymentType = "hu_ics"
	ExpectedPaymentTypeInterac     ExpectedPaymentType = "interac"
	ExpectedPaymentTypeMasav       ExpectedPaymentType = "masav"
	ExpectedPaymentTypeMxCcen      ExpectedPaymentType = "mx_ccen"
	ExpectedPaymentTypeNeft        ExpectedPaymentType = "neft"
	ExpectedPaymentTypeNics        ExpectedPaymentType = "nics"
	ExpectedPaymentTypeNzBecs      ExpectedPaymentType = "nz_becs"
	ExpectedPaymentTypePlElixir    ExpectedPaymentType = "pl_elixir"
	ExpectedPaymentTypeProvxchange ExpectedPaymentType = "provxchange"
	ExpectedPaymentTypeRoSent      ExpectedPaymentType = "ro_sent"
	ExpectedPaymentTypeRtp         ExpectedPaymentType = "rtp"
	ExpectedPaymentTypeSeBankgirot ExpectedPaymentType = "se_bankgirot"
	ExpectedPaymentTypeSen         ExpectedPaymentType = "sen"
	ExpectedPaymentTypeSepa        ExpectedPaymentType = "sepa"
	ExpectedPaymentTypeSgGiro      ExpectedPaymentType = "sg_giro"
	ExpectedPaymentTypeSic         ExpectedPaymentType = "sic"
	ExpectedPaymentTypeSignet      ExpectedPaymentType = "signet"
	ExpectedPaymentTypeSknbi       ExpectedPaymentType = "sknbi"
	ExpectedPaymentTypeWire        ExpectedPaymentType = "wire"
	ExpectedPaymentTypeZengin      ExpectedPaymentType = "zengin"
)

func (ExpectedPaymentType) IsKnown added in v2.10.0

func (r ExpectedPaymentType) IsKnown() bool

type ExpectedPaymentUpdateParams

type ExpectedPaymentUpdateParams struct {
	// The lowest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountLowerBound param.Field[int64] `json:"amount_lower_bound"`
	// The highest amount this expected payment may be equal to. Value in specified
	// currency's smallest unit. e.g. $10 would be represented as 1000.
	AmountUpperBound param.Field[int64] `json:"amount_upper_bound"`
	// The ID of the counterparty you expect for this payment.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Must conform to ISO 4217. Defaults to the currency of the internal account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// The earliest date the payment may come in. Format: yyyy-mm-dd
	DateLowerBound param.Field[time.Time] `json:"date_lower_bound" format:"date"`
	// The latest date the payment may come in. Format: yyyy-mm-dd
	DateUpperBound param.Field[time.Time] `json:"date_upper_bound" format:"date"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// One of credit or debit. When you are receiving money, use credit. When you are
	// being charged, use debit.
	Direction param.Field[shared.TransactionDirection] `json:"direction"`
	// The ID of the Internal Account for the expected payment.
	InternalAccountID param.Field[string] `json:"internal_account_id" format:"uuid"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The reconciliation filters you have for this payment.
	ReconciliationFilters param.Field[interface{}] `json:"reconciliation_filters"`
	// The reconciliation groups you have for this payment.
	ReconciliationGroups param.Field[interface{}] `json:"reconciliation_groups"`
	// An array of reconciliation rule variables for this payment.
	ReconciliationRuleVariables param.Field[[]map[string]string] `json:"reconciliation_rule_variables"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// The statement description you expect to see on the transaction. For ACH
	// payments, this will be the full line item passed from the bank. For wire
	// payments, this will be the OBI field on the wire. For check payments, this will
	// be the memo field.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// The Expected Payment's status can be updated from partially_reconciled to
	// reconciled.
	Status param.Field[ExpectedPaymentUpdateParamsStatus] `json:"status"`
	// One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen,
	// sepa, signet, wire.
	Type param.Field[ExpectedPaymentType] `json:"type"`
}

func (ExpectedPaymentUpdateParams) MarshalJSON

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

type ExpectedPaymentUpdateParamsStatus added in v2.13.0

type ExpectedPaymentUpdateParamsStatus string

The Expected Payment's status can be updated from partially_reconciled to reconciled.

const (
	ExpectedPaymentUpdateParamsStatusReconciled ExpectedPaymentUpdateParamsStatus = "reconciled"
)

func (ExpectedPaymentUpdateParamsStatus) IsKnown added in v2.13.0

type ExternalAccount

type ExternalAccount struct {
	ID             string          `json:"id,required" format:"uuid"`
	AccountDetails []AccountDetail `json:"account_details,required"`
	// Can be `checking`, `savings` or `other`.
	AccountType    ExternalAccountType            `json:"account_type,required"`
	ContactDetails []ExternalAccountContactDetail `json:"contact_details,required"`
	CounterpartyID string                         `json:"counterparty_id,required,nullable" format:"uuid"`
	CreatedAt      time.Time                      `json:"created_at,required" format:"date-time"`
	DiscardedAt    time.Time                      `json:"discarded_at,required,nullable" format:"date-time"`
	// If the external account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID string `json:"ledger_account_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name   string `json:"name,required,nullable"`
	Object string `json:"object,required"`
	// The address associated with the owner or `null`.
	PartyAddress ExternalAccountPartyAddress `json:"party_address,required,nullable"`
	// The legal name of the entity which owns the account.
	PartyName string `json:"party_name,required"`
	// Either `individual` or `business`.
	PartyType          ExternalAccountPartyType          `json:"party_type,required,nullable"`
	RoutingDetails     []RoutingDetail                   `json:"routing_details,required"`
	UpdatedAt          time.Time                         `json:"updated_at,required" format:"date-time"`
	VerificationSource ExternalAccountVerificationSource `json:"verification_source,required,nullable"`
	VerificationStatus ExternalAccountVerificationStatus `json:"verification_status,required"`
	JSON               externalAccountJSON               `json:"-"`
}

func (*ExternalAccount) UnmarshalJSON

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

type ExternalAccountCompleteVerificationParams

type ExternalAccountCompleteVerificationParams struct {
	Amounts param.Field[[]int64] `json:"amounts"`
}

func (ExternalAccountCompleteVerificationParams) MarshalJSON

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

type ExternalAccountContactDetail

type ExternalAccountContactDetail struct {
	ID                    string                                             `json:"id,required" format:"uuid"`
	ContactIdentifier     string                                             `json:"contact_identifier,required"`
	ContactIdentifierType ExternalAccountContactDetailsContactIdentifierType `json:"contact_identifier_type,required"`
	CreatedAt             time.Time                                          `json:"created_at,required" format:"date-time"`
	DiscardedAt           time.Time                                          `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                             `json:"live_mode,required"`
	Object    string                           `json:"object,required"`
	UpdatedAt time.Time                        `json:"updated_at,required" format:"date-time"`
	JSON      externalAccountContactDetailJSON `json:"-"`
}

func (*ExternalAccountContactDetail) UnmarshalJSON

func (r *ExternalAccountContactDetail) UnmarshalJSON(data []byte) (err error)

type ExternalAccountContactDetailsContactIdentifierType

type ExternalAccountContactDetailsContactIdentifierType string
const (
	ExternalAccountContactDetailsContactIdentifierTypeEmail       ExternalAccountContactDetailsContactIdentifierType = "email"
	ExternalAccountContactDetailsContactIdentifierTypePhoneNumber ExternalAccountContactDetailsContactIdentifierType = "phone_number"
	ExternalAccountContactDetailsContactIdentifierTypeWebsite     ExternalAccountContactDetailsContactIdentifierType = "website"
)

func (ExternalAccountContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type ExternalAccountListParams

type ExternalAccountListParams struct {
	AfterCursor    param.Field[string] `query:"after_cursor"`
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// Searches the ExternalAccount's party_name AND the Counterparty's party_name
	PartyName param.Field[string] `query:"party_name"`
	PerPage   param.Field[int64]  `query:"per_page"`
}

func (ExternalAccountListParams) URLQuery

func (r ExternalAccountListParams) URLQuery() (v url.Values)

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

type ExternalAccountNewParams

type ExternalAccountNewParams struct {
	CounterpartyID param.Field[string]                                  `json:"counterparty_id,required" format:"uuid"`
	AccountDetails param.Field[[]ExternalAccountNewParamsAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                     `json:"account_type"`
	ContactDetails param.Field[[]ExternalAccountNewParamsContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[ExternalAccountNewParamsLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[ExternalAccountNewParamsPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                               `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[ExternalAccountNewParamsPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                  `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]ExternalAccountNewParamsRoutingDetail] `json:"routing_details"`
}

func (ExternalAccountNewParams) MarshalJSON

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

type ExternalAccountNewParamsAccountDetail

type ExternalAccountNewParamsAccountDetail struct {
	AccountNumber     param.Field[string]                                                  `json:"account_number,required"`
	AccountNumberType param.Field[ExternalAccountNewParamsAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (ExternalAccountNewParamsAccountDetail) MarshalJSON

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

type ExternalAccountNewParamsAccountDetailsAccountNumberType

type ExternalAccountNewParamsAccountDetailsAccountNumberType string
const (
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeAuNumber      ExternalAccountNewParamsAccountDetailsAccountNumberType = "au_number"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeClabe         ExternalAccountNewParamsAccountDetailsAccountNumberType = "clabe"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeHkNumber      ExternalAccountNewParamsAccountDetailsAccountNumberType = "hk_number"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeIban          ExternalAccountNewParamsAccountDetailsAccountNumberType = "iban"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeIDNumber      ExternalAccountNewParamsAccountDetailsAccountNumberType = "id_number"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeNzNumber      ExternalAccountNewParamsAccountDetailsAccountNumberType = "nz_number"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeOther         ExternalAccountNewParamsAccountDetailsAccountNumberType = "other"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypePan           ExternalAccountNewParamsAccountDetailsAccountNumberType = "pan"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeSgNumber      ExternalAccountNewParamsAccountDetailsAccountNumberType = "sg_number"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeWalletAddress ExternalAccountNewParamsAccountDetailsAccountNumberType = "wallet_address"
)

func (ExternalAccountNewParamsAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type ExternalAccountNewParamsContactDetail

type ExternalAccountNewParamsContactDetail struct {
	ContactIdentifier     param.Field[string]                                                      `json:"contact_identifier"`
	ContactIdentifierType param.Field[ExternalAccountNewParamsContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (ExternalAccountNewParamsContactDetail) MarshalJSON

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

type ExternalAccountNewParamsContactDetailsContactIdentifierType

type ExternalAccountNewParamsContactDetailsContactIdentifierType string
const (
	ExternalAccountNewParamsContactDetailsContactIdentifierTypeEmail       ExternalAccountNewParamsContactDetailsContactIdentifierType = "email"
	ExternalAccountNewParamsContactDetailsContactIdentifierTypePhoneNumber ExternalAccountNewParamsContactDetailsContactIdentifierType = "phone_number"
	ExternalAccountNewParamsContactDetailsContactIdentifierTypeWebsite     ExternalAccountNewParamsContactDetailsContactIdentifierType = "website"
)

func (ExternalAccountNewParamsContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type ExternalAccountNewParamsLedgerAccount

type ExternalAccountNewParamsLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[ExternalAccountNewParamsLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (ExternalAccountNewParamsLedgerAccount) MarshalJSON

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

type ExternalAccountNewParamsLedgerAccountLedgerableType

type ExternalAccountNewParamsLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	ExternalAccountNewParamsLedgerAccountLedgerableTypeCounterparty    ExternalAccountNewParamsLedgerAccountLedgerableType = "counterparty"
	ExternalAccountNewParamsLedgerAccountLedgerableTypeExternalAccount ExternalAccountNewParamsLedgerAccountLedgerableType = "external_account"
	ExternalAccountNewParamsLedgerAccountLedgerableTypeInternalAccount ExternalAccountNewParamsLedgerAccountLedgerableType = "internal_account"
	ExternalAccountNewParamsLedgerAccountLedgerableTypeVirtualAccount  ExternalAccountNewParamsLedgerAccountLedgerableType = "virtual_account"
)

func (ExternalAccountNewParamsLedgerAccountLedgerableType) IsKnown added in v2.10.0

type ExternalAccountNewParamsPartyAddress

type ExternalAccountNewParamsPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (ExternalAccountNewParamsPartyAddress) MarshalJSON

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

type ExternalAccountNewParamsPartyType

type ExternalAccountNewParamsPartyType string

Either `individual` or `business`.

const (
	ExternalAccountNewParamsPartyTypeBusiness   ExternalAccountNewParamsPartyType = "business"
	ExternalAccountNewParamsPartyTypeIndividual ExternalAccountNewParamsPartyType = "individual"
)

func (ExternalAccountNewParamsPartyType) IsKnown added in v2.10.0

type ExternalAccountNewParamsRoutingDetail

type ExternalAccountNewParamsRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                  `json:"routing_number,required"`
	RoutingNumberType param.Field[ExternalAccountNewParamsRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[ExternalAccountNewParamsRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (ExternalAccountNewParamsRoutingDetail) MarshalJSON

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

type ExternalAccountNewParamsRoutingDetailsPaymentType

type ExternalAccountNewParamsRoutingDetailsPaymentType string
const (
	ExternalAccountNewParamsRoutingDetailsPaymentTypeACH         ExternalAccountNewParamsRoutingDetailsPaymentType = "ach"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeAuBecs      ExternalAccountNewParamsRoutingDetailsPaymentType = "au_becs"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeBacs        ExternalAccountNewParamsRoutingDetailsPaymentType = "bacs"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeBook        ExternalAccountNewParamsRoutingDetailsPaymentType = "book"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeCard        ExternalAccountNewParamsRoutingDetailsPaymentType = "card"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeChats       ExternalAccountNewParamsRoutingDetailsPaymentType = "chats"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeCheck       ExternalAccountNewParamsRoutingDetailsPaymentType = "check"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeCrossBorder ExternalAccountNewParamsRoutingDetailsPaymentType = "cross_border"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeDkNets      ExternalAccountNewParamsRoutingDetailsPaymentType = "dk_nets"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeEft         ExternalAccountNewParamsRoutingDetailsPaymentType = "eft"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeHuIcs       ExternalAccountNewParamsRoutingDetailsPaymentType = "hu_ics"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeInterac     ExternalAccountNewParamsRoutingDetailsPaymentType = "interac"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeMasav       ExternalAccountNewParamsRoutingDetailsPaymentType = "masav"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeMxCcen      ExternalAccountNewParamsRoutingDetailsPaymentType = "mx_ccen"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNeft        ExternalAccountNewParamsRoutingDetailsPaymentType = "neft"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNics        ExternalAccountNewParamsRoutingDetailsPaymentType = "nics"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNzBecs      ExternalAccountNewParamsRoutingDetailsPaymentType = "nz_becs"
	ExternalAccountNewParamsRoutingDetailsPaymentTypePlElixir    ExternalAccountNewParamsRoutingDetailsPaymentType = "pl_elixir"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeProvxchange ExternalAccountNewParamsRoutingDetailsPaymentType = "provxchange"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeRoSent      ExternalAccountNewParamsRoutingDetailsPaymentType = "ro_sent"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeRtp         ExternalAccountNewParamsRoutingDetailsPaymentType = "rtp"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSeBankgirot ExternalAccountNewParamsRoutingDetailsPaymentType = "se_bankgirot"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSen         ExternalAccountNewParamsRoutingDetailsPaymentType = "sen"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSepa        ExternalAccountNewParamsRoutingDetailsPaymentType = "sepa"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSgGiro      ExternalAccountNewParamsRoutingDetailsPaymentType = "sg_giro"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSic         ExternalAccountNewParamsRoutingDetailsPaymentType = "sic"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSignet      ExternalAccountNewParamsRoutingDetailsPaymentType = "signet"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSknbi       ExternalAccountNewParamsRoutingDetailsPaymentType = "sknbi"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeWire        ExternalAccountNewParamsRoutingDetailsPaymentType = "wire"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeZengin      ExternalAccountNewParamsRoutingDetailsPaymentType = "zengin"
)

func (ExternalAccountNewParamsRoutingDetailsPaymentType) IsKnown added in v2.10.0

type ExternalAccountNewParamsRoutingDetailsRoutingNumberType

type ExternalAccountNewParamsRoutingDetailsRoutingNumberType string
const (
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeAba                     ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "aba"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeAuBsb                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "au_bsb"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeBrCodigo                ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "br_codigo"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeCaCpa                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "ca_cpa"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeChips                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "chips"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeCnaps                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "cnaps"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeDkInterbankClearingCode ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeGBSortCode              ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "gb_sort_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeHkInterbankClearingCode ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeHuInterbankClearingCode ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeIDSknbiCode             ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "id_sknbi_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeInIfsc                  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "in_ifsc"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeJpZenginCode            ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "jp_zengin_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeMyBranchCode            ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "my_branch_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeMxBankIdentifier        ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypePlNationalClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeSwift                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "swift"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeZaNationalClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (ExternalAccountNewParamsRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type ExternalAccountPartyAddress

type ExternalAccountPartyAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country   string    `json:"country,required,nullable"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	Line1     string    `json:"line1,required,nullable"`
	Line2     string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                          `json:"region,required,nullable"`
	UpdatedAt time.Time                       `json:"updated_at,required" format:"date-time"`
	JSON      externalAccountPartyAddressJSON `json:"-"`
}

The address associated with the owner or `null`.

func (*ExternalAccountPartyAddress) UnmarshalJSON

func (r *ExternalAccountPartyAddress) UnmarshalJSON(data []byte) (err error)

type ExternalAccountPartyType

type ExternalAccountPartyType string

Either `individual` or `business`.

const (
	ExternalAccountPartyTypeBusiness   ExternalAccountPartyType = "business"
	ExternalAccountPartyTypeIndividual ExternalAccountPartyType = "individual"
)

func (ExternalAccountPartyType) IsKnown added in v2.10.0

func (r ExternalAccountPartyType) IsKnown() bool

type ExternalAccountService

type ExternalAccountService struct {
	Options []option.RequestOption
}

ExternalAccountService contains methods and other services that help with interacting with the Modern Treasury 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) CompleteVerification

complete verification of external account

func (*ExternalAccountService) Delete

func (r *ExternalAccountService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

delete external account

func (*ExternalAccountService) Get

show external account

func (*ExternalAccountService) List

list external accounts

func (*ExternalAccountService) ListAutoPaging

list external accounts

func (*ExternalAccountService) New

create external account

func (*ExternalAccountService) Update

update external account

func (*ExternalAccountService) Verify

verify external account

type ExternalAccountType

type ExternalAccountType string

Can be `checking`, `savings` or `other`.

const (
	ExternalAccountTypeCash          ExternalAccountType = "cash"
	ExternalAccountTypeChecking      ExternalAccountType = "checking"
	ExternalAccountTypeGeneralLedger ExternalAccountType = "general_ledger"
	ExternalAccountTypeLoan          ExternalAccountType = "loan"
	ExternalAccountTypeNonResident   ExternalAccountType = "non_resident"
	ExternalAccountTypeOther         ExternalAccountType = "other"
	ExternalAccountTypeOverdraft     ExternalAccountType = "overdraft"
	ExternalAccountTypeSavings       ExternalAccountType = "savings"
)

func (ExternalAccountType) IsKnown added in v2.10.0

func (r ExternalAccountType) IsKnown() bool

type ExternalAccountUpdateParams

type ExternalAccountUpdateParams struct {
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType] `json:"account_type"`
	CounterpartyID param.Field[string]              `json:"counterparty_id" format:"uuid"`
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name         param.Field[string]                                  `json:"name"`
	PartyAddress param.Field[ExternalAccountUpdateParamsPartyAddress] `json:"party_address"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[ExternalAccountUpdateParamsPartyType] `json:"party_type"`
}

func (ExternalAccountUpdateParams) MarshalJSON

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

type ExternalAccountUpdateParamsPartyAddress

type ExternalAccountUpdateParamsPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

func (ExternalAccountUpdateParamsPartyAddress) MarshalJSON

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

type ExternalAccountUpdateParamsPartyType

type ExternalAccountUpdateParamsPartyType string

Either `individual` or `business`.

const (
	ExternalAccountUpdateParamsPartyTypeBusiness   ExternalAccountUpdateParamsPartyType = "business"
	ExternalAccountUpdateParamsPartyTypeIndividual ExternalAccountUpdateParamsPartyType = "individual"
)

func (ExternalAccountUpdateParamsPartyType) IsKnown added in v2.10.0

type ExternalAccountVerificationSource added in v2.15.0

type ExternalAccountVerificationSource string
const (
	ExternalAccountVerificationSourceACHPrenote    ExternalAccountVerificationSource = "ach_prenote"
	ExternalAccountVerificationSourceMicrodeposits ExternalAccountVerificationSource = "microdeposits"
	ExternalAccountVerificationSourcePlaid         ExternalAccountVerificationSource = "plaid"
)

func (ExternalAccountVerificationSource) IsKnown added in v2.15.0

type ExternalAccountVerificationStatus

type ExternalAccountVerificationStatus string
const (
	ExternalAccountVerificationStatusPendingVerification ExternalAccountVerificationStatus = "pending_verification"
	ExternalAccountVerificationStatusUnverified          ExternalAccountVerificationStatus = "unverified"
	ExternalAccountVerificationStatusVerified            ExternalAccountVerificationStatus = "verified"
)

func (ExternalAccountVerificationStatus) IsKnown added in v2.10.0

type ExternalAccountVerifyParams

type ExternalAccountVerifyParams struct {
	// The ID of the internal account where the micro-deposits originate from. Both
	// credit and debit capabilities must be enabled.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required" format:"uuid"`
	// Can be `ach`, `eft`, or `rtp`.
	PaymentType param.Field[ExternalAccountVerifyParamsPaymentType] `json:"payment_type,required"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (payment_type=rtp and fallback_type=ach)
	FallbackType param.Field[ExternalAccountVerifyParamsFallbackType] `json:"fallback_type"`
	// Either `normal` or `high`. For ACH payments, `high` represents a same-day ACH
	// transfer. This will apply to both `payment_type` and `fallback_type`.
	Priority param.Field[ExternalAccountVerifyParamsPriority] `json:"priority"`
}

func (ExternalAccountVerifyParams) MarshalJSON

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

type ExternalAccountVerifyParamsFallbackType added in v2.13.0

type ExternalAccountVerifyParamsFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (payment_type=rtp and fallback_type=ach)

const (
	ExternalAccountVerifyParamsFallbackTypeACH ExternalAccountVerifyParamsFallbackType = "ach"
)

func (ExternalAccountVerifyParamsFallbackType) IsKnown added in v2.13.0

type ExternalAccountVerifyParamsPaymentType

type ExternalAccountVerifyParamsPaymentType string

Can be `ach`, `eft`, or `rtp`.

const (
	ExternalAccountVerifyParamsPaymentTypeACH         ExternalAccountVerifyParamsPaymentType = "ach"
	ExternalAccountVerifyParamsPaymentTypeAuBecs      ExternalAccountVerifyParamsPaymentType = "au_becs"
	ExternalAccountVerifyParamsPaymentTypeBacs        ExternalAccountVerifyParamsPaymentType = "bacs"
	ExternalAccountVerifyParamsPaymentTypeBook        ExternalAccountVerifyParamsPaymentType = "book"
	ExternalAccountVerifyParamsPaymentTypeCard        ExternalAccountVerifyParamsPaymentType = "card"
	ExternalAccountVerifyParamsPaymentTypeChats       ExternalAccountVerifyParamsPaymentType = "chats"
	ExternalAccountVerifyParamsPaymentTypeCheck       ExternalAccountVerifyParamsPaymentType = "check"
	ExternalAccountVerifyParamsPaymentTypeCrossBorder ExternalAccountVerifyParamsPaymentType = "cross_border"
	ExternalAccountVerifyParamsPaymentTypeDkNets      ExternalAccountVerifyParamsPaymentType = "dk_nets"
	ExternalAccountVerifyParamsPaymentTypeEft         ExternalAccountVerifyParamsPaymentType = "eft"
	ExternalAccountVerifyParamsPaymentTypeHuIcs       ExternalAccountVerifyParamsPaymentType = "hu_ics"
	ExternalAccountVerifyParamsPaymentTypeInterac     ExternalAccountVerifyParamsPaymentType = "interac"
	ExternalAccountVerifyParamsPaymentTypeMasav       ExternalAccountVerifyParamsPaymentType = "masav"
	ExternalAccountVerifyParamsPaymentTypeMxCcen      ExternalAccountVerifyParamsPaymentType = "mx_ccen"
	ExternalAccountVerifyParamsPaymentTypeNeft        ExternalAccountVerifyParamsPaymentType = "neft"
	ExternalAccountVerifyParamsPaymentTypeNics        ExternalAccountVerifyParamsPaymentType = "nics"
	ExternalAccountVerifyParamsPaymentTypeNzBecs      ExternalAccountVerifyParamsPaymentType = "nz_becs"
	ExternalAccountVerifyParamsPaymentTypePlElixir    ExternalAccountVerifyParamsPaymentType = "pl_elixir"
	ExternalAccountVerifyParamsPaymentTypeProvxchange ExternalAccountVerifyParamsPaymentType = "provxchange"
	ExternalAccountVerifyParamsPaymentTypeRoSent      ExternalAccountVerifyParamsPaymentType = "ro_sent"
	ExternalAccountVerifyParamsPaymentTypeRtp         ExternalAccountVerifyParamsPaymentType = "rtp"
	ExternalAccountVerifyParamsPaymentTypeSeBankgirot ExternalAccountVerifyParamsPaymentType = "se_bankgirot"
	ExternalAccountVerifyParamsPaymentTypeSen         ExternalAccountVerifyParamsPaymentType = "sen"
	ExternalAccountVerifyParamsPaymentTypeSepa        ExternalAccountVerifyParamsPaymentType = "sepa"
	ExternalAccountVerifyParamsPaymentTypeSgGiro      ExternalAccountVerifyParamsPaymentType = "sg_giro"
	ExternalAccountVerifyParamsPaymentTypeSic         ExternalAccountVerifyParamsPaymentType = "sic"
	ExternalAccountVerifyParamsPaymentTypeSignet      ExternalAccountVerifyParamsPaymentType = "signet"
	ExternalAccountVerifyParamsPaymentTypeSknbi       ExternalAccountVerifyParamsPaymentType = "sknbi"
	ExternalAccountVerifyParamsPaymentTypeWire        ExternalAccountVerifyParamsPaymentType = "wire"
	ExternalAccountVerifyParamsPaymentTypeZengin      ExternalAccountVerifyParamsPaymentType = "zengin"
)

func (ExternalAccountVerifyParamsPaymentType) IsKnown added in v2.10.0

type ExternalAccountVerifyParamsPriority added in v2.13.0

type ExternalAccountVerifyParamsPriority string

Either `normal` or `high`. For ACH payments, `high` represents a same-day ACH transfer. This will apply to both `payment_type` and `fallback_type`.

const (
	ExternalAccountVerifyParamsPriorityHigh   ExternalAccountVerifyParamsPriority = "high"
	ExternalAccountVerifyParamsPriorityNormal ExternalAccountVerifyParamsPriority = "normal"
)

func (ExternalAccountVerifyParamsPriority) IsKnown added in v2.13.0

type ExternalAccountVerifyResponse added in v2.15.0

type ExternalAccountVerifyResponse struct {
	ID     string `json:"id,required" format:"uuid"`
	Object string `json:"object,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode    bool      `json:"live_mode,required"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	UpdatedAt   time.Time `json:"updated_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,nullable" format:"date-time"`
	// Can be `checking`, `savings` or `other`.
	AccountType ExternalAccountType `json:"account_type"`
	// Either `individual` or `business`.
	PartyType ExternalAccountVerifyResponsePartyType `json:"party_type,nullable"`
	// This field can have the runtime type of [ExternalAccountPartyAddress].
	PartyAddress interface{} `json:"party_address,required"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name           string `json:"name,nullable"`
	CounterpartyID string `json:"counterparty_id,nullable" format:"uuid"`
	// This field can have the runtime type of [[]AccountDetail].
	AccountDetails interface{} `json:"account_details,required"`
	// This field can have the runtime type of [[]RoutingDetail].
	RoutingDetails interface{} `json:"routing_details,required"`
	// This field can have the runtime type of [map[string]string].
	Metadata interface{} `json:"metadata,required"`
	// The legal name of the entity which owns the account.
	PartyName string `json:"party_name"`
	// This field can have the runtime type of [[]ExternalAccountContactDetail].
	ContactDetails interface{} `json:"contact_details,required"`
	// If the external account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID    string                                          `json:"ledger_account_id,nullable" format:"uuid"`
	VerificationStatus ExternalAccountVerifyResponseVerificationStatus `json:"verification_status"`
	VerificationSource ExternalAccountVerifyResponseVerificationSource `json:"verification_source,nullable"`
	// The ID of the external account.
	ExternalAccountID string `json:"external_account_id" format:"uuid"`
	// The ID of the internal account where the micro-deposits originate from.
	OriginatingAccountID string `json:"originating_account_id" format:"uuid"`
	// The type of payment that can be made to this account. Can be `ach`, `eft`, or
	// `rtp`.
	PaymentType ExternalAccountVerifyResponsePaymentType `json:"payment_type"`
	// The priority of the payment. Can be `normal` or `high`.
	Priority ExternalAccountVerifyResponsePriority `json:"priority,nullable"`
	// The status of the verification attempt. Can be `pending_verification`,
	// `verified`, `failed`, or `cancelled`.
	Status ExternalAccountVerifyResponseStatus `json:"status"`
	JSON   externalAccountVerifyResponseJSON   `json:"-"`
	// contains filtered or unexported fields
}

func (ExternalAccountVerifyResponse) AsUnion added in v2.15.0

AsUnion returns a ExternalAccountVerifyResponseUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are ExternalAccount, ExternalAccountVerifyResponseExternalAccountVerificationAttempt.

func (*ExternalAccountVerifyResponse) UnmarshalJSON added in v2.15.0

func (r *ExternalAccountVerifyResponse) UnmarshalJSON(data []byte) (err error)

type ExternalAccountVerifyResponseExternalAccountVerificationAttempt added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttempt struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The ID of the external account.
	ExternalAccountID string `json:"external_account_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The ID of the internal account where the micro-deposits originate from.
	OriginatingAccountID string `json:"originating_account_id,required" format:"uuid"`
	// The type of payment that can be made to this account. Can be `ach`, `eft`, or
	// `rtp`.
	PaymentType ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType `json:"payment_type,required"`
	// The priority of the payment. Can be `normal` or `high`.
	Priority ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority `json:"priority,required,nullable"`
	// The status of the verification attempt. Can be `pending_verification`,
	// `verified`, `failed`, or `cancelled`.
	Status    ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus `json:"status,required"`
	UpdatedAt time.Time                                                             `json:"updated_at,required" format:"date-time"`
	JSON      externalAccountVerifyResponseExternalAccountVerificationAttemptJSON   `json:"-"`
}

func (*ExternalAccountVerifyResponseExternalAccountVerificationAttempt) UnmarshalJSON added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType string

The type of payment that can be made to this account. Can be `ach`, `eft`, or `rtp`.

const (
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeACH         ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "ach"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeAuBecs      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "au_becs"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeBacs        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "bacs"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeBook        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "book"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeCard        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "card"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeChats       ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "chats"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeCheck       ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "check"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeCrossBorder ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "cross_border"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeDkNets      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "dk_nets"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeEft         ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "eft"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeHuIcs       ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "hu_ics"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeInterac     ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "interac"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeMasav       ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "masav"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeMxCcen      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "mx_ccen"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeNeft        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "neft"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeNics        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "nics"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeNzBecs      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "nz_becs"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypePlElixir    ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "pl_elixir"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeProvxchange ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "provxchange"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeRoSent      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "ro_sent"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeRtp         ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "rtp"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSeBankgirot ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "se_bankgirot"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSen         ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "sen"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSepa        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "sepa"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSgGiro      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "sg_giro"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSic         ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "sic"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSignet      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "signet"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeSknbi       ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "sknbi"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeWire        ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "wire"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentTypeZengin      ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType = "zengin"
)

func (ExternalAccountVerifyResponseExternalAccountVerificationAttemptPaymentType) IsKnown added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority string

The priority of the payment. Can be `normal` or `high`.

const (
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriorityHigh   ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority = "high"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriorityNormal ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority = "normal"
)

func (ExternalAccountVerifyResponseExternalAccountVerificationAttemptPriority) IsKnown added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus added in v2.15.0

type ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus string

The status of the verification attempt. Can be `pending_verification`, `verified`, `failed`, or `cancelled`.

const (
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatusCancelled           ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus = "cancelled"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatusFailed              ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus = "failed"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatusPendingVerification ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus = "pending_verification"
	ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatusVerified            ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus = "verified"
)

func (ExternalAccountVerifyResponseExternalAccountVerificationAttemptStatus) IsKnown added in v2.15.0

type ExternalAccountVerifyResponsePartyType added in v2.15.0

type ExternalAccountVerifyResponsePartyType string

Either `individual` or `business`.

const (
	ExternalAccountVerifyResponsePartyTypeBusiness   ExternalAccountVerifyResponsePartyType = "business"
	ExternalAccountVerifyResponsePartyTypeIndividual ExternalAccountVerifyResponsePartyType = "individual"
)

func (ExternalAccountVerifyResponsePartyType) IsKnown added in v2.15.0

type ExternalAccountVerifyResponsePaymentType added in v2.15.0

type ExternalAccountVerifyResponsePaymentType string

The type of payment that can be made to this account. Can be `ach`, `eft`, or `rtp`.

const (
	ExternalAccountVerifyResponsePaymentTypeACH         ExternalAccountVerifyResponsePaymentType = "ach"
	ExternalAccountVerifyResponsePaymentTypeAuBecs      ExternalAccountVerifyResponsePaymentType = "au_becs"
	ExternalAccountVerifyResponsePaymentTypeBacs        ExternalAccountVerifyResponsePaymentType = "bacs"
	ExternalAccountVerifyResponsePaymentTypeBook        ExternalAccountVerifyResponsePaymentType = "book"
	ExternalAccountVerifyResponsePaymentTypeCard        ExternalAccountVerifyResponsePaymentType = "card"
	ExternalAccountVerifyResponsePaymentTypeChats       ExternalAccountVerifyResponsePaymentType = "chats"
	ExternalAccountVerifyResponsePaymentTypeCheck       ExternalAccountVerifyResponsePaymentType = "check"
	ExternalAccountVerifyResponsePaymentTypeCrossBorder ExternalAccountVerifyResponsePaymentType = "cross_border"
	ExternalAccountVerifyResponsePaymentTypeDkNets      ExternalAccountVerifyResponsePaymentType = "dk_nets"
	ExternalAccountVerifyResponsePaymentTypeEft         ExternalAccountVerifyResponsePaymentType = "eft"
	ExternalAccountVerifyResponsePaymentTypeHuIcs       ExternalAccountVerifyResponsePaymentType = "hu_ics"
	ExternalAccountVerifyResponsePaymentTypeInterac     ExternalAccountVerifyResponsePaymentType = "interac"
	ExternalAccountVerifyResponsePaymentTypeMasav       ExternalAccountVerifyResponsePaymentType = "masav"
	ExternalAccountVerifyResponsePaymentTypeMxCcen      ExternalAccountVerifyResponsePaymentType = "mx_ccen"
	ExternalAccountVerifyResponsePaymentTypeNeft        ExternalAccountVerifyResponsePaymentType = "neft"
	ExternalAccountVerifyResponsePaymentTypeNics        ExternalAccountVerifyResponsePaymentType = "nics"
	ExternalAccountVerifyResponsePaymentTypeNzBecs      ExternalAccountVerifyResponsePaymentType = "nz_becs"
	ExternalAccountVerifyResponsePaymentTypePlElixir    ExternalAccountVerifyResponsePaymentType = "pl_elixir"
	ExternalAccountVerifyResponsePaymentTypeProvxchange ExternalAccountVerifyResponsePaymentType = "provxchange"
	ExternalAccountVerifyResponsePaymentTypeRoSent      ExternalAccountVerifyResponsePaymentType = "ro_sent"
	ExternalAccountVerifyResponsePaymentTypeRtp         ExternalAccountVerifyResponsePaymentType = "rtp"
	ExternalAccountVerifyResponsePaymentTypeSeBankgirot ExternalAccountVerifyResponsePaymentType = "se_bankgirot"
	ExternalAccountVerifyResponsePaymentTypeSen         ExternalAccountVerifyResponsePaymentType = "sen"
	ExternalAccountVerifyResponsePaymentTypeSepa        ExternalAccountVerifyResponsePaymentType = "sepa"
	ExternalAccountVerifyResponsePaymentTypeSgGiro      ExternalAccountVerifyResponsePaymentType = "sg_giro"
	ExternalAccountVerifyResponsePaymentTypeSic         ExternalAccountVerifyResponsePaymentType = "sic"
	ExternalAccountVerifyResponsePaymentTypeSignet      ExternalAccountVerifyResponsePaymentType = "signet"
	ExternalAccountVerifyResponsePaymentTypeSknbi       ExternalAccountVerifyResponsePaymentType = "sknbi"
	ExternalAccountVerifyResponsePaymentTypeWire        ExternalAccountVerifyResponsePaymentType = "wire"
	ExternalAccountVerifyResponsePaymentTypeZengin      ExternalAccountVerifyResponsePaymentType = "zengin"
)

func (ExternalAccountVerifyResponsePaymentType) IsKnown added in v2.15.0

type ExternalAccountVerifyResponsePriority added in v2.15.0

type ExternalAccountVerifyResponsePriority string

The priority of the payment. Can be `normal` or `high`.

const (
	ExternalAccountVerifyResponsePriorityHigh   ExternalAccountVerifyResponsePriority = "high"
	ExternalAccountVerifyResponsePriorityNormal ExternalAccountVerifyResponsePriority = "normal"
)

func (ExternalAccountVerifyResponsePriority) IsKnown added in v2.15.0

type ExternalAccountVerifyResponseStatus added in v2.15.0

type ExternalAccountVerifyResponseStatus string

The status of the verification attempt. Can be `pending_verification`, `verified`, `failed`, or `cancelled`.

const (
	ExternalAccountVerifyResponseStatusCancelled           ExternalAccountVerifyResponseStatus = "cancelled"
	ExternalAccountVerifyResponseStatusFailed              ExternalAccountVerifyResponseStatus = "failed"
	ExternalAccountVerifyResponseStatusPendingVerification ExternalAccountVerifyResponseStatus = "pending_verification"
	ExternalAccountVerifyResponseStatusVerified            ExternalAccountVerifyResponseStatus = "verified"
)

func (ExternalAccountVerifyResponseStatus) IsKnown added in v2.15.0

type ExternalAccountVerifyResponseUnion added in v2.15.0

type ExternalAccountVerifyResponseUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by ExternalAccount or ExternalAccountVerifyResponseExternalAccountVerificationAttempt.

type ExternalAccountVerifyResponseVerificationSource added in v2.15.0

type ExternalAccountVerifyResponseVerificationSource string
const (
	ExternalAccountVerifyResponseVerificationSourceACHPrenote    ExternalAccountVerifyResponseVerificationSource = "ach_prenote"
	ExternalAccountVerifyResponseVerificationSourceMicrodeposits ExternalAccountVerifyResponseVerificationSource = "microdeposits"
	ExternalAccountVerifyResponseVerificationSourcePlaid         ExternalAccountVerifyResponseVerificationSource = "plaid"
)

func (ExternalAccountVerifyResponseVerificationSource) IsKnown added in v2.15.0

type ExternalAccountVerifyResponseVerificationStatus added in v2.15.0

type ExternalAccountVerifyResponseVerificationStatus string
const (
	ExternalAccountVerifyResponseVerificationStatusPendingVerification ExternalAccountVerifyResponseVerificationStatus = "pending_verification"
	ExternalAccountVerifyResponseVerificationStatusUnverified          ExternalAccountVerifyResponseVerificationStatus = "unverified"
	ExternalAccountVerifyResponseVerificationStatusVerified            ExternalAccountVerifyResponseVerificationStatus = "verified"
)

func (ExternalAccountVerifyResponseVerificationStatus) IsKnown added in v2.15.0

type ForeignExchangeQuote added in v2.7.0

type ForeignExchangeQuote struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The timestamp until when the quoted rate is valid.
	EffectiveAt time.Time `json:"effective_at,required" format:"date-time"`
	// The timestamp until which the quote must be booked by.
	ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
	// Either `fixed_to_variable` if the `base_amount` was specified, or
	// `variable_to_fixed` if the `target_amount` was specified when requesting the
	// quote.
	ForeignExchangeIndicator string `json:"foreign_exchange_indicator,required"`
	// The serialized rate information represented by this quote.
	ForeignExchangeRate ForeignExchangeQuoteForeignExchangeRate `json:"foreign_exchange_rate,required"`
	// The ID for the `InternalAccount` this quote is associated with.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata  map[string]string `json:"metadata,required"`
	Object    string            `json:"object,required"`
	UpdatedAt time.Time         `json:"updated_at,required" format:"date-time"`
	// This vendor assigned ID for this quote.
	VendorID string                   `json:"vendor_id"`
	JSON     foreignExchangeQuoteJSON `json:"-"`
}

func (*ForeignExchangeQuote) UnmarshalJSON added in v2.7.0

func (r *ForeignExchangeQuote) UnmarshalJSON(data []byte) (err error)

type ForeignExchangeQuoteForeignExchangeRate added in v2.7.0

type ForeignExchangeQuoteForeignExchangeRate struct {
	// Amount in the lowest denomination of the `base_currency` to convert, often
	// called the "sell" amount.
	BaseAmount int64 `json:"base_amount,required"`
	// Currency to convert, often called the "sell" currency.
	BaseCurrency shared.Currency `json:"base_currency,required"`
	// The exponent component of the rate. The decimal is calculated as `value` / (10 ^
	// `exponent`).
	Exponent int64 `json:"exponent,required"`
	// A string representation of the rate.
	RateString string `json:"rate_string,required"`
	// Amount in the lowest denomination of the `target_currency`, often called the
	// "buy" amount.
	TargetAmount int64 `json:"target_amount,required"`
	// Currency to convert the `base_currency` to, often called the "buy" currency.
	TargetCurrency shared.Currency `json:"target_currency,required"`
	// The whole number component of the rate. The decimal is calculated as `value` /
	// (10 ^ `exponent`).
	Value int64                                       `json:"value,required"`
	JSON  foreignExchangeQuoteForeignExchangeRateJSON `json:"-"`
}

The serialized rate information represented by this quote.

func (*ForeignExchangeQuoteForeignExchangeRate) UnmarshalJSON added in v2.7.0

func (r *ForeignExchangeQuoteForeignExchangeRate) UnmarshalJSON(data []byte) (err error)

type ForeignExchangeQuoteListParams added in v2.7.0

type ForeignExchangeQuoteListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Currency to convert, often called the "sell" currency.
	BaseCurrency param.Field[string] `query:"base_currency"`
	// An inclusive upper bound for searching effective_at
	EffectiveAtEnd param.Field[time.Time] `query:"effective_at_end" format:"date"`
	// An inclusive lower bound for searching effective_at
	EffectiveAtStart param.Field[time.Time] `query:"effective_at_start" format:"date"`
	// The timestamp until which the quote must be booked by.
	ExpiresAt param.Field[time.Time] `query:"expires_at" format:"date-time"`
	// The ID for the `InternalAccount` this quote is associated with.
	InternalAccountID param.Field[string] `query:"internal_account_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
	// Currency to convert the `base_currency` to, often called the "buy" currency.
	TargetCurrency param.Field[string] `query:"target_currency"`
}

func (ForeignExchangeQuoteListParams) URLQuery added in v2.7.0

func (r ForeignExchangeQuoteListParams) URLQuery() (v url.Values)

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

type ForeignExchangeQuoteNewParams added in v2.7.0

type ForeignExchangeQuoteNewParams struct {
	// The ID for the `InternalAccount` this quote is associated with.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// Currency to convert the `base_currency` to, often called the "buy" currency.
	TargetCurrency param.Field[shared.Currency] `json:"target_currency,required"`
	// Amount in the lowest denomination of the `base_currency` to convert, often
	// called the "sell" amount.
	BaseAmount param.Field[int64] `json:"base_amount"`
	// Currency to convert, often called the "sell" currency.
	BaseCurrency param.Field[shared.Currency] `json:"base_currency"`
	// The timestamp until when the quoted rate is valid.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// Amount in the lowest denomination of the `target_currency`, often called the
	// "buy" amount.
	TargetAmount param.Field[int64] `json:"target_amount"`
}

func (ForeignExchangeQuoteNewParams) MarshalJSON added in v2.7.0

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

type ForeignExchangeQuoteService added in v2.7.0

type ForeignExchangeQuoteService struct {
	Options []option.RequestOption
}

ForeignExchangeQuoteService contains methods and other services that help with interacting with the Modern Treasury 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 NewForeignExchangeQuoteService method instead.

func NewForeignExchangeQuoteService added in v2.7.0

func NewForeignExchangeQuoteService(opts ...option.RequestOption) (r *ForeignExchangeQuoteService)

NewForeignExchangeQuoteService 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 (*ForeignExchangeQuoteService) Get added in v2.7.0

get foreign_exchange_quote

func (*ForeignExchangeQuoteService) List added in v2.7.0

list foreign_exchange_quotes

func (*ForeignExchangeQuoteService) ListAutoPaging added in v2.7.0

list foreign_exchange_quotes

func (*ForeignExchangeQuoteService) New added in v2.7.0

create foreign_exchange_quote

type IncomingPaymentDetail

type IncomingPaymentDetail struct {
	ID string `json:"id,required" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount int64 `json:"amount,required"`
	// The date on which the corresponding transaction will occur.
	AsOfDate  time.Time `json:"as_of_date,required" format:"date"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The currency of the incoming payment detail.
	Currency shared.Currency `json:"currency,required"`
	// The raw data from the payment pre-notification file that we get from the bank.
	Data map[string]interface{} `json:"data,required"`
	// One of `credit` or `debit`.
	Direction shared.TransactionDirection `json:"direction,required"`
	// The ID of the Internal Account for the incoming payment detail. This is always
	// present.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// The ID of the ledger transaction linked to the incoming payment detail or
	// `null`.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The last 4 digits of the originating account_number for the incoming payment
	// detail.
	OriginatingAccountNumberSafe string `json:"originating_account_number_safe,required,nullable"`
	// The type of the originating account number for the incoming payment detail.
	OriginatingAccountNumberType IncomingPaymentDetailOriginatingAccountNumberType `json:"originating_account_number_type,required,nullable"`
	// The routing number of the originating account for the incoming payment detail.
	OriginatingRoutingNumber string `json:"originating_routing_number,required,nullable"`
	// The type of the originating routing number for the incoming payment detail.
	OriginatingRoutingNumberType IncomingPaymentDetailOriginatingRoutingNumberType `json:"originating_routing_number_type,required,nullable"`
	// The current status of the incoming payment order. One of `pending`, `completed`,
	// or `returned`.
	Status IncomingPaymentDetailStatus `json:"status,required"`
	// The ID of the reconciled Transaction or `null`.
	TransactionID string `json:"transaction_id,required,nullable" format:"uuid"`
	// The ID of the reconciled Transaction Line Item or `null`.
	TransactionLineItemID string `json:"transaction_line_item_id,required,nullable" format:"uuid"`
	// One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or
	// `wire`.
	Type      IncomingPaymentDetailType `json:"type,required"`
	UpdatedAt time.Time                 `json:"updated_at,required" format:"date-time"`
	// The identifier of the vendor bank.
	VendorID string `json:"vendor_id,required,nullable" format:"uuid"`
	// If the incoming payment detail is in a virtual account, the serialized virtual
	// account object.
	VirtualAccount VirtualAccount `json:"virtual_account,required,nullable"`
	// If the incoming payment detail is in a virtual account, the ID of the Virtual
	// Account.
	VirtualAccountID string `json:"virtual_account_id,required,nullable" format:"uuid"`
	// The account number of the originating account for the incoming payment detail.
	OriginatingAccountNumber string                    `json:"originating_account_number,nullable"`
	JSON                     incomingPaymentDetailJSON `json:"-"`
}

func (*IncomingPaymentDetail) UnmarshalJSON

func (r *IncomingPaymentDetail) UnmarshalJSON(data []byte) (err error)

type IncomingPaymentDetailListParams

type IncomingPaymentDetailListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Filters incoming payment details with an as_of_date starting on or before the
	// specified date (YYYY-MM-DD).
	AsOfDateEnd param.Field[time.Time] `query:"as_of_date_end" format:"date"`
	// Filters incoming payment details with an as_of_date starting on or after the
	// specified date (YYYY-MM-DD).
	AsOfDateStart param.Field[time.Time] `query:"as_of_date_start" format:"date"`
	// One of `credit` or `debit`.
	Direction param.Field[shared.TransactionDirection] `query:"direction"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
	// The current status of the incoming payment order. One of `pending`, `completed`,
	// or `returned`.
	Status param.Field[IncomingPaymentDetailListParamsStatus] `query:"status"`
	// One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or
	// `wire`.
	Type param.Field[IncomingPaymentDetailListParamsType] `query:"type"`
	// If the incoming payment detail is in a virtual account, the ID of the Virtual
	// Account.
	VirtualAccountID param.Field[string] `query:"virtual_account_id"`
}

func (IncomingPaymentDetailListParams) URLQuery

func (r IncomingPaymentDetailListParams) URLQuery() (v url.Values)

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

type IncomingPaymentDetailListParamsStatus

type IncomingPaymentDetailListParamsStatus string

The current status of the incoming payment order. One of `pending`, `completed`, or `returned`.

const (
	IncomingPaymentDetailListParamsStatusCompleted IncomingPaymentDetailListParamsStatus = "completed"
	IncomingPaymentDetailListParamsStatusPending   IncomingPaymentDetailListParamsStatus = "pending"
	IncomingPaymentDetailListParamsStatusReturned  IncomingPaymentDetailListParamsStatus = "returned"
)

func (IncomingPaymentDetailListParamsStatus) IsKnown added in v2.10.0

type IncomingPaymentDetailListParamsType

type IncomingPaymentDetailListParamsType string

One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or `wire`.

const (
	IncomingPaymentDetailListParamsTypeACH     IncomingPaymentDetailListParamsType = "ach"
	IncomingPaymentDetailListParamsTypeBook    IncomingPaymentDetailListParamsType = "book"
	IncomingPaymentDetailListParamsTypeCheck   IncomingPaymentDetailListParamsType = "check"
	IncomingPaymentDetailListParamsTypeEft     IncomingPaymentDetailListParamsType = "eft"
	IncomingPaymentDetailListParamsTypeInterac IncomingPaymentDetailListParamsType = "interac"
	IncomingPaymentDetailListParamsTypeRtp     IncomingPaymentDetailListParamsType = "rtp"
	IncomingPaymentDetailListParamsTypeSepa    IncomingPaymentDetailListParamsType = "sepa"
	IncomingPaymentDetailListParamsTypeSignet  IncomingPaymentDetailListParamsType = "signet"
	IncomingPaymentDetailListParamsTypeWire    IncomingPaymentDetailListParamsType = "wire"
)

func (IncomingPaymentDetailListParamsType) IsKnown added in v2.10.0

type IncomingPaymentDetailNewAsyncParams

type IncomingPaymentDetailNewAsyncParams struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount"`
	// Defaults to today.
	AsOfDate param.Field[time.Time] `json:"as_of_date" format:"date"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// Defaults to a random description.
	Description param.Field[string] `json:"description"`
	// One of `credit`, `debit`.
	Direction param.Field[IncomingPaymentDetailNewAsyncParamsDirection] `json:"direction"`
	// The ID of one of your internal accounts.
	InternalAccountID param.Field[string] `json:"internal_account_id" format:"uuid"`
	// One of `ach`, `wire`, `check`.
	Type param.Field[IncomingPaymentDetailNewAsyncParamsType] `json:"type"`
	// An optional parameter to associate the incoming payment detail to a virtual
	// account.
	VirtualAccountID param.Field[string] `json:"virtual_account_id" format:"uuid"`
}

func (IncomingPaymentDetailNewAsyncParams) MarshalJSON

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

type IncomingPaymentDetailNewAsyncParamsDirection

type IncomingPaymentDetailNewAsyncParamsDirection string

One of `credit`, `debit`.

const (
	IncomingPaymentDetailNewAsyncParamsDirectionCredit IncomingPaymentDetailNewAsyncParamsDirection = "credit"
	IncomingPaymentDetailNewAsyncParamsDirectionDebit  IncomingPaymentDetailNewAsyncParamsDirection = "debit"
)

func (IncomingPaymentDetailNewAsyncParamsDirection) IsKnown added in v2.10.0

type IncomingPaymentDetailNewAsyncParamsType

type IncomingPaymentDetailNewAsyncParamsType string

One of `ach`, `wire`, `check`.

const (
	IncomingPaymentDetailNewAsyncParamsTypeACH     IncomingPaymentDetailNewAsyncParamsType = "ach"
	IncomingPaymentDetailNewAsyncParamsTypeBook    IncomingPaymentDetailNewAsyncParamsType = "book"
	IncomingPaymentDetailNewAsyncParamsTypeCheck   IncomingPaymentDetailNewAsyncParamsType = "check"
	IncomingPaymentDetailNewAsyncParamsTypeEft     IncomingPaymentDetailNewAsyncParamsType = "eft"
	IncomingPaymentDetailNewAsyncParamsTypeInterac IncomingPaymentDetailNewAsyncParamsType = "interac"
	IncomingPaymentDetailNewAsyncParamsTypeRtp     IncomingPaymentDetailNewAsyncParamsType = "rtp"
	IncomingPaymentDetailNewAsyncParamsTypeSepa    IncomingPaymentDetailNewAsyncParamsType = "sepa"
	IncomingPaymentDetailNewAsyncParamsTypeSignet  IncomingPaymentDetailNewAsyncParamsType = "signet"
	IncomingPaymentDetailNewAsyncParamsTypeWire    IncomingPaymentDetailNewAsyncParamsType = "wire"
)

func (IncomingPaymentDetailNewAsyncParamsType) IsKnown added in v2.10.0

type IncomingPaymentDetailOriginatingAccountNumberType

type IncomingPaymentDetailOriginatingAccountNumberType string

The type of the originating account number for the incoming payment detail.

const (
	IncomingPaymentDetailOriginatingAccountNumberTypeAuNumber      IncomingPaymentDetailOriginatingAccountNumberType = "au_number"
	IncomingPaymentDetailOriginatingAccountNumberTypeClabe         IncomingPaymentDetailOriginatingAccountNumberType = "clabe"
	IncomingPaymentDetailOriginatingAccountNumberTypeHkNumber      IncomingPaymentDetailOriginatingAccountNumberType = "hk_number"
	IncomingPaymentDetailOriginatingAccountNumberTypeIban          IncomingPaymentDetailOriginatingAccountNumberType = "iban"
	IncomingPaymentDetailOriginatingAccountNumberTypeIDNumber      IncomingPaymentDetailOriginatingAccountNumberType = "id_number"
	IncomingPaymentDetailOriginatingAccountNumberTypeNzNumber      IncomingPaymentDetailOriginatingAccountNumberType = "nz_number"
	IncomingPaymentDetailOriginatingAccountNumberTypeOther         IncomingPaymentDetailOriginatingAccountNumberType = "other"
	IncomingPaymentDetailOriginatingAccountNumberTypePan           IncomingPaymentDetailOriginatingAccountNumberType = "pan"
	IncomingPaymentDetailOriginatingAccountNumberTypeSgNumber      IncomingPaymentDetailOriginatingAccountNumberType = "sg_number"
	IncomingPaymentDetailOriginatingAccountNumberTypeWalletAddress IncomingPaymentDetailOriginatingAccountNumberType = "wallet_address"
)

func (IncomingPaymentDetailOriginatingAccountNumberType) IsKnown added in v2.10.0

type IncomingPaymentDetailOriginatingRoutingNumberType

type IncomingPaymentDetailOriginatingRoutingNumberType string

The type of the originating routing number for the incoming payment detail.

const (
	IncomingPaymentDetailOriginatingRoutingNumberTypeAba                     IncomingPaymentDetailOriginatingRoutingNumberType = "aba"
	IncomingPaymentDetailOriginatingRoutingNumberTypeAuBsb                   IncomingPaymentDetailOriginatingRoutingNumberType = "au_bsb"
	IncomingPaymentDetailOriginatingRoutingNumberTypeBrCodigo                IncomingPaymentDetailOriginatingRoutingNumberType = "br_codigo"
	IncomingPaymentDetailOriginatingRoutingNumberTypeCaCpa                   IncomingPaymentDetailOriginatingRoutingNumberType = "ca_cpa"
	IncomingPaymentDetailOriginatingRoutingNumberTypeChips                   IncomingPaymentDetailOriginatingRoutingNumberType = "chips"
	IncomingPaymentDetailOriginatingRoutingNumberTypeCnaps                   IncomingPaymentDetailOriginatingRoutingNumberType = "cnaps"
	IncomingPaymentDetailOriginatingRoutingNumberTypeDkInterbankClearingCode IncomingPaymentDetailOriginatingRoutingNumberType = "dk_interbank_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeGBSortCode              IncomingPaymentDetailOriginatingRoutingNumberType = "gb_sort_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeHkInterbankClearingCode IncomingPaymentDetailOriginatingRoutingNumberType = "hk_interbank_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeHuInterbankClearingCode IncomingPaymentDetailOriginatingRoutingNumberType = "hu_interbank_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeIDSknbiCode             IncomingPaymentDetailOriginatingRoutingNumberType = "id_sknbi_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeInIfsc                  IncomingPaymentDetailOriginatingRoutingNumberType = "in_ifsc"
	IncomingPaymentDetailOriginatingRoutingNumberTypeJpZenginCode            IncomingPaymentDetailOriginatingRoutingNumberType = "jp_zengin_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeMxBankIdentifier        IncomingPaymentDetailOriginatingRoutingNumberType = "mx_bank_identifier"
	IncomingPaymentDetailOriginatingRoutingNumberTypeMyBranchCode            IncomingPaymentDetailOriginatingRoutingNumberType = "my_branch_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeNzNationalClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "nz_national_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypePlNationalClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "pl_national_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeSeBankgiroClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "se_bankgiro_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeSwift                   IncomingPaymentDetailOriginatingRoutingNumberType = "swift"
	IncomingPaymentDetailOriginatingRoutingNumberTypeZaNationalClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "za_national_clearing_code"
)

func (IncomingPaymentDetailOriginatingRoutingNumberType) IsKnown added in v2.10.0

type IncomingPaymentDetailService

type IncomingPaymentDetailService struct {
	Options []option.RequestOption
}

IncomingPaymentDetailService contains methods and other services that help with interacting with the Modern Treasury 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 NewIncomingPaymentDetailService method instead.

func NewIncomingPaymentDetailService

func NewIncomingPaymentDetailService(opts ...option.RequestOption) (r *IncomingPaymentDetailService)

NewIncomingPaymentDetailService 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 (*IncomingPaymentDetailService) Get

Get an existing Incoming Payment Detail.

func (*IncomingPaymentDetailService) List

Get a list of Incoming Payment Details.

func (*IncomingPaymentDetailService) ListAutoPaging

Get a list of Incoming Payment Details.

func (*IncomingPaymentDetailService) NewAsync

Simulate Incoming Payment Detail

func (*IncomingPaymentDetailService) Update

Update an existing Incoming Payment Detail.

type IncomingPaymentDetailStatus

type IncomingPaymentDetailStatus string

The current status of the incoming payment order. One of `pending`, `completed`, or `returned`.

const (
	IncomingPaymentDetailStatusCompleted IncomingPaymentDetailStatus = "completed"
	IncomingPaymentDetailStatusPending   IncomingPaymentDetailStatus = "pending"
	IncomingPaymentDetailStatusReturned  IncomingPaymentDetailStatus = "returned"
)

func (IncomingPaymentDetailStatus) IsKnown added in v2.10.0

func (r IncomingPaymentDetailStatus) IsKnown() bool

type IncomingPaymentDetailType

type IncomingPaymentDetailType string

One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or `wire`.

const (
	IncomingPaymentDetailTypeACH     IncomingPaymentDetailType = "ach"
	IncomingPaymentDetailTypeBook    IncomingPaymentDetailType = "book"
	IncomingPaymentDetailTypeCheck   IncomingPaymentDetailType = "check"
	IncomingPaymentDetailTypeEft     IncomingPaymentDetailType = "eft"
	IncomingPaymentDetailTypeInterac IncomingPaymentDetailType = "interac"
	IncomingPaymentDetailTypeRtp     IncomingPaymentDetailType = "rtp"
	IncomingPaymentDetailTypeSepa    IncomingPaymentDetailType = "sepa"
	IncomingPaymentDetailTypeSignet  IncomingPaymentDetailType = "signet"
	IncomingPaymentDetailTypeWire    IncomingPaymentDetailType = "wire"
)

func (IncomingPaymentDetailType) IsKnown added in v2.10.0

func (r IncomingPaymentDetailType) IsKnown() bool

type IncomingPaymentDetailUpdateParams

type IncomingPaymentDetailUpdateParams struct {
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (IncomingPaymentDetailUpdateParams) MarshalJSON

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

type InternalAccount

type InternalAccount struct {
	ID string `json:"id,required" format:"uuid"`
	// An array of account detail objects.
	AccountDetails []AccountDetail `json:"account_details,required"`
	// Can be checking, savings or other.
	AccountType InternalAccountAccountType `json:"account_type,required,nullable"`
	// Specifies which financial institution the accounts belong to.
	Connection Connection `json:"connection,required"`
	// The Counterparty associated to this account.
	CounterpartyID string    `json:"counterparty_id,required,nullable" format:"uuid"`
	CreatedAt      time.Time `json:"created_at,required" format:"date-time"`
	// The currency of the account.
	Currency shared.Currency `json:"currency,required"`
	// If the internal account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID string `json:"ledger_account_id,required,nullable" format:"uuid"`
	// The Legal Entity associated to this account
	LegalEntityID string `json:"legal_entity_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// A nickname for the account.
	Name   string `json:"name,required,nullable"`
	Object string `json:"object,required"`
	// The parent InternalAccount of this account.
	ParentAccountID string `json:"parent_account_id,required,nullable" format:"uuid"`
	// The address associated with the owner or null.
	PartyAddress InternalAccountPartyAddress `json:"party_address,required,nullable"`
	// The legal name of the entity which owns the account.
	PartyName string `json:"party_name,required"`
	// Either individual or business.
	PartyType InternalAccountPartyType `json:"party_type,required,nullable"`
	// An array of routing detail objects.
	RoutingDetails []RoutingDetail     `json:"routing_details,required"`
	UpdatedAt      time.Time           `json:"updated_at,required" format:"date-time"`
	JSON           internalAccountJSON `json:"-"`
}

func (*InternalAccount) UnmarshalJSON

func (r *InternalAccount) UnmarshalJSON(data []byte) (err error)

type InternalAccountAccountType

type InternalAccountAccountType string

Can be checking, savings or other.

const (
	InternalAccountAccountTypeCash          InternalAccountAccountType = "cash"
	InternalAccountAccountTypeChecking      InternalAccountAccountType = "checking"
	InternalAccountAccountTypeGeneralLedger InternalAccountAccountType = "general_ledger"
	InternalAccountAccountTypeLoan          InternalAccountAccountType = "loan"
	InternalAccountAccountTypeNonResident   InternalAccountAccountType = "non_resident"
	InternalAccountAccountTypeOther         InternalAccountAccountType = "other"
	InternalAccountAccountTypeOverdraft     InternalAccountAccountType = "overdraft"
	InternalAccountAccountTypeSavings       InternalAccountAccountType = "savings"
)

func (InternalAccountAccountType) IsKnown added in v2.10.0

func (r InternalAccountAccountType) IsKnown() bool

type InternalAccountBalanceReportService

type InternalAccountBalanceReportService struct {
	Options []option.RequestOption
}

InternalAccountBalanceReportService contains methods and other services that help with interacting with the Modern Treasury 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 NewInternalAccountBalanceReportService method instead.

func NewInternalAccountBalanceReportService

func NewInternalAccountBalanceReportService(opts ...option.RequestOption) (r *InternalAccountBalanceReportService)

NewInternalAccountBalanceReportService 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 (*InternalAccountBalanceReportService) Delete added in v2.6.0

func (r *InternalAccountBalanceReportService) Delete(ctx context.Context, internalAccountID string, id string, opts ...option.RequestOption) (err error)

Deletes a given balance report.

func (*InternalAccountBalanceReportService) Get

func (r *InternalAccountBalanceReportService) Get(ctx context.Context, internalAccountID string, id string, opts ...option.RequestOption) (res *BalanceReport, err error)

Get a single balance report for a given internal account.

func (*InternalAccountBalanceReportService) List

Get all balance reports for a given internal account.

func (*InternalAccountBalanceReportService) ListAutoPaging

Get all balance reports for a given internal account.

func (*InternalAccountBalanceReportService) New added in v2.6.0

create balance reports

type InternalAccountListParams

type InternalAccountListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Only return internal accounts associated with this counterparty.
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// Only return internal accounts with this currency.
	Currency param.Field[shared.Currency] `query:"currency"`
	// Only return internal accounts associated with this legal entity.
	LegalEntityID param.Field[string] `query:"legal_entity_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// Only return internal accounts that can originate payments with this direction.
	PaymentDirection param.Field[shared.TransactionDirection] `query:"payment_direction"`
	// Only return internal accounts that can make this type of payment.
	PaymentType param.Field[InternalAccountListParamsPaymentType] `query:"payment_type"`
	PerPage     param.Field[int64]                                `query:"per_page"`
}

func (InternalAccountListParams) URLQuery

func (r InternalAccountListParams) URLQuery() (v url.Values)

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

type InternalAccountListParamsPaymentType

type InternalAccountListParamsPaymentType string

Only return internal accounts that can make this type of payment.

const (
	InternalAccountListParamsPaymentTypeACH         InternalAccountListParamsPaymentType = "ach"
	InternalAccountListParamsPaymentTypeAuBecs      InternalAccountListParamsPaymentType = "au_becs"
	InternalAccountListParamsPaymentTypeBacs        InternalAccountListParamsPaymentType = "bacs"
	InternalAccountListParamsPaymentTypeBook        InternalAccountListParamsPaymentType = "book"
	InternalAccountListParamsPaymentTypeCard        InternalAccountListParamsPaymentType = "card"
	InternalAccountListParamsPaymentTypeChats       InternalAccountListParamsPaymentType = "chats"
	InternalAccountListParamsPaymentTypeCheck       InternalAccountListParamsPaymentType = "check"
	InternalAccountListParamsPaymentTypeCrossBorder InternalAccountListParamsPaymentType = "cross_border"
	InternalAccountListParamsPaymentTypeDkNets      InternalAccountListParamsPaymentType = "dk_nets"
	InternalAccountListParamsPaymentTypeEft         InternalAccountListParamsPaymentType = "eft"
	InternalAccountListParamsPaymentTypeHuIcs       InternalAccountListParamsPaymentType = "hu_ics"
	InternalAccountListParamsPaymentTypeInterac     InternalAccountListParamsPaymentType = "interac"
	InternalAccountListParamsPaymentTypeMasav       InternalAccountListParamsPaymentType = "masav"
	InternalAccountListParamsPaymentTypeMxCcen      InternalAccountListParamsPaymentType = "mx_ccen"
	InternalAccountListParamsPaymentTypeNeft        InternalAccountListParamsPaymentType = "neft"
	InternalAccountListParamsPaymentTypeNics        InternalAccountListParamsPaymentType = "nics"
	InternalAccountListParamsPaymentTypeNzBecs      InternalAccountListParamsPaymentType = "nz_becs"
	InternalAccountListParamsPaymentTypePlElixir    InternalAccountListParamsPaymentType = "pl_elixir"
	InternalAccountListParamsPaymentTypeProvxchange InternalAccountListParamsPaymentType = "provxchange"
	InternalAccountListParamsPaymentTypeRoSent      InternalAccountListParamsPaymentType = "ro_sent"
	InternalAccountListParamsPaymentTypeRtp         InternalAccountListParamsPaymentType = "rtp"
	InternalAccountListParamsPaymentTypeSeBankgirot InternalAccountListParamsPaymentType = "se_bankgirot"
	InternalAccountListParamsPaymentTypeSen         InternalAccountListParamsPaymentType = "sen"
	InternalAccountListParamsPaymentTypeSepa        InternalAccountListParamsPaymentType = "sepa"
	InternalAccountListParamsPaymentTypeSgGiro      InternalAccountListParamsPaymentType = "sg_giro"
	InternalAccountListParamsPaymentTypeSic         InternalAccountListParamsPaymentType = "sic"
	InternalAccountListParamsPaymentTypeSignet      InternalAccountListParamsPaymentType = "signet"
	InternalAccountListParamsPaymentTypeSknbi       InternalAccountListParamsPaymentType = "sknbi"
	InternalAccountListParamsPaymentTypeWire        InternalAccountListParamsPaymentType = "wire"
	InternalAccountListParamsPaymentTypeZengin      InternalAccountListParamsPaymentType = "zengin"
)

func (InternalAccountListParamsPaymentType) IsKnown added in v2.10.0

type InternalAccountNewParams

type InternalAccountNewParams struct {
	// The identifier of the financial institution the account belongs to.
	ConnectionID param.Field[string] `json:"connection_id,required"`
	// Either "USD" or "CAD". Internal accounts created at Increase only supports
	// "USD".
	Currency param.Field[InternalAccountNewParamsCurrency] `json:"currency,required"`
	// The nickname of the account.
	Name param.Field[string] `json:"name,required"`
	// The legal name of the entity which owns the account.
	PartyName param.Field[string] `json:"party_name,required"`
	// The Counterparty associated to this account.
	CounterpartyID param.Field[string] `json:"counterparty_id"`
	// The LegalEntity associated to this account.
	LegalEntityID param.Field[string] `json:"legal_entity_id"`
	// The parent internal account of this new account.
	ParentAccountID param.Field[string] `json:"parent_account_id"`
	// The address associated with the owner or null.
	PartyAddress param.Field[InternalAccountNewParamsPartyAddress] `json:"party_address"`
	// A hash of vendor specific attributes that will be used when creating the account
	// at the vendor specified by the given connection.
	VendorAttributes param.Field[map[string]string] `json:"vendor_attributes"`
}

func (InternalAccountNewParams) MarshalJSON

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

type InternalAccountNewParamsCurrency

type InternalAccountNewParamsCurrency string

Either "USD" or "CAD". Internal accounts created at Increase only supports "USD".

const (
	InternalAccountNewParamsCurrencyUsd InternalAccountNewParamsCurrency = "USD"
	InternalAccountNewParamsCurrencyCad InternalAccountNewParamsCurrency = "CAD"
)

func (InternalAccountNewParamsCurrency) IsKnown added in v2.10.0

type InternalAccountNewParamsPartyAddress

type InternalAccountNewParamsPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The address associated with the owner or null.

func (InternalAccountNewParamsPartyAddress) MarshalJSON

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

type InternalAccountPartyAddress

type InternalAccountPartyAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country   string    `json:"country,required,nullable"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	Line1     string    `json:"line1,required,nullable"`
	Line2     string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                          `json:"region,required,nullable"`
	UpdatedAt time.Time                       `json:"updated_at,required" format:"date-time"`
	JSON      internalAccountPartyAddressJSON `json:"-"`
}

The address associated with the owner or null.

func (*InternalAccountPartyAddress) UnmarshalJSON

func (r *InternalAccountPartyAddress) UnmarshalJSON(data []byte) (err error)

type InternalAccountPartyType

type InternalAccountPartyType string

Either individual or business.

const (
	InternalAccountPartyTypeBusiness   InternalAccountPartyType = "business"
	InternalAccountPartyTypeIndividual InternalAccountPartyType = "individual"
)

func (InternalAccountPartyType) IsKnown added in v2.10.0

func (r InternalAccountPartyType) IsKnown() bool

type InternalAccountService

type InternalAccountService struct {
	Options        []option.RequestOption
	BalanceReports *InternalAccountBalanceReportService
}

InternalAccountService contains methods and other services that help with interacting with the Modern Treasury 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 NewInternalAccountService method instead.

func NewInternalAccountService

func NewInternalAccountService(opts ...option.RequestOption) (r *InternalAccountService)

NewInternalAccountService 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 (*InternalAccountService) Get

get internal account

func (*InternalAccountService) List

list internal accounts

func (*InternalAccountService) ListAutoPaging

list internal accounts

func (*InternalAccountService) New

create internal account

func (*InternalAccountService) Update

update internal account

type InternalAccountUpdateParams

type InternalAccountUpdateParams struct {
	// The Counterparty associated to this account.
	CounterpartyID param.Field[string] `json:"counterparty_id"`
	// The Ledger Account associated to this account.
	LedgerAccountID param.Field[string] `json:"ledger_account_id"`
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The nickname for the internal account.
	Name param.Field[string] `json:"name"`
	// The parent internal account for this account.
	ParentAccountID param.Field[string] `json:"parent_account_id"`
}

func (InternalAccountUpdateParams) MarshalJSON

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

type Invoice

type Invoice struct {
	ID string `json:"id,required" format:"uuid"`
	// Amount paid on the invoice in specified currency's smallest unit, e.g., $10 USD
	// would be represented as 1000.
	AmountPaid int64 `json:"amount_paid,required"`
	// Amount remaining due on the invoice in specified currency's smallest unit, e.g.,
	// $10 USD would be represented as 1000.
	AmountRemaining int64 `json:"amount_remaining,required"`
	// The invoicer's contact details displayed at the top of the invoice.
	ContactDetails []InvoiceContactDetail `json:"contact_details,required"`
	// The counterparty's billing address.
	CounterpartyBillingAddress InvoiceCounterpartyBillingAddress `json:"counterparty_billing_address,required,nullable"`
	// The ID of the counterparty receiving the invoice.
	CounterpartyID string `json:"counterparty_id,required"`
	// The counterparty's shipping address where physical goods should be delivered.
	CounterpartyShippingAddress InvoiceCounterpartyShippingAddress `json:"counterparty_shipping_address,required,nullable"`
	CreatedAt                   time.Time                          `json:"created_at,required" format:"date-time"`
	// Currency that the invoice is denominated in. Defaults to `USD` if not provided.
	Currency shared.Currency `json:"currency,required"`
	// A free-form description of the invoice.
	Description string `json:"description,required"`
	// A future date by when the invoice needs to be paid.
	DueDate time.Time `json:"due_date,required" format:"date-time"`
	// The expected payments created for an unpaid invoice.
	ExpectedPayments []ExpectedPayment `json:"expected_payments,required"`
	// When payment_method is automatic, the fallback payment method to use when an
	// automatic payment fails. One of `manual` or `ui`.
	FallbackPaymentMethod string `json:"fallback_payment_method,required,nullable"`
	// The URL of the hosted web UI where the invoice can be viewed.
	HostedURL string `json:"hosted_url,required"`
	// The invoice issuer's business address.
	InvoicerAddress InvoiceInvoicerAddress `json:"invoicer_address,required,nullable"`
	// The ledger account settlement object linked to the invoice.
	LedgerAccountSettlementID string `json:"ledger_account_settlement_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// Emails in addition to the counterparty email to send invoice status
	// notifications to. At least one email is required if notifications are enabled
	// and the counterparty doesn't have an email.
	NotificationEmailAddresses []string `json:"notification_email_addresses,required,nullable"`
	// If true, the invoice will send email notifications to the invoice recipients
	// about invoice status changes.
	NotificationsEnabled bool `json:"notifications_enabled,required"`
	// A unique record number assigned to each invoice that is issued.
	Number string `json:"number,required"`
	Object string `json:"object,required"`
	// The ID of the internal account the invoice should be paid to.
	OriginatingAccountID string `json:"originating_account_id,required"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	PaymentEffectiveDate time.Time `json:"payment_effective_date,required,nullable" format:"date"`
	// When opening an invoice, whether to show the embedded payment UI , automatically
	// debit the recipient, or rely on manual payment from the recipient.
	PaymentMethod InvoicePaymentMethod `json:"payment_method,required,nullable"`
	// The payment orders created for paying the invoice through the invoice payment
	// UI.
	PaymentOrders []PaymentOrder `json:"payment_orders,required"`
	// One of `ach` or `eft`.
	PaymentType InvoicePaymentType `json:"payment_type,required,nullable"`
	// The URL where the invoice PDF can be downloaded.
	PdfURL string `json:"pdf_url,required,nullable"`
	// The receiving account ID. Can be an `internal_account`.
	ReceivingAccountID string `json:"receiving_account_id,required,nullable" format:"uuid"`
	// The email of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientEmail string `json:"recipient_email,required,nullable"`
	// The name of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientName string `json:"recipient_name,required,nullable"`
	// Number of days after due date when overdue reminder emails will be sent out to
	// invoice recipients.
	RemindAfterOverdueDays []int64 `json:"remind_after_overdue_days,required,nullable"`
	// The status of the invoice.
	Status InvoiceStatus `json:"status,required"`
	// Total amount due in specified currency's smallest unit, e.g., $10 USD would be
	// represented as 1000.
	TotalAmount int64 `json:"total_amount,required"`
	// IDs of transaction line items associated with an invoice.
	TransactionLineItemIDs []string  `json:"transaction_line_item_ids,required" format:"uuid"`
	UpdatedAt              time.Time `json:"updated_at,required" format:"date-time"`
	// The ID of the virtual account the invoice should be paid to.
	VirtualAccountID string      `json:"virtual_account_id,required,nullable" format:"uuid"`
	JSON             invoiceJSON `json:"-"`
}

func (*Invoice) UnmarshalJSON

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

type InvoiceContactDetail

type InvoiceContactDetail struct {
	ID                    string                                     `json:"id,required" format:"uuid"`
	ContactIdentifier     string                                     `json:"contact_identifier,required"`
	ContactIdentifierType InvoiceContactDetailsContactIdentifierType `json:"contact_identifier_type,required"`
	CreatedAt             time.Time                                  `json:"created_at,required" format:"date-time"`
	DiscardedAt           time.Time                                  `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                     `json:"live_mode,required"`
	Object    string                   `json:"object,required"`
	UpdatedAt time.Time                `json:"updated_at,required" format:"date-time"`
	JSON      invoiceContactDetailJSON `json:"-"`
}

func (*InvoiceContactDetail) UnmarshalJSON

func (r *InvoiceContactDetail) UnmarshalJSON(data []byte) (err error)

type InvoiceContactDetailsContactIdentifierType

type InvoiceContactDetailsContactIdentifierType string
const (
	InvoiceContactDetailsContactIdentifierTypeEmail       InvoiceContactDetailsContactIdentifierType = "email"
	InvoiceContactDetailsContactIdentifierTypePhoneNumber InvoiceContactDetailsContactIdentifierType = "phone_number"
	InvoiceContactDetailsContactIdentifierTypeWebsite     InvoiceContactDetailsContactIdentifierType = "website"
)

func (InvoiceContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type InvoiceCounterpartyBillingAddress

type InvoiceCounterpartyBillingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country string `json:"country,required"`
	Line1   string `json:"line1,required"`
	// Locality or City.
	Locality string `json:"locality,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required"`
	// Region or State.
	Region string                                `json:"region,required"`
	Line2  string                                `json:"line2"`
	JSON   invoiceCounterpartyBillingAddressJSON `json:"-"`
}

The counterparty's billing address.

func (*InvoiceCounterpartyBillingAddress) UnmarshalJSON

func (r *InvoiceCounterpartyBillingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceCounterpartyShippingAddress

type InvoiceCounterpartyShippingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country string `json:"country,required"`
	Line1   string `json:"line1,required"`
	// Locality or City.
	Locality string `json:"locality,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required"`
	// Region or State.
	Region string                                 `json:"region,required"`
	Line2  string                                 `json:"line2"`
	JSON   invoiceCounterpartyShippingAddressJSON `json:"-"`
}

The counterparty's shipping address where physical goods should be delivered.

func (*InvoiceCounterpartyShippingAddress) UnmarshalJSON

func (r *InvoiceCounterpartyShippingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceInvoicerAddress

type InvoiceInvoicerAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country string `json:"country,required"`
	Line1   string `json:"line1,required"`
	// Locality or City.
	Locality string `json:"locality,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required"`
	// Region or State.
	Region string                     `json:"region,required"`
	Line2  string                     `json:"line2"`
	JSON   invoiceInvoicerAddressJSON `json:"-"`
}

The invoice issuer's business address.

func (*InvoiceInvoicerAddress) UnmarshalJSON

func (r *InvoiceInvoicerAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItem

type InvoiceLineItem struct {
	ID string `json:"id,required" format:"uuid"`
	// The total amount for this line item specified in the invoice currency's smallest
	// unit.
	Amount    int64     `json:"amount,required"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// An optional free-form description of the line item.
	Description string `json:"description,required"`
	// Either `debit` or `credit`. `debit` indicates that a client owes the business
	// money and increases the invoice's `total_amount` due. `credit` has the opposite
	// intention and effect.
	Direction string `json:"direction,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// The name of the line item, typically a product or SKU name.
	Name   string `json:"name,required"`
	Object string `json:"object,required"`
	// The number of units of a product or service that this line item is for. Must be
	// a whole number. Defaults to 1 if not provided.
	Quantity int64 `json:"quantity,required"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit.
	UnitAmount int64 `json:"unit_amount,required"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit. Accepts decimal strings with
	// up to 12 decimals
	UnitAmountDecimal string              `json:"unit_amount_decimal,required"`
	UpdatedAt         time.Time           `json:"updated_at,required" format:"date-time"`
	JSON              invoiceLineItemJSON `json:"-"`
}

func (*InvoiceLineItem) UnmarshalJSON

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

type InvoiceLineItemListParams

type InvoiceLineItemListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (InvoiceLineItemListParams) URLQuery

func (r InvoiceLineItemListParams) URLQuery() (v url.Values)

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

type InvoiceLineItemNewParams

type InvoiceLineItemNewParams struct {
	// The name of the line item, typically a product or SKU name.
	Name param.Field[string] `json:"name,required"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit.
	UnitAmount param.Field[int64] `json:"unit_amount,required"`
	// An optional free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Either `debit` or `credit`. `debit` indicates that a client owes the business
	// money and increases the invoice's `total_amount` due. `credit` has the opposite
	// intention and effect.
	Direction param.Field[string] `json:"direction"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The number of units of a product or service that this line item is for. Must be
	// a whole number. Defaults to 1 if not provided.
	Quantity param.Field[int64] `json:"quantity"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit. Accepts decimal strings with
	// up to 12 decimals
	UnitAmountDecimal param.Field[string] `json:"unit_amount_decimal"`
}

func (InvoiceLineItemNewParams) MarshalJSON

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

type InvoiceLineItemService

type InvoiceLineItemService struct {
	Options []option.RequestOption
}

InvoiceLineItemService contains methods and other services that help with interacting with the Modern Treasury 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 NewInvoiceLineItemService method instead.

func NewInvoiceLineItemService

func NewInvoiceLineItemService(opts ...option.RequestOption) (r *InvoiceLineItemService)

NewInvoiceLineItemService 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 (*InvoiceLineItemService) Delete

func (r *InvoiceLineItemService) Delete(ctx context.Context, invoiceID string, id string, opts ...option.RequestOption) (res *InvoiceLineItem, err error)

delete invoice_line_item

func (*InvoiceLineItemService) Get

func (r *InvoiceLineItemService) Get(ctx context.Context, invoiceID string, id string, opts ...option.RequestOption) (res *InvoiceLineItem, err error)

get invoice_line_item

func (*InvoiceLineItemService) List

list invoice_line_items

func (*InvoiceLineItemService) ListAutoPaging

list invoice_line_items

func (*InvoiceLineItemService) New

create invoice_line_item

func (*InvoiceLineItemService) Update

update invoice_line_item

type InvoiceLineItemUpdateParams

type InvoiceLineItemUpdateParams struct {
	// An optional free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Either `debit` or `credit`. `debit` indicates that a client owes the business
	// money and increases the invoice's `total_amount` due. `credit` has the opposite
	// intention and effect.
	Direction param.Field[string] `json:"direction"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The name of the line item, typically a product or SKU name.
	Name param.Field[string] `json:"name"`
	// The number of units of a product or service that this line item is for. Must be
	// a whole number. Defaults to 1 if not provided.
	Quantity param.Field[int64] `json:"quantity"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit.
	UnitAmount param.Field[int64] `json:"unit_amount"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit. Accepts decimal strings with
	// up to 12 decimals
	UnitAmountDecimal param.Field[string] `json:"unit_amount_decimal"`
}

func (InvoiceLineItemUpdateParams) MarshalJSON

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

type InvoiceListParams

type InvoiceListParams struct {
	AfterCursor    param.Field[string] `query:"after_cursor"`
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// An inclusive upper bound for searching due_date
	DueDateEnd param.Field[time.Time] `query:"due_date_end" format:"date"`
	// An inclusive lower bound for searching due_date
	DueDateStart      param.Field[time.Time] `query:"due_date_start" format:"date"`
	ExpectedPaymentID param.Field[string]    `query:"expected_payment_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// A unique record number assigned to each invoice that is issued.
	Number               param.Field[string]                  `query:"number"`
	OriginatingAccountID param.Field[string]                  `query:"originating_account_id"`
	PaymentOrderID       param.Field[string]                  `query:"payment_order_id"`
	PerPage              param.Field[int64]                   `query:"per_page"`
	Status               param.Field[InvoiceListParamsStatus] `query:"status"`
}

func (InvoiceListParams) URLQuery

func (r InvoiceListParams) URLQuery() (v url.Values)

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

type InvoiceListParamsStatus added in v2.10.0

type InvoiceListParamsStatus string
const (
	InvoiceListParamsStatusDraft          InvoiceListParamsStatus = "draft"
	InvoiceListParamsStatusPaid           InvoiceListParamsStatus = "paid"
	InvoiceListParamsStatusPartiallyPaid  InvoiceListParamsStatus = "partially_paid"
	InvoiceListParamsStatusPaymentPending InvoiceListParamsStatus = "payment_pending"
	InvoiceListParamsStatusUnpaid         InvoiceListParamsStatus = "unpaid"
	InvoiceListParamsStatusVoided         InvoiceListParamsStatus = "voided"
)

func (InvoiceListParamsStatus) IsKnown added in v2.10.0

func (r InvoiceListParamsStatus) IsKnown() bool

type InvoiceNewParams

type InvoiceNewParams struct {
	// The ID of the counterparty receiving the invoice.
	CounterpartyID param.Field[string] `json:"counterparty_id,required"`
	// A future date by when the invoice needs to be paid.
	DueDate param.Field[time.Time] `json:"due_date,required" format:"date-time"`
	// The ID of the internal account the invoice should be paid to.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required"`
	// The invoicer's contact details displayed at the top of the invoice.
	ContactDetails param.Field[[]InvoiceNewParamsContactDetail] `json:"contact_details"`
	// The counterparty's billing address.
	CounterpartyBillingAddress param.Field[InvoiceNewParamsCounterpartyBillingAddress] `json:"counterparty_billing_address"`
	// The counterparty's shipping address where physical goods should be delivered.
	CounterpartyShippingAddress param.Field[InvoiceNewParamsCounterpartyShippingAddress] `json:"counterparty_shipping_address"`
	// Currency that the invoice is denominated in. Defaults to `USD` if not provided.
	Currency param.Field[shared.Currency] `json:"currency"`
	// A free-form description of the invoice.
	Description param.Field[string] `json:"description"`
	// When payment_method is automatic, the fallback payment method to use when an
	// automatic payment fails. One of `manual` or `ui`.
	FallbackPaymentMethod param.Field[string] `json:"fallback_payment_method"`
	// Whether to ingest the ledger_entries to populate the invoice line items. If this
	// is false, then a line item must be provided. If this is true, line_items must be
	// empty. Ignored if ledger_account_settlement_id is empty.
	IngestLedgerEntries param.Field[bool] `json:"ingest_ledger_entries"`
	// An array of invoice line items. The API supports a maximum of 50 invoice line
	// items per invoice. If a greater number of invoice line items is required, please
	// contact support.
	InvoiceLineItems param.Field[[]InvoiceNewParamsInvoiceLineItem] `json:"invoice_line_items"`
	// The invoice issuer's business address.
	InvoicerAddress param.Field[InvoiceNewParamsInvoicerAddress] `json:"invoicer_address"`
	// The ID of the virtual account the invoice should be paid to.
	LedgerAccountSettlementID param.Field[string] `json:"ledger_account_settlement_id" format:"uuid"`
	// Emails in addition to the counterparty email to send invoice status
	// notifications to. At least one email is required if notifications are enabled
	// and the counterparty doesn't have an email.
	NotificationEmailAddresses param.Field[[]string] `json:"notification_email_addresses"`
	// If true, the invoice will send email notifications to the invoice recipients
	// about invoice status changes.
	NotificationsEnabled param.Field[bool] `json:"notifications_enabled"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	PaymentEffectiveDate param.Field[time.Time] `json:"payment_effective_date" format:"date"`
	// The method by which the invoice can be paid. `ui` will show the embedded payment
	// collection flow. `automatic` will automatically initiate payment based upon the
	// account details of the receiving_account id.\nIf the invoice amount is positive,
	// the automatically initiated payment order's direction will be debit. If the
	// invoice amount is negative, the automatically initiated payment order's
	// direction will be credit. One of `manual`, `ui`, or `automatic`.
	PaymentMethod param.Field[InvoiceNewParamsPaymentMethod] `json:"payment_method"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	PaymentType param.Field[PaymentOrderType] `json:"payment_type"`
	// The receiving account ID. Can be an `external_account`.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// The email of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientEmail param.Field[string] `json:"recipient_email"`
	// The name of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientName param.Field[string] `json:"recipient_name"`
	// Number of days after due date when overdue reminder emails will be sent out to
	// invoice recipients.
	RemindAfterOverdueDays param.Field[[]int64] `json:"remind_after_overdue_days"`
	// The ID of the virtual account the invoice should be paid to.
	VirtualAccountID param.Field[string] `json:"virtual_account_id" format:"uuid"`
}

func (InvoiceNewParams) MarshalJSON

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

type InvoiceNewParamsContactDetail

type InvoiceNewParamsContactDetail struct {
	ID                    param.Field[string]                                              `json:"id,required" format:"uuid"`
	ContactIdentifier     param.Field[string]                                              `json:"contact_identifier,required"`
	ContactIdentifierType param.Field[InvoiceNewParamsContactDetailsContactIdentifierType] `json:"contact_identifier_type,required"`
	CreatedAt             param.Field[time.Time]                                           `json:"created_at,required" format:"date-time"`
	DiscardedAt           param.Field[time.Time]                                           `json:"discarded_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  param.Field[bool]      `json:"live_mode,required"`
	Object    param.Field[string]    `json:"object,required"`
	UpdatedAt param.Field[time.Time] `json:"updated_at,required" format:"date-time"`
}

func (InvoiceNewParamsContactDetail) MarshalJSON

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

type InvoiceNewParamsContactDetailsContactIdentifierType

type InvoiceNewParamsContactDetailsContactIdentifierType string
const (
	InvoiceNewParamsContactDetailsContactIdentifierTypeEmail       InvoiceNewParamsContactDetailsContactIdentifierType = "email"
	InvoiceNewParamsContactDetailsContactIdentifierTypePhoneNumber InvoiceNewParamsContactDetailsContactIdentifierType = "phone_number"
	InvoiceNewParamsContactDetailsContactIdentifierTypeWebsite     InvoiceNewParamsContactDetailsContactIdentifierType = "website"
)

func (InvoiceNewParamsContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type InvoiceNewParamsCounterpartyBillingAddress

type InvoiceNewParamsCounterpartyBillingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The counterparty's billing address.

func (InvoiceNewParamsCounterpartyBillingAddress) MarshalJSON

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

type InvoiceNewParamsCounterpartyShippingAddress

type InvoiceNewParamsCounterpartyShippingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The counterparty's shipping address where physical goods should be delivered.

func (InvoiceNewParamsCounterpartyShippingAddress) MarshalJSON

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

type InvoiceNewParamsInvoiceLineItem added in v2.13.0

type InvoiceNewParamsInvoiceLineItem struct {
	// The name of the line item, typically a product or SKU name.
	Name param.Field[string] `json:"name,required"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit.
	UnitAmount param.Field[int64] `json:"unit_amount,required"`
	// An optional free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Either `debit` or `credit`. `debit` indicates that a client owes the business
	// money and increases the invoice's `total_amount` due. `credit` has the opposite
	// intention and effect.
	Direction param.Field[string] `json:"direction"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The number of units of a product or service that this line item is for. Must be
	// a whole number. Defaults to 1 if not provided.
	Quantity param.Field[int64] `json:"quantity"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit. Accepts decimal strings with
	// up to 12 decimals
	UnitAmountDecimal param.Field[string] `json:"unit_amount_decimal"`
}

func (InvoiceNewParamsInvoiceLineItem) MarshalJSON added in v2.13.0

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

type InvoiceNewParamsInvoicerAddress

type InvoiceNewParamsInvoicerAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The invoice issuer's business address.

func (InvoiceNewParamsInvoicerAddress) MarshalJSON

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

type InvoiceNewParamsPaymentMethod

type InvoiceNewParamsPaymentMethod string

The method by which the invoice can be paid. `ui` will show the embedded payment collection flow. `automatic` will automatically initiate payment based upon the account details of the receiving_account id.\nIf the invoice amount is positive, the automatically initiated payment order's direction will be debit. If the invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`.

const (
	InvoiceNewParamsPaymentMethodUi        InvoiceNewParamsPaymentMethod = "ui"
	InvoiceNewParamsPaymentMethodManual    InvoiceNewParamsPaymentMethod = "manual"
	InvoiceNewParamsPaymentMethodAutomatic InvoiceNewParamsPaymentMethod = "automatic"
)

func (InvoiceNewParamsPaymentMethod) IsKnown added in v2.10.0

func (r InvoiceNewParamsPaymentMethod) IsKnown() bool

type InvoicePaymentMethod

type InvoicePaymentMethod string

When opening an invoice, whether to show the embedded payment UI , automatically debit the recipient, or rely on manual payment from the recipient.

const (
	InvoicePaymentMethodUi        InvoicePaymentMethod = "ui"
	InvoicePaymentMethodManual    InvoicePaymentMethod = "manual"
	InvoicePaymentMethodAutomatic InvoicePaymentMethod = "automatic"
)

func (InvoicePaymentMethod) IsKnown added in v2.10.0

func (r InvoicePaymentMethod) IsKnown() bool

type InvoicePaymentType

type InvoicePaymentType string

One of `ach` or `eft`.

const (
	InvoicePaymentTypeEft InvoicePaymentType = "eft"
	InvoicePaymentTypeACH InvoicePaymentType = "ach"
)

func (InvoicePaymentType) IsKnown added in v2.10.0

func (r InvoicePaymentType) IsKnown() bool

type InvoiceService

type InvoiceService struct {
	Options   []option.RequestOption
	LineItems *InvoiceLineItemService
}

InvoiceService contains methods and other services that help with interacting with the Modern Treasury 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) AddPaymentOrder

func (r *InvoiceService) AddPaymentOrder(ctx context.Context, id string, paymentOrderID string, opts ...option.RequestOption) (err error)

Add a payment order to an invoice.

func (*InvoiceService) Get

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

get invoice

func (*InvoiceService) List

func (r *InvoiceService) List(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) (res *pagination.Page[Invoice], err error)

list invoices

func (*InvoiceService) ListAutoPaging

list invoices

func (*InvoiceService) New

func (r *InvoiceService) New(ctx context.Context, body InvoiceNewParams, opts ...option.RequestOption) (res *Invoice, err error)

create invoice

func (*InvoiceService) Update

func (r *InvoiceService) Update(ctx context.Context, id string, body InvoiceUpdateParams, opts ...option.RequestOption) (res *Invoice, err error)

update invoice

type InvoiceStatus

type InvoiceStatus string

The status of the invoice.

const (
	InvoiceStatusDraft          InvoiceStatus = "draft"
	InvoiceStatusPaid           InvoiceStatus = "paid"
	InvoiceStatusPartiallyPaid  InvoiceStatus = "partially_paid"
	InvoiceStatusPaymentPending InvoiceStatus = "payment_pending"
	InvoiceStatusUnpaid         InvoiceStatus = "unpaid"
	InvoiceStatusVoided         InvoiceStatus = "voided"
)

func (InvoiceStatus) IsKnown added in v2.10.0

func (r InvoiceStatus) IsKnown() bool

type InvoiceUpdateParams

type InvoiceUpdateParams struct {
	// The invoicer's contact details displayed at the top of the invoice.
	ContactDetails param.Field[[]InvoiceUpdateParamsContactDetail] `json:"contact_details"`
	// The counterparty's billing address.
	CounterpartyBillingAddress param.Field[InvoiceUpdateParamsCounterpartyBillingAddress] `json:"counterparty_billing_address"`
	// The ID of the counterparty receiving the invoice.
	CounterpartyID param.Field[string] `json:"counterparty_id"`
	// The counterparty's shipping address where physical goods should be delivered.
	CounterpartyShippingAddress param.Field[InvoiceUpdateParamsCounterpartyShippingAddress] `json:"counterparty_shipping_address"`
	// Currency that the invoice is denominated in. Defaults to `USD` if not provided.
	Currency param.Field[shared.Currency] `json:"currency"`
	// A free-form description of the invoice.
	Description param.Field[string] `json:"description"`
	// A future date by when the invoice needs to be paid.
	DueDate param.Field[time.Time] `json:"due_date" format:"date-time"`
	// When payment_method is automatic, the fallback payment method to use when an
	// automatic payment fails. One of `manual` or `ui`.
	FallbackPaymentMethod param.Field[string] `json:"fallback_payment_method"`
	// Whether to ingest the ledger_entries to populate the invoice line items. If this
	// is false, then a line item must be provided. If this is true, line_items must be
	// empty. Ignored if ledger_account_settlement_id is empty.
	IngestLedgerEntries param.Field[bool] `json:"ingest_ledger_entries"`
	// An array of invoice line items. The API supports a maximum of 50 invoice line
	// items per invoice. If a greater number of invoice line items is required, please
	// contact support.
	InvoiceLineItems param.Field[[]InvoiceUpdateParamsInvoiceLineItem] `json:"invoice_line_items"`
	// The invoice issuer's business address.
	InvoicerAddress param.Field[InvoiceUpdateParamsInvoicerAddress] `json:"invoicer_address"`
	// The ID of the virtual account the invoice should be paid to.
	LedgerAccountSettlementID param.Field[string] `json:"ledger_account_settlement_id" format:"uuid"`
	// Emails in addition to the counterparty email to send invoice status
	// notifications to. At least one email is required if notifications are enabled
	// and the counterparty doesn't have an email.
	NotificationEmailAddresses param.Field[[]string] `json:"notification_email_addresses"`
	// If true, the invoice will send email notifications to the invoice recipients
	// about invoice status changes.
	NotificationsEnabled param.Field[bool] `json:"notifications_enabled"`
	// The ID of the internal account the invoice should be paid to.
	OriginatingAccountID param.Field[string] `json:"originating_account_id"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	PaymentEffectiveDate param.Field[time.Time] `json:"payment_effective_date" format:"date"`
	// The method by which the invoice can be paid. `ui` will show the embedded payment
	// collection flow. `automatic` will automatically initiate payment based upon the
	// account details of the receiving_account id.\nIf the invoice amount is positive,
	// the automatically initiated payment order's direction will be debit. If the
	// invoice amount is negative, the automatically initiated payment order's
	// direction will be credit. One of `manual`, `ui`, or `automatic`.
	PaymentMethod param.Field[InvoiceUpdateParamsPaymentMethod] `json:"payment_method"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	PaymentType param.Field[PaymentOrderType] `json:"payment_type"`
	// The receiving account ID. Can be an `external_account`.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// The email of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientEmail param.Field[string] `json:"recipient_email"`
	// The name of the recipient of the invoice. Leaving this value as null will
	// fallback to using the counterparty's name.
	RecipientName param.Field[string] `json:"recipient_name"`
	// Number of days after due date when overdue reminder emails will be sent out to
	// invoice recipients.
	RemindAfterOverdueDays param.Field[[]int64] `json:"remind_after_overdue_days"`
	// Invoice status must be updated in a `PATCH` request that does not modify any
	// other invoice attributes. Valid state transitions are `draft` to `unpaid`,
	// `draft` or `unpaid` to `voided`, and `draft` or `unpaid` to `paid`.
	Status param.Field[string] `json:"status"`
	// The ID of the virtual account the invoice should be paid to.
	VirtualAccountID param.Field[string] `json:"virtual_account_id" format:"uuid"`
}

func (InvoiceUpdateParams) MarshalJSON

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

type InvoiceUpdateParamsContactDetail

type InvoiceUpdateParamsContactDetail struct {
	ID                    param.Field[string]                                                 `json:"id,required" format:"uuid"`
	ContactIdentifier     param.Field[string]                                                 `json:"contact_identifier,required"`
	ContactIdentifierType param.Field[InvoiceUpdateParamsContactDetailsContactIdentifierType] `json:"contact_identifier_type,required"`
	CreatedAt             param.Field[time.Time]                                              `json:"created_at,required" format:"date-time"`
	DiscardedAt           param.Field[time.Time]                                              `json:"discarded_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  param.Field[bool]      `json:"live_mode,required"`
	Object    param.Field[string]    `json:"object,required"`
	UpdatedAt param.Field[time.Time] `json:"updated_at,required" format:"date-time"`
}

func (InvoiceUpdateParamsContactDetail) MarshalJSON

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

type InvoiceUpdateParamsContactDetailsContactIdentifierType

type InvoiceUpdateParamsContactDetailsContactIdentifierType string
const (
	InvoiceUpdateParamsContactDetailsContactIdentifierTypeEmail       InvoiceUpdateParamsContactDetailsContactIdentifierType = "email"
	InvoiceUpdateParamsContactDetailsContactIdentifierTypePhoneNumber InvoiceUpdateParamsContactDetailsContactIdentifierType = "phone_number"
	InvoiceUpdateParamsContactDetailsContactIdentifierTypeWebsite     InvoiceUpdateParamsContactDetailsContactIdentifierType = "website"
)

func (InvoiceUpdateParamsContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type InvoiceUpdateParamsCounterpartyBillingAddress

type InvoiceUpdateParamsCounterpartyBillingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The counterparty's billing address.

func (InvoiceUpdateParamsCounterpartyBillingAddress) MarshalJSON

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

type InvoiceUpdateParamsCounterpartyShippingAddress

type InvoiceUpdateParamsCounterpartyShippingAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The counterparty's shipping address where physical goods should be delivered.

func (InvoiceUpdateParamsCounterpartyShippingAddress) MarshalJSON

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

type InvoiceUpdateParamsInvoiceLineItem added in v2.13.0

type InvoiceUpdateParamsInvoiceLineItem struct {
	// The name of the line item, typically a product or SKU name.
	Name param.Field[string] `json:"name,required"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit.
	UnitAmount param.Field[int64] `json:"unit_amount,required"`
	// An optional free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Either `debit` or `credit`. `debit` indicates that a client owes the business
	// money and increases the invoice's `total_amount` due. `credit` has the opposite
	// intention and effect.
	Direction param.Field[string] `json:"direction"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The number of units of a product or service that this line item is for. Must be
	// a whole number. Defaults to 1 if not provided.
	Quantity param.Field[int64] `json:"quantity"`
	// The cost per unit of the product or service that this line item is for,
	// specified in the invoice currency's smallest unit. Accepts decimal strings with
	// up to 12 decimals
	UnitAmountDecimal param.Field[string] `json:"unit_amount_decimal"`
}

func (InvoiceUpdateParamsInvoiceLineItem) MarshalJSON added in v2.13.0

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

type InvoiceUpdateParamsInvoicerAddress

type InvoiceUpdateParamsInvoicerAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	Line2  param.Field[string] `json:"line2"`
}

The invoice issuer's business address.

func (InvoiceUpdateParamsInvoicerAddress) MarshalJSON

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

type InvoiceUpdateParamsPaymentMethod

type InvoiceUpdateParamsPaymentMethod string

The method by which the invoice can be paid. `ui` will show the embedded payment collection flow. `automatic` will automatically initiate payment based upon the account details of the receiving_account id.\nIf the invoice amount is positive, the automatically initiated payment order's direction will be debit. If the invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`.

const (
	InvoiceUpdateParamsPaymentMethodUi        InvoiceUpdateParamsPaymentMethod = "ui"
	InvoiceUpdateParamsPaymentMethodManual    InvoiceUpdateParamsPaymentMethod = "manual"
	InvoiceUpdateParamsPaymentMethodAutomatic InvoiceUpdateParamsPaymentMethod = "automatic"
)

func (InvoiceUpdateParamsPaymentMethod) IsKnown added in v2.10.0

type Ledger

type Ledger struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// An optional free-form description for internal use.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// The name of the ledger.
	Name        string                 `json:"name,required"`
	Object      string                 `json:"object,required"`
	UpdatedAt   time.Time              `json:"updated_at,required" format:"date-time"`
	ExtraFields map[string]interface{} `json:"-,extras"`
	JSON        ledgerJSON             `json:"-"`
}

func (*Ledger) UnmarshalJSON

func (r *Ledger) UnmarshalJSON(data []byte) (err error)

type LedgerAccount

type LedgerAccount struct {
	ID string `json:"id,required" format:"uuid"`
	// The pending, posted, and available balances for this ledger account. The posted
	// balance is the sum of all posted entries on the account. The pending balance is
	// the sum of all pending and posted entries on the account. The available balance
	// is the posted incoming entries minus the sum of the pending and posted outgoing
	// amounts.
	Balances  LedgerAccountBalances `json:"balances,required"`
	CreatedAt time.Time             `json:"created_at,required" format:"date-time"`
	// The description of the ledger account.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The id of the ledger that this account belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID string `json:"ledgerable_id,required,nullable" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType LedgerAccountLedgerableType `json:"ledgerable_type,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Lock version of the ledger account.
	LockVersion int64 `json:"lock_version,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// The name of the ledger account.
	Name string `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance shared.TransactionDirection `json:"normal_balance,required"`
	Object        string                      `json:"object,required"`
	UpdatedAt     time.Time                   `json:"updated_at,required" format:"date-time"`
	JSON          ledgerAccountJSON           `json:"-"`
}

func (*LedgerAccount) UnmarshalJSON

func (r *LedgerAccount) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalanceMonitor

type LedgerAccountBalanceMonitor struct {
	ID string `json:"id,required" format:"uuid"`
	// Describes the condition that must be satisfied for the monitor to be triggered.
	AlertCondition LedgerAccountBalanceMonitorAlertCondition `json:"alert_condition,required"`
	CreatedAt      time.Time                                 `json:"created_at,required" format:"date-time"`
	// The ledger account's balances and the monitor state as of the current ledger
	// account lock version.
	CurrentLedgerAccountBalanceState LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceState `json:"current_ledger_account_balance_state,required"`
	// An optional, free-form description for internal use.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The ledger account associated with this balance monitor.
	LedgerAccountID string `json:"ledger_account_id,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata  map[string]string               `json:"metadata,required"`
	Object    string                          `json:"object,required"`
	UpdatedAt time.Time                       `json:"updated_at,required" format:"date-time"`
	JSON      ledgerAccountBalanceMonitorJSON `json:"-"`
}

func (*LedgerAccountBalanceMonitor) UnmarshalJSON

func (r *LedgerAccountBalanceMonitor) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalanceMonitorAlertCondition

type LedgerAccountBalanceMonitorAlertCondition struct {
	// One of `available_balance_amount`, `pending_balance_amount`,
	// `posted_balance_amount`, `ledger_account_lock_version`.
	Field string `json:"field,required"`
	// A logical operator to compare the `field` against the `value`. One of
	// `less_than`, `less_than_or_equals`, `equals`, `greater_than_or_equals`,
	// `greater_than`.
	Operator string `json:"operator,required"`
	// The monitor's `current_ledger_account_balance_state.triggered` will be `true`
	// when comparing the `field` to this integer value using the `operator` is
	// logically true.
	Value int64                                         `json:"value,required"`
	JSON  ledgerAccountBalanceMonitorAlertConditionJSON `json:"-"`
}

Describes the condition that must be satisfied for the monitor to be triggered.

func (*LedgerAccountBalanceMonitorAlertCondition) UnmarshalJSON

func (r *LedgerAccountBalanceMonitorAlertCondition) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceState

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceState struct {
	Balances LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalances `json:"balances,required"`
	// The current lock version of the ledger account.
	LedgerAccountLockVersion int64 `json:"ledger_account_lock_version,required"`
	// If `true`, the ledger account's balances satisfy the `alert_condition` at this
	// lock version.
	Triggered bool                                                            `json:"triggered,required"`
	JSON      ledgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateJSON `json:"-"`
}

The ledger account's balances and the monitor state as of the current ledger account lock version.

func (*LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceState) UnmarshalJSON

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalances

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalances struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesJSON          `json:"-"`
}

func (*LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalances) UnmarshalJSON

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesAvailableBalance

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                   `json:"currency_exponent,required"`
	Debits           int64                                                                                   `json:"debits,required"`
	JSON             ledgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesAvailableBalance) UnmarshalJSON

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPendingBalance

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                 `json:"currency_exponent,required"`
	Debits           int64                                                                                 `json:"debits,required"`
	JSON             ledgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPendingBalance) UnmarshalJSON

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPostedBalance

type LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                `json:"currency_exponent,required"`
	Debits           int64                                                                                `json:"debits,required"`
	JSON             ledgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountBalanceMonitorCurrentLedgerAccountBalanceStateBalancesPostedBalance) UnmarshalJSON

type LedgerAccountBalanceMonitorListParams

type LedgerAccountBalanceMonitorListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// Query the balance monitors for a single ledger account.
	LedgerAccountID param.Field[string] `query:"ledger_account_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
}

func (LedgerAccountBalanceMonitorListParams) URLQuery

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

type LedgerAccountBalanceMonitorNewParams

type LedgerAccountBalanceMonitorNewParams struct {
	// Describes the condition that must be satisfied for the monitor to be triggered.
	AlertCondition param.Field[LedgerAccountBalanceMonitorNewParamsAlertCondition] `json:"alert_condition,required"`
	// The ledger account associated with this balance monitor.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required"`
	// An optional, free-form description for internal use.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerAccountBalanceMonitorNewParams) MarshalJSON

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

type LedgerAccountBalanceMonitorNewParamsAlertCondition

type LedgerAccountBalanceMonitorNewParamsAlertCondition struct {
	// One of `available_balance_amount`, `pending_balance_amount`,
	// `posted_balance_amount`, `ledger_account_lock_version`.
	Field param.Field[string] `json:"field,required"`
	// A logical operator to compare the `field` against the `value`. One of
	// `less_than`, `less_than_or_equals`, `equals`, `greater_than_or_equals`,
	// `greater_than`.
	Operator param.Field[string] `json:"operator,required"`
	// The monitor's `current_ledger_account_balance_state.triggered` will be `true`
	// when comparing the `field` to this integer value using the `operator` is
	// logically true.
	Value param.Field[int64] `json:"value,required"`
}

Describes the condition that must be satisfied for the monitor to be triggered.

func (LedgerAccountBalanceMonitorNewParamsAlertCondition) MarshalJSON

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

type LedgerAccountBalanceMonitorService

type LedgerAccountBalanceMonitorService struct {
	Options []option.RequestOption
}

LedgerAccountBalanceMonitorService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerAccountBalanceMonitorService method instead.

func NewLedgerAccountBalanceMonitorService

func NewLedgerAccountBalanceMonitorService(opts ...option.RequestOption) (r *LedgerAccountBalanceMonitorService)

NewLedgerAccountBalanceMonitorService 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 (*LedgerAccountBalanceMonitorService) Delete

Delete a ledger account balance monitor.

func (*LedgerAccountBalanceMonitorService) Get

Get details on a single ledger account balance monitor.

func (*LedgerAccountBalanceMonitorService) List

Get a list of ledger account balance monitors.

func (*LedgerAccountBalanceMonitorService) ListAutoPaging

Get a list of ledger account balance monitors.

func (*LedgerAccountBalanceMonitorService) New

Create a ledger account balance monitor.

func (*LedgerAccountBalanceMonitorService) Update

Update a ledger account balance monitor.

type LedgerAccountBalanceMonitorUpdateParams

type LedgerAccountBalanceMonitorUpdateParams struct {
	// An optional, free-form description for internal use.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerAccountBalanceMonitorUpdateParams) MarshalJSON

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

type LedgerAccountBalances

type LedgerAccountBalances struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountBalancesAvailableBalance `json:"available_balance,required"`
	// The inclusive lower bound of the effective_at timestamp for the returned
	// balances.
	EffectiveAtLowerBound time.Time `json:"effective_at_lower_bound,required,nullable" format:"date-time"`
	// The exclusive upper bound of the effective_at timestamp for the returned
	// balances.
	EffectiveAtUpperBound time.Time `json:"effective_at_upper_bound,required,nullable" format:"date-time"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountBalancesPendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountBalancesPostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountBalancesJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountBalances) UnmarshalJSON

func (r *LedgerAccountBalances) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalancesAvailableBalance

type LedgerAccountBalancesAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                     `json:"currency_exponent,required"`
	Debits           int64                                     `json:"debits,required"`
	JSON             ledgerAccountBalancesAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountBalancesAvailableBalance) UnmarshalJSON

func (r *LedgerAccountBalancesAvailableBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalancesPendingBalance

type LedgerAccountBalancesPendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                   `json:"currency_exponent,required"`
	Debits           int64                                   `json:"debits,required"`
	JSON             ledgerAccountBalancesPendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountBalancesPendingBalance) UnmarshalJSON

func (r *LedgerAccountBalancesPendingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountBalancesPostedBalance

type LedgerAccountBalancesPostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                  `json:"currency_exponent,required"`
	Debits           int64                                  `json:"debits,required"`
	JSON             ledgerAccountBalancesPostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountBalancesPostedBalance) UnmarshalJSON

func (r *LedgerAccountBalancesPostedBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategory

type LedgerAccountCategory struct {
	ID string `json:"id,required" format:"uuid"`
	// The pending, posted, and available balances for this ledger account category.
	// The posted balance is the sum of all posted entries on the account. The pending
	// balance is the sum of all pending and posted entries on the account. The
	// available balance is the posted incoming entries minus the sum of the pending
	// and posted outgoing amounts.
	Balances  LedgerAccountCategoryBalances `json:"balances,required"`
	CreatedAt time.Time                     `json:"created_at,required" format:"date-time"`
	// The description of the ledger account category.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The id of the ledger that this account category belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// The name of the ledger account category.
	Name string `json:"name,required"`
	// The normal balance of the ledger account category.
	NormalBalance shared.TransactionDirection `json:"normal_balance,required"`
	Object        string                      `json:"object,required"`
	UpdatedAt     time.Time                   `json:"updated_at,required" format:"date-time"`
	JSON          ledgerAccountCategoryJSON   `json:"-"`
}

func (*LedgerAccountCategory) UnmarshalJSON

func (r *LedgerAccountCategory) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategoryBalances

type LedgerAccountCategoryBalances struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountCategoryBalancesAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountCategoryBalancesPendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountCategoryBalancesPostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountCategoryBalancesJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account category. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountCategoryBalances) UnmarshalJSON

func (r *LedgerAccountCategoryBalances) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategoryBalancesAvailableBalance

type LedgerAccountCategoryBalancesAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                             `json:"currency_exponent,required"`
	Debits           int64                                             `json:"debits,required"`
	JSON             ledgerAccountCategoryBalancesAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountCategoryBalancesAvailableBalance) UnmarshalJSON

func (r *LedgerAccountCategoryBalancesAvailableBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategoryBalancesPendingBalance

type LedgerAccountCategoryBalancesPendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                           `json:"currency_exponent,required"`
	Debits           int64                                           `json:"debits,required"`
	JSON             ledgerAccountCategoryBalancesPendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountCategoryBalancesPendingBalance) UnmarshalJSON

func (r *LedgerAccountCategoryBalancesPendingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategoryBalancesPostedBalance

type LedgerAccountCategoryBalancesPostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                          `json:"currency_exponent,required"`
	Debits           int64                                          `json:"debits,required"`
	JSON             ledgerAccountCategoryBalancesPostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountCategoryBalancesPostedBalance) UnmarshalJSON

func (r *LedgerAccountCategoryBalancesPostedBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountCategoryGetParams

type LedgerAccountCategoryGetParams struct {
	// For example, if you want the balances as of a particular time (ISO8601), the
	// encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
	// The balances as of a time are inclusive of entries with that exact time.
	Balances param.Field[LedgerAccountCategoryGetParamsBalances] `query:"balances"`
}

func (LedgerAccountCategoryGetParams) URLQuery

func (r LedgerAccountCategoryGetParams) URLQuery() (v url.Values)

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

type LedgerAccountCategoryGetParamsBalances

type LedgerAccountCategoryGetParamsBalances struct {
	AsOfDate    param.Field[time.Time] `query:"as_of_date" format:"date"`
	EffectiveAt param.Field[time.Time] `query:"effective_at" format:"date-time"`
}

For example, if you want the balances as of a particular time (ISO8601), the encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`. The balances as of a time are inclusive of entries with that exact time.

func (LedgerAccountCategoryGetParamsBalances) URLQuery

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

type LedgerAccountCategoryListParams

type LedgerAccountCategoryListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// For example, if you want the balances as of a particular time (ISO8601), the
	// encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
	// The balances as of a time are inclusive of entries with that exact time.
	Balances param.Field[LedgerAccountCategoryListParamsBalances] `query:"balances"`
	Currency param.Field[string]                                  `query:"currency"`
	// Query categories which contain a ledger account directly or through child
	// categories.
	LedgerAccountID param.Field[string] `query:"ledger_account_id"`
	LedgerID        param.Field[string] `query:"ledger_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	Name     param.Field[string]            `query:"name"`
	// Query categories that are nested underneath a parent category
	ParentLedgerAccountCategoryID param.Field[string] `query:"parent_ledger_account_category_id"`
	PerPage                       param.Field[int64]  `query:"per_page"`
}

func (LedgerAccountCategoryListParams) URLQuery

func (r LedgerAccountCategoryListParams) URLQuery() (v url.Values)

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

type LedgerAccountCategoryListParamsBalances

type LedgerAccountCategoryListParamsBalances struct {
	EffectiveAt param.Field[time.Time] `query:"effective_at" format:"date-time"`
}

For example, if you want the balances as of a particular time (ISO8601), the encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`. The balances as of a time are inclusive of entries with that exact time.

func (LedgerAccountCategoryListParamsBalances) URLQuery

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

type LedgerAccountCategoryNewParams

type LedgerAccountCategoryNewParams struct {
	// The currency of the ledger account category.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account category belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account category.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account category.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account category.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account category.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerAccountCategoryNewParams) MarshalJSON

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

type LedgerAccountCategoryService

type LedgerAccountCategoryService struct {
	Options []option.RequestOption
}

LedgerAccountCategoryService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerAccountCategoryService method instead.

func NewLedgerAccountCategoryService

func NewLedgerAccountCategoryService(opts ...option.RequestOption) (r *LedgerAccountCategoryService)

NewLedgerAccountCategoryService 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 (*LedgerAccountCategoryService) AddLedgerAccount

func (r *LedgerAccountCategoryService) AddLedgerAccount(ctx context.Context, id string, ledgerAccountID string, opts ...option.RequestOption) (err error)

Add a ledger account to a ledger account category.

func (*LedgerAccountCategoryService) AddNestedCategory

func (r *LedgerAccountCategoryService) AddNestedCategory(ctx context.Context, id string, subCategoryID string, opts ...option.RequestOption) (err error)

Add a ledger account category to a ledger account category.

func (*LedgerAccountCategoryService) Delete

Delete a ledger account category.

func (*LedgerAccountCategoryService) Get

Get the details on a single ledger account category.

func (*LedgerAccountCategoryService) List

Get a list of ledger account categories.

func (*LedgerAccountCategoryService) ListAutoPaging

Get a list of ledger account categories.

func (*LedgerAccountCategoryService) New

Create a ledger account category.

func (*LedgerAccountCategoryService) RemoveLedgerAccount

func (r *LedgerAccountCategoryService) RemoveLedgerAccount(ctx context.Context, id string, ledgerAccountID string, opts ...option.RequestOption) (err error)

Remove a ledger account from a ledger account category.

func (*LedgerAccountCategoryService) RemoveNestedCategory

func (r *LedgerAccountCategoryService) RemoveNestedCategory(ctx context.Context, id string, subCategoryID string, opts ...option.RequestOption) (err error)

Delete a ledger account category from a ledger account category.

func (*LedgerAccountCategoryService) Update

Update the details of a ledger account category.

type LedgerAccountCategoryUpdateParams

type LedgerAccountCategoryUpdateParams struct {
	// The description of the ledger account category.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The name of the ledger account category.
	Name param.Field[string] `json:"name"`
}

func (LedgerAccountCategoryUpdateParams) MarshalJSON

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

type LedgerAccountGetParams

type LedgerAccountGetParams struct {
	// Use `balances[effective_at_lower_bound]` and
	// `balances[effective_at_upper_bound]` to get the balances change between the two
	// timestamps. The lower bound is inclusive while the upper bound is exclusive of
	// the provided timestamps. If no value is supplied the balances will be retrieved
	// not including that bound. Use `balances[as_of_lock_version]` to retrieve a
	// balance as of a specific Ledger Account `lock_version`.
	Balances param.Field[LedgerAccountGetParamsBalances] `query:"balances"`
}

func (LedgerAccountGetParams) URLQuery

func (r LedgerAccountGetParams) URLQuery() (v url.Values)

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

type LedgerAccountGetParamsBalances

type LedgerAccountGetParamsBalances struct {
	AsOfDate              param.Field[time.Time] `query:"as_of_date" format:"date"`
	AsOfLockVersion       param.Field[int64]     `query:"as_of_lock_version"`
	EffectiveAt           param.Field[time.Time] `query:"effective_at" format:"date-time"`
	EffectiveAtLowerBound param.Field[time.Time] `query:"effective_at_lower_bound" format:"date-time"`
	EffectiveAtUpperBound param.Field[time.Time] `query:"effective_at_upper_bound" format:"date-time"`
}

Use `balances[effective_at_lower_bound]` and `balances[effective_at_upper_bound]` to get the balances change between the two timestamps. The lower bound is inclusive while the upper bound is exclusive of the provided timestamps. If no value is supplied the balances will be retrieved not including that bound. Use `balances[as_of_lock_version]` to retrieve a balance as of a specific Ledger Account `lock_version`.

func (LedgerAccountGetParamsBalances) URLQuery

func (r LedgerAccountGetParamsBalances) URLQuery() (v url.Values)

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

type LedgerAccountLedgerableType

type LedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	LedgerAccountLedgerableTypeCounterparty    LedgerAccountLedgerableType = "counterparty"
	LedgerAccountLedgerableTypeExternalAccount LedgerAccountLedgerableType = "external_account"
	LedgerAccountLedgerableTypeInternalAccount LedgerAccountLedgerableType = "internal_account"
	LedgerAccountLedgerableTypeVirtualAccount  LedgerAccountLedgerableType = "virtual_account"
)

func (LedgerAccountLedgerableType) IsKnown added in v2.10.0

func (r LedgerAccountLedgerableType) IsKnown() bool

type LedgerAccountListParams

type LedgerAccountListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to
	// filter by balance amount.
	AvailableBalanceAmount param.Field[LedgerAccountListParamsAvailableBalanceAmount] `query:"available_balance_amount"`
	// Use `balances[effective_at_lower_bound]` and
	// `balances[effective_at_upper_bound]` to get the balances change between the two
	// timestamps. The lower bound is inclusive while the upper bound is exclusive of
	// the provided timestamps. If no value is supplied the balances will be retrieved
	// not including that bound.
	Balances param.Field[LedgerAccountListParamsBalances] `query:"balances"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// created at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// created_at%5Bgt%5D=2000-01-01T12:00:00Z.
	CreatedAt               param.Field[map[string]time.Time] `query:"created_at" format:"date-time"`
	Currency                param.Field[string]               `query:"currency"`
	LedgerAccountCategoryID param.Field[string]               `query:"ledger_account_category_id"`
	LedgerID                param.Field[string]               `query:"ledger_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// If you have specific names to retrieve in bulk, you can pass them as query
	// parameters delimited with `name[]=`, for example `?name[]=123&name[]=abc`.
	Name param.Field[[]string] `query:"name"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to
	// filter by balance amount.
	PendingBalanceAmount param.Field[LedgerAccountListParamsPendingBalanceAmount] `query:"pending_balance_amount"`
	PerPage              param.Field[int64]                                       `query:"per_page"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to
	// filter by balance amount.
	PostedBalanceAmount param.Field[LedgerAccountListParamsPostedBalanceAmount] `query:"posted_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// updated at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// updated_at%5Bgt%5D=2000-01-01T12:00:00Z.
	UpdatedAt param.Field[map[string]time.Time] `query:"updated_at" format:"date-time"`
}

func (LedgerAccountListParams) URLQuery

func (r LedgerAccountListParams) URLQuery() (v url.Values)

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

type LedgerAccountListParamsAvailableBalanceAmount

type LedgerAccountListParamsAvailableBalanceAmount struct {
	Eq    param.Field[int64] `query:"eq"`
	Gt    param.Field[int64] `query:"gt"`
	Gte   param.Field[int64] `query:"gte"`
	Lt    param.Field[int64] `query:"lt"`
	Lte   param.Field[int64] `query:"lte"`
	NotEq param.Field[int64] `query:"not_eq"`
}

Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to filter by balance amount.

func (LedgerAccountListParamsAvailableBalanceAmount) URLQuery

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

type LedgerAccountListParamsBalances

type LedgerAccountListParamsBalances struct {
	AsOfDate              param.Field[time.Time] `query:"as_of_date" format:"date"`
	EffectiveAt           param.Field[time.Time] `query:"effective_at" format:"date-time"`
	EffectiveAtLowerBound param.Field[time.Time] `query:"effective_at_lower_bound" format:"date-time"`
	EffectiveAtUpperBound param.Field[time.Time] `query:"effective_at_upper_bound" format:"date-time"`
}

Use `balances[effective_at_lower_bound]` and `balances[effective_at_upper_bound]` to get the balances change between the two timestamps. The lower bound is inclusive while the upper bound is exclusive of the provided timestamps. If no value is supplied the balances will be retrieved not including that bound.

func (LedgerAccountListParamsBalances) URLQuery

func (r LedgerAccountListParamsBalances) URLQuery() (v url.Values)

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

type LedgerAccountListParamsPendingBalanceAmount

type LedgerAccountListParamsPendingBalanceAmount struct {
	Eq    param.Field[int64] `query:"eq"`
	Gt    param.Field[int64] `query:"gt"`
	Gte   param.Field[int64] `query:"gte"`
	Lt    param.Field[int64] `query:"lt"`
	Lte   param.Field[int64] `query:"lte"`
	NotEq param.Field[int64] `query:"not_eq"`
}

Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to filter by balance amount.

func (LedgerAccountListParamsPendingBalanceAmount) URLQuery

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

type LedgerAccountListParamsPostedBalanceAmount

type LedgerAccountListParamsPostedBalanceAmount struct {
	Eq    param.Field[int64] `query:"eq"`
	Gt    param.Field[int64] `query:"gt"`
	Gte   param.Field[int64] `query:"gte"`
	Lt    param.Field[int64] `query:"lt"`
	Lte   param.Field[int64] `query:"lte"`
	NotEq param.Field[int64] `query:"not_eq"`
}

Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to filter by balance amount.

func (LedgerAccountListParamsPostedBalanceAmount) URLQuery

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

type LedgerAccountNewParams

type LedgerAccountNewParams struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[LedgerAccountNewParamsLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerAccountNewParams) MarshalJSON

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

type LedgerAccountNewParamsLedgerableType

type LedgerAccountNewParamsLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	LedgerAccountNewParamsLedgerableTypeCounterparty    LedgerAccountNewParamsLedgerableType = "counterparty"
	LedgerAccountNewParamsLedgerableTypeExternalAccount LedgerAccountNewParamsLedgerableType = "external_account"
	LedgerAccountNewParamsLedgerableTypeInternalAccount LedgerAccountNewParamsLedgerableType = "internal_account"
	LedgerAccountNewParamsLedgerableTypeVirtualAccount  LedgerAccountNewParamsLedgerableType = "virtual_account"
)

func (LedgerAccountNewParamsLedgerableType) IsKnown added in v2.10.0

type LedgerAccountService

type LedgerAccountService struct {
	Options []option.RequestOption
}

LedgerAccountService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerAccountService method instead.

func NewLedgerAccountService

func NewLedgerAccountService(opts ...option.RequestOption) (r *LedgerAccountService)

NewLedgerAccountService 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 (*LedgerAccountService) Delete

func (r *LedgerAccountService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *LedgerAccount, err error)

Delete a ledger account.

func (*LedgerAccountService) Get

Get details on a single ledger account.

func (*LedgerAccountService) List

Get a list of ledger accounts.

func (*LedgerAccountService) ListAutoPaging

Get a list of ledger accounts.

func (*LedgerAccountService) New

Create a ledger account.

func (*LedgerAccountService) Update

Update the details of a ledger account.

type LedgerAccountSettlement added in v2.5.0

type LedgerAccountSettlement struct {
	ID string `json:"id,required" format:"uuid"`
	// The amount of the ledger account settlement.
	Amount int64 `json:"amount,required,nullable"`
	// The id of the contra ledger account that sends to or receives funds from the
	// settled ledger account.
	ContraLedgerAccountID string    `json:"contra_ledger_account_id,required" format:"uuid"`
	CreatedAt             time.Time `json:"created_at,required" format:"date-time"`
	// The currency of the ledger account settlement.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account settlement.
	CurrencyExponent int64 `json:"currency_exponent,required,nullable"`
	// The description of the ledger account settlement.
	Description string `json:"description,required,nullable"`
	// The exclusive upper bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account settlement. The default value is the
	// created_at timestamp of the ledger account settlement.
	EffectiveAtUpperBound time.Time `json:"effective_at_upper_bound,required" format:"date-time"`
	// The id of the ledger that this ledger account settlement belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// The id of the ledger transaction that this settlement is associated with.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The id of the settled ledger account whose ledger entries are queried against,
	// and its balance is reduced as a result.
	SettledLedgerAccountID string `json:"settled_ledger_account_id,required" format:"uuid"`
	// The direction of the ledger entry with the settlement_ledger_account.
	SettlementEntryDirection string `json:"settlement_entry_direction,required,nullable"`
	// The status of the ledger account settlement. One of `processing`, `pending`,
	// `posted`, `archiving` or `archived`.
	Status    LedgerAccountSettlementStatus `json:"status,required"`
	UpdatedAt time.Time                     `json:"updated_at,required" format:"date-time"`
	JSON      ledgerAccountSettlementJSON   `json:"-"`
}

func (*LedgerAccountSettlement) UnmarshalJSON added in v2.5.0

func (r *LedgerAccountSettlement) UnmarshalJSON(data []byte) (err error)

type LedgerAccountSettlementListParams added in v2.5.0

type LedgerAccountSettlementListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID                  param.Field[[]string] `query:"id"`
	AfterCursor         param.Field[string]   `query:"after_cursor"`
	LedgerID            param.Field[string]   `query:"ledger_id"`
	LedgerTransactionID param.Field[string]   `query:"ledger_transaction_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata                 param.Field[map[string]string] `query:"metadata"`
	PerPage                  param.Field[int64]             `query:"per_page"`
	SettledLedgerAccountID   param.Field[string]            `query:"settled_ledger_account_id"`
	SettlementEntryDirection param.Field[string]            `query:"settlement_entry_direction"`
}

func (LedgerAccountSettlementListParams) URLQuery added in v2.5.0

func (r LedgerAccountSettlementListParams) URLQuery() (v url.Values)

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

type LedgerAccountSettlementNewParams added in v2.5.0

type LedgerAccountSettlementNewParams struct {
	// The id of the contra ledger account that sends to or receives funds from the
	// settled ledger account.
	ContraLedgerAccountID param.Field[string] `json:"contra_ledger_account_id,required" format:"uuid"`
	// The id of the settled ledger account whose ledger entries are queried against,
	// and its balance is reduced as a result.
	SettledLedgerAccountID param.Field[string] `json:"settled_ledger_account_id,required" format:"uuid"`
	// If true, the settlement amount and settlement_entry_direction will bring the
	// settlement ledger account's balance closer to zero, even if the balance is
	// negative.
	AllowEitherDirection param.Field[bool] `json:"allow_either_direction"`
	// The description of the ledger account settlement.
	Description param.Field[string] `json:"description"`
	// The exclusive upper bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account settlement. The default value is the
	// created_at timestamp of the ledger account settlement.
	EffectiveAtUpperBound param.Field[time.Time] `json:"effective_at_upper_bound" format:"date-time"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// It is set to `false` by default. It should be set to `true` when migrating
	// existing settlements.
	SkipSettlementLedgerTransaction param.Field[bool] `json:"skip_settlement_ledger_transaction"`
	// The status of the ledger account settlement. It is set to `pending` by default.
	// To post a ledger account settlement at creation, use `posted`.
	Status param.Field[LedgerAccountSettlementNewParamsStatus] `json:"status"`
}

func (LedgerAccountSettlementNewParams) MarshalJSON added in v2.5.0

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

type LedgerAccountSettlementNewParamsStatus added in v2.5.0

type LedgerAccountSettlementNewParamsStatus string

The status of the ledger account settlement. It is set to `pending` by default. To post a ledger account settlement at creation, use `posted`.

const (
	LedgerAccountSettlementNewParamsStatusPending LedgerAccountSettlementNewParamsStatus = "pending"
	LedgerAccountSettlementNewParamsStatusPosted  LedgerAccountSettlementNewParamsStatus = "posted"
)

func (LedgerAccountSettlementNewParamsStatus) IsKnown added in v2.10.0

type LedgerAccountSettlementService added in v2.5.0

type LedgerAccountSettlementService struct {
	Options []option.RequestOption
}

LedgerAccountSettlementService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerAccountSettlementService method instead.

func NewLedgerAccountSettlementService added in v2.5.0

func NewLedgerAccountSettlementService(opts ...option.RequestOption) (r *LedgerAccountSettlementService)

NewLedgerAccountSettlementService 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 (*LedgerAccountSettlementService) Get added in v2.5.0

Get details on a single ledger account settlement.

func (*LedgerAccountSettlementService) List added in v2.5.0

Get a list of ledger account settlements.

func (*LedgerAccountSettlementService) ListAutoPaging added in v2.5.0

Get a list of ledger account settlements.

func (*LedgerAccountSettlementService) New added in v2.5.0

Create a ledger account settlement.

func (*LedgerAccountSettlementService) Update added in v2.5.0

Update the details of a ledger account settlement.

type LedgerAccountSettlementStatus added in v2.5.0

type LedgerAccountSettlementStatus string

The status of the ledger account settlement. One of `processing`, `pending`, `posted`, `archiving` or `archived`.

const (
	LedgerAccountSettlementStatusArchived   LedgerAccountSettlementStatus = "archived"
	LedgerAccountSettlementStatusArchiving  LedgerAccountSettlementStatus = "archiving"
	LedgerAccountSettlementStatusPending    LedgerAccountSettlementStatus = "pending"
	LedgerAccountSettlementStatusPosted     LedgerAccountSettlementStatus = "posted"
	LedgerAccountSettlementStatusProcessing LedgerAccountSettlementStatus = "processing"
)

func (LedgerAccountSettlementStatus) IsKnown added in v2.10.0

func (r LedgerAccountSettlementStatus) IsKnown() bool

type LedgerAccountSettlementUpdateParams added in v2.5.0

type LedgerAccountSettlementUpdateParams struct {
	// The description of the ledger account settlement.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a pending ledger account settlement, use `posted`. To archive a pending
	// ledger transaction, use `archived`.
	Status param.Field[LedgerAccountSettlementUpdateParamsStatus] `json:"status"`
}

func (LedgerAccountSettlementUpdateParams) MarshalJSON added in v2.5.0

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

type LedgerAccountSettlementUpdateParamsStatus added in v2.5.0

type LedgerAccountSettlementUpdateParamsStatus string

To post a pending ledger account settlement, use `posted`. To archive a pending ledger transaction, use `archived`.

const (
	LedgerAccountSettlementUpdateParamsStatusPosted   LedgerAccountSettlementUpdateParamsStatus = "posted"
	LedgerAccountSettlementUpdateParamsStatusArchived LedgerAccountSettlementUpdateParamsStatus = "archived"
)

func (LedgerAccountSettlementUpdateParamsStatus) IsKnown added in v2.10.0

type LedgerAccountStatementGetResponse

type LedgerAccountStatementGetResponse struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The description of the ledger account statement.
	Description string `json:"description,required,nullable"`
	// The inclusive lower bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtLowerBound time.Time `json:"effective_at_lower_bound,required" format:"date-time"`
	// The exclusive upper bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtUpperBound time.Time `json:"effective_at_upper_bound,required" format:"date-time"`
	// The pending, posted, and available balances for this ledger account at the
	// `effective_at_upper_bound`. The posted balance is the sum of all posted entries
	// on the account. The pending balance is the sum of all pending and posted entries
	// on the account. The available balance is the posted incoming entries minus the
	// sum of the pending and posted outgoing amounts.
	EndingBalance LedgerAccountStatementGetResponseEndingBalance `json:"ending_balance,required"`
	// The id of the ledger account whose ledger entries are queried against, and its
	// balances are computed as a result.
	LedgerAccountID string `json:"ledger_account_id,required" format:"uuid"`
	// Lock version of the ledger account at the time of statement generation.
	LedgerAccountLockVersion int64 `json:"ledger_account_lock_version,required"`
	// The normal balance of the ledger account.
	LedgerAccountNormalBalance shared.TransactionDirection `json:"ledger_account_normal_balance,required"`
	// The id of the ledger that this ledger account statement belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The pending, posted, and available balances for this ledger account at the
	// `effective_at_lower_bound`. The posted balance is the sum of all posted entries
	// on the account. The pending balance is the sum of all pending and posted entries
	// on the account. The available balance is the posted incoming entries minus the
	// sum of the pending and posted outgoing amounts.
	StartingBalance LedgerAccountStatementGetResponseStartingBalance `json:"starting_balance,required"`
	UpdatedAt       time.Time                                        `json:"updated_at,required" format:"date-time"`
	JSON            ledgerAccountStatementGetResponseJSON            `json:"-"`
}

func (*LedgerAccountStatementGetResponse) UnmarshalJSON

func (r *LedgerAccountStatementGetResponse) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementGetResponseEndingBalance

type LedgerAccountStatementGetResponseEndingBalance struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountStatementGetResponseEndingBalanceAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountStatementGetResponseEndingBalancePendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountStatementGetResponseEndingBalancePostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountStatementGetResponseEndingBalanceJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account at the `effective_at_upper_bound`. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountStatementGetResponseEndingBalance) UnmarshalJSON

func (r *LedgerAccountStatementGetResponseEndingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementGetResponseEndingBalanceAvailableBalance

type LedgerAccountStatementGetResponseEndingBalanceAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                              `json:"currency_exponent,required"`
	Debits           int64                                                              `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseEndingBalanceAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountStatementGetResponseEndingBalanceAvailableBalance) UnmarshalJSON

type LedgerAccountStatementGetResponseEndingBalancePendingBalance

type LedgerAccountStatementGetResponseEndingBalancePendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                            `json:"currency_exponent,required"`
	Debits           int64                                                            `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseEndingBalancePendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountStatementGetResponseEndingBalancePendingBalance) UnmarshalJSON

type LedgerAccountStatementGetResponseEndingBalancePostedBalance

type LedgerAccountStatementGetResponseEndingBalancePostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                           `json:"currency_exponent,required"`
	Debits           int64                                                           `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseEndingBalancePostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountStatementGetResponseEndingBalancePostedBalance) UnmarshalJSON

type LedgerAccountStatementGetResponseStartingBalance

type LedgerAccountStatementGetResponseStartingBalance struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountStatementGetResponseStartingBalanceAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountStatementGetResponseStartingBalancePendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountStatementGetResponseStartingBalancePostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountStatementGetResponseStartingBalanceJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account at the `effective_at_lower_bound`. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountStatementGetResponseStartingBalance) UnmarshalJSON

func (r *LedgerAccountStatementGetResponseStartingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementGetResponseStartingBalanceAvailableBalance

type LedgerAccountStatementGetResponseStartingBalanceAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                `json:"currency_exponent,required"`
	Debits           int64                                                                `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseStartingBalanceAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountStatementGetResponseStartingBalanceAvailableBalance) UnmarshalJSON

type LedgerAccountStatementGetResponseStartingBalancePendingBalance

type LedgerAccountStatementGetResponseStartingBalancePendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                              `json:"currency_exponent,required"`
	Debits           int64                                                              `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseStartingBalancePendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountStatementGetResponseStartingBalancePendingBalance) UnmarshalJSON

type LedgerAccountStatementGetResponseStartingBalancePostedBalance

type LedgerAccountStatementGetResponseStartingBalancePostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                             `json:"currency_exponent,required"`
	Debits           int64                                                             `json:"debits,required"`
	JSON             ledgerAccountStatementGetResponseStartingBalancePostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountStatementGetResponseStartingBalancePostedBalance) UnmarshalJSON

type LedgerAccountStatementNewParams

type LedgerAccountStatementNewParams struct {
	// The inclusive lower bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtLowerBound param.Field[time.Time] `json:"effective_at_lower_bound,required" format:"date-time"`
	// The exclusive upper bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtUpperBound param.Field[time.Time] `json:"effective_at_upper_bound,required" format:"date-time"`
	// The id of the ledger account whose ledger entries are queried against, and its
	// balances are computed as a result.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// The description of the ledger account statement.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerAccountStatementNewParams) MarshalJSON

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

type LedgerAccountStatementNewResponse

type LedgerAccountStatementNewResponse struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The description of the ledger account statement.
	Description string `json:"description,required,nullable"`
	// The inclusive lower bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtLowerBound time.Time `json:"effective_at_lower_bound,required" format:"date-time"`
	// The exclusive upper bound of the effective_at timestamp of the ledger entries to
	// be included in the ledger account statement.
	EffectiveAtUpperBound time.Time `json:"effective_at_upper_bound,required" format:"date-time"`
	// The pending, posted, and available balances for this ledger account at the
	// `effective_at_upper_bound`. The posted balance is the sum of all posted entries
	// on the account. The pending balance is the sum of all pending and posted entries
	// on the account. The available balance is the posted incoming entries minus the
	// sum of the pending and posted outgoing amounts.
	EndingBalance LedgerAccountStatementNewResponseEndingBalance `json:"ending_balance,required"`
	// The id of the ledger account whose ledger entries are queried against, and its
	// balances are computed as a result.
	LedgerAccountID string `json:"ledger_account_id,required" format:"uuid"`
	// Lock version of the ledger account at the time of statement generation.
	LedgerAccountLockVersion int64 `json:"ledger_account_lock_version,required"`
	// The normal balance of the ledger account.
	LedgerAccountNormalBalance shared.TransactionDirection `json:"ledger_account_normal_balance,required"`
	// The id of the ledger that this ledger account statement belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The pending, posted, and available balances for this ledger account at the
	// `effective_at_lower_bound`. The posted balance is the sum of all posted entries
	// on the account. The pending balance is the sum of all pending and posted entries
	// on the account. The available balance is the posted incoming entries minus the
	// sum of the pending and posted outgoing amounts.
	StartingBalance LedgerAccountStatementNewResponseStartingBalance `json:"starting_balance,required"`
	UpdatedAt       time.Time                                        `json:"updated_at,required" format:"date-time"`
	JSON            ledgerAccountStatementNewResponseJSON            `json:"-"`
}

func (*LedgerAccountStatementNewResponse) UnmarshalJSON

func (r *LedgerAccountStatementNewResponse) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementNewResponseEndingBalance

type LedgerAccountStatementNewResponseEndingBalance struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountStatementNewResponseEndingBalanceAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountStatementNewResponseEndingBalancePendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountStatementNewResponseEndingBalancePostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountStatementNewResponseEndingBalanceJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account at the `effective_at_upper_bound`. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountStatementNewResponseEndingBalance) UnmarshalJSON

func (r *LedgerAccountStatementNewResponseEndingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementNewResponseEndingBalanceAvailableBalance

type LedgerAccountStatementNewResponseEndingBalanceAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                              `json:"currency_exponent,required"`
	Debits           int64                                                              `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseEndingBalanceAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountStatementNewResponseEndingBalanceAvailableBalance) UnmarshalJSON

type LedgerAccountStatementNewResponseEndingBalancePendingBalance

type LedgerAccountStatementNewResponseEndingBalancePendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                            `json:"currency_exponent,required"`
	Debits           int64                                                            `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseEndingBalancePendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountStatementNewResponseEndingBalancePendingBalance) UnmarshalJSON

type LedgerAccountStatementNewResponseEndingBalancePostedBalance

type LedgerAccountStatementNewResponseEndingBalancePostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                           `json:"currency_exponent,required"`
	Debits           int64                                                           `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseEndingBalancePostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountStatementNewResponseEndingBalancePostedBalance) UnmarshalJSON

type LedgerAccountStatementNewResponseStartingBalance

type LedgerAccountStatementNewResponseStartingBalance struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerAccountStatementNewResponseStartingBalanceAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerAccountStatementNewResponseStartingBalancePendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerAccountStatementNewResponseStartingBalancePostedBalance `json:"posted_balance,required"`
	JSON          ledgerAccountStatementNewResponseStartingBalanceJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger account at the `effective_at_lower_bound`. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts.

func (*LedgerAccountStatementNewResponseStartingBalance) UnmarshalJSON

func (r *LedgerAccountStatementNewResponseStartingBalance) UnmarshalJSON(data []byte) (err error)

type LedgerAccountStatementNewResponseStartingBalanceAvailableBalance

type LedgerAccountStatementNewResponseStartingBalanceAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                `json:"currency_exponent,required"`
	Debits           int64                                                                `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseStartingBalanceAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerAccountStatementNewResponseStartingBalanceAvailableBalance) UnmarshalJSON

type LedgerAccountStatementNewResponseStartingBalancePendingBalance

type LedgerAccountStatementNewResponseStartingBalancePendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                              `json:"currency_exponent,required"`
	Debits           int64                                                              `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseStartingBalancePendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerAccountStatementNewResponseStartingBalancePendingBalance) UnmarshalJSON

type LedgerAccountStatementNewResponseStartingBalancePostedBalance

type LedgerAccountStatementNewResponseStartingBalancePostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                             `json:"currency_exponent,required"`
	Debits           int64                                                             `json:"debits,required"`
	JSON             ledgerAccountStatementNewResponseStartingBalancePostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerAccountStatementNewResponseStartingBalancePostedBalance) UnmarshalJSON

type LedgerAccountStatementService

type LedgerAccountStatementService struct {
	Options []option.RequestOption
}

LedgerAccountStatementService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerAccountStatementService method instead.

func NewLedgerAccountStatementService

func NewLedgerAccountStatementService(opts ...option.RequestOption) (r *LedgerAccountStatementService)

NewLedgerAccountStatementService 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 (*LedgerAccountStatementService) Get

Get details on a single ledger account statement.

func (*LedgerAccountStatementService) New

Create a ledger account statement.

type LedgerAccountUpdateParams

type LedgerAccountUpdateParams struct {
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name"`
}

func (LedgerAccountUpdateParams) MarshalJSON

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

type LedgerEntry

type LedgerEntry struct {
	ID string `json:"id,required" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount    int64     `json:"amount,required"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction   shared.TransactionDirection `json:"direction,required"`
	DiscardedAt time.Time                   `json:"discarded_at,required,nullable" format:"date-time"`
	// The currency of the ledger account.
	LedgerAccountCurrency string `json:"ledger_account_currency,required"`
	// The currency exponent of the ledger account.
	LedgerAccountCurrencyExponent int64 `json:"ledger_account_currency_exponent,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID string `json:"ledger_account_id,required" format:"uuid"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LedgerAccountLockVersion int64 `json:"ledger_account_lock_version,required,nullable"`
	// The ledger transaction that this ledger entry is associated with.
	LedgerTransactionID string `json:"ledger_transaction_id,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The pending, posted, and available balances for this ledger entry's ledger
	// account. The posted balance is the sum of all posted entries on the account. The
	// pending balance is the sum of all pending and posted entries on the account. The
	// available balance is the posted incoming entries minus the sum of the pending
	// and posted outgoing amounts. Please see
	// https://docs.moderntreasury.com/docs/transaction-status-and-balances for more
	// details.
	ResultingLedgerAccountBalances LedgerEntryResultingLedgerAccountBalances `json:"resulting_ledger_account_balances,required,nullable"`
	// Equal to the state of the ledger transaction when the ledger entry was created.
	// One of `pending`, `posted`, or `archived`.
	Status    LedgerEntryStatus `json:"status,required"`
	UpdatedAt time.Time         `json:"updated_at,required" format:"date-time"`
	JSON      ledgerEntryJSON   `json:"-"`
}

func (*LedgerEntry) UnmarshalJSON

func (r *LedgerEntry) UnmarshalJSON(data []byte) (err error)

type LedgerEntryGetParams

type LedgerEntryGetParams struct {
	// If true, response will include the balances attached to the ledger entry. If
	// there is no balance available, null will be returned instead.
	ShowBalances param.Field[bool] `query:"show_balances"`
}

func (LedgerEntryGetParams) URLQuery

func (r LedgerEntryGetParams) URLQuery() (v url.Values)

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

type LedgerEntryListParams

type LedgerEntryListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// Shows all ledger entries that were present on a ledger account at a particular
	// `lock_version`. You must also specify `ledger_account_id`.
	AsOfLockVersion param.Field[int64] `query:"as_of_lock_version"`
	// If true, response will include ledger entries that were deleted. When you update
	// a ledger transaction to specify a new set of entries, the previous entries are
	// deleted.
	Direction param.Field[shared.TransactionDirection] `query:"direction"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// transaction's effective time. Format ISO8601
	EffectiveAt param.Field[map[string]time.Time] `query:"effective_at" format:"date-time"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// transaction's effective date. Format YYYY-MM-DD
	EffectiveDate param.Field[map[string]time.Time] `query:"effective_date" format:"date"`
	// Get all ledger entries that match the direction specified. One of `credit`,
	// `debit`.
	LedgerAccountCategoryID param.Field[string] `query:"ledger_account_category_id"`
	LedgerAccountID         param.Field[string] `query:"ledger_account_id"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// lock_version of a ledger account. For example, for all entries created at or
	// before before lock_version 1000 of a ledger account, use
	// `ledger_account_lock_version%5Blte%5D=1000`.
	LedgerAccountLockVersion  param.Field[map[string]int64] `query:"ledger_account_lock_version"`
	LedgerAccountPayoutID     param.Field[string]           `query:"ledger_account_payout_id"`
	LedgerAccountSettlementID param.Field[string]           `query:"ledger_account_settlement_id"`
	// Get all ledger entries that are included in the ledger account statement.
	LedgerAccountStatementID param.Field[string] `query:"ledger_account_statement_id"`
	LedgerTransactionID      param.Field[string] `query:"ledger_transaction_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// Order by `created_at` or `effective_at` in `asc` or `desc` order. For example,
	// to order by `effective_at asc`, use `order_by%5Beffective_at%5D=asc`. Ordering
	// by only one field at a time is supported.
	OrderBy param.Field[LedgerEntryListParamsOrderBy] `query:"order_by"`
	PerPage param.Field[int64]                        `query:"per_page"`
	// If true, response will include the balances attached to the ledger entry. If
	// there is no balance available, null will be returned instead.
	ShowBalances param.Field[bool] `query:"show_balances"`
	// If true, response will include ledger entries that were deleted. When you update
	// a ledger transaction to specify a new set of entries, the previous entries are
	// deleted.
	ShowDeleted param.Field[bool] `query:"show_deleted"`
	// Get all ledger entries that match the status specified. One of `pending`,
	// `posted`, or `archived`.
	Status param.Field[LedgerEntryListParamsStatus] `query:"status"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// posted at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// updated_at%5Bgt%5D=2000-01-01T12:00:00Z.
	UpdatedAt param.Field[map[string]time.Time] `query:"updated_at" format:"date-time"`
}

func (LedgerEntryListParams) URLQuery

func (r LedgerEntryListParams) URLQuery() (v url.Values)

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

type LedgerEntryListParamsOrderBy

type LedgerEntryListParamsOrderBy struct {
	CreatedAt   param.Field[LedgerEntryListParamsOrderByCreatedAt]   `query:"created_at"`
	EffectiveAt param.Field[LedgerEntryListParamsOrderByEffectiveAt] `query:"effective_at"`
}

Order by `created_at` or `effective_at` in `asc` or `desc` order. For example, to order by `effective_at asc`, use `order_by%5Beffective_at%5D=asc`. Ordering by only one field at a time is supported.

func (LedgerEntryListParamsOrderBy) URLQuery

func (r LedgerEntryListParamsOrderBy) URLQuery() (v url.Values)

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

type LedgerEntryListParamsOrderByCreatedAt

type LedgerEntryListParamsOrderByCreatedAt string
const (
	LedgerEntryListParamsOrderByCreatedAtAsc  LedgerEntryListParamsOrderByCreatedAt = "asc"
	LedgerEntryListParamsOrderByCreatedAtDesc LedgerEntryListParamsOrderByCreatedAt = "desc"
)

func (LedgerEntryListParamsOrderByCreatedAt) IsKnown added in v2.10.0

type LedgerEntryListParamsOrderByEffectiveAt

type LedgerEntryListParamsOrderByEffectiveAt string
const (
	LedgerEntryListParamsOrderByEffectiveAtAsc  LedgerEntryListParamsOrderByEffectiveAt = "asc"
	LedgerEntryListParamsOrderByEffectiveAtDesc LedgerEntryListParamsOrderByEffectiveAt = "desc"
)

func (LedgerEntryListParamsOrderByEffectiveAt) IsKnown added in v2.10.0

type LedgerEntryListParamsStatus

type LedgerEntryListParamsStatus string

Get all ledger entries that match the status specified. One of `pending`, `posted`, or `archived`.

const (
	LedgerEntryListParamsStatusPending  LedgerEntryListParamsStatus = "pending"
	LedgerEntryListParamsStatusPosted   LedgerEntryListParamsStatus = "posted"
	LedgerEntryListParamsStatusArchived LedgerEntryListParamsStatus = "archived"
)

func (LedgerEntryListParamsStatus) IsKnown added in v2.10.0

func (r LedgerEntryListParamsStatus) IsKnown() bool

type LedgerEntryResultingLedgerAccountBalances

type LedgerEntryResultingLedgerAccountBalances struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerEntryResultingLedgerAccountBalancesAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerEntryResultingLedgerAccountBalancesPendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerEntryResultingLedgerAccountBalancesPostedBalance `json:"posted_balance,required"`
	JSON          ledgerEntryResultingLedgerAccountBalancesJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger entry's ledger account. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts. Please see https://docs.moderntreasury.com/docs/transaction-status-and-balances for more details.

func (*LedgerEntryResultingLedgerAccountBalances) UnmarshalJSON

func (r *LedgerEntryResultingLedgerAccountBalances) UnmarshalJSON(data []byte) (err error)

type LedgerEntryResultingLedgerAccountBalancesAvailableBalance

type LedgerEntryResultingLedgerAccountBalancesAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                         `json:"currency_exponent,required"`
	Debits           int64                                                         `json:"debits,required"`
	JSON             ledgerEntryResultingLedgerAccountBalancesAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerEntryResultingLedgerAccountBalancesAvailableBalance) UnmarshalJSON

type LedgerEntryResultingLedgerAccountBalancesPendingBalance

type LedgerEntryResultingLedgerAccountBalancesPendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                       `json:"currency_exponent,required"`
	Debits           int64                                                       `json:"debits,required"`
	JSON             ledgerEntryResultingLedgerAccountBalancesPendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerEntryResultingLedgerAccountBalancesPendingBalance) UnmarshalJSON

type LedgerEntryResultingLedgerAccountBalancesPostedBalance

type LedgerEntryResultingLedgerAccountBalancesPostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                      `json:"currency_exponent,required"`
	Debits           int64                                                      `json:"debits,required"`
	JSON             ledgerEntryResultingLedgerAccountBalancesPostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerEntryResultingLedgerAccountBalancesPostedBalance) UnmarshalJSON

func (r *LedgerEntryResultingLedgerAccountBalancesPostedBalance) UnmarshalJSON(data []byte) (err error)

type LedgerEntryService

type LedgerEntryService struct {
	Options []option.RequestOption
}

LedgerEntryService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerEntryService method instead.

func NewLedgerEntryService

func NewLedgerEntryService(opts ...option.RequestOption) (r *LedgerEntryService)

NewLedgerEntryService 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 (*LedgerEntryService) Get

Get details on a single ledger entry.

func (*LedgerEntryService) List

Get a list of all ledger entries.

func (*LedgerEntryService) ListAutoPaging

Get a list of all ledger entries.

func (*LedgerEntryService) Update added in v2.5.0

Update the details of a ledger entry.

type LedgerEntryStatus

type LedgerEntryStatus string

Equal to the state of the ledger transaction when the ledger entry was created. One of `pending`, `posted`, or `archived`.

const (
	LedgerEntryStatusArchived LedgerEntryStatus = "archived"
	LedgerEntryStatusPending  LedgerEntryStatus = "pending"
	LedgerEntryStatusPosted   LedgerEntryStatus = "posted"
)

func (LedgerEntryStatus) IsKnown added in v2.10.0

func (r LedgerEntryStatus) IsKnown() bool

type LedgerEntryUpdateParams added in v2.5.0

type LedgerEntryUpdateParams struct {
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerEntryUpdateParams) MarshalJSON added in v2.5.0

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

type LedgerEventHandler added in v2.1.0

type LedgerEventHandler struct {
	ID         string                       `json:"id,required" format:"uuid"`
	Conditions LedgerEventHandlerConditions `json:"conditions,required,nullable"`
	CreatedAt  time.Time                    `json:"created_at,required" format:"date-time"`
	// An optional description.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The id of the ledger that this event handler belongs to.
	LedgerID                  string                                      `json:"ledger_id,required,nullable"`
	LedgerTransactionTemplate LedgerEventHandlerLedgerTransactionTemplate `json:"ledger_transaction_template,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required,nullable"`
	// Name of the ledger event handler.
	Name      string                                `json:"name,required"`
	Object    string                                `json:"object,required"`
	UpdatedAt time.Time                             `json:"updated_at,required" format:"date-time"`
	Variables map[string]LedgerEventHandlerVariable `json:"variables,required,nullable"`
	JSON      ledgerEventHandlerJSON                `json:"-"`
}

func (*LedgerEventHandler) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandler) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerConditions added in v2.1.0

type LedgerEventHandlerConditions struct {
	// The LHS of the conditional.
	Field string `json:"field,required"`
	// What the operator between the `field` and `value` is.
	Operator string `json:"operator,required"`
	// The RHS of the conditional.
	Value string                           `json:"value,required"`
	JSON  ledgerEventHandlerConditionsJSON `json:"-"`
}

func (*LedgerEventHandlerConditions) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandlerConditions) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerLedgerTransactionTemplate added in v2.1.0

type LedgerEventHandlerLedgerTransactionTemplate struct {
	// An optional description for internal use.
	Description string `json:"description,required,nullable"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt string `json:"effective_at,required,nullable"`
	// An array of ledger entry objects.
	LedgerEntries []LedgerEventHandlerLedgerTransactionTemplateLedgerEntry `json:"ledger_entries,required"`
	// To post a ledger transaction at creation, use `posted`.
	Status string                                          `json:"status,required,nullable"`
	JSON   ledgerEventHandlerLedgerTransactionTemplateJSON `json:"-"`
}

func (*LedgerEventHandlerLedgerTransactionTemplate) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandlerLedgerTransactionTemplate) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerLedgerTransactionTemplateLedgerEntry added in v2.1.0

type LedgerEventHandlerLedgerTransactionTemplateLedgerEntry struct {
	// The LHS of the conditional.
	Amount string `json:"amount,required"`
	// What the operator between the `field` and `value` is.
	Direction string `json:"direction,required"`
	// The RHS of the conditional.
	LedgerAccountID string                                                     `json:"ledger_account_id,required"`
	JSON            ledgerEventHandlerLedgerTransactionTemplateLedgerEntryJSON `json:"-"`
}

func (*LedgerEventHandlerLedgerTransactionTemplateLedgerEntry) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandlerLedgerTransactionTemplateLedgerEntry) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerListParams

type LedgerEventHandlerListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// posted at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// created_at%5Bgt%5D=2000-01-01T12:00:00Z.
	CreatedAt param.Field[map[string]time.Time] `query:"created_at" format:"date-time"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	Name     param.Field[string]            `query:"name"`
	PerPage  param.Field[int64]             `query:"per_page"`
}

func (LedgerEventHandlerListParams) URLQuery

func (r LedgerEventHandlerListParams) URLQuery() (v url.Values)

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

type LedgerEventHandlerNewParams

type LedgerEventHandlerNewParams struct {
	LedgerTransactionTemplate param.Field[LedgerEventHandlerNewParamsLedgerTransactionTemplate] `json:"ledger_transaction_template,required"`
	// Name of the ledger event handler.
	Name       param.Field[string]                                `json:"name,required"`
	Conditions param.Field[LedgerEventHandlerNewParamsConditions] `json:"conditions"`
	// An optional description.
	Description param.Field[string] `json:"description"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id" format:"uuid"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata  param.Field[map[string]string]                          `json:"metadata"`
	Variables param.Field[map[string]LedgerEventHandlerVariableParam] `json:"variables"`
}

func (LedgerEventHandlerNewParams) MarshalJSON

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

type LedgerEventHandlerNewParamsConditions

type LedgerEventHandlerNewParamsConditions struct {
	// The LHS of the conditional.
	Field param.Field[string] `json:"field,required"`
	// What the operator between the `field` and `value` is.
	Operator param.Field[string] `json:"operator,required"`
	// The RHS of the conditional.
	Value param.Field[string] `json:"value,required"`
}

func (LedgerEventHandlerNewParamsConditions) MarshalJSON

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

type LedgerEventHandlerNewParamsLedgerTransactionTemplate

type LedgerEventHandlerNewParamsLedgerTransactionTemplate struct {
	// An optional description for internal use.
	Description param.Field[string] `json:"description,required"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[string] `json:"effective_at,required"`
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]LedgerEventHandlerNewParamsLedgerTransactionTemplateLedgerEntry] `json:"ledger_entries,required"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[string] `json:"status,required"`
}

func (LedgerEventHandlerNewParamsLedgerTransactionTemplate) MarshalJSON

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

type LedgerEventHandlerNewParamsLedgerTransactionTemplateLedgerEntry

type LedgerEventHandlerNewParamsLedgerTransactionTemplateLedgerEntry struct {
	// The LHS of the conditional.
	Amount param.Field[string] `json:"amount,required"`
	// What the operator between the `field` and `value` is.
	Direction param.Field[string] `json:"direction,required"`
	// The RHS of the conditional.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required"`
}

func (LedgerEventHandlerNewParamsLedgerTransactionTemplateLedgerEntry) MarshalJSON

type LedgerEventHandlerService

type LedgerEventHandlerService struct {
	Options []option.RequestOption
}

LedgerEventHandlerService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerEventHandlerService method instead.

func NewLedgerEventHandlerService

func NewLedgerEventHandlerService(opts ...option.RequestOption) (r *LedgerEventHandlerService)

NewLedgerEventHandlerService 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 (*LedgerEventHandlerService) Delete

Archive a ledger event handler.

func (*LedgerEventHandlerService) Get

Get details on a single ledger event handler.

func (*LedgerEventHandlerService) List

Get a list of ledger event handlers.

func (*LedgerEventHandlerService) ListAutoPaging

Get a list of ledger event handlers.

func (*LedgerEventHandlerService) New

create ledger_event_handler

type LedgerEventHandlerVariable added in v2.1.0

type LedgerEventHandlerVariable struct {
	Query LedgerEventHandlerVariableQuery `json:"query,required"`
	// The type of object this variable is. Currently, only "ledger_account" is
	// supported.
	Type string                         `json:"type,required"`
	JSON ledgerEventHandlerVariableJSON `json:"-"`
}

func (*LedgerEventHandlerVariable) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandlerVariable) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerVariableParam added in v2.1.0

type LedgerEventHandlerVariableParam struct {
	Query param.Field[LedgerEventHandlerVariableQueryParam] `json:"query,required"`
	// The type of object this variable is. Currently, only "ledger_account" is
	// supported.
	Type param.Field[string] `json:"type,required"`
}

func (LedgerEventHandlerVariableParam) MarshalJSON added in v2.1.0

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

type LedgerEventHandlerVariableQuery added in v2.1.0

type LedgerEventHandlerVariableQuery struct {
	// The LHS of the conditional.
	Field string `json:"field,required"`
	// What the operator between the `field` and `value` is.
	Operator string `json:"operator,required"`
	// The RHS of the conditional.
	Value string                              `json:"value,required"`
	JSON  ledgerEventHandlerVariableQueryJSON `json:"-"`
}

func (*LedgerEventHandlerVariableQuery) UnmarshalJSON added in v2.1.0

func (r *LedgerEventHandlerVariableQuery) UnmarshalJSON(data []byte) (err error)

type LedgerEventHandlerVariableQueryParam added in v2.1.0

type LedgerEventHandlerVariableQueryParam struct {
	// The LHS of the conditional.
	Field param.Field[string] `json:"field,required"`
	// What the operator between the `field` and `value` is.
	Operator param.Field[string] `json:"operator,required"`
	// The RHS of the conditional.
	Value param.Field[string] `json:"value,required"`
}

func (LedgerEventHandlerVariableQueryParam) MarshalJSON added in v2.1.0

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

type LedgerListParams

type LedgerListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// posted at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// updated_at%5Bgt%5D=2000-01-01T12:00:00Z.
	UpdatedAt param.Field[map[string]time.Time] `query:"updated_at" format:"date-time"`
}

func (LedgerListParams) URLQuery

func (r LedgerListParams) URLQuery() (v url.Values)

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

type LedgerNewParams

type LedgerNewParams struct {
	// The name of the ledger.
	Name param.Field[string] `json:"name,required"`
	// An optional free-form description for internal use.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerNewParams) MarshalJSON

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

type LedgerService

type LedgerService struct {
	Options []option.RequestOption
}

LedgerService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerService method instead.

func NewLedgerService

func NewLedgerService(opts ...option.RequestOption) (r *LedgerService)

NewLedgerService 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 (*LedgerService) Delete

func (r *LedgerService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *Ledger, err error)

Delete a ledger.

func (*LedgerService) Get

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

Get details on a single ledger.

func (*LedgerService) List

func (r *LedgerService) List(ctx context.Context, query LedgerListParams, opts ...option.RequestOption) (res *pagination.Page[Ledger], err error)

Get a list of ledgers.

func (*LedgerService) ListAutoPaging

Get a list of ledgers.

func (*LedgerService) New

func (r *LedgerService) New(ctx context.Context, body LedgerNewParams, opts ...option.RequestOption) (res *Ledger, err error)

Create a ledger.

func (*LedgerService) Update

func (r *LedgerService) Update(ctx context.Context, id string, body LedgerUpdateParams, opts ...option.RequestOption) (res *Ledger, err error)

Update the details of a ledger.

type LedgerTransaction

type LedgerTransaction struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// An optional description for internal use.
	Description string `json:"description,required,nullable"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt time.Time `json:"effective_at,required" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate time.Time `json:"effective_date,required" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID string `json:"external_id,required,nullable"`
	// An array of ledger entry objects.
	LedgerEntries []LedgerEntry `json:"ledger_entries,required"`
	// The ID of the ledger this ledger transaction belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID string `json:"ledgerable_id,required,nullable" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType LedgerTransactionLedgerableType `json:"ledgerable_type,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The time on which the ledger transaction posted. This is null if the ledger
	// transaction is pending.
	PostedAt time.Time `json:"posted_at,required,nullable" format:"date-time"`
	// The ID of the ledger transaction that reversed this ledger transaction.
	ReversedByLedgerTransactionID string `json:"reversed_by_ledger_transaction_id,required,nullable"`
	// The ID of the original ledger transaction that this ledger transaction reverses.
	ReversesLedgerTransactionID string `json:"reverses_ledger_transaction_id,required,nullable"`
	// To post a ledger transaction at creation, use `posted`.
	Status    LedgerTransactionStatus `json:"status,required"`
	UpdatedAt time.Time               `json:"updated_at,required" format:"date-time"`
	JSON      ledgerTransactionJSON   `json:"-"`
}

func (*LedgerTransaction) UnmarshalJSON

func (r *LedgerTransaction) UnmarshalJSON(data []byte) (err error)

type LedgerTransactionLedgerableType

type LedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	LedgerTransactionLedgerableTypeExpectedPayment       LedgerTransactionLedgerableType = "expected_payment"
	LedgerTransactionLedgerableTypeIncomingPaymentDetail LedgerTransactionLedgerableType = "incoming_payment_detail"
	LedgerTransactionLedgerableTypePaperItem             LedgerTransactionLedgerableType = "paper_item"
	LedgerTransactionLedgerableTypePaymentOrder          LedgerTransactionLedgerableType = "payment_order"
	LedgerTransactionLedgerableTypeReturn                LedgerTransactionLedgerableType = "return"
	LedgerTransactionLedgerableTypeReversal              LedgerTransactionLedgerableType = "reversal"
)

func (LedgerTransactionLedgerableType) IsKnown added in v2.10.0

type LedgerTransactionListParams

type LedgerTransactionListParams struct {
	// If you have specific IDs to retrieve in bulk, you can pass them as query
	// parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
	ID          param.Field[[]string] `query:"id"`
	AfterCursor param.Field[string]   `query:"after_cursor"`
	// Use "gt" (>), "gte" (>=), "lt" (<), "lte" (<=), or "eq" (=) to filter by
	// effective at. For example, for all transactions after Jan 1 2000, use
	// effective_at%5Bgt%5D=2000-01-01T00:00:00:00.000Z.
	EffectiveAt param.Field[map[string]time.Time] `query:"effective_at" format:"date-time"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by
	// effective date. For example, for all dates after Jan 1 2000, use
	// effective_date%5Bgt%5D=2000-01-01.
	EffectiveDate             param.Field[map[string]time.Time]                      `query:"effective_date" format:"date-time"`
	ExternalID                param.Field[string]                                    `query:"external_id"`
	LedgerAccountCategoryID   param.Field[string]                                    `query:"ledger_account_category_id"`
	LedgerAccountID           param.Field[string]                                    `query:"ledger_account_id"`
	LedgerAccountSettlementID param.Field[string]                                    `query:"ledger_account_settlement_id"`
	LedgerID                  param.Field[string]                                    `query:"ledger_id"`
	LedgerableID              param.Field[string]                                    `query:"ledgerable_id"`
	LedgerableType            param.Field[LedgerTransactionListParamsLedgerableType] `query:"ledgerable_type"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	// Order by `created_at` or `effective_at` in `asc` or `desc` order. For example,
	// to order by `effective_at asc`, use `order_by%5Beffective_at%5D=asc`. Ordering
	// by only one field at a time is supported.
	OrderBy param.Field[LedgerTransactionListParamsOrderBy] `query:"order_by"`
	PerPage param.Field[int64]                              `query:"per_page"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// posted at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// posted_at%5Bgt%5D=2000-01-01T12:00:00Z.
	PostedAt                    param.Field[map[string]time.Time]              `query:"posted_at" format:"date-time"`
	ReversesLedgerTransactionID param.Field[string]                            `query:"reverses_ledger_transaction_id"`
	Status                      param.Field[LedgerTransactionListParamsStatus] `query:"status"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// posted at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use
	// updated_at%5Bgt%5D=2000-01-01T12:00:00Z.
	UpdatedAt param.Field[map[string]time.Time] `query:"updated_at" format:"date-time"`
}

func (LedgerTransactionListParams) URLQuery

func (r LedgerTransactionListParams) URLQuery() (v url.Values)

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

type LedgerTransactionListParamsLedgerableType

type LedgerTransactionListParamsLedgerableType string
const (
	LedgerTransactionListParamsLedgerableTypeExpectedPayment       LedgerTransactionListParamsLedgerableType = "expected_payment"
	LedgerTransactionListParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionListParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionListParamsLedgerableTypePaperItem             LedgerTransactionListParamsLedgerableType = "paper_item"
	LedgerTransactionListParamsLedgerableTypePaymentOrder          LedgerTransactionListParamsLedgerableType = "payment_order"
	LedgerTransactionListParamsLedgerableTypeReturn                LedgerTransactionListParamsLedgerableType = "return"
	LedgerTransactionListParamsLedgerableTypeReversal              LedgerTransactionListParamsLedgerableType = "reversal"
)

func (LedgerTransactionListParamsLedgerableType) IsKnown added in v2.10.0

type LedgerTransactionListParamsOrderBy

type LedgerTransactionListParamsOrderBy struct {
	CreatedAt   param.Field[LedgerTransactionListParamsOrderByCreatedAt]   `query:"created_at"`
	EffectiveAt param.Field[LedgerTransactionListParamsOrderByEffectiveAt] `query:"effective_at"`
}

Order by `created_at` or `effective_at` in `asc` or `desc` order. For example, to order by `effective_at asc`, use `order_by%5Beffective_at%5D=asc`. Ordering by only one field at a time is supported.

func (LedgerTransactionListParamsOrderBy) URLQuery

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

type LedgerTransactionListParamsOrderByCreatedAt

type LedgerTransactionListParamsOrderByCreatedAt string
const (
	LedgerTransactionListParamsOrderByCreatedAtAsc  LedgerTransactionListParamsOrderByCreatedAt = "asc"
	LedgerTransactionListParamsOrderByCreatedAtDesc LedgerTransactionListParamsOrderByCreatedAt = "desc"
)

func (LedgerTransactionListParamsOrderByCreatedAt) IsKnown added in v2.10.0

type LedgerTransactionListParamsOrderByEffectiveAt

type LedgerTransactionListParamsOrderByEffectiveAt string
const (
	LedgerTransactionListParamsOrderByEffectiveAtAsc  LedgerTransactionListParamsOrderByEffectiveAt = "asc"
	LedgerTransactionListParamsOrderByEffectiveAtDesc LedgerTransactionListParamsOrderByEffectiveAt = "desc"
)

func (LedgerTransactionListParamsOrderByEffectiveAt) IsKnown added in v2.10.0

type LedgerTransactionListParamsStatus

type LedgerTransactionListParamsStatus string
const (
	LedgerTransactionListParamsStatusPending  LedgerTransactionListParamsStatus = "pending"
	LedgerTransactionListParamsStatusPosted   LedgerTransactionListParamsStatus = "posted"
	LedgerTransactionListParamsStatusArchived LedgerTransactionListParamsStatus = "archived"
)

func (LedgerTransactionListParamsStatus) IsKnown added in v2.10.0

type LedgerTransactionNewParams

type LedgerTransactionNewParams struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]LedgerTransactionNewParamsLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[LedgerTransactionNewParamsLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[LedgerTransactionNewParamsStatus] `json:"status"`
}

func (LedgerTransactionNewParams) MarshalJSON

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

type LedgerTransactionNewParamsLedgerEntry

type LedgerTransactionNewParamsLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (LedgerTransactionNewParamsLedgerEntry) MarshalJSON

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

type LedgerTransactionNewParamsLedgerableType

type LedgerTransactionNewParamsLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	LedgerTransactionNewParamsLedgerableTypeExpectedPayment       LedgerTransactionNewParamsLedgerableType = "expected_payment"
	LedgerTransactionNewParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionNewParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionNewParamsLedgerableTypePaperItem             LedgerTransactionNewParamsLedgerableType = "paper_item"
	LedgerTransactionNewParamsLedgerableTypePaymentOrder          LedgerTransactionNewParamsLedgerableType = "payment_order"
	LedgerTransactionNewParamsLedgerableTypeReturn                LedgerTransactionNewParamsLedgerableType = "return"
	LedgerTransactionNewParamsLedgerableTypeReversal              LedgerTransactionNewParamsLedgerableType = "reversal"
)

func (LedgerTransactionNewParamsLedgerableType) IsKnown added in v2.10.0

type LedgerTransactionNewParamsStatus

type LedgerTransactionNewParamsStatus string

To post a ledger transaction at creation, use `posted`.

const (
	LedgerTransactionNewParamsStatusArchived LedgerTransactionNewParamsStatus = "archived"
	LedgerTransactionNewParamsStatusPending  LedgerTransactionNewParamsStatus = "pending"
	LedgerTransactionNewParamsStatusPosted   LedgerTransactionNewParamsStatus = "posted"
)

func (LedgerTransactionNewParamsStatus) IsKnown added in v2.10.0

type LedgerTransactionNewReversalParams

type LedgerTransactionNewReversalParams struct {
	// An optional free-form description for the reversal ledger transaction. Maximum
	// of 1000 characters allowed.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the reversal ledger transaction happened
	// for reporting purposes. It defaults to the `effective_at` of the original ledger
	// transaction if not provided.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// Must be unique within the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// Specify this if you'd like to link the reversal ledger transaction to a Payment
	// object like Return or Reversal.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// Specify this if you'd like to link the reversal ledger transaction to a Payment
	// object like Return or Reversal.
	LedgerableType param.Field[LedgerTransactionNewReversalParamsLedgerableType] `json:"ledgerable_type"`
	// Additional data to be added to the reversal ledger transaction as key-value
	// pairs. Both the key and value must be strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Status of the reversal ledger transaction. It defaults to `posted` if not
	// provided.
	Status param.Field[LedgerTransactionNewReversalParamsStatus] `json:"status"`
}

func (LedgerTransactionNewReversalParams) MarshalJSON

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

type LedgerTransactionNewReversalParamsLedgerableType

type LedgerTransactionNewReversalParamsLedgerableType string

Specify this if you'd like to link the reversal ledger transaction to a Payment object like Return or Reversal.

const (
	LedgerTransactionNewReversalParamsLedgerableTypeExpectedPayment       LedgerTransactionNewReversalParamsLedgerableType = "expected_payment"
	LedgerTransactionNewReversalParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionNewReversalParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionNewReversalParamsLedgerableTypePaperItem             LedgerTransactionNewReversalParamsLedgerableType = "paper_item"
	LedgerTransactionNewReversalParamsLedgerableTypePaymentOrder          LedgerTransactionNewReversalParamsLedgerableType = "payment_order"
	LedgerTransactionNewReversalParamsLedgerableTypeReturn                LedgerTransactionNewReversalParamsLedgerableType = "return"
	LedgerTransactionNewReversalParamsLedgerableTypeReversal              LedgerTransactionNewReversalParamsLedgerableType = "reversal"
)

func (LedgerTransactionNewReversalParamsLedgerableType) IsKnown added in v2.10.0

type LedgerTransactionNewReversalParamsStatus

type LedgerTransactionNewReversalParamsStatus string

Status of the reversal ledger transaction. It defaults to `posted` if not provided.

const (
	LedgerTransactionNewReversalParamsStatusArchived LedgerTransactionNewReversalParamsStatus = "archived"
	LedgerTransactionNewReversalParamsStatusPending  LedgerTransactionNewReversalParamsStatus = "pending"
	LedgerTransactionNewReversalParamsStatusPosted   LedgerTransactionNewReversalParamsStatus = "posted"
)

func (LedgerTransactionNewReversalParamsStatus) IsKnown added in v2.10.0

type LedgerTransactionService

type LedgerTransactionService struct {
	Options  []option.RequestOption
	Versions *LedgerTransactionVersionService
}

LedgerTransactionService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerTransactionService method instead.

func NewLedgerTransactionService

func NewLedgerTransactionService(opts ...option.RequestOption) (r *LedgerTransactionService)

NewLedgerTransactionService 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 (*LedgerTransactionService) Get

Get details on a single ledger transaction.

func (*LedgerTransactionService) List

Get a list of ledger transactions.

func (*LedgerTransactionService) ListAutoPaging

Get a list of ledger transactions.

func (*LedgerTransactionService) New

Create a ledger transaction.

func (*LedgerTransactionService) NewReversal

Create a ledger transaction reversal.

func (*LedgerTransactionService) Update

Update the details of a ledger transaction.

type LedgerTransactionStatus

type LedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	LedgerTransactionStatusArchived LedgerTransactionStatus = "archived"
	LedgerTransactionStatusPending  LedgerTransactionStatus = "pending"
	LedgerTransactionStatusPosted   LedgerTransactionStatus = "posted"
)

func (LedgerTransactionStatus) IsKnown added in v2.10.0

func (r LedgerTransactionStatus) IsKnown() bool

type LedgerTransactionUpdateParams

type LedgerTransactionUpdateParams struct {
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]LedgerTransactionUpdateParamsLedgerEntry] `json:"ledger_entries"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[LedgerTransactionUpdateParamsLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[LedgerTransactionUpdateParamsStatus] `json:"status"`
}

func (LedgerTransactionUpdateParams) MarshalJSON

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

type LedgerTransactionUpdateParamsLedgerEntry

type LedgerTransactionUpdateParamsLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (LedgerTransactionUpdateParamsLedgerEntry) MarshalJSON

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

type LedgerTransactionUpdateParamsLedgerableType added in v2.13.0

type LedgerTransactionUpdateParamsLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	LedgerTransactionUpdateParamsLedgerableTypeExpectedPayment       LedgerTransactionUpdateParamsLedgerableType = "expected_payment"
	LedgerTransactionUpdateParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionUpdateParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionUpdateParamsLedgerableTypePaperItem             LedgerTransactionUpdateParamsLedgerableType = "paper_item"
	LedgerTransactionUpdateParamsLedgerableTypePaymentOrder          LedgerTransactionUpdateParamsLedgerableType = "payment_order"
	LedgerTransactionUpdateParamsLedgerableTypeReturn                LedgerTransactionUpdateParamsLedgerableType = "return"
	LedgerTransactionUpdateParamsLedgerableTypeReversal              LedgerTransactionUpdateParamsLedgerableType = "reversal"
)

func (LedgerTransactionUpdateParamsLedgerableType) IsKnown added in v2.13.0

type LedgerTransactionUpdateParamsStatus

type LedgerTransactionUpdateParamsStatus string

To post a ledger transaction at creation, use `posted`.

const (
	LedgerTransactionUpdateParamsStatusArchived LedgerTransactionUpdateParamsStatus = "archived"
	LedgerTransactionUpdateParamsStatusPending  LedgerTransactionUpdateParamsStatus = "pending"
	LedgerTransactionUpdateParamsStatusPosted   LedgerTransactionUpdateParamsStatus = "posted"
)

func (LedgerTransactionUpdateParamsStatus) IsKnown added in v2.10.0

type LedgerTransactionVersion

type LedgerTransactionVersion struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// An optional description for internal use.
	Description string `json:"description,required,nullable"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt time.Time `json:"effective_at,required" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate time.Time `json:"effective_date,required" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID string `json:"external_id,required,nullable"`
	// An array of ledger entry objects.
	LedgerEntries []LedgerTransactionVersionLedgerEntry `json:"ledger_entries,required"`
	// The ID of the ledger this ledger transaction belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// The ID of the ledger transaction
	LedgerTransactionID string `json:"ledger_transaction_id,required" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID string `json:"ledgerable_id,required,nullable" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, or reversal.
	LedgerableType LedgerTransactionVersionLedgerableType `json:"ledgerable_type,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The time on which the ledger transaction posted. This is null if the ledger
	// transaction is pending.
	PostedAt time.Time `json:"posted_at,required,nullable" format:"date-time"`
	// The ID of the ledger transaction that reversed this ledger transaction.
	ReversedByLedgerTransactionID string `json:"reversed_by_ledger_transaction_id,required,nullable"`
	// The ID of the original ledger transaction. that this ledger transaction
	// reverses.
	ReversesLedgerTransactionID string `json:"reverses_ledger_transaction_id,required,nullable"`
	// One of `pending`, `posted`, or `archived`.
	Status LedgerTransactionVersionStatus `json:"status,required"`
	// Version number of the ledger transaction.
	Version int64                        `json:"version,required"`
	JSON    ledgerTransactionVersionJSON `json:"-"`
}

func (*LedgerTransactionVersion) UnmarshalJSON

func (r *LedgerTransactionVersion) UnmarshalJSON(data []byte) (err error)

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalances

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalances struct {
	// The available_balance is the sum of all posted inbound entries and pending
	// outbound entries. For credit normal, available_amount = posted_credits -
	// pending_debits; for debit normal, available_amount = posted_debits -
	// pending_credits.
	AvailableBalance LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesAvailableBalance `json:"available_balance,required"`
	// The pending_balance is the sum of all pending and posted entries.
	PendingBalance LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPendingBalance `json:"pending_balance,required"`
	// The posted_balance is the sum of all posted entries.
	PostedBalance LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPostedBalance `json:"posted_balance,required"`
	JSON          ledgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesJSON          `json:"-"`
}

The pending, posted, and available balances for this ledger entry's ledger account. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts. Please see https://docs.moderntreasury.com/docs/transaction-status-and-balances for more details.

func (*LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalances) UnmarshalJSON

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesAvailableBalance

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesAvailableBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                   `json:"currency_exponent,required"`
	Debits           int64                                                                                   `json:"debits,required"`
	JSON             ledgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesAvailableBalanceJSON `json:"-"`
}

The available_balance is the sum of all posted inbound entries and pending outbound entries. For credit normal, available_amount = posted_credits - pending_debits; for debit normal, available_amount = posted_debits - pending_credits.

func (*LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesAvailableBalance) UnmarshalJSON

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPendingBalance

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPendingBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                 `json:"currency_exponent,required"`
	Debits           int64                                                                                 `json:"debits,required"`
	JSON             ledgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPendingBalanceJSON `json:"-"`
}

The pending_balance is the sum of all pending and posted entries.

func (*LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPendingBalance) UnmarshalJSON

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPostedBalance

type LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPostedBalance struct {
	Amount  int64 `json:"amount,required"`
	Credits int64 `json:"credits,required"`
	// The currency of the ledger account.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent int64                                                                                `json:"currency_exponent,required"`
	Debits           int64                                                                                `json:"debits,required"`
	JSON             ledgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPostedBalanceJSON `json:"-"`
}

The posted_balance is the sum of all posted entries.

func (*LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalancesPostedBalance) UnmarshalJSON

type LedgerTransactionVersionLedgerEntriesStatus

type LedgerTransactionVersionLedgerEntriesStatus string

Equal to the state of the ledger transaction when the ledger entry was created. One of `pending`, `posted`, or `archived`.

const (
	LedgerTransactionVersionLedgerEntriesStatusArchived LedgerTransactionVersionLedgerEntriesStatus = "archived"
	LedgerTransactionVersionLedgerEntriesStatusPending  LedgerTransactionVersionLedgerEntriesStatus = "pending"
	LedgerTransactionVersionLedgerEntriesStatusPosted   LedgerTransactionVersionLedgerEntriesStatus = "posted"
)

func (LedgerTransactionVersionLedgerEntriesStatus) IsKnown added in v2.10.0

type LedgerTransactionVersionLedgerEntry

type LedgerTransactionVersionLedgerEntry struct {
	ID string `json:"id,required" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount    int64     `json:"amount,required"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction shared.TransactionDirection `json:"direction,required"`
	// The currency of the ledger account.
	LedgerAccountCurrency string `json:"ledger_account_currency,required"`
	// The currency exponent of the ledger account.
	LedgerAccountCurrencyExponent int64 `json:"ledger_account_currency_exponent,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID string `json:"ledger_account_id,required" format:"uuid"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LedgerAccountLockVersion int64 `json:"ledger_account_lock_version,required,nullable"`
	// The ledger transaction that this ledger entry is associated with.
	LedgerTransactionID string `json:"ledger_transaction_id,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The pending, posted, and available balances for this ledger entry's ledger
	// account. The posted balance is the sum of all posted entries on the account. The
	// pending balance is the sum of all pending and posted entries on the account. The
	// available balance is the posted incoming entries minus the sum of the pending
	// and posted outgoing amounts. Please see
	// https://docs.moderntreasury.com/docs/transaction-status-and-balances for more
	// details.
	ResultingLedgerAccountBalances LedgerTransactionVersionLedgerEntriesResultingLedgerAccountBalances `json:"resulting_ledger_account_balances,required,nullable"`
	// Equal to the state of the ledger transaction when the ledger entry was created.
	// One of `pending`, `posted`, or `archived`.
	Status LedgerTransactionVersionLedgerEntriesStatus `json:"status,required"`
	JSON   ledgerTransactionVersionLedgerEntryJSON     `json:"-"`
}

func (*LedgerTransactionVersionLedgerEntry) UnmarshalJSON

func (r *LedgerTransactionVersionLedgerEntry) UnmarshalJSON(data []byte) (err error)

type LedgerTransactionVersionLedgerableType

type LedgerTransactionVersionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, or reversal.

const (
	LedgerTransactionVersionLedgerableTypeExpectedPayment       LedgerTransactionVersionLedgerableType = "expected_payment"
	LedgerTransactionVersionLedgerableTypeIncomingPaymentDetail LedgerTransactionVersionLedgerableType = "incoming_payment_detail"
	LedgerTransactionVersionLedgerableTypePaperItem             LedgerTransactionVersionLedgerableType = "paper_item"
	LedgerTransactionVersionLedgerableTypePaymentOrder          LedgerTransactionVersionLedgerableType = "payment_order"
	LedgerTransactionVersionLedgerableTypeReturn                LedgerTransactionVersionLedgerableType = "return"
	LedgerTransactionVersionLedgerableTypeReversal              LedgerTransactionVersionLedgerableType = "reversal"
)

func (LedgerTransactionVersionLedgerableType) IsKnown added in v2.10.0

type LedgerTransactionVersionListParams

type LedgerTransactionVersionListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// created_at timestamp. For example, for all dates after Jan 1 2000 12:00 UTC, use
	// created_at%5Bgt%5D=2000-01-01T12:00:00Z.
	CreatedAt param.Field[map[string]time.Time] `query:"created_at" format:"date-time"`
	// Get all ledger transaction versions that are included in the ledger account
	// statement.
	LedgerAccountStatementID param.Field[string] `query:"ledger_account_statement_id"`
	// Get all the ledger transaction versions corresponding to the ID of a ledger
	// transaction.
	LedgerTransactionID param.Field[string] `query:"ledger_transaction_id"`
	PerPage             param.Field[int64]  `query:"per_page"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
	// version. For example, for all versions after 2, use version%5Bgt%5D=2.
	Version param.Field[map[string]int64] `query:"version"`
}

func (LedgerTransactionVersionListParams) URLQuery

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

type LedgerTransactionVersionService

type LedgerTransactionVersionService struct {
	Options []option.RequestOption
}

LedgerTransactionVersionService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerTransactionVersionService method instead.

func NewLedgerTransactionVersionService

func NewLedgerTransactionVersionService(opts ...option.RequestOption) (r *LedgerTransactionVersionService)

NewLedgerTransactionVersionService 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 (*LedgerTransactionVersionService) List

Get a list of ledger transaction versions.

func (*LedgerTransactionVersionService) ListAutoPaging

Get a list of ledger transaction versions.

type LedgerTransactionVersionStatus

type LedgerTransactionVersionStatus string

One of `pending`, `posted`, or `archived`.

const (
	LedgerTransactionVersionStatusArchived LedgerTransactionVersionStatus = "archived"
	LedgerTransactionVersionStatusPending  LedgerTransactionVersionStatus = "pending"
	LedgerTransactionVersionStatusPosted   LedgerTransactionVersionStatus = "posted"
)

func (LedgerTransactionVersionStatus) IsKnown added in v2.10.0

type LedgerUpdateParams

type LedgerUpdateParams struct {
	// An optional free-form description for internal use.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The name of the ledger.
	Name param.Field[string] `json:"name"`
}

func (LedgerUpdateParams) MarshalJSON

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

type LedgerableEvent

type LedgerableEvent struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Additionally data to be used by the Ledger Event Handler.
	CustomData interface{} `json:"custom_data,required,nullable"`
	// Description of the ledgerable event.
	Description string `json:"description,required,nullable"`
	// Id of the ledger event handler that is used to create a ledger transaction.
	LedgerEventHandlerID string `json:"ledger_event_handler_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required,nullable"`
	// Name of the ledgerable event.
	Name      string              `json:"name,required"`
	Object    string              `json:"object,required"`
	UpdatedAt time.Time           `json:"updated_at,required" format:"date-time"`
	JSON      ledgerableEventJSON `json:"-"`
}

func (*LedgerableEvent) UnmarshalJSON

func (r *LedgerableEvent) UnmarshalJSON(data []byte) (err error)

type LedgerableEventNewParams

type LedgerableEventNewParams struct {
	// Name of the ledgerable event.
	Name param.Field[string] `json:"name,required"`
	// Additionally data to be used by the Ledger Event Handler.
	CustomData param.Field[interface{}] `json:"custom_data"`
	// Description of the ledgerable event.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LedgerableEventNewParams) MarshalJSON

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

type LedgerableEventService

type LedgerableEventService struct {
	Options []option.RequestOption
}

LedgerableEventService contains methods and other services that help with interacting with the Modern Treasury 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 NewLedgerableEventService method instead.

func NewLedgerableEventService

func NewLedgerableEventService(opts ...option.RequestOption) (r *LedgerableEventService)

NewLedgerableEventService 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 (*LedgerableEventService) Get

Get details on a single ledgerable event.

func (*LedgerableEventService) New

Create a ledgerable event.

type LegalEntity added in v2.8.0

type LegalEntity struct {
	ID string `json:"id,required" format:"uuid"`
	// A list of addresses for the entity.
	Addresses []LegalEntityAddress `json:"addresses,required"`
	// The business's legal business name.
	BusinessName string    `json:"business_name,required,nullable"`
	CreatedAt    time.Time `json:"created_at,required" format:"date-time"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed time.Time `json:"date_formed,required,nullable" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          time.Time `json:"date_of_birth,required,nullable" format:"date"`
	DiscardedAt          time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	DoingBusinessAsNames []string  `json:"doing_business_as_names,required"`
	// The entity's primary email.
	Email string `json:"email,required,nullable"`
	// An individual's first name.
	FirstName string `json:"first_name,required,nullable"`
	// A list of identifications for the legal entity.
	Identifications []LegalEntityIdentification `json:"identifications,required"`
	// An individual's last name.
	LastName string `json:"last_name,required,nullable"`
	// The legal entity associations and its child legal entities.
	LegalEntityAssociations []LegalEntityAssociation `json:"legal_entity_associations,required,nullable"`
	// The type of legal entity.
	LegalEntityType LegalEntityLegalEntityType `json:"legal_entity_type,required"`
	// The business's legal structure.
	LegalStructure LegalEntityLegalStructure `json:"legal_structure,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     map[string]string        `json:"metadata,required"`
	Object       string                   `json:"object,required"`
	PhoneNumbers []LegalEntityPhoneNumber `json:"phone_numbers,required"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating LegalEntityRiskRating `json:"risk_rating,required,nullable"`
	UpdatedAt  time.Time             `json:"updated_at,required" format:"date-time"`
	// The entity's primary website URL.
	Website string          `json:"website,required,nullable"`
	JSON    legalEntityJSON `json:"-"`
}

func (*LegalEntity) UnmarshalJSON added in v2.8.0

func (r *LegalEntity) UnmarshalJSON(data []byte) (err error)

type LegalEntityAddress added in v2.8.0

type LegalEntityAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// The types of this address.
	AddressTypes []LegalEntityAddressesAddressType `json:"address_types,required"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country     string    `json:"country,required,nullable"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	Line1       string    `json:"line1,required,nullable"`
	Line2       string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                 `json:"region,required,nullable"`
	UpdatedAt time.Time              `json:"updated_at,required" format:"date-time"`
	JSON      legalEntityAddressJSON `json:"-"`
}

func (*LegalEntityAddress) UnmarshalJSON added in v2.8.0

func (r *LegalEntityAddress) UnmarshalJSON(data []byte) (err error)

type LegalEntityAddressesAddressType added in v2.9.0

type LegalEntityAddressesAddressType string
const (
	LegalEntityAddressesAddressTypeBusiness    LegalEntityAddressesAddressType = "business"
	LegalEntityAddressesAddressTypeMailing     LegalEntityAddressesAddressType = "mailing"
	LegalEntityAddressesAddressTypeOther       LegalEntityAddressesAddressType = "other"
	LegalEntityAddressesAddressTypePoBox       LegalEntityAddressesAddressType = "po_box"
	LegalEntityAddressesAddressTypeResidential LegalEntityAddressesAddressType = "residential"
)

func (LegalEntityAddressesAddressType) IsKnown added in v2.10.0

type LegalEntityAssociation added in v2.8.0

type LegalEntityAssociation struct {
	ID string `json:"id,required" format:"uuid"`
	// The child legal entity.
	ChildLegalEntity LegalEntityAssociationChildLegalEntity `json:"child_legal_entity,required"`
	CreatedAt        time.Time                              `json:"created_at,required" format:"date-time"`
	DiscardedAt      time.Time                              `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The child entity's ownership percentage iff they are a beneficial owner.
	OwnershipPercentage int64 `json:"ownership_percentage,required,nullable"`
	// The ID of the parent legal entity. This must be a business or joint legal
	// entity.
	ParentLegalEntityID string                                   `json:"parent_legal_entity_id,required"`
	RelationshipTypes   []LegalEntityAssociationRelationshipType `json:"relationship_types,required"`
	// The job title of the child entity at the parent entity.
	Title     string                     `json:"title,required,nullable"`
	UpdatedAt time.Time                  `json:"updated_at,required" format:"date-time"`
	JSON      legalEntityAssociationJSON `json:"-"`
}

func (*LegalEntityAssociation) UnmarshalJSON added in v2.8.0

func (r *LegalEntityAssociation) UnmarshalJSON(data []byte) (err error)

type LegalEntityAssociationChildLegalEntity added in v2.10.0

type LegalEntityAssociationChildLegalEntity struct {
	ID string `json:"id,required" format:"uuid"`
	// A list of addresses for the entity.
	Addresses []LegalEntityAssociationChildLegalEntityAddress `json:"addresses,required"`
	// The business's legal business name.
	BusinessName string    `json:"business_name,required,nullable"`
	CreatedAt    time.Time `json:"created_at,required" format:"date-time"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed time.Time `json:"date_formed,required,nullable" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          time.Time `json:"date_of_birth,required,nullable" format:"date"`
	DiscardedAt          time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	DoingBusinessAsNames []string  `json:"doing_business_as_names,required"`
	// The entity's primary email.
	Email string `json:"email,required,nullable"`
	// An individual's first name.
	FirstName string `json:"first_name,required,nullable"`
	// A list of identifications for the legal entity.
	Identifications []LegalEntityAssociationChildLegalEntityIdentification `json:"identifications,required"`
	// An individual's last name.
	LastName string `json:"last_name,required,nullable"`
	// The type of legal entity.
	LegalEntityType LegalEntityAssociationChildLegalEntityLegalEntityType `json:"legal_entity_type,required"`
	// The business's legal structure.
	LegalStructure LegalEntityAssociationChildLegalEntityLegalStructure `json:"legal_structure,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     map[string]string                                   `json:"metadata,required"`
	Object       string                                              `json:"object,required"`
	PhoneNumbers []LegalEntityAssociationChildLegalEntityPhoneNumber `json:"phone_numbers,required"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating LegalEntityAssociationChildLegalEntityRiskRating `json:"risk_rating,required,nullable"`
	UpdatedAt  time.Time                                        `json:"updated_at,required" format:"date-time"`
	// The entity's primary website URL.
	Website string                                     `json:"website,required,nullable"`
	JSON    legalEntityAssociationChildLegalEntityJSON `json:"-"`
}

The child legal entity.

func (*LegalEntityAssociationChildLegalEntity) UnmarshalJSON added in v2.10.0

func (r *LegalEntityAssociationChildLegalEntity) UnmarshalJSON(data []byte) (err error)

type LegalEntityAssociationChildLegalEntityAddress added in v2.10.0

type LegalEntityAssociationChildLegalEntityAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// The types of this address.
	AddressTypes []LegalEntityAssociationChildLegalEntityAddressesAddressType `json:"address_types,required"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country     string    `json:"country,required,nullable"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	Line1       string    `json:"line1,required,nullable"`
	Line2       string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                                            `json:"region,required,nullable"`
	UpdatedAt time.Time                                         `json:"updated_at,required" format:"date-time"`
	JSON      legalEntityAssociationChildLegalEntityAddressJSON `json:"-"`
}

func (*LegalEntityAssociationChildLegalEntityAddress) UnmarshalJSON added in v2.10.0

func (r *LegalEntityAssociationChildLegalEntityAddress) UnmarshalJSON(data []byte) (err error)

type LegalEntityAssociationChildLegalEntityAddressesAddressType added in v2.10.0

type LegalEntityAssociationChildLegalEntityAddressesAddressType string
const (
	LegalEntityAssociationChildLegalEntityAddressesAddressTypeBusiness    LegalEntityAssociationChildLegalEntityAddressesAddressType = "business"
	LegalEntityAssociationChildLegalEntityAddressesAddressTypeMailing     LegalEntityAssociationChildLegalEntityAddressesAddressType = "mailing"
	LegalEntityAssociationChildLegalEntityAddressesAddressTypeOther       LegalEntityAssociationChildLegalEntityAddressesAddressType = "other"
	LegalEntityAssociationChildLegalEntityAddressesAddressTypePoBox       LegalEntityAssociationChildLegalEntityAddressesAddressType = "po_box"
	LegalEntityAssociationChildLegalEntityAddressesAddressTypeResidential LegalEntityAssociationChildLegalEntityAddressesAddressType = "residential"
)

func (LegalEntityAssociationChildLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type LegalEntityAssociationChildLegalEntityIdentification added in v2.10.0

type LegalEntityAssociationChildLegalEntityIdentification struct {
	ID          string    `json:"id,required" format:"uuid"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The type of ID number.
	IDType LegalEntityAssociationChildLegalEntityIdentificationsIDType `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry string `json:"issuing_country,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                                                     `json:"live_mode,required"`
	Object    string                                                   `json:"object,required"`
	UpdatedAt time.Time                                                `json:"updated_at,required" format:"date-time"`
	JSON      legalEntityAssociationChildLegalEntityIdentificationJSON `json:"-"`
}

func (*LegalEntityAssociationChildLegalEntityIdentification) UnmarshalJSON added in v2.10.0

func (r *LegalEntityAssociationChildLegalEntityIdentification) UnmarshalJSON(data []byte) (err error)

type LegalEntityAssociationChildLegalEntityIdentificationsIDType added in v2.10.0

type LegalEntityAssociationChildLegalEntityIdentificationsIDType string

The type of ID number.

const (
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuil    LegalEntityAssociationChildLegalEntityIdentificationsIDType = "ar_cuil"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuit    LegalEntityAssociationChildLegalEntityIdentificationsIDType = "ar_cuit"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCnpj    LegalEntityAssociationChildLegalEntityIdentificationsIDType = "br_cnpj"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCpf     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "br_cpf"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeClRut     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "cl_rut"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityAssociationChildLegalEntityIdentificationsIDType = "co_cedulas"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoNit     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "co_nit"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnID      LegalEntityAssociationChildLegalEntityIdentificationsIDType = "hn_id"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnRtn     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "hn_rtn"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeInLei     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "in_lei"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrBrn     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_brn"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrCrn     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_crn"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrRrn     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_rrn"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypePassport  LegalEntityAssociationChildLegalEntityIdentificationsIDType = "passport"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaTin     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "sa_tin"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaVat     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "sa_vat"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsEin     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_ein"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsItin    LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_itin"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsSsn     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_ssn"
	LegalEntityAssociationChildLegalEntityIdentificationsIDTypeVnTin     LegalEntityAssociationChildLegalEntityIdentificationsIDType = "vn_tin"
)

func (LegalEntityAssociationChildLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type LegalEntityAssociationChildLegalEntityLegalEntityType added in v2.10.0

type LegalEntityAssociationChildLegalEntityLegalEntityType string

The type of legal entity.

const (
	LegalEntityAssociationChildLegalEntityLegalEntityTypeBusiness   LegalEntityAssociationChildLegalEntityLegalEntityType = "business"
	LegalEntityAssociationChildLegalEntityLegalEntityTypeIndividual LegalEntityAssociationChildLegalEntityLegalEntityType = "individual"
	LegalEntityAssociationChildLegalEntityLegalEntityTypeJoint      LegalEntityAssociationChildLegalEntityLegalEntityType = "joint"
)

func (LegalEntityAssociationChildLegalEntityLegalEntityType) IsKnown added in v2.10.0

type LegalEntityAssociationChildLegalEntityLegalStructure added in v2.10.0

type LegalEntityAssociationChildLegalEntityLegalStructure string

The business's legal structure.

const (
	LegalEntityAssociationChildLegalEntityLegalStructureCorporation        LegalEntityAssociationChildLegalEntityLegalStructure = "corporation"
	LegalEntityAssociationChildLegalEntityLegalStructureLlc                LegalEntityAssociationChildLegalEntityLegalStructure = "llc"
	LegalEntityAssociationChildLegalEntityLegalStructureNonProfit          LegalEntityAssociationChildLegalEntityLegalStructure = "non_profit"
	LegalEntityAssociationChildLegalEntityLegalStructurePartnership        LegalEntityAssociationChildLegalEntityLegalStructure = "partnership"
	LegalEntityAssociationChildLegalEntityLegalStructureSoleProprietorship LegalEntityAssociationChildLegalEntityLegalStructure = "sole_proprietorship"
	LegalEntityAssociationChildLegalEntityLegalStructureTrust              LegalEntityAssociationChildLegalEntityLegalStructure = "trust"
)

func (LegalEntityAssociationChildLegalEntityLegalStructure) IsKnown added in v2.10.0

type LegalEntityAssociationChildLegalEntityPhoneNumber added in v2.10.0

type LegalEntityAssociationChildLegalEntityPhoneNumber struct {
	PhoneNumber string                                                `json:"phone_number"`
	JSON        legalEntityAssociationChildLegalEntityPhoneNumberJSON `json:"-"`
}

A list of phone numbers in E.164 format.

func (*LegalEntityAssociationChildLegalEntityPhoneNumber) UnmarshalJSON added in v2.10.0

func (r *LegalEntityAssociationChildLegalEntityPhoneNumber) UnmarshalJSON(data []byte) (err error)

type LegalEntityAssociationChildLegalEntityRiskRating added in v2.14.0

type LegalEntityAssociationChildLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityAssociationChildLegalEntityRiskRatingLow    LegalEntityAssociationChildLegalEntityRiskRating = "low"
	LegalEntityAssociationChildLegalEntityRiskRatingMedium LegalEntityAssociationChildLegalEntityRiskRating = "medium"
	LegalEntityAssociationChildLegalEntityRiskRatingHigh   LegalEntityAssociationChildLegalEntityRiskRating = "high"
)

func (LegalEntityAssociationChildLegalEntityRiskRating) IsKnown added in v2.14.0

type LegalEntityAssociationNewParams added in v2.8.0

type LegalEntityAssociationNewParams struct {
	// The ID of the parent legal entity. This must be a business or joint legal
	// entity.
	ParentLegalEntityID param.Field[string]                                            `json:"parent_legal_entity_id,required"`
	RelationshipTypes   param.Field[[]LegalEntityAssociationNewParamsRelationshipType] `json:"relationship_types,required"`
	// The child legal entity.
	ChildLegalEntity param.Field[LegalEntityAssociationNewParamsChildLegalEntity] `json:"child_legal_entity"`
	// The ID of the child legal entity.
	ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
	// The child entity's ownership percentage iff they are a beneficial owner.
	OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
	// The job title of the child entity at the parent entity.
	Title param.Field[string] `json:"title"`
}

func (LegalEntityAssociationNewParams) MarshalJSON added in v2.8.0

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

type LegalEntityAssociationNewParamsChildLegalEntity added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntity struct {
	// A list of addresses for the entity.
	Addresses param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The type of legal entity.
	LegalEntityType param.Field[LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
	// The business's legal structure.
	LegalStructure param.Field[LegalEntityAssociationNewParamsChildLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                                            `json:"metadata"`
	PhoneNumbers param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[LegalEntityAssociationNewParamsChildLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

The child legal entity.

func (LegalEntityAssociationNewParamsChildLegalEntity) MarshalJSON added in v2.10.0

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

type LegalEntityAssociationNewParamsChildLegalEntityAddress added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                                `json:"line2"`
}

func (LegalEntityAssociationNewParamsChildLegalEntityAddress) MarshalJSON added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType string
const (
	LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeBusiness    LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "business"
	LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeMailing     LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "mailing"
	LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeOther       LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "other"
	LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypePoBox       LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "po_box"
	LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeResidential LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "residential"
)

func (LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityIdentification added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (LegalEntityAssociationNewParamsChildLegalEntityIdentification) MarshalJSON added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType string

The type of ID number.

const (
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuil    LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "ar_cuil"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuit    LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "ar_cuit"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCnpj    LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "br_cnpj"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCpf     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "br_cpf"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeClRut     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "cl_rut"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "co_cedulas"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoNit     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "co_nit"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnID      LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "hn_id"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnRtn     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "hn_rtn"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeInLei     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "in_lei"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrBrn     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_brn"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrCrn     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_crn"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrRrn     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_rrn"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypePassport  LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "passport"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaTin     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "sa_tin"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaVat     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "sa_vat"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsEin     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_ein"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsItin    LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_itin"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsSsn     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_ssn"
	LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeVnTin     LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "vn_tin"
)

func (LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType string

The type of legal entity.

const (
	LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeBusiness   LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType = "business"
	LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeIndividual LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType = "individual"
)

func (LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType) IsKnown added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityLegalStructure added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityLegalStructure string

The business's legal structure.

const (
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructureCorporation        LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "corporation"
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructureLlc                LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "llc"
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructureNonProfit          LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "non_profit"
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructurePartnership        LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "partnership"
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructureSoleProprietorship LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "sole_proprietorship"
	LegalEntityAssociationNewParamsChildLegalEntityLegalStructureTrust              LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "trust"
)

func (LegalEntityAssociationNewParamsChildLegalEntityLegalStructure) IsKnown added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber) MarshalJSON added in v2.10.0

type LegalEntityAssociationNewParamsChildLegalEntityRiskRating added in v2.14.0

type LegalEntityAssociationNewParamsChildLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityAssociationNewParamsChildLegalEntityRiskRatingLow    LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "low"
	LegalEntityAssociationNewParamsChildLegalEntityRiskRatingMedium LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "medium"
	LegalEntityAssociationNewParamsChildLegalEntityRiskRatingHigh   LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "high"
)

func (LegalEntityAssociationNewParamsChildLegalEntityRiskRating) IsKnown added in v2.14.0

type LegalEntityAssociationNewParamsRelationshipType added in v2.8.0

type LegalEntityAssociationNewParamsRelationshipType string

A list of relationship types for how the child entity relates to parent entity.

const (
	LegalEntityAssociationNewParamsRelationshipTypeBeneficialOwner LegalEntityAssociationNewParamsRelationshipType = "beneficial_owner"
	LegalEntityAssociationNewParamsRelationshipTypeControlPerson   LegalEntityAssociationNewParamsRelationshipType = "control_person"
)

func (LegalEntityAssociationNewParamsRelationshipType) IsKnown added in v2.10.0

type LegalEntityAssociationRelationshipType added in v2.8.0

type LegalEntityAssociationRelationshipType string

A list of relationship types for how the child entity relates to parent entity.

const (
	LegalEntityAssociationRelationshipTypeBeneficialOwner LegalEntityAssociationRelationshipType = "beneficial_owner"
	LegalEntityAssociationRelationshipTypeControlPerson   LegalEntityAssociationRelationshipType = "control_person"
)

func (LegalEntityAssociationRelationshipType) IsKnown added in v2.10.0

type LegalEntityAssociationService added in v2.8.0

type LegalEntityAssociationService struct {
	Options []option.RequestOption
}

LegalEntityAssociationService contains methods and other services that help with interacting with the Modern Treasury 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 NewLegalEntityAssociationService method instead.

func NewLegalEntityAssociationService added in v2.8.0

func NewLegalEntityAssociationService(opts ...option.RequestOption) (r *LegalEntityAssociationService)

NewLegalEntityAssociationService 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 (*LegalEntityAssociationService) New added in v2.8.0

create legal_entity_association

type LegalEntityIdentification added in v2.8.0

type LegalEntityIdentification struct {
	ID          string    `json:"id,required" format:"uuid"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The type of ID number.
	IDType LegalEntityIdentificationsIDType `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry string `json:"issuing_country,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode  bool                          `json:"live_mode,required"`
	Object    string                        `json:"object,required"`
	UpdatedAt time.Time                     `json:"updated_at,required" format:"date-time"`
	JSON      legalEntityIdentificationJSON `json:"-"`
}

func (*LegalEntityIdentification) UnmarshalJSON added in v2.8.0

func (r *LegalEntityIdentification) UnmarshalJSON(data []byte) (err error)

type LegalEntityIdentificationsIDType added in v2.8.0

type LegalEntityIdentificationsIDType string

The type of ID number.

const (
	LegalEntityIdentificationsIDTypeArCuil    LegalEntityIdentificationsIDType = "ar_cuil"
	LegalEntityIdentificationsIDTypeArCuit    LegalEntityIdentificationsIDType = "ar_cuit"
	LegalEntityIdentificationsIDTypeBrCnpj    LegalEntityIdentificationsIDType = "br_cnpj"
	LegalEntityIdentificationsIDTypeBrCpf     LegalEntityIdentificationsIDType = "br_cpf"
	LegalEntityIdentificationsIDTypeClRut     LegalEntityIdentificationsIDType = "cl_rut"
	LegalEntityIdentificationsIDTypeCoCedulas LegalEntityIdentificationsIDType = "co_cedulas"
	LegalEntityIdentificationsIDTypeCoNit     LegalEntityIdentificationsIDType = "co_nit"
	LegalEntityIdentificationsIDTypeHnID      LegalEntityIdentificationsIDType = "hn_id"
	LegalEntityIdentificationsIDTypeHnRtn     LegalEntityIdentificationsIDType = "hn_rtn"
	LegalEntityIdentificationsIDTypeInLei     LegalEntityIdentificationsIDType = "in_lei"
	LegalEntityIdentificationsIDTypeKrBrn     LegalEntityIdentificationsIDType = "kr_brn"
	LegalEntityIdentificationsIDTypeKrCrn     LegalEntityIdentificationsIDType = "kr_crn"
	LegalEntityIdentificationsIDTypeKrRrn     LegalEntityIdentificationsIDType = "kr_rrn"
	LegalEntityIdentificationsIDTypePassport  LegalEntityIdentificationsIDType = "passport"
	LegalEntityIdentificationsIDTypeSaTin     LegalEntityIdentificationsIDType = "sa_tin"
	LegalEntityIdentificationsIDTypeSaVat     LegalEntityIdentificationsIDType = "sa_vat"
	LegalEntityIdentificationsIDTypeUsEin     LegalEntityIdentificationsIDType = "us_ein"
	LegalEntityIdentificationsIDTypeUsItin    LegalEntityIdentificationsIDType = "us_itin"
	LegalEntityIdentificationsIDTypeUsSsn     LegalEntityIdentificationsIDType = "us_ssn"
	LegalEntityIdentificationsIDTypeVnTin     LegalEntityIdentificationsIDType = "vn_tin"
)

func (LegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type LegalEntityLegalEntityType added in v2.8.0

type LegalEntityLegalEntityType string

The type of legal entity.

const (
	LegalEntityLegalEntityTypeBusiness   LegalEntityLegalEntityType = "business"
	LegalEntityLegalEntityTypeIndividual LegalEntityLegalEntityType = "individual"
	LegalEntityLegalEntityTypeJoint      LegalEntityLegalEntityType = "joint"
)

func (LegalEntityLegalEntityType) IsKnown added in v2.10.0

func (r LegalEntityLegalEntityType) IsKnown() bool

type LegalEntityLegalStructure added in v2.9.0

type LegalEntityLegalStructure string

The business's legal structure.

const (
	LegalEntityLegalStructureCorporation        LegalEntityLegalStructure = "corporation"
	LegalEntityLegalStructureLlc                LegalEntityLegalStructure = "llc"
	LegalEntityLegalStructureNonProfit          LegalEntityLegalStructure = "non_profit"
	LegalEntityLegalStructurePartnership        LegalEntityLegalStructure = "partnership"
	LegalEntityLegalStructureSoleProprietorship LegalEntityLegalStructure = "sole_proprietorship"
	LegalEntityLegalStructureTrust              LegalEntityLegalStructure = "trust"
)

func (LegalEntityLegalStructure) IsKnown added in v2.10.0

func (r LegalEntityLegalStructure) IsKnown() bool

type LegalEntityListParams added in v2.8.0

type LegalEntityListParams struct {
	AfterCursor     param.Field[string]                               `query:"after_cursor"`
	LegalEntityType param.Field[LegalEntityListParamsLegalEntityType] `query:"legal_entity_type"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata    param.Field[map[string]string] `query:"metadata"`
	PerPage     param.Field[int64]             `query:"per_page"`
	ShowDeleted param.Field[string]            `query:"show_deleted"`
}

func (LegalEntityListParams) URLQuery added in v2.8.0

func (r LegalEntityListParams) URLQuery() (v url.Values)

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

type LegalEntityListParamsLegalEntityType added in v2.8.0

type LegalEntityListParamsLegalEntityType string
const (
	LegalEntityListParamsLegalEntityTypeBusiness   LegalEntityListParamsLegalEntityType = "business"
	LegalEntityListParamsLegalEntityTypeIndividual LegalEntityListParamsLegalEntityType = "individual"
)

func (LegalEntityListParamsLegalEntityType) IsKnown added in v2.10.0

type LegalEntityNewParams added in v2.8.0

type LegalEntityNewParams struct {
	// The type of legal entity.
	LegalEntityType param.Field[LegalEntityNewParamsLegalEntityType] `json:"legal_entity_type,required"`
	// A list of addresses for the entity.
	Addresses param.Field[[]LegalEntityNewParamsAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]LegalEntityNewParamsIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The legal entity associations and its child legal entities.
	LegalEntityAssociations param.Field[[]LegalEntityNewParamsLegalEntityAssociation] `json:"legal_entity_associations"`
	// The business's legal structure.
	LegalStructure param.Field[LegalEntityNewParamsLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                 `json:"metadata"`
	PhoneNumbers param.Field[[]LegalEntityNewParamsPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[LegalEntityNewParamsRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

func (LegalEntityNewParams) MarshalJSON added in v2.8.0

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

type LegalEntityNewParamsAddress added in v2.8.0

type LegalEntityNewParamsAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]LegalEntityNewParamsAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                     `json:"line2"`
}

func (LegalEntityNewParamsAddress) MarshalJSON added in v2.8.0

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

type LegalEntityNewParamsAddressesAddressType added in v2.9.0

type LegalEntityNewParamsAddressesAddressType string
const (
	LegalEntityNewParamsAddressesAddressTypeBusiness    LegalEntityNewParamsAddressesAddressType = "business"
	LegalEntityNewParamsAddressesAddressTypeMailing     LegalEntityNewParamsAddressesAddressType = "mailing"
	LegalEntityNewParamsAddressesAddressTypeOther       LegalEntityNewParamsAddressesAddressType = "other"
	LegalEntityNewParamsAddressesAddressTypePoBox       LegalEntityNewParamsAddressesAddressType = "po_box"
	LegalEntityNewParamsAddressesAddressTypeResidential LegalEntityNewParamsAddressesAddressType = "residential"
)

func (LegalEntityNewParamsAddressesAddressType) IsKnown added in v2.10.0

type LegalEntityNewParamsIdentification added in v2.8.0

type LegalEntityNewParamsIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[LegalEntityNewParamsIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (LegalEntityNewParamsIdentification) MarshalJSON added in v2.8.0

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

type LegalEntityNewParamsIdentificationsIDType added in v2.8.0

type LegalEntityNewParamsIdentificationsIDType string

The type of ID number.

const (
	LegalEntityNewParamsIdentificationsIDTypeArCuil    LegalEntityNewParamsIdentificationsIDType = "ar_cuil"
	LegalEntityNewParamsIdentificationsIDTypeArCuit    LegalEntityNewParamsIdentificationsIDType = "ar_cuit"
	LegalEntityNewParamsIdentificationsIDTypeBrCnpj    LegalEntityNewParamsIdentificationsIDType = "br_cnpj"
	LegalEntityNewParamsIdentificationsIDTypeBrCpf     LegalEntityNewParamsIdentificationsIDType = "br_cpf"
	LegalEntityNewParamsIdentificationsIDTypeClRut     LegalEntityNewParamsIdentificationsIDType = "cl_rut"
	LegalEntityNewParamsIdentificationsIDTypeCoCedulas LegalEntityNewParamsIdentificationsIDType = "co_cedulas"
	LegalEntityNewParamsIdentificationsIDTypeCoNit     LegalEntityNewParamsIdentificationsIDType = "co_nit"
	LegalEntityNewParamsIdentificationsIDTypeHnID      LegalEntityNewParamsIdentificationsIDType = "hn_id"
	LegalEntityNewParamsIdentificationsIDTypeHnRtn     LegalEntityNewParamsIdentificationsIDType = "hn_rtn"
	LegalEntityNewParamsIdentificationsIDTypeInLei     LegalEntityNewParamsIdentificationsIDType = "in_lei"
	LegalEntityNewParamsIdentificationsIDTypeKrBrn     LegalEntityNewParamsIdentificationsIDType = "kr_brn"
	LegalEntityNewParamsIdentificationsIDTypeKrCrn     LegalEntityNewParamsIdentificationsIDType = "kr_crn"
	LegalEntityNewParamsIdentificationsIDTypeKrRrn     LegalEntityNewParamsIdentificationsIDType = "kr_rrn"
	LegalEntityNewParamsIdentificationsIDTypePassport  LegalEntityNewParamsIdentificationsIDType = "passport"
	LegalEntityNewParamsIdentificationsIDTypeSaTin     LegalEntityNewParamsIdentificationsIDType = "sa_tin"
	LegalEntityNewParamsIdentificationsIDTypeSaVat     LegalEntityNewParamsIdentificationsIDType = "sa_vat"
	LegalEntityNewParamsIdentificationsIDTypeUsEin     LegalEntityNewParamsIdentificationsIDType = "us_ein"
	LegalEntityNewParamsIdentificationsIDTypeUsItin    LegalEntityNewParamsIdentificationsIDType = "us_itin"
	LegalEntityNewParamsIdentificationsIDTypeUsSsn     LegalEntityNewParamsIdentificationsIDType = "us_ssn"
	LegalEntityNewParamsIdentificationsIDTypeVnTin     LegalEntityNewParamsIdentificationsIDType = "vn_tin"
)

func (LegalEntityNewParamsIdentificationsIDType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociation added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociation struct {
	RelationshipTypes param.Field[[]LegalEntityNewParamsLegalEntityAssociationsRelationshipType] `json:"relationship_types,required"`
	// The child legal entity.
	ChildLegalEntity param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity] `json:"child_legal_entity"`
	// The ID of the child legal entity.
	ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
	// The child entity's ownership percentage iff they are a beneficial owner.
	OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
	// The job title of the child entity at the parent entity.
	Title param.Field[string] `json:"title"`
}

func (LegalEntityNewParamsLegalEntityAssociation) MarshalJSON added in v2.10.0

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

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity struct {
	// A list of addresses for the entity.
	Addresses param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress] `json:"addresses"`
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// A list of identifications for the legal entity.
	Identifications param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification] `json:"identifications"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The type of legal entity.
	LegalEntityType param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
	// The business's legal structure.
	LegalStructure param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                                                        `json:"metadata"`
	PhoneNumbers param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

The child legal entity.

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity) MarshalJSON added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country,required"`
	Line1   param.Field[string] `json:"line1,required"`
	// Locality or City.
	Locality param.Field[string] `json:"locality,required"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code,required"`
	// Region or State.
	Region param.Field[string] `json:"region,required"`
	// The types of this address.
	AddressTypes param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType] `json:"address_types"`
	Line2        param.Field[string]                                                                            `json:"line2"`
}

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress) MarshalJSON added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType string
const (
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeBusiness    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "business"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeMailing     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "mailing"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeOther       LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "other"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypePoBox       LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "po_box"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeResidential LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "residential"
)

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification struct {
	// The ID number of identification document.
	IDNumber param.Field[string] `json:"id_number,required"`
	// The type of ID number.
	IDType param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType] `json:"id_type,required"`
	// The ISO 3166-1 alpha-2 country code of the country that issued the
	// identification
	IssuingCountry param.Field[string] `json:"issuing_country"`
}

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification) MarshalJSON added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType string

The type of ID number.

const (
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuil    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuil"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuit    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuit"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCnpj    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cnpj"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCpf     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cpf"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRut     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "cl_rut"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_cedulas"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoNit     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_nit"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnID      LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_id"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnRtn     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_rtn"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeInLei     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "in_lei"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrBrn     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_brn"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrCrn     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_crn"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrRrn     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_rrn"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypePassport  LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "passport"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaTin     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_tin"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaVat     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_vat"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsEin     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ein"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsItin    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_itin"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsSsn     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ssn"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeVnTin     LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "vn_tin"
)

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType string

The type of legal entity.

const (
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeBusiness   LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType = "business"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeIndividual LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType = "individual"
)

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure string

The business's legal structure.

const (
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureCorporation        LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "corporation"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureLlc                LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "llc"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureNonProfit          LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "non_profit"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructurePartnership        LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "partnership"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureSoleProprietorship LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "sole_proprietorship"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureTrust              LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "trust"
)

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber) MarshalJSON added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating added in v2.14.0

type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingLow    LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "low"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingMedium LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "medium"
	LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingHigh   LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "high"
)

func (LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating) IsKnown added in v2.14.0

type LegalEntityNewParamsLegalEntityAssociationsRelationshipType added in v2.10.0

type LegalEntityNewParamsLegalEntityAssociationsRelationshipType string

A list of relationship types for how the child entity relates to parent entity.

const (
	LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeBeneficialOwner LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "beneficial_owner"
	LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeControlPerson   LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "control_person"
)

func (LegalEntityNewParamsLegalEntityAssociationsRelationshipType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalEntityType added in v2.8.0

type LegalEntityNewParamsLegalEntityType string

The type of legal entity.

const (
	LegalEntityNewParamsLegalEntityTypeBusiness   LegalEntityNewParamsLegalEntityType = "business"
	LegalEntityNewParamsLegalEntityTypeIndividual LegalEntityNewParamsLegalEntityType = "individual"
)

func (LegalEntityNewParamsLegalEntityType) IsKnown added in v2.10.0

type LegalEntityNewParamsLegalStructure added in v2.9.0

type LegalEntityNewParamsLegalStructure string

The business's legal structure.

const (
	LegalEntityNewParamsLegalStructureCorporation        LegalEntityNewParamsLegalStructure = "corporation"
	LegalEntityNewParamsLegalStructureLlc                LegalEntityNewParamsLegalStructure = "llc"
	LegalEntityNewParamsLegalStructureNonProfit          LegalEntityNewParamsLegalStructure = "non_profit"
	LegalEntityNewParamsLegalStructurePartnership        LegalEntityNewParamsLegalStructure = "partnership"
	LegalEntityNewParamsLegalStructureSoleProprietorship LegalEntityNewParamsLegalStructure = "sole_proprietorship"
	LegalEntityNewParamsLegalStructureTrust              LegalEntityNewParamsLegalStructure = "trust"
)

func (LegalEntityNewParamsLegalStructure) IsKnown added in v2.10.0

type LegalEntityNewParamsPhoneNumber added in v2.8.0

type LegalEntityNewParamsPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (LegalEntityNewParamsPhoneNumber) MarshalJSON added in v2.8.0

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

type LegalEntityNewParamsRiskRating added in v2.14.0

type LegalEntityNewParamsRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityNewParamsRiskRatingLow    LegalEntityNewParamsRiskRating = "low"
	LegalEntityNewParamsRiskRatingMedium LegalEntityNewParamsRiskRating = "medium"
	LegalEntityNewParamsRiskRatingHigh   LegalEntityNewParamsRiskRating = "high"
)

func (LegalEntityNewParamsRiskRating) IsKnown added in v2.14.0

type LegalEntityPhoneNumber added in v2.8.0

type LegalEntityPhoneNumber struct {
	PhoneNumber string                     `json:"phone_number"`
	JSON        legalEntityPhoneNumberJSON `json:"-"`
}

A list of phone numbers in E.164 format.

func (*LegalEntityPhoneNumber) UnmarshalJSON added in v2.8.0

func (r *LegalEntityPhoneNumber) UnmarshalJSON(data []byte) (err error)

type LegalEntityRiskRating added in v2.14.0

type LegalEntityRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityRiskRatingLow    LegalEntityRiskRating = "low"
	LegalEntityRiskRatingMedium LegalEntityRiskRating = "medium"
	LegalEntityRiskRatingHigh   LegalEntityRiskRating = "high"
)

func (LegalEntityRiskRating) IsKnown added in v2.14.0

func (r LegalEntityRiskRating) IsKnown() bool

type LegalEntityService added in v2.8.0

type LegalEntityService struct {
	Options []option.RequestOption
}

LegalEntityService contains methods and other services that help with interacting with the Modern Treasury 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 NewLegalEntityService method instead.

func NewLegalEntityService added in v2.8.0

func NewLegalEntityService(opts ...option.RequestOption) (r *LegalEntityService)

NewLegalEntityService 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 (*LegalEntityService) Get added in v2.8.0

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

Get details on a single legal entity.

func (*LegalEntityService) List added in v2.8.0

Get a list of all legal entities.

func (*LegalEntityService) ListAutoPaging added in v2.8.0

Get a list of all legal entities.

func (*LegalEntityService) New added in v2.8.0

create legal_entity

func (*LegalEntityService) Update added in v2.8.0

Update a legal entity.

type LegalEntityUpdateParams added in v2.8.0

type LegalEntityUpdateParams struct {
	// The business's legal business name.
	BusinessName param.Field[string] `json:"business_name"`
	// A business's formation date (YYYY-MM-DD).
	DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
	// An individual's date of birth (YYYY-MM-DD).
	DateOfBirth          param.Field[time.Time] `json:"date_of_birth" format:"date"`
	DoingBusinessAsNames param.Field[[]string]  `json:"doing_business_as_names"`
	// The entity's primary email.
	Email param.Field[string] `json:"email"`
	// An individual's first name.
	FirstName param.Field[string] `json:"first_name"`
	// An individual's last name.
	LastName param.Field[string] `json:"last_name"`
	// The business's legal structure.
	LegalStructure param.Field[LegalEntityUpdateParamsLegalStructure] `json:"legal_structure"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata     param.Field[map[string]string]                    `json:"metadata"`
	PhoneNumbers param.Field[[]LegalEntityUpdateParamsPhoneNumber] `json:"phone_numbers"`
	// Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating
	RiskRating param.Field[LegalEntityUpdateParamsRiskRating] `json:"risk_rating"`
	// The entity's primary website URL.
	Website param.Field[string] `json:"website"`
}

func (LegalEntityUpdateParams) MarshalJSON added in v2.8.0

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

type LegalEntityUpdateParamsLegalStructure added in v2.9.0

type LegalEntityUpdateParamsLegalStructure string

The business's legal structure.

const (
	LegalEntityUpdateParamsLegalStructureCorporation        LegalEntityUpdateParamsLegalStructure = "corporation"
	LegalEntityUpdateParamsLegalStructureLlc                LegalEntityUpdateParamsLegalStructure = "llc"
	LegalEntityUpdateParamsLegalStructureNonProfit          LegalEntityUpdateParamsLegalStructure = "non_profit"
	LegalEntityUpdateParamsLegalStructurePartnership        LegalEntityUpdateParamsLegalStructure = "partnership"
	LegalEntityUpdateParamsLegalStructureSoleProprietorship LegalEntityUpdateParamsLegalStructure = "sole_proprietorship"
	LegalEntityUpdateParamsLegalStructureTrust              LegalEntityUpdateParamsLegalStructure = "trust"
)

func (LegalEntityUpdateParamsLegalStructure) IsKnown added in v2.10.0

type LegalEntityUpdateParamsPhoneNumber added in v2.8.0

type LegalEntityUpdateParamsPhoneNumber struct {
	PhoneNumber param.Field[string] `json:"phone_number"`
}

A list of phone numbers in E.164 format.

func (LegalEntityUpdateParamsPhoneNumber) MarshalJSON added in v2.8.0

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

type LegalEntityUpdateParamsRiskRating added in v2.14.0

type LegalEntityUpdateParamsRiskRating string

Translation missing: en.openapi.descriptions.legal_entity.schema.risk_rating

const (
	LegalEntityUpdateParamsRiskRatingLow    LegalEntityUpdateParamsRiskRating = "low"
	LegalEntityUpdateParamsRiskRatingMedium LegalEntityUpdateParamsRiskRating = "medium"
	LegalEntityUpdateParamsRiskRatingHigh   LegalEntityUpdateParamsRiskRating = "high"
)

func (LegalEntityUpdateParamsRiskRating) IsKnown added in v2.14.0

type LineItem

type LineItem struct {
	ID         string             `json:"id,required" format:"uuid"`
	Accounting LineItemAccounting `json:"accounting,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID string `json:"accounting_category_id,required,nullable" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	AccountingLedgerClassID string `json:"accounting_ledger_class_id,required,nullable" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount    int64     `json:"amount,required"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// A free-form description of the line item.
	Description string `json:"description,required,nullable"`
	// The ID of the payment order or expected payment.
	ItemizableID string `json:"itemizable_id,required" format:"uuid"`
	// One of `payment_orders` or `expected_payments`.
	ItemizableType LineItemItemizableType `json:"itemizable_type,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata  map[string]string `json:"metadata,required"`
	Object    string            `json:"object,required"`
	UpdatedAt time.Time         `json:"updated_at,required" format:"date-time"`
	JSON      lineItemJSON      `json:"-"`
}

func (*LineItem) UnmarshalJSON

func (r *LineItem) UnmarshalJSON(data []byte) (err error)

type LineItemAccounting

type LineItemAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID string `json:"account_id,nullable" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID string                 `json:"class_id,nullable" format:"uuid"`
	JSON    lineItemAccountingJSON `json:"-"`
}

func (*LineItemAccounting) UnmarshalJSON

func (r *LineItemAccounting) UnmarshalJSON(data []byte) (err error)

type LineItemGetParamsItemizableType

type LineItemGetParamsItemizableType string
const (
	LineItemGetParamsItemizableTypeExpectedPayments LineItemGetParamsItemizableType = "expected_payments"
	LineItemGetParamsItemizableTypePaymentOrders    LineItemGetParamsItemizableType = "payment_orders"
)

func (LineItemGetParamsItemizableType) IsKnown added in v2.10.0

type LineItemItemizableType

type LineItemItemizableType string

One of `payment_orders` or `expected_payments`.

const (
	LineItemItemizableTypeExpectedPayment LineItemItemizableType = "ExpectedPayment"
	LineItemItemizableTypePaymentOrder    LineItemItemizableType = "PaymentOrder"
)

func (LineItemItemizableType) IsKnown added in v2.10.0

func (r LineItemItemizableType) IsKnown() bool

type LineItemListParams

type LineItemListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (LineItemListParams) URLQuery

func (r LineItemListParams) URLQuery() (v url.Values)

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

type LineItemListParamsItemizableType

type LineItemListParamsItemizableType string
const (
	LineItemListParamsItemizableTypeExpectedPayments LineItemListParamsItemizableType = "expected_payments"
	LineItemListParamsItemizableTypePaymentOrders    LineItemListParamsItemizableType = "payment_orders"
)

func (LineItemListParamsItemizableType) IsKnown added in v2.10.0

type LineItemService

type LineItemService struct {
	Options []option.RequestOption
}

LineItemService contains methods and other services that help with interacting with the Modern Treasury 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 NewLineItemService method instead.

func NewLineItemService

func NewLineItemService(opts ...option.RequestOption) (r *LineItemService)

NewLineItemService 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 (*LineItemService) Get

func (r *LineItemService) Get(ctx context.Context, itemizableType LineItemGetParamsItemizableType, itemizableID string, id string, opts ...option.RequestOption) (res *LineItem, err error)

Get a single line item

func (*LineItemService) List

func (r *LineItemService) List(ctx context.Context, itemizableType LineItemListParamsItemizableType, itemizableID string, query LineItemListParams, opts ...option.RequestOption) (res *pagination.Page[LineItem], err error)

Get a list of line items

func (*LineItemService) ListAutoPaging

func (r *LineItemService) ListAutoPaging(ctx context.Context, itemizableType LineItemListParamsItemizableType, itemizableID string, query LineItemListParams, opts ...option.RequestOption) *pagination.PageAutoPager[LineItem]

Get a list of line items

func (*LineItemService) Update

func (r *LineItemService) Update(ctx context.Context, itemizableType LineItemUpdateParamsItemizableType, itemizableID string, id string, body LineItemUpdateParams, opts ...option.RequestOption) (res *LineItem, err error)

update line item

type LineItemUpdateParams

type LineItemUpdateParams struct {
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (LineItemUpdateParams) MarshalJSON

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

type LineItemUpdateParamsItemizableType

type LineItemUpdateParamsItemizableType string
const (
	LineItemUpdateParamsItemizableTypeExpectedPayments LineItemUpdateParamsItemizableType = "expected_payments"
	LineItemUpdateParamsItemizableTypePaymentOrders    LineItemUpdateParamsItemizableType = "payment_orders"
)

func (LineItemUpdateParamsItemizableType) IsKnown added in v2.10.0

type PaperItem

type PaperItem struct {
	ID string `json:"id,required" format:"uuid"`
	// The account number on the paper item.
	AccountNumber string `json:"account_number,required,nullable"`
	// The last 4 digits of the account_number.
	AccountNumberSafe string `json:"account_number_safe,required,nullable"`
	// The amount of the paper item.
	Amount int64 `json:"amount,required"`
	// The check number on the paper item.
	CheckNumber string    `json:"check_number,required,nullable"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	// The currency of the paper item.
	Currency shared.Currency `json:"currency,required"`
	// The date the paper item was deposited into your organization's bank account.
	DepositDate time.Time `json:"deposit_date,required" format:"date"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// The identifier for the lockbox assigned by the bank.
	LockboxNumber string `json:"lockbox_number,required"`
	// The memo field on the paper item.
	MemoField string `json:"memo_field,required,nullable"`
	Object    string `json:"object,required"`
	// The name of the remitter on the paper item.
	RemitterName string `json:"remitter_name,required,nullable"`
	// The routing number on the paper item.
	RoutingNumber string `json:"routing_number,required,nullable"`
	// The current status of the paper item. One of `pending`, `completed`, or
	// `returned`.
	Status PaperItemStatus `json:"status,required"`
	// The ID of the reconciled Transaction or `null`.
	TransactionID string `json:"transaction_id,required,nullable" format:"uuid"`
	// The ID of the reconciled Transaction Line Item or `null`.
	TransactionLineItemID string        `json:"transaction_line_item_id,required,nullable" format:"uuid"`
	UpdatedAt             time.Time     `json:"updated_at,required" format:"date-time"`
	JSON                  paperItemJSON `json:"-"`
}

func (*PaperItem) UnmarshalJSON

func (r *PaperItem) UnmarshalJSON(data []byte) (err error)

type PaperItemListParams

type PaperItemListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Specify an inclusive end date (YYYY-MM-DD) when filtering by deposit_date
	DepositDateEnd param.Field[time.Time] `query:"deposit_date_end" format:"date"`
	// Specify an inclusive start date (YYYY-MM-DD) when filtering by deposit_date
	DepositDateStart param.Field[time.Time] `query:"deposit_date_start" format:"date"`
	// Specify `lockbox_number` if you wish to see paper items that are associated with
	// a specific lockbox number.
	LockboxNumber param.Field[string] `query:"lockbox_number"`
	PerPage       param.Field[int64]  `query:"per_page"`
}

func (PaperItemListParams) URLQuery

func (r PaperItemListParams) URLQuery() (v url.Values)

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

type PaperItemService

type PaperItemService struct {
	Options []option.RequestOption
}

PaperItemService contains methods and other services that help with interacting with the Modern Treasury 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 NewPaperItemService method instead.

func NewPaperItemService

func NewPaperItemService(opts ...option.RequestOption) (r *PaperItemService)

NewPaperItemService 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 (*PaperItemService) Get

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

Get details on a single paper item.

func (*PaperItemService) List

Get a list of all paper items.

func (*PaperItemService) ListAutoPaging

Get a list of all paper items.

type PaperItemStatus

type PaperItemStatus string

The current status of the paper item. One of `pending`, `completed`, or `returned`.

const (
	PaperItemStatusCompleted PaperItemStatus = "completed"
	PaperItemStatusPending   PaperItemStatus = "pending"
	PaperItemStatusReturned  PaperItemStatus = "returned"
)

func (PaperItemStatus) IsKnown added in v2.10.0

func (r PaperItemStatus) IsKnown() bool

type PaymentFlow

type PaymentFlow struct {
	ID string `json:"id" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount int64 `json:"amount"`
	// The client token of the payment flow. This token can be used to embed a payment
	// workflow in your client-side application.
	ClientToken string `json:"client_token"`
	// The ID of a counterparty associated with the payment. As part of the payment
	// workflow an external account will be associated with this counterparty.
	CounterpartyID string    `json:"counterparty_id,nullable" format:"uuid"`
	CreatedAt      time.Time `json:"created_at" format:"date-time"`
	// The currency of the payment.
	Currency string `json:"currency"`
	// Describes the direction money is flowing in the transaction. Can only be
	// `debit`. A `debit` pulls money from someone else's account to your own.
	Direction PaymentFlowDirection `json:"direction"`
	// The due date for the flow. Can only be passed in when
	// `effective_date_selection_enabled` is `true`.
	DueDate time.Time `json:"due_date,nullable" format:"date"`
	// When `true`, your end-user can schedule the payment `effective_date` while
	// completing the pre-built UI.
	EffectiveDateSelectionEnabled bool `json:"effective_date_selection_enabled"`
	// When `verified` and `external_account_collection` is `enabled`, filters the list
	// of external accounts your end-user can select to those with a
	// `verification_status` of `verified`.
	ExistingExternalAccountsFilter PaymentFlowExistingExternalAccountsFilter `json:"existing_external_accounts_filter,nullable"`
	// When `enabled`, your end-user can select from an existing external account when
	// completing the flow. When `disabled`, your end-user must add new payment details
	// when completing the flow.
	ExternalAccountCollection PaymentFlowExternalAccountCollection `json:"external_account_collection"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode"`
	Object   string `json:"object"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID string `json:"originating_account_id,nullable" format:"uuid"`
	// If present, the ID of the payment order created using this flow.
	PaymentOrderID string `json:"payment_order_id,nullable" format:"uuid"`
	// If present, the ID of the external account created using this flow.
	ReceivingAccountID string `json:"receiving_account_id,nullable" format:"uuid"`
	// This field is set after your end-user selects a payment date while completing
	// the pre-built UI. This field is always `null` unless
	// `effective_date_selection_enabled` is `true`.
	SelectedEffectiveDate time.Time `json:"selected_effective_date,nullable" format:"date"`
	// The current status of the payment flow. One of `pending`, `completed`,
	// `expired`, or `cancelled`.
	Status    PaymentFlowStatus `json:"status"`
	UpdatedAt time.Time         `json:"updated_at" format:"date-time"`
	JSON      paymentFlowJSON   `json:"-"`
}

func (*PaymentFlow) UnmarshalJSON

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

type PaymentFlowDirection

type PaymentFlowDirection string

Describes the direction money is flowing in the transaction. Can only be `debit`. A `debit` pulls money from someone else's account to your own.

const (
	PaymentFlowDirectionCredit PaymentFlowDirection = "credit"
	PaymentFlowDirectionDebit  PaymentFlowDirection = "debit"
)

func (PaymentFlowDirection) IsKnown added in v2.10.0

func (r PaymentFlowDirection) IsKnown() bool

type PaymentFlowExistingExternalAccountsFilter added in v2.3.0

type PaymentFlowExistingExternalAccountsFilter string

When `verified` and `external_account_collection` is `enabled`, filters the list of external accounts your end-user can select to those with a `verification_status` of `verified`.

const (
	PaymentFlowExistingExternalAccountsFilterVerified PaymentFlowExistingExternalAccountsFilter = "verified"
)

func (PaymentFlowExistingExternalAccountsFilter) IsKnown added in v2.10.0

type PaymentFlowExternalAccountCollection added in v2.3.0

type PaymentFlowExternalAccountCollection string

When `enabled`, your end-user can select from an existing external account when completing the flow. When `disabled`, your end-user must add new payment details when completing the flow.

const (
	PaymentFlowExternalAccountCollectionDisabled PaymentFlowExternalAccountCollection = "disabled"
	PaymentFlowExternalAccountCollectionEnabled  PaymentFlowExternalAccountCollection = "enabled"
)

func (PaymentFlowExternalAccountCollection) IsKnown added in v2.10.0

type PaymentFlowListParams

type PaymentFlowListParams struct {
	AfterCursor          param.Field[string] `query:"after_cursor"`
	ClientToken          param.Field[string] `query:"client_token"`
	CounterpartyID       param.Field[string] `query:"counterparty_id"`
	OriginatingAccountID param.Field[string] `query:"originating_account_id"`
	PaymentOrderID       param.Field[string] `query:"payment_order_id"`
	PerPage              param.Field[int64]  `query:"per_page"`
	ReceivingAccountID   param.Field[string] `query:"receiving_account_id"`
	Status               param.Field[string] `query:"status"`
}

func (PaymentFlowListParams) URLQuery

func (r PaymentFlowListParams) URLQuery() (v url.Values)

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

type PaymentFlowNewParams

type PaymentFlowNewParams struct {
	// Required. Value in specified currency's smallest unit. e.g. $10 would be
	// represented as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// Required. The ID of a counterparty associated with the payment. As part of the
	// payment workflow an external account will be associated with this model.
	CounterpartyID param.Field[string] `json:"counterparty_id,required" format:"uuid"`
	// Required. The currency of the payment.
	Currency param.Field[string] `json:"currency,required"`
	// Required. Describes the direction money is flowing in the transaction. Can only
	// be `debit`. A `debit` pulls money from someone else's account to your own.
	Direction param.Field[PaymentFlowNewParamsDirection] `json:"direction,required"`
	// Required. The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required" format:"uuid"`
	// Optional. Can only be passed in when `effective_date_selection_enabled` is
	// `true`. When set, the due date is shown to your end-user in the pre-built UI as
	// they are selecting a payment `effective_date`.
	DueDate param.Field[time.Time] `json:"due_date" format:"date"`
}

func (PaymentFlowNewParams) MarshalJSON

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

type PaymentFlowNewParamsDirection

type PaymentFlowNewParamsDirection string

Required. Describes the direction money is flowing in the transaction. Can only be `debit`. A `debit` pulls money from someone else's account to your own.

const (
	PaymentFlowNewParamsDirectionCredit PaymentFlowNewParamsDirection = "credit"
	PaymentFlowNewParamsDirectionDebit  PaymentFlowNewParamsDirection = "debit"
)

func (PaymentFlowNewParamsDirection) IsKnown added in v2.10.0

func (r PaymentFlowNewParamsDirection) IsKnown() bool

type PaymentFlowService

type PaymentFlowService struct {
	Options []option.RequestOption
}

PaymentFlowService contains methods and other services that help with interacting with the Modern Treasury 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 NewPaymentFlowService method instead.

func NewPaymentFlowService

func NewPaymentFlowService(opts ...option.RequestOption) (r *PaymentFlowService)

NewPaymentFlowService 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 (*PaymentFlowService) Get

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

get payment_flow

func (*PaymentFlowService) List

list payment_flows

func (*PaymentFlowService) ListAutoPaging

list payment_flows

func (*PaymentFlowService) New

create payment_flow

func (*PaymentFlowService) Update

update payment_flow

type PaymentFlowStatus

type PaymentFlowStatus string

The current status of the payment flow. One of `pending`, `completed`, `expired`, or `cancelled`.

const (
	PaymentFlowStatusCancelled PaymentFlowStatus = "cancelled"
	PaymentFlowStatusCompleted PaymentFlowStatus = "completed"
	PaymentFlowStatusExpired   PaymentFlowStatus = "expired"
	PaymentFlowStatusPending   PaymentFlowStatus = "pending"
)

func (PaymentFlowStatus) IsKnown added in v2.10.0

func (r PaymentFlowStatus) IsKnown() bool

type PaymentFlowUpdateParams

type PaymentFlowUpdateParams struct {
	// Required. The updated status of the payment flow. Can only be used to mark a
	// flow as `cancelled`.
	Status param.Field[PaymentFlowUpdateParamsStatus] `json:"status,required"`
}

func (PaymentFlowUpdateParams) MarshalJSON

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

type PaymentFlowUpdateParamsStatus

type PaymentFlowUpdateParamsStatus string

Required. The updated status of the payment flow. Can only be used to mark a flow as `cancelled`.

const (
	PaymentFlowUpdateParamsStatusCancelled PaymentFlowUpdateParamsStatus = "cancelled"
)

func (PaymentFlowUpdateParamsStatus) IsKnown added in v2.10.0

func (r PaymentFlowUpdateParamsStatus) IsKnown() bool

type PaymentOrder

type PaymentOrder struct {
	ID         string                 `json:"id,required" format:"uuid"`
	Accounting PaymentOrderAccounting `json:"accounting,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID string `json:"accounting_category_id,required,nullable" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID string `json:"accounting_ledger_class_id,required,nullable" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount int64 `json:"amount,required"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer PaymentOrderChargeBearer `json:"charge_bearer,required,nullable"`
	// Custom key-value pair for usage in compliance rules. Please contact support
	// before making changes to this field.
	ComplianceRuleMetadata map[string]interface{} `json:"compliance_rule_metadata,required,nullable"`
	// If the payment order is tied to a specific Counterparty, their id will appear,
	// otherwise `null`.
	CounterpartyID string    `json:"counterparty_id,required,nullable" format:"uuid"`
	CreatedAt      time.Time `json:"created_at,required" format:"date-time"`
	// Defaults to the currency of the originating account.
	Currency shared.Currency `json:"currency,required"`
	// If the payment order's status is `returned`, this will include the return
	// object's data.
	CurrentReturn ReturnObject `json:"current_return,required,nullable"`
	// The ID of the compliance decision for the payment order, if transaction
	// monitoring is enabled.
	DecisionID string `json:"decision_id,required,nullable" format:"uuid"`
	// An optional description for internal use.
	Description string `json:"description,required,nullable"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction PaymentOrderDirection `json:"direction,required"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate time.Time `json:"effective_date,required" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt time.Time `json:"expires_at,required,nullable" format:"date-time"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract string `json:"foreign_exchange_contract,required,nullable"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator PaymentOrderForeignExchangeIndicator `json:"foreign_exchange_indicator,required,nullable"`
	// Associated serialized foreign exchange rate information.
	ForeignExchangeRate PaymentOrderForeignExchangeRate `json:"foreign_exchange_rate,required,nullable"`
	// The ID of the ledger transaction linked to the payment order.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected bool   `json:"nsf_protected,required"`
	Object       string `json:"object,required"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID string `json:"originating_account_id,required" format:"uuid"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName string `json:"originating_party_name,required,nullable"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority PaymentOrderPriority `json:"priority,required"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter time.Time `json:"process_after,required,nullable" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose string `json:"purpose,required,nullable"`
	// The receiving account ID. Can be an `external_account` or `internal_account`.
	ReceivingAccountID   string                           `json:"receiving_account_id,required" format:"uuid"`
	ReceivingAccountType PaymentOrderReceivingAccountType `json:"receiving_account_type,required"`
	ReferenceNumbers     []PaymentOrderReferenceNumber    `json:"reference_numbers,required"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation string `json:"remittance_information,required,nullable"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice bool `json:"send_remittance_advice,required,nullable"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor string `json:"statement_descriptor,required,nullable"`
	// The current status of the payment order.
	Status PaymentOrderStatus `json:"status,required"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype PaymentOrderSubtype `json:"subtype,required,nullable"`
	// The IDs of all the transactions associated to this payment order. Usually, you
	// will only have a single transaction ID. However, if a payment order initially
	// results in a Return, but gets redrafted and is later successfully completed, it
	// can have many transactions.
	TransactionIDs []string `json:"transaction_ids,required" format:"uuid"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled bool `json:"transaction_monitoring_enabled,required"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type PaymentOrderType `json:"type,required"`
	// The account to which the originating of this payment should be attributed to.
	// Can be a `virtual_account` or `internal_account`.
	UltimateOriginatingAccount PaymentOrderUltimateOriginatingAccount `json:"ultimate_originating_account,required,nullable"`
	// The ultimate originating account ID. Can be a `virtual_account` or
	// `internal_account`.
	UltimateOriginatingAccountID   string                                     `json:"ultimate_originating_account_id,required,nullable" format:"uuid"`
	UltimateOriginatingAccountType PaymentOrderUltimateOriginatingAccountType `json:"ultimate_originating_account_type,required,nullable"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier string `json:"ultimate_originating_party_identifier,required,nullable"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName     string    `json:"ultimate_originating_party_name,required,nullable"`
	UltimateReceivingPartyIdentifier string    `json:"ultimate_receiving_party_identifier,required,nullable"`
	UltimateReceivingPartyName       string    `json:"ultimate_receiving_party_name,required,nullable"`
	UpdatedAt                        time.Time `json:"updated_at,required" format:"date-time"`
	// Additional vendor specific fields for this payment. Data must be represented as
	// key-value pairs.
	VendorAttributes interface{} `json:"vendor_attributes,required,nullable"`
	// This field will be populated if a vendor failure occurs. Logic shouldn't be
	// built on its value as it is free-form.
	VendorFailureReason string           `json:"vendor_failure_reason,required,nullable"`
	JSON                paymentOrderJSON `json:"-"`
}

func (*PaymentOrder) UnmarshalJSON

func (r *PaymentOrder) UnmarshalJSON(data []byte) (err error)

type PaymentOrderAccounting

type PaymentOrderAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID string `json:"account_id,nullable" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID string                     `json:"class_id,nullable" format:"uuid"`
	JSON    paymentOrderAccountingJSON `json:"-"`
}

func (*PaymentOrderAccounting) UnmarshalJSON

func (r *PaymentOrderAccounting) UnmarshalJSON(data []byte) (err error)

type PaymentOrderChargeBearer

type PaymentOrderChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	PaymentOrderChargeBearerShared   PaymentOrderChargeBearer = "shared"
	PaymentOrderChargeBearerSender   PaymentOrderChargeBearer = "sender"
	PaymentOrderChargeBearerReceiver PaymentOrderChargeBearer = "receiver"
)

func (PaymentOrderChargeBearer) IsKnown added in v2.10.0

func (r PaymentOrderChargeBearer) IsKnown() bool

type PaymentOrderDirection

type PaymentOrderDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	PaymentOrderDirectionCredit PaymentOrderDirection = "credit"
	PaymentOrderDirectionDebit  PaymentOrderDirection = "debit"
)

func (PaymentOrderDirection) IsKnown added in v2.10.0

func (r PaymentOrderDirection) IsKnown() bool

type PaymentOrderForeignExchangeIndicator

type PaymentOrderForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	PaymentOrderForeignExchangeIndicatorFixedToVariable PaymentOrderForeignExchangeIndicator = "fixed_to_variable"
	PaymentOrderForeignExchangeIndicatorVariableToFixed PaymentOrderForeignExchangeIndicator = "variable_to_fixed"
)

func (PaymentOrderForeignExchangeIndicator) IsKnown added in v2.10.0

type PaymentOrderForeignExchangeRate added in v2.8.0

type PaymentOrderForeignExchangeRate struct {
	// Amount in the lowest denomination of the `base_currency` to convert, often
	// called the "sell" amount.
	BaseAmount int64 `json:"base_amount,required"`
	// Currency to convert, often called the "sell" currency.
	BaseCurrency shared.Currency `json:"base_currency,required"`
	// The exponent component of the rate. The decimal is calculated as `value` / (10 ^
	// `exponent`).
	Exponent int64 `json:"exponent,required"`
	// A string representation of the rate.
	RateString string `json:"rate_string,required"`
	// Amount in the lowest denomination of the `target_currency`, often called the
	// "buy" amount.
	TargetAmount int64 `json:"target_amount,required"`
	// Currency to convert the `base_currency` to, often called the "buy" currency.
	TargetCurrency shared.Currency `json:"target_currency,required"`
	// The whole number component of the rate. The decimal is calculated as `value` /
	// (10 ^ `exponent`).
	Value int64                               `json:"value,required"`
	JSON  paymentOrderForeignExchangeRateJSON `json:"-"`
}

Associated serialized foreign exchange rate information.

func (*PaymentOrderForeignExchangeRate) UnmarshalJSON added in v2.8.0

func (r *PaymentOrderForeignExchangeRate) UnmarshalJSON(data []byte) (err error)

type PaymentOrderListParams

type PaymentOrderListParams struct {
	AfterCursor    param.Field[string] `query:"after_cursor"`
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// An inclusive upper bound for searching created_at
	CreatedAtEnd param.Field[time.Time] `query:"created_at_end" format:"date"`
	// An inclusive lower bound for searching created_at
	CreatedAtStart param.Field[time.Time]                   `query:"created_at_start" format:"date"`
	Direction      param.Field[shared.TransactionDirection] `query:"direction"`
	// An inclusive upper bound for searching effective_date
	EffectiveDateEnd param.Field[time.Time] `query:"effective_date_end" format:"date"`
	// An inclusive lower bound for searching effective_date
	EffectiveDateStart param.Field[time.Time] `query:"effective_date_start" format:"date"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata             param.Field[map[string]string] `query:"metadata"`
	OriginatingAccountID param.Field[string]            `query:"originating_account_id"`
	PerPage              param.Field[int64]             `query:"per_page"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[PaymentOrderListParamsPriority] `query:"priority"`
	// An inclusive upper bound for searching process_after
	ProcessAfterEnd param.Field[time.Time] `query:"process_after_end" format:"date-time"`
	// An inclusive lower bound for searching process_after
	ProcessAfterStart param.Field[time.Time] `query:"process_after_start" format:"date-time"`
	// Query for records with the provided reference number
	ReferenceNumber param.Field[string]                       `query:"reference_number"`
	Status          param.Field[PaymentOrderListParamsStatus] `query:"status"`
	// The ID of a transaction that the payment order has been reconciled to.
	TransactionID param.Field[string]                     `query:"transaction_id"`
	Type          param.Field[PaymentOrderListParamsType] `query:"type"`
}

func (PaymentOrderListParams) URLQuery

func (r PaymentOrderListParams) URLQuery() (v url.Values)

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

type PaymentOrderListParamsPriority

type PaymentOrderListParamsPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	PaymentOrderListParamsPriorityHigh   PaymentOrderListParamsPriority = "high"
	PaymentOrderListParamsPriorityNormal PaymentOrderListParamsPriority = "normal"
)

func (PaymentOrderListParamsPriority) IsKnown added in v2.10.0

type PaymentOrderListParamsStatus

type PaymentOrderListParamsStatus string
const (
	PaymentOrderListParamsStatusApproved      PaymentOrderListParamsStatus = "approved"
	PaymentOrderListParamsStatusCancelled     PaymentOrderListParamsStatus = "cancelled"
	PaymentOrderListParamsStatusCompleted     PaymentOrderListParamsStatus = "completed"
	PaymentOrderListParamsStatusDenied        PaymentOrderListParamsStatus = "denied"
	PaymentOrderListParamsStatusFailed        PaymentOrderListParamsStatus = "failed"
	PaymentOrderListParamsStatusNeedsApproval PaymentOrderListParamsStatus = "needs_approval"
	PaymentOrderListParamsStatusPending       PaymentOrderListParamsStatus = "pending"
	PaymentOrderListParamsStatusProcessing    PaymentOrderListParamsStatus = "processing"
	PaymentOrderListParamsStatusReturned      PaymentOrderListParamsStatus = "returned"
	PaymentOrderListParamsStatusReversed      PaymentOrderListParamsStatus = "reversed"
	PaymentOrderListParamsStatusSent          PaymentOrderListParamsStatus = "sent"
)

func (PaymentOrderListParamsStatus) IsKnown added in v2.10.0

func (r PaymentOrderListParamsStatus) IsKnown() bool

type PaymentOrderListParamsType

type PaymentOrderListParamsType string
const (
	PaymentOrderListParamsTypeACH         PaymentOrderListParamsType = "ach"
	PaymentOrderListParamsTypeAuBecs      PaymentOrderListParamsType = "au_becs"
	PaymentOrderListParamsTypeBacs        PaymentOrderListParamsType = "bacs"
	PaymentOrderListParamsTypeBook        PaymentOrderListParamsType = "book"
	PaymentOrderListParamsTypeCard        PaymentOrderListParamsType = "card"
	PaymentOrderListParamsTypeChats       PaymentOrderListParamsType = "chats"
	PaymentOrderListParamsTypeCheck       PaymentOrderListParamsType = "check"
	PaymentOrderListParamsTypeCrossBorder PaymentOrderListParamsType = "cross_border"
	PaymentOrderListParamsTypeDkNets      PaymentOrderListParamsType = "dk_nets"
	PaymentOrderListParamsTypeEft         PaymentOrderListParamsType = "eft"
	PaymentOrderListParamsTypeHuIcs       PaymentOrderListParamsType = "hu_ics"
	PaymentOrderListParamsTypeInterac     PaymentOrderListParamsType = "interac"
	PaymentOrderListParamsTypeMasav       PaymentOrderListParamsType = "masav"
	PaymentOrderListParamsTypeMxCcen      PaymentOrderListParamsType = "mx_ccen"
	PaymentOrderListParamsTypeNeft        PaymentOrderListParamsType = "neft"
	PaymentOrderListParamsTypeNics        PaymentOrderListParamsType = "nics"
	PaymentOrderListParamsTypeNzBecs      PaymentOrderListParamsType = "nz_becs"
	PaymentOrderListParamsTypePlElixir    PaymentOrderListParamsType = "pl_elixir"
	PaymentOrderListParamsTypeProvxchange PaymentOrderListParamsType = "provxchange"
	PaymentOrderListParamsTypeRoSent      PaymentOrderListParamsType = "ro_sent"
	PaymentOrderListParamsTypeRtp         PaymentOrderListParamsType = "rtp"
	PaymentOrderListParamsTypeSeBankgirot PaymentOrderListParamsType = "se_bankgirot"
	PaymentOrderListParamsTypeSen         PaymentOrderListParamsType = "sen"
	PaymentOrderListParamsTypeSepa        PaymentOrderListParamsType = "sepa"
	PaymentOrderListParamsTypeSgGiro      PaymentOrderListParamsType = "sg_giro"
	PaymentOrderListParamsTypeSic         PaymentOrderListParamsType = "sic"
	PaymentOrderListParamsTypeSignet      PaymentOrderListParamsType = "signet"
	PaymentOrderListParamsTypeSknbi       PaymentOrderListParamsType = "sknbi"
	PaymentOrderListParamsTypeWire        PaymentOrderListParamsType = "wire"
	PaymentOrderListParamsTypeZengin      PaymentOrderListParamsType = "zengin"
)

func (PaymentOrderListParamsType) IsKnown added in v2.10.0

func (r PaymentOrderListParamsType) IsKnown() bool

type PaymentOrderNewAsyncParams

type PaymentOrderNewAsyncParams struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[PaymentOrderNewAsyncParamsDirection] `json:"direction,required"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required" format:"uuid"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type       param.Field[PaymentOrderType]                     `json:"type,required"`
	Accounting param.Field[PaymentOrderNewAsyncParamsAccounting] `json:"accounting"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[PaymentOrderNewAsyncParamsChargeBearer] `json:"charge_bearer"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType param.Field[PaymentOrderNewAsyncParamsFallbackType] `json:"fallback_type"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[PaymentOrderNewAsyncParamsForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// Specifies a ledger transaction object that will be created with the payment
	// order. If the ledger transaction cannot be created, then the payment order
	// creation will fail. The resulting ledger transaction will mirror the status of
	// the payment order.
	LedgerTransaction param.Field[PaymentOrderNewAsyncParamsLedgerTransaction] `json:"ledger_transaction"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon payment order creation. Once the
	// payment order is created, the status of the ledger transaction tracks the
	// payment order automatically.
	LedgerTransactionID param.Field[string] `json:"ledger_transaction_id" format:"uuid"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]PaymentOrderNewAsyncParamsLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[PaymentOrderNewAsyncParamsPriority] `json:"priority"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose param.Field[string] `json:"purpose"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccount param.Field[PaymentOrderNewAsyncParamsReceivingAccount] `json:"receiving_account"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled param.Field[bool] `json:"transaction_monitoring_enabled"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// Identifier of the ultimate funds recipient.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// Name of the ultimate funds recipient.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
}

func (PaymentOrderNewAsyncParams) MarshalJSON

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

type PaymentOrderNewAsyncParamsAccounting

type PaymentOrderNewAsyncParamsAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID param.Field[string] `json:"account_id" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID param.Field[string] `json:"class_id" format:"uuid"`
}

func (PaymentOrderNewAsyncParamsAccounting) MarshalJSON

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

type PaymentOrderNewAsyncParamsChargeBearer

type PaymentOrderNewAsyncParamsChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	PaymentOrderNewAsyncParamsChargeBearerShared   PaymentOrderNewAsyncParamsChargeBearer = "shared"
	PaymentOrderNewAsyncParamsChargeBearerSender   PaymentOrderNewAsyncParamsChargeBearer = "sender"
	PaymentOrderNewAsyncParamsChargeBearerReceiver PaymentOrderNewAsyncParamsChargeBearer = "receiver"
)

func (PaymentOrderNewAsyncParamsChargeBearer) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsDirection

type PaymentOrderNewAsyncParamsDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	PaymentOrderNewAsyncParamsDirectionCredit PaymentOrderNewAsyncParamsDirection = "credit"
	PaymentOrderNewAsyncParamsDirectionDebit  PaymentOrderNewAsyncParamsDirection = "debit"
)

func (PaymentOrderNewAsyncParamsDirection) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsFallbackType

type PaymentOrderNewAsyncParamsFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	PaymentOrderNewAsyncParamsFallbackTypeACH PaymentOrderNewAsyncParamsFallbackType = "ach"
)

func (PaymentOrderNewAsyncParamsFallbackType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsForeignExchangeIndicator

type PaymentOrderNewAsyncParamsForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	PaymentOrderNewAsyncParamsForeignExchangeIndicatorFixedToVariable PaymentOrderNewAsyncParamsForeignExchangeIndicator = "fixed_to_variable"
	PaymentOrderNewAsyncParamsForeignExchangeIndicatorVariableToFixed PaymentOrderNewAsyncParamsForeignExchangeIndicator = "variable_to_fixed"
)

func (PaymentOrderNewAsyncParamsForeignExchangeIndicator) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsLedgerTransaction

type PaymentOrderNewAsyncParamsLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]PaymentOrderNewAsyncParamsLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[PaymentOrderNewAsyncParamsLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the payment order. If the ledger transaction cannot be created, then the payment order creation will fail. The resulting ledger transaction will mirror the status of the payment order.

func (PaymentOrderNewAsyncParamsLedgerTransaction) MarshalJSON

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

type PaymentOrderNewAsyncParamsLedgerTransactionLedgerEntry

type PaymentOrderNewAsyncParamsLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (PaymentOrderNewAsyncParamsLedgerTransactionLedgerEntry) MarshalJSON

type PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType

type PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "reversal"
)

func (PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsLedgerTransactionStatus

type PaymentOrderNewAsyncParamsLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	PaymentOrderNewAsyncParamsLedgerTransactionStatusArchived PaymentOrderNewAsyncParamsLedgerTransactionStatus = "archived"
	PaymentOrderNewAsyncParamsLedgerTransactionStatusPending  PaymentOrderNewAsyncParamsLedgerTransactionStatus = "pending"
	PaymentOrderNewAsyncParamsLedgerTransactionStatusPosted   PaymentOrderNewAsyncParamsLedgerTransactionStatus = "posted"
)

func (PaymentOrderNewAsyncParamsLedgerTransactionStatus) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsLineItem

type PaymentOrderNewAsyncParamsLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PaymentOrderNewAsyncParamsLineItem) MarshalJSON

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

type PaymentOrderNewAsyncParamsPriority

type PaymentOrderNewAsyncParamsPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	PaymentOrderNewAsyncParamsPriorityHigh   PaymentOrderNewAsyncParamsPriority = "high"
	PaymentOrderNewAsyncParamsPriorityNormal PaymentOrderNewAsyncParamsPriority = "normal"
)

func (PaymentOrderNewAsyncParamsPriority) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccount

type PaymentOrderNewAsyncParamsReceivingAccount struct {
	AccountDetails param.Field[[]PaymentOrderNewAsyncParamsReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                       `json:"account_type"`
	ContactDetails param.Field[[]PaymentOrderNewAsyncParamsReceivingAccountContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[PaymentOrderNewAsyncParamsReceivingAccountLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[PaymentOrderNewAsyncParamsReceivingAccountPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                                 `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[PaymentOrderNewAsyncParamsReceivingAccountPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                                    `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]PaymentOrderNewAsyncParamsReceivingAccountRoutingDetail] `json:"routing_details"`
}

Either `receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.

func (PaymentOrderNewAsyncParamsReceivingAccount) MarshalJSON

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

type PaymentOrderNewAsyncParamsReceivingAccountAccountDetail

type PaymentOrderNewAsyncParamsReceivingAccountAccountDetail struct {
	AccountNumber     param.Field[string]                                                                    `json:"account_number,required"`
	AccountNumberType param.Field[PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (PaymentOrderNewAsyncParamsReceivingAccountAccountDetail) MarshalJSON

type PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType

type PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType string
const (
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeAuNumber      PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "au_number"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeHkNumber      PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "hk_number"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeIDNumber      PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "id_number"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeNzNumber      PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "nz_number"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "other"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeSgNumber      PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "sg_number"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
)

func (PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccountContactDetail

type PaymentOrderNewAsyncParamsReceivingAccountContactDetail struct {
	ContactIdentifier     param.Field[string]                                                                        `json:"contact_identifier"`
	ContactIdentifierType param.Field[PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (PaymentOrderNewAsyncParamsReceivingAccountContactDetail) MarshalJSON

type PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType

type PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType string
const (
	PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierTypeEmail       PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType = "email"
	PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierTypePhoneNumber PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierTypeWebsite     PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType = "website"
)

func (PaymentOrderNewAsyncParamsReceivingAccountContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccountLedgerAccount

type PaymentOrderNewAsyncParamsReceivingAccountLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (PaymentOrderNewAsyncParamsReceivingAccountLedgerAccount) MarshalJSON

type PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType

type PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeCounterparty    PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "counterparty"
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeVirtualAccount  PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "virtual_account"
)

func (PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccountPartyAddress

type PaymentOrderNewAsyncParamsReceivingAccountPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (PaymentOrderNewAsyncParamsReceivingAccountPartyAddress) MarshalJSON

type PaymentOrderNewAsyncParamsReceivingAccountPartyType

type PaymentOrderNewAsyncParamsReceivingAccountPartyType string

Either `individual` or `business`.

const (
	PaymentOrderNewAsyncParamsReceivingAccountPartyTypeBusiness   PaymentOrderNewAsyncParamsReceivingAccountPartyType = "business"
	PaymentOrderNewAsyncParamsReceivingAccountPartyTypeIndividual PaymentOrderNewAsyncParamsReceivingAccountPartyType = "individual"
)

func (PaymentOrderNewAsyncParamsReceivingAccountPartyType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetail

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                    `json:"routing_number,required"`
	RoutingNumberType param.Field[PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (PaymentOrderNewAsyncParamsReceivingAccountRoutingDetail) MarshalJSON

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType string
const (
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeACH         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "ach"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeAuBecs      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "au_becs"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeBacs        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "bacs"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeBook        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "book"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeCard        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "card"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeChats       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "chats"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeCheck       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "check"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeCrossBorder PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "cross_border"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeDkNets      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeEft         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "eft"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeHuIcs       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "hu_ics"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeMxCcen      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "mx_ccen"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypePlElixir    PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "pl_elixir"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeRoSent      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "ro_sent"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSknbi       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sknbi"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

func (PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType) IsKnown added in v2.10.0

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeChips                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeHuInterbankClearingCode PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeIDSknbiCode             PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "id_sknbi_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeMxBankIdentifier        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypePlNationalClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeZaNationalClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type PaymentOrderNewParams

type PaymentOrderNewParams struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[PaymentOrderNewParamsDirection] `json:"direction,required"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id,required" format:"uuid"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type       param.Field[PaymentOrderType]                `json:"type,required"`
	Accounting param.Field[PaymentOrderNewParamsAccounting] `json:"accounting"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[PaymentOrderNewParamsChargeBearer] `json:"charge_bearer"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// An array of documents to be attached to the payment order. Note that if you
	// attach documents, the request's content type must be `multipart/form-data`.
	Documents param.Field[[]PaymentOrderNewParamsDocument] `json:"documents"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType param.Field[PaymentOrderNewParamsFallbackType] `json:"fallback_type"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[PaymentOrderNewParamsForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// Specifies a ledger transaction object that will be created with the payment
	// order. If the ledger transaction cannot be created, then the payment order
	// creation will fail. The resulting ledger transaction will mirror the status of
	// the payment order.
	LedgerTransaction param.Field[PaymentOrderNewParamsLedgerTransaction] `json:"ledger_transaction"`
	// Either ledger_transaction or ledger_transaction_id can be provided. Only a
	// pending ledger transaction can be attached upon payment order creation. Once the
	// payment order is created, the status of the ledger transaction tracks the
	// payment order automatically.
	LedgerTransactionID param.Field[string] `json:"ledger_transaction_id" format:"uuid"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]PaymentOrderNewParamsLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[PaymentOrderNewParamsPriority] `json:"priority"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose param.Field[string] `json:"purpose"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccount param.Field[PaymentOrderNewParamsReceivingAccount] `json:"receiving_account"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// A flag that determines whether a payment order should go through transaction
	// monitoring.
	TransactionMonitoringEnabled param.Field[bool] `json:"transaction_monitoring_enabled"`
	// Identifier of the ultimate originator of the payment order.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// Name of the ultimate originator of the payment order.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// Identifier of the ultimate funds recipient.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// Name of the ultimate funds recipient.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
}

func (PaymentOrderNewParams) MarshalMultipart

func (r PaymentOrderNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type PaymentOrderNewParamsAccounting

type PaymentOrderNewParamsAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID param.Field[string] `json:"account_id" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID param.Field[string] `json:"class_id" format:"uuid"`
}

func (PaymentOrderNewParamsAccounting) MarshalJSON

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

type PaymentOrderNewParamsChargeBearer

type PaymentOrderNewParamsChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	PaymentOrderNewParamsChargeBearerShared   PaymentOrderNewParamsChargeBearer = "shared"
	PaymentOrderNewParamsChargeBearerSender   PaymentOrderNewParamsChargeBearer = "sender"
	PaymentOrderNewParamsChargeBearerReceiver PaymentOrderNewParamsChargeBearer = "receiver"
)

func (PaymentOrderNewParamsChargeBearer) IsKnown added in v2.10.0

type PaymentOrderNewParamsDirection

type PaymentOrderNewParamsDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	PaymentOrderNewParamsDirectionCredit PaymentOrderNewParamsDirection = "credit"
	PaymentOrderNewParamsDirectionDebit  PaymentOrderNewParamsDirection = "debit"
)

func (PaymentOrderNewParamsDirection) IsKnown added in v2.10.0

type PaymentOrderNewParamsDocument

type PaymentOrderNewParamsDocument struct {
	// The unique identifier for the associated object.
	DocumentableID   param.Field[string]                                         `json:"documentable_id,required"`
	DocumentableType param.Field[PaymentOrderNewParamsDocumentsDocumentableType] `json:"documentable_type,required"`
	File             param.Field[io.Reader]                                      `json:"file,required" format:"binary"`
	// A category given to the document, can be `null`.
	DocumentType param.Field[string] `json:"document_type"`
}

func (PaymentOrderNewParamsDocument) MarshalJSON

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

type PaymentOrderNewParamsDocumentsDocumentableType

type PaymentOrderNewParamsDocumentsDocumentableType string
const (
	PaymentOrderNewParamsDocumentsDocumentableTypeCases                  PaymentOrderNewParamsDocumentsDocumentableType = "cases"
	PaymentOrderNewParamsDocumentsDocumentableTypeCounterparties         PaymentOrderNewParamsDocumentsDocumentableType = "counterparties"
	PaymentOrderNewParamsDocumentsDocumentableTypeExpectedPayments       PaymentOrderNewParamsDocumentsDocumentableType = "expected_payments"
	PaymentOrderNewParamsDocumentsDocumentableTypeExternalAccounts       PaymentOrderNewParamsDocumentsDocumentableType = "external_accounts"
	PaymentOrderNewParamsDocumentsDocumentableTypeIncomingPaymentDetails PaymentOrderNewParamsDocumentsDocumentableType = "incoming_payment_details"
	PaymentOrderNewParamsDocumentsDocumentableTypeInternalAccounts       PaymentOrderNewParamsDocumentsDocumentableType = "internal_accounts"
	PaymentOrderNewParamsDocumentsDocumentableTypeOrganizations          PaymentOrderNewParamsDocumentsDocumentableType = "organizations"
	PaymentOrderNewParamsDocumentsDocumentableTypePaperItems             PaymentOrderNewParamsDocumentsDocumentableType = "paper_items"
	PaymentOrderNewParamsDocumentsDocumentableTypePaymentOrders          PaymentOrderNewParamsDocumentsDocumentableType = "payment_orders"
	PaymentOrderNewParamsDocumentsDocumentableTypeTransactions           PaymentOrderNewParamsDocumentsDocumentableType = "transactions"
	PaymentOrderNewParamsDocumentsDocumentableTypeDecisions              PaymentOrderNewParamsDocumentsDocumentableType = "decisions"
	PaymentOrderNewParamsDocumentsDocumentableTypeConnections            PaymentOrderNewParamsDocumentsDocumentableType = "connections"
)

func (PaymentOrderNewParamsDocumentsDocumentableType) IsKnown added in v2.10.0

type PaymentOrderNewParamsFallbackType

type PaymentOrderNewParamsFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	PaymentOrderNewParamsFallbackTypeACH PaymentOrderNewParamsFallbackType = "ach"
)

func (PaymentOrderNewParamsFallbackType) IsKnown added in v2.10.0

type PaymentOrderNewParamsForeignExchangeIndicator

type PaymentOrderNewParamsForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	PaymentOrderNewParamsForeignExchangeIndicatorFixedToVariable PaymentOrderNewParamsForeignExchangeIndicator = "fixed_to_variable"
	PaymentOrderNewParamsForeignExchangeIndicatorVariableToFixed PaymentOrderNewParamsForeignExchangeIndicator = "variable_to_fixed"
)

func (PaymentOrderNewParamsForeignExchangeIndicator) IsKnown added in v2.10.0

type PaymentOrderNewParamsLedgerTransaction

type PaymentOrderNewParamsLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]PaymentOrderNewParamsLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[PaymentOrderNewParamsLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[PaymentOrderNewParamsLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the payment order. If the ledger transaction cannot be created, then the payment order creation will fail. The resulting ledger transaction will mirror the status of the payment order.

func (PaymentOrderNewParamsLedgerTransaction) MarshalJSON

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

type PaymentOrderNewParamsLedgerTransactionLedgerEntry

type PaymentOrderNewParamsLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (PaymentOrderNewParamsLedgerTransactionLedgerEntry) MarshalJSON

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

type PaymentOrderNewParamsLedgerTransactionLedgerableType

type PaymentOrderNewParamsLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderNewParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderNewParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderNewParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderNewParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderNewParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderNewParamsLedgerTransactionLedgerableType = "reversal"
)

func (PaymentOrderNewParamsLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type PaymentOrderNewParamsLedgerTransactionStatus

type PaymentOrderNewParamsLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	PaymentOrderNewParamsLedgerTransactionStatusArchived PaymentOrderNewParamsLedgerTransactionStatus = "archived"
	PaymentOrderNewParamsLedgerTransactionStatusPending  PaymentOrderNewParamsLedgerTransactionStatus = "pending"
	PaymentOrderNewParamsLedgerTransactionStatusPosted   PaymentOrderNewParamsLedgerTransactionStatus = "posted"
)

func (PaymentOrderNewParamsLedgerTransactionStatus) IsKnown added in v2.10.0

type PaymentOrderNewParamsLineItem

type PaymentOrderNewParamsLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PaymentOrderNewParamsLineItem) MarshalJSON

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

type PaymentOrderNewParamsPriority

type PaymentOrderNewParamsPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	PaymentOrderNewParamsPriorityHigh   PaymentOrderNewParamsPriority = "high"
	PaymentOrderNewParamsPriorityNormal PaymentOrderNewParamsPriority = "normal"
)

func (PaymentOrderNewParamsPriority) IsKnown added in v2.10.0

func (r PaymentOrderNewParamsPriority) IsKnown() bool

type PaymentOrderNewParamsReceivingAccount

type PaymentOrderNewParamsReceivingAccount struct {
	AccountDetails param.Field[[]PaymentOrderNewParamsReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                  `json:"account_type"`
	ContactDetails param.Field[[]PaymentOrderNewParamsReceivingAccountContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[PaymentOrderNewParamsReceivingAccountLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[PaymentOrderNewParamsReceivingAccountPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                            `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[PaymentOrderNewParamsReceivingAccountPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                               `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]PaymentOrderNewParamsReceivingAccountRoutingDetail] `json:"routing_details"`
}

Either `receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.

func (PaymentOrderNewParamsReceivingAccount) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountAccountDetail

type PaymentOrderNewParamsReceivingAccountAccountDetail struct {
	AccountNumber     param.Field[string]                                                               `json:"account_number,required"`
	AccountNumberType param.Field[PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (PaymentOrderNewParamsReceivingAccountAccountDetail) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType

type PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType string
const (
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeAuNumber      PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "au_number"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeHkNumber      PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "hk_number"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeIDNumber      PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "id_number"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeNzNumber      PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "nz_number"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "other"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeSgNumber      PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "sg_number"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
)

func (PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type PaymentOrderNewParamsReceivingAccountContactDetail

type PaymentOrderNewParamsReceivingAccountContactDetail struct {
	ContactIdentifier     param.Field[string]                                                                   `json:"contact_identifier"`
	ContactIdentifierType param.Field[PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (PaymentOrderNewParamsReceivingAccountContactDetail) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType

type PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType string
const (
	PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierTypeEmail       PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType = "email"
	PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierTypePhoneNumber PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierTypeWebsite     PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType = "website"
)

func (PaymentOrderNewParamsReceivingAccountContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type PaymentOrderNewParamsReceivingAccountLedgerAccount

type PaymentOrderNewParamsReceivingAccountLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (PaymentOrderNewParamsReceivingAccountLedgerAccount) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType

type PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeCounterparty    PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "counterparty"
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeVirtualAccount  PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "virtual_account"
)

func (PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType) IsKnown added in v2.10.0

type PaymentOrderNewParamsReceivingAccountPartyAddress

type PaymentOrderNewParamsReceivingAccountPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (PaymentOrderNewParamsReceivingAccountPartyAddress) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountPartyType

type PaymentOrderNewParamsReceivingAccountPartyType string

Either `individual` or `business`.

const (
	PaymentOrderNewParamsReceivingAccountPartyTypeBusiness   PaymentOrderNewParamsReceivingAccountPartyType = "business"
	PaymentOrderNewParamsReceivingAccountPartyTypeIndividual PaymentOrderNewParamsReceivingAccountPartyType = "individual"
)

func (PaymentOrderNewParamsReceivingAccountPartyType) IsKnown added in v2.10.0

type PaymentOrderNewParamsReceivingAccountRoutingDetail

type PaymentOrderNewParamsReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                               `json:"routing_number,required"`
	RoutingNumberType param.Field[PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (PaymentOrderNewParamsReceivingAccountRoutingDetail) MarshalJSON

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

type PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType

type PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType string
const (
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeACH         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "ach"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeAuBecs      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "au_becs"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeBacs        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "bacs"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeBook        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "book"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeCard        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "card"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeChats       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "chats"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeCheck       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "check"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeCrossBorder PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "cross_border"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeDkNets      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeEft         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "eft"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeHuIcs       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "hu_ics"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeMxCcen      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "mx_ccen"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypePlElixir    PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "pl_elixir"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeRoSent      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "ro_sent"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSknbi       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sknbi"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

func (PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType) IsKnown added in v2.10.0

type PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeChips                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeHuInterbankClearingCode PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeIDSknbiCode             PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "id_sknbi_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeMxBankIdentifier        PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypePlNationalClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeZaNationalClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type PaymentOrderPriority

type PaymentOrderPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	PaymentOrderPriorityHigh   PaymentOrderPriority = "high"
	PaymentOrderPriorityNormal PaymentOrderPriority = "normal"
)

func (PaymentOrderPriority) IsKnown added in v2.10.0

func (r PaymentOrderPriority) IsKnown() bool

type PaymentOrderReceivingAccountType

type PaymentOrderReceivingAccountType string
const (
	PaymentOrderReceivingAccountTypeInternalAccount PaymentOrderReceivingAccountType = "internal_account"
	PaymentOrderReceivingAccountTypeExternalAccount PaymentOrderReceivingAccountType = "external_account"
)

func (PaymentOrderReceivingAccountType) IsKnown added in v2.10.0

type PaymentOrderReferenceNumber

type PaymentOrderReferenceNumber struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The vendor reference number.
	ReferenceNumber string `json:"reference_number,required"`
	// The type of the reference number. Referring to the vendor payment id.
	ReferenceNumberType PaymentOrderReferenceNumbersReferenceNumberType `json:"reference_number_type,required"`
	UpdatedAt           time.Time                                       `json:"updated_at,required" format:"date-time"`
	JSON                paymentOrderReferenceNumberJSON                 `json:"-"`
}

func (*PaymentOrderReferenceNumber) UnmarshalJSON

func (r *PaymentOrderReferenceNumber) UnmarshalJSON(data []byte) (err error)

type PaymentOrderReferenceNumbersReferenceNumberType

type PaymentOrderReferenceNumbersReferenceNumberType string

The type of the reference number. Referring to the vendor payment id.

const (
	PaymentOrderReferenceNumbersReferenceNumberTypeACHOriginalTraceNumber                         PaymentOrderReferenceNumbersReferenceNumberType = "ach_original_trace_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeACHTraceNumber                                 PaymentOrderReferenceNumbersReferenceNumberType = "ach_trace_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeBankprovPaymentActivityDate                    PaymentOrderReferenceNumbersReferenceNumberType = "bankprov_payment_activity_date"
	PaymentOrderReferenceNumbersReferenceNumberTypeBankprovPaymentID                              PaymentOrderReferenceNumbersReferenceNumberType = "bankprov_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeBnkDevPrenotificationID                        PaymentOrderReferenceNumbersReferenceNumberType = "bnk_dev_prenotification_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeBnkDevTransferID                               PaymentOrderReferenceNumbersReferenceNumberType = "bnk_dev_transfer_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeBofaEndToEndID                                 PaymentOrderReferenceNumbersReferenceNumberType = "bofa_end_to_end_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeBofaTransactionID                              PaymentOrderReferenceNumbersReferenceNumberType = "bofa_transaction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCheckNumber                                    PaymentOrderReferenceNumbersReferenceNumberType = "check_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeCitibankReferenceNumber                        PaymentOrderReferenceNumbersReferenceNumberType = "citibank_reference_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeCitibankWorldlinkClearingSystemReferenceNumber PaymentOrderReferenceNumbersReferenceNumberType = "citibank_worldlink_clearing_system_reference_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnFxQuoteID                                PaymentOrderReferenceNumbersReferenceNumberType = "column_fx_quote_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnReversalPairTransferID                   PaymentOrderReferenceNumbersReferenceNumberType = "column_reversal_pair_transfer_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnTransferID                               PaymentOrderReferenceNumbersReferenceNumberType = "column_transfer_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCrossRiverPaymentID                            PaymentOrderReferenceNumbersReferenceNumberType = "cross_river_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCrossRiverServiceMessage                       PaymentOrderReferenceNumbersReferenceNumberType = "cross_river_service_message"
	PaymentOrderReferenceNumbersReferenceNumberTypeCrossRiverTransactionID                        PaymentOrderReferenceNumbersReferenceNumberType = "cross_river_transaction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCurrencycloudConversionID                      PaymentOrderReferenceNumbersReferenceNumberType = "currencycloud_conversion_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCurrencycloudPaymentID                         PaymentOrderReferenceNumbersReferenceNumberType = "currencycloud_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeDcBankTransactionID                            PaymentOrderReferenceNumbersReferenceNumberType = "dc_bank_transaction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeDwollaTransactionID                            PaymentOrderReferenceNumbersReferenceNumberType = "dwolla_transaction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeEftTraceNumber                                 PaymentOrderReferenceNumbersReferenceNumberType = "eft_trace_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeEvolveTransactionID                            PaymentOrderReferenceNumbersReferenceNumberType = "evolve_transaction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeFedwireImad                                    PaymentOrderReferenceNumbersReferenceNumberType = "fedwire_imad"
	PaymentOrderReferenceNumbersReferenceNumberTypeFedwireOmad                                    PaymentOrderReferenceNumbersReferenceNumberType = "fedwire_omad"
	PaymentOrderReferenceNumbersReferenceNumberTypeFirstRepublicInternalID                        PaymentOrderReferenceNumbersReferenceNumberType = "first_republic_internal_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeGoldmanSachsCollectionRequestID                PaymentOrderReferenceNumbersReferenceNumberType = "goldman_sachs_collection_request_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeGoldmanSachsEndToEndID                         PaymentOrderReferenceNumbersReferenceNumberType = "goldman_sachs_end_to_end_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeGoldmanSachsPaymentRequestID                   PaymentOrderReferenceNumbersReferenceNumberType = "goldman_sachs_payment_request_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeGoldmanSachsRequestID                          PaymentOrderReferenceNumbersReferenceNumberType = "goldman_sachs_request_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeGoldmanSachsUniquePaymentID                    PaymentOrderReferenceNumbersReferenceNumberType = "goldman_sachs_unique_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeInteracMessageID                               PaymentOrderReferenceNumbersReferenceNumberType = "interac_message_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcCcn                                        PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_ccn"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcClearingSystemReference                    PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_clearing_system_reference"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcCustomerReferenceID                        PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_customer_reference_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcEndToEndID                                 PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_end_to_end_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcFirmRootID                                 PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_firm_root_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcP3ID                                       PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_p3_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcPaymentBatchID                             PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_payment_batch_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcPaymentInformationID                       PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_payment_information_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeJpmcPaymentReturnedDatetime                    PaymentOrderReferenceNumbersReferenceNumberType = "jpmc_payment_returned_datetime"
	PaymentOrderReferenceNumbersReferenceNumberTypeLobCheckID                                     PaymentOrderReferenceNumbersReferenceNumberType = "lob_check_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeOther                                          PaymentOrderReferenceNumbersReferenceNumberType = "other"
	PaymentOrderReferenceNumbersReferenceNumberTypePartialSwiftMir                                PaymentOrderReferenceNumbersReferenceNumberType = "partial_swift_mir"
	PaymentOrderReferenceNumbersReferenceNumberTypePncClearingReference                           PaymentOrderReferenceNumbersReferenceNumberType = "pnc_clearing_reference"
	PaymentOrderReferenceNumbersReferenceNumberTypePncInstructionID                               PaymentOrderReferenceNumbersReferenceNumberType = "pnc_instruction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypePncMultipaymentID                              PaymentOrderReferenceNumbersReferenceNumberType = "pnc_multipayment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypePncPaymentTraceID                              PaymentOrderReferenceNumbersReferenceNumberType = "pnc_payment_trace_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeRspecVendorPaymentID                           PaymentOrderReferenceNumbersReferenceNumberType = "rspec_vendor_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeRtpInstructionID                               PaymentOrderReferenceNumbersReferenceNumberType = "rtp_instruction_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSignetAPIReferenceID                           PaymentOrderReferenceNumbersReferenceNumberType = "signet_api_reference_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSignetConfirmationID                           PaymentOrderReferenceNumbersReferenceNumberType = "signet_confirmation_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSignetRequestID                                PaymentOrderReferenceNumbersReferenceNumberType = "signet_request_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSilvergatePaymentID                            PaymentOrderReferenceNumbersReferenceNumberType = "silvergate_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbEndToEndID                                  PaymentOrderReferenceNumbersReferenceNumberType = "svb_end_to_end_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbPaymentID                                   PaymentOrderReferenceNumbersReferenceNumberType = "svb_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbTransactionClearedForSanctionsReview        PaymentOrderReferenceNumbersReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbTransactionHeldForSanctionsReview           PaymentOrderReferenceNumbersReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	PaymentOrderReferenceNumbersReferenceNumberTypeSwiftMir                                       PaymentOrderReferenceNumbersReferenceNumberType = "swift_mir"
	PaymentOrderReferenceNumbersReferenceNumberTypeSwiftUetr                                      PaymentOrderReferenceNumbersReferenceNumberType = "swift_uetr"
	PaymentOrderReferenceNumbersReferenceNumberTypeUmbProductPartnerAccountNumber                 PaymentOrderReferenceNumbersReferenceNumberType = "umb_product_partner_account_number"
	PaymentOrderReferenceNumbersReferenceNumberTypeUsbankPaymentID                                PaymentOrderReferenceNumbersReferenceNumberType = "usbank_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeWellsFargoPaymentID                            PaymentOrderReferenceNumbersReferenceNumberType = "wells_fargo_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeWellsFargoTraceNumber                          PaymentOrderReferenceNumbersReferenceNumberType = "wells_fargo_trace_number"
)

func (PaymentOrderReferenceNumbersReferenceNumberType) IsKnown added in v2.10.0

type PaymentOrderReversalListParams

type PaymentOrderReversalListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (PaymentOrderReversalListParams) URLQuery

func (r PaymentOrderReversalListParams) URLQuery() (v url.Values)

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

type PaymentOrderReversalNewParams

type PaymentOrderReversalNewParams struct {
	// The reason for the reversal. Must be one of `duplicate`, `incorrect_amount`,
	// `incorrect_receiving_account`, `date_earlier_than_intended`,
	// `date_later_than_intended`.
	Reason param.Field[PaymentOrderReversalNewParamsReason] `json:"reason,required"`
	// Specifies a ledger transaction object that will be created with the reversal. If
	// the ledger transaction cannot be created, then the reversal creation will fail.
	// The resulting ledger transaction will mirror the status of the reversal.
	LedgerTransaction param.Field[PaymentOrderReversalNewParamsLedgerTransaction] `json:"ledger_transaction"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PaymentOrderReversalNewParams) MarshalJSON

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

type PaymentOrderReversalNewParamsLedgerTransaction

type PaymentOrderReversalNewParamsLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]PaymentOrderReversalNewParamsLedgerTransactionLedgerEntry] `json:"ledger_entries,required"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// The timestamp (ISO8601 format) at which the ledger transaction happened for
	// reporting purposes.
	EffectiveAt param.Field[time.Time] `json:"effective_at" format:"date-time"`
	// The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
	// purposes.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// A unique string to represent the ledger transaction. Only one pending or posted
	// ledger transaction may have this ID in the ledger.
	ExternalID param.Field[string] `json:"external_id"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the id will be populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger transaction can be reconciled to another object in Modern
	// Treasury, the type will be populated here, otherwise null. This can be one of
	// payment_order, incoming_payment_detail, expected_payment, return, paper_item, or
	// reversal.
	LedgerableType param.Field[PaymentOrderReversalNewParamsLedgerTransactionLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// To post a ledger transaction at creation, use `posted`.
	Status param.Field[PaymentOrderReversalNewParamsLedgerTransactionStatus] `json:"status"`
}

Specifies a ledger transaction object that will be created with the reversal. If the ledger transaction cannot be created, then the reversal creation will fail. The resulting ledger transaction will mirror the status of the reversal.

func (PaymentOrderReversalNewParamsLedgerTransaction) MarshalJSON

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

type PaymentOrderReversalNewParamsLedgerTransactionLedgerEntry

type PaymentOrderReversalNewParamsLedgerTransactionLedgerEntry struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000. Can be any integer up to 36 digits.
	Amount param.Field[int64] `json:"amount,required"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[shared.TransactionDirection] `json:"direction,required"`
	// The ledger account that this ledger entry is associated with.
	LedgerAccountID param.Field[string] `json:"ledger_account_id,required" format:"uuid"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s available balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	AvailableBalanceAmount param.Field[map[string]int64] `json:"available_balance_amount"`
	// Lock version of the ledger account. This can be passed when creating a ledger
	// transaction to only succeed if no ledger transactions have posted since the
	// given version. See our post about Designing the Ledgers API with Optimistic
	// Locking for more details.
	LockVersion param.Field[int64] `json:"lock_version"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s pending balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PendingBalanceAmount param.Field[map[string]int64] `json:"pending_balance_amount"`
	// Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
	// account’s posted balance. If any of these conditions would be false after the
	// transaction is created, the entire call will fail with error code 422.
	PostedBalanceAmount param.Field[map[string]int64] `json:"posted_balance_amount"`
	// If true, response will include the balance of the associated ledger account for
	// the entry.
	ShowResultingLedgerAccountBalances param.Field[bool] `json:"show_resulting_ledger_account_balances"`
}

func (PaymentOrderReversalNewParamsLedgerTransactionLedgerEntry) MarshalJSON

type PaymentOrderReversalNewParamsLedgerTransactionLedgerableType

type PaymentOrderReversalNewParamsLedgerTransactionLedgerableType string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, paper_item, or reversal.

const (
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "reversal"
)

func (PaymentOrderReversalNewParamsLedgerTransactionLedgerableType) IsKnown added in v2.10.0

type PaymentOrderReversalNewParamsLedgerTransactionStatus

type PaymentOrderReversalNewParamsLedgerTransactionStatus string

To post a ledger transaction at creation, use `posted`.

const (
	PaymentOrderReversalNewParamsLedgerTransactionStatusArchived PaymentOrderReversalNewParamsLedgerTransactionStatus = "archived"
	PaymentOrderReversalNewParamsLedgerTransactionStatusPending  PaymentOrderReversalNewParamsLedgerTransactionStatus = "pending"
	PaymentOrderReversalNewParamsLedgerTransactionStatusPosted   PaymentOrderReversalNewParamsLedgerTransactionStatus = "posted"
)

func (PaymentOrderReversalNewParamsLedgerTransactionStatus) IsKnown added in v2.10.0

type PaymentOrderReversalNewParamsReason

type PaymentOrderReversalNewParamsReason string

The reason for the reversal. Must be one of `duplicate`, `incorrect_amount`, `incorrect_receiving_account`, `date_earlier_than_intended`, `date_later_than_intended`.

const (
	PaymentOrderReversalNewParamsReasonDuplicate                 PaymentOrderReversalNewParamsReason = "duplicate"
	PaymentOrderReversalNewParamsReasonIncorrectAmount           PaymentOrderReversalNewParamsReason = "incorrect_amount"
	PaymentOrderReversalNewParamsReasonIncorrectReceivingAccount PaymentOrderReversalNewParamsReason = "incorrect_receiving_account"
	PaymentOrderReversalNewParamsReasonDateEarlierThanIntended   PaymentOrderReversalNewParamsReason = "date_earlier_than_intended"
	PaymentOrderReversalNewParamsReasonDateLaterThanIntended     PaymentOrderReversalNewParamsReason = "date_later_than_intended"
)

func (PaymentOrderReversalNewParamsReason) IsKnown added in v2.10.0

type PaymentOrderReversalService

type PaymentOrderReversalService struct {
	Options []option.RequestOption
}

PaymentOrderReversalService contains methods and other services that help with interacting with the Modern Treasury 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 NewPaymentOrderReversalService method instead.

func NewPaymentOrderReversalService

func NewPaymentOrderReversalService(opts ...option.RequestOption) (r *PaymentOrderReversalService)

NewPaymentOrderReversalService 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 (*PaymentOrderReversalService) Get

func (r *PaymentOrderReversalService) Get(ctx context.Context, paymentOrderID string, reversalID string, opts ...option.RequestOption) (res *Reversal, err error)

Get details on a single reversal of a payment order.

func (*PaymentOrderReversalService) List

Get a list of all reversals of a payment order.

func (*PaymentOrderReversalService) ListAutoPaging

Get a list of all reversals of a payment order.

func (*PaymentOrderReversalService) New

func (r *PaymentOrderReversalService) New(ctx context.Context, paymentOrderID string, body PaymentOrderReversalNewParams, opts ...option.RequestOption) (res *Reversal, err error)

Create a reversal for a payment order.

type PaymentOrderService

type PaymentOrderService struct {
	Options   []option.RequestOption
	Reversals *PaymentOrderReversalService
}

PaymentOrderService contains methods and other services that help with interacting with the Modern Treasury 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 NewPaymentOrderService method instead.

func NewPaymentOrderService

func NewPaymentOrderService(opts ...option.RequestOption) (r *PaymentOrderService)

NewPaymentOrderService 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 (*PaymentOrderService) Get

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

Get details on a single payment order

func (*PaymentOrderService) List

Get a list of all payment orders

func (*PaymentOrderService) ListAutoPaging

Get a list of all payment orders

func (*PaymentOrderService) New

Create a new Payment Order

func (*PaymentOrderService) NewAsync

Create a new payment order asynchronously

func (*PaymentOrderService) Update

Update a payment order

type PaymentOrderStatus

type PaymentOrderStatus string

The current status of the payment order.

const (
	PaymentOrderStatusApproved      PaymentOrderStatus = "approved"
	PaymentOrderStatusCancelled     PaymentOrderStatus = "cancelled"
	PaymentOrderStatusCompleted     PaymentOrderStatus = "completed"
	PaymentOrderStatusDenied        PaymentOrderStatus = "denied"
	PaymentOrderStatusFailed        PaymentOrderStatus = "failed"
	PaymentOrderStatusNeedsApproval PaymentOrderStatus = "needs_approval"
	PaymentOrderStatusPending       PaymentOrderStatus = "pending"
	PaymentOrderStatusProcessing    PaymentOrderStatus = "processing"
	PaymentOrderStatusReturned      PaymentOrderStatus = "returned"
	PaymentOrderStatusReversed      PaymentOrderStatus = "reversed"
	PaymentOrderStatusSent          PaymentOrderStatus = "sent"
)

func (PaymentOrderStatus) IsKnown added in v2.10.0

func (r PaymentOrderStatus) IsKnown() bool

type PaymentOrderSubtype

type PaymentOrderSubtype string

An additional layer of classification for the type of payment order you are doing. This field is only used for `ach` payment orders currently. For `ach` payment orders, the `subtype` represents the SEC code. We currently support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.

const (
	PaymentOrderSubtypeBacsNewInstruction          PaymentOrderSubtype = "0C"
	PaymentOrderSubtypeBacsCancellationInstruction PaymentOrderSubtype = "0N"
	PaymentOrderSubtypeBacsConversionInstruction   PaymentOrderSubtype = "0S"
	PaymentOrderSubtypeCcd                         PaymentOrderSubtype = "CCD"
	PaymentOrderSubtypeCie                         PaymentOrderSubtype = "CIE"
	PaymentOrderSubtypeCtx                         PaymentOrderSubtype = "CTX"
	PaymentOrderSubtypeIat                         PaymentOrderSubtype = "IAT"
	PaymentOrderSubtypePpd                         PaymentOrderSubtype = "PPD"
	PaymentOrderSubtypeTel                         PaymentOrderSubtype = "TEL"
	PaymentOrderSubtypeWeb                         PaymentOrderSubtype = "WEB"
	PaymentOrderSubtypeAuBecs                      PaymentOrderSubtype = "au_becs"
	PaymentOrderSubtypeBacs                        PaymentOrderSubtype = "bacs"
	PaymentOrderSubtypeChats                       PaymentOrderSubtype = "chats"
	PaymentOrderSubtypeDkNets                      PaymentOrderSubtype = "dk_nets"
	PaymentOrderSubtypeEft                         PaymentOrderSubtype = "eft"
	PaymentOrderSubtypeHuIcs                       PaymentOrderSubtype = "hu_ics"
	PaymentOrderSubtypeInterac                     PaymentOrderSubtype = "interac"
	PaymentOrderSubtypeMasav                       PaymentOrderSubtype = "masav"
	PaymentOrderSubtypeMxCcen                      PaymentOrderSubtype = "mx_ccen"
	PaymentOrderSubtypeNeft                        PaymentOrderSubtype = "neft"
	PaymentOrderSubtypeNics                        PaymentOrderSubtype = "nics"
	PaymentOrderSubtypeNzBecs                      PaymentOrderSubtype = "nz_becs"
	PaymentOrderSubtypePlElixir                    PaymentOrderSubtype = "pl_elixir"
	PaymentOrderSubtypeRoSent                      PaymentOrderSubtype = "ro_sent"
	PaymentOrderSubtypeSeBankgirot                 PaymentOrderSubtype = "se_bankgirot"
	PaymentOrderSubtypeSepa                        PaymentOrderSubtype = "sepa"
	PaymentOrderSubtypeSgGiro                      PaymentOrderSubtype = "sg_giro"
	PaymentOrderSubtypeSic                         PaymentOrderSubtype = "sic"
	PaymentOrderSubtypeSknbi                       PaymentOrderSubtype = "sknbi"
	PaymentOrderSubtypeZengin                      PaymentOrderSubtype = "zengin"
)

func (PaymentOrderSubtype) IsKnown added in v2.10.0

func (r PaymentOrderSubtype) IsKnown() bool

type PaymentOrderType

type PaymentOrderType string

One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, `sic`, `signet`, `provexchange`, `zengin`.

const (
	PaymentOrderTypeACH         PaymentOrderType = "ach"
	PaymentOrderTypeAuBecs      PaymentOrderType = "au_becs"
	PaymentOrderTypeBacs        PaymentOrderType = "bacs"
	PaymentOrderTypeBook        PaymentOrderType = "book"
	PaymentOrderTypeCard        PaymentOrderType = "card"
	PaymentOrderTypeChats       PaymentOrderType = "chats"
	PaymentOrderTypeCheck       PaymentOrderType = "check"
	PaymentOrderTypeCrossBorder PaymentOrderType = "cross_border"
	PaymentOrderTypeDkNets      PaymentOrderType = "dk_nets"
	PaymentOrderTypeEft         PaymentOrderType = "eft"
	PaymentOrderTypeHuIcs       PaymentOrderType = "hu_ics"
	PaymentOrderTypeInterac     PaymentOrderType = "interac"
	PaymentOrderTypeMasav       PaymentOrderType = "masav"
	PaymentOrderTypeMxCcen      PaymentOrderType = "mx_ccen"
	PaymentOrderTypeNeft        PaymentOrderType = "neft"
	PaymentOrderTypeNics        PaymentOrderType = "nics"
	PaymentOrderTypeNzBecs      PaymentOrderType = "nz_becs"
	PaymentOrderTypePlElixir    PaymentOrderType = "pl_elixir"
	PaymentOrderTypeProvxchange PaymentOrderType = "provxchange"
	PaymentOrderTypeRoSent      PaymentOrderType = "ro_sent"
	PaymentOrderTypeRtp         PaymentOrderType = "rtp"
	PaymentOrderTypeSeBankgirot PaymentOrderType = "se_bankgirot"
	PaymentOrderTypeSen         PaymentOrderType = "sen"
	PaymentOrderTypeSepa        PaymentOrderType = "sepa"
	PaymentOrderTypeSgGiro      PaymentOrderType = "sg_giro"
	PaymentOrderTypeSic         PaymentOrderType = "sic"
	PaymentOrderTypeSignet      PaymentOrderType = "signet"
	PaymentOrderTypeSknbi       PaymentOrderType = "sknbi"
	PaymentOrderTypeWire        PaymentOrderType = "wire"
	PaymentOrderTypeZengin      PaymentOrderType = "zengin"
)

func (PaymentOrderType) IsKnown added in v2.10.0

func (r PaymentOrderType) IsKnown() bool

type PaymentOrderUltimateOriginatingAccount added in v2.1.0

type PaymentOrderUltimateOriginatingAccount struct {
	ID     string `json:"id,required" format:"uuid"`
	Object string `json:"object,required"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode    bool      `json:"live_mode,required"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	UpdatedAt   time.Time `json:"updated_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,nullable" format:"date-time"`
	// The name of the virtual account.
	Name string `json:"name,required"`
	// An optional free-form description for internal use.
	Description string `json:"description,nullable"`
	// The ID of a counterparty that the virtual account belongs to. Optional.
	CounterpartyID string `json:"counterparty_id,required,nullable" format:"uuid"`
	// The ID of the internal account that the virtual account is in.
	InternalAccountID string `json:"internal_account_id" format:"uuid"`
	// This field can have the runtime type of [[]AccountDetail].
	AccountDetails interface{} `json:"account_details"`
	// This field can have the runtime type of [[]RoutingDetail].
	RoutingDetails interface{} `json:"routing_details"`
	// The ID of a debit normal ledger account. When money enters the virtual account,
	// this ledger account will be debited. Must be accompanied by a
	// credit_ledger_account_id if present.
	DebitLedgerAccountID string `json:"debit_ledger_account_id,nullable" format:"uuid"`
	// The ID of a credit normal ledger account. When money enters the virtual account,
	// this ledger account will be credited. Must be accompanied by a
	// debit_ledger_account_id if present.
	CreditLedgerAccountID string `json:"credit_ledger_account_id,nullable" format:"uuid"`
	// If the virtual account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID string `json:"ledger_account_id,required,nullable" format:"uuid"`
	// This field can have the runtime type of [map[string]string].
	Metadata interface{} `json:"metadata"`
	// Can be checking, savings or other.
	AccountType PaymentOrderUltimateOriginatingAccountAccountType `json:"account_type,nullable"`
	// The legal name of the entity which owns the account.
	PartyName string `json:"party_name"`
	// Either individual or business.
	PartyType PaymentOrderUltimateOriginatingAccountPartyType `json:"party_type,nullable"`
	// This field can have the runtime type of [InternalAccountPartyAddress].
	PartyAddress interface{} `json:"party_address,required"`
	// Specifies which financial institution the accounts belong to.
	Connection Connection `json:"connection"`
	// The currency of the account.
	Currency shared.Currency `json:"currency"`
	// The parent InternalAccount of this account.
	ParentAccountID string `json:"parent_account_id,nullable" format:"uuid"`
	// The Legal Entity associated to this account
	LegalEntityID string                                     `json:"legal_entity_id,nullable" format:"uuid"`
	JSON          paymentOrderUltimateOriginatingAccountJSON `json:"-"`
	// contains filtered or unexported fields
}

The account to which the originating of this payment should be attributed to. Can be a `virtual_account` or `internal_account`.

func (PaymentOrderUltimateOriginatingAccount) AsUnion added in v2.11.0

AsUnion returns a PaymentOrderUltimateOriginatingAccountUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are VirtualAccount, InternalAccount.

func (*PaymentOrderUltimateOriginatingAccount) UnmarshalJSON added in v2.11.0

func (r *PaymentOrderUltimateOriginatingAccount) UnmarshalJSON(data []byte) (err error)

type PaymentOrderUltimateOriginatingAccountAccountType added in v2.11.0

type PaymentOrderUltimateOriginatingAccountAccountType string

Can be checking, savings or other.

const (
	PaymentOrderUltimateOriginatingAccountAccountTypeCash          PaymentOrderUltimateOriginatingAccountAccountType = "cash"
	PaymentOrderUltimateOriginatingAccountAccountTypeChecking      PaymentOrderUltimateOriginatingAccountAccountType = "checking"
	PaymentOrderUltimateOriginatingAccountAccountTypeGeneralLedger PaymentOrderUltimateOriginatingAccountAccountType = "general_ledger"
	PaymentOrderUltimateOriginatingAccountAccountTypeLoan          PaymentOrderUltimateOriginatingAccountAccountType = "loan"
	PaymentOrderUltimateOriginatingAccountAccountTypeNonResident   PaymentOrderUltimateOriginatingAccountAccountType = "non_resident"
	PaymentOrderUltimateOriginatingAccountAccountTypeOther         PaymentOrderUltimateOriginatingAccountAccountType = "other"
	PaymentOrderUltimateOriginatingAccountAccountTypeOverdraft     PaymentOrderUltimateOriginatingAccountAccountType = "overdraft"
	PaymentOrderUltimateOriginatingAccountAccountTypeSavings       PaymentOrderUltimateOriginatingAccountAccountType = "savings"
)

func (PaymentOrderUltimateOriginatingAccountAccountType) IsKnown added in v2.11.0

type PaymentOrderUltimateOriginatingAccountPartyType added in v2.11.0

type PaymentOrderUltimateOriginatingAccountPartyType string

Either individual or business.

const (
	PaymentOrderUltimateOriginatingAccountPartyTypeBusiness   PaymentOrderUltimateOriginatingAccountPartyType = "business"
	PaymentOrderUltimateOriginatingAccountPartyTypeIndividual PaymentOrderUltimateOriginatingAccountPartyType = "individual"
)

func (PaymentOrderUltimateOriginatingAccountPartyType) IsKnown added in v2.11.0

type PaymentOrderUltimateOriginatingAccountType added in v2.1.0

type PaymentOrderUltimateOriginatingAccountType string
const (
	PaymentOrderUltimateOriginatingAccountTypeInternalAccount PaymentOrderUltimateOriginatingAccountType = "internal_account"
	PaymentOrderUltimateOriginatingAccountTypeVirtualAccount  PaymentOrderUltimateOriginatingAccountType = "virtual_account"
)

func (PaymentOrderUltimateOriginatingAccountType) IsKnown added in v2.10.0

type PaymentOrderUltimateOriginatingAccountUnion added in v2.11.0

type PaymentOrderUltimateOriginatingAccountUnion interface {
	// contains filtered or unexported methods
}

The account to which the originating of this payment should be attributed to. Can be a `virtual_account` or `internal_account`.

Union satisfied by VirtualAccount or InternalAccount.

type PaymentOrderUpdateParams

type PaymentOrderUpdateParams struct {
	Accounting param.Field[PaymentOrderUpdateParamsAccounting] `json:"accounting"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id" format:"uuid"`
	// The ID of one of your accounting ledger classes. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingLedgerClassID param.Field[string] `json:"accounting_ledger_class_id" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented as
	// 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
	Amount param.Field[int64] `json:"amount"`
	// The party that will pay the fees for the payment order. Only applies to wire
	// payment orders. Can be one of shared, sender, or receiver, which correspond
	// respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
	ChargeBearer param.Field[PaymentOrderUpdateParamsChargeBearer] `json:"charge_bearer"`
	// Required when receiving_account_id is passed the ID of an external account.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// One of `credit`, `debit`. Describes the direction money is flowing in the
	// transaction. A `credit` moves money from your account to someone else's. A
	// `debit` pulls money from someone else's account to your own. Note that wire,
	// rtp, and check payments will always be `credit`.
	Direction param.Field[PaymentOrderUpdateParamsDirection] `json:"direction"`
	// Date transactions are to be posted to the participants' account. Defaults to the
	// current business day or the next business day if the current day is a bank
	// holiday or weekend. Format: yyyy-mm-dd.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
	// RFP payments require an expires_at. This value must be past the effective_date.
	ExpiresAt param.Field[time.Time] `json:"expires_at" format:"date-time"`
	// A payment type to fallback to if the original type is not valid for the
	// receiving account. Currently, this only supports falling back from RTP to ACH
	// (type=rtp and fallback_type=ach)
	FallbackType param.Field[PaymentOrderUpdateParamsFallbackType] `json:"fallback_type"`
	// If present, indicates a specific foreign exchange contract number that has been
	// generated by your financial institution.
	ForeignExchangeContract param.Field[string] `json:"foreign_exchange_contract"`
	// Indicates the type of FX transfer to initiate, can be either
	// `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
	// currency matches the originating account currency.
	ForeignExchangeIndicator param.Field[PaymentOrderUpdateParamsForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]PaymentOrderUpdateParamsLineItem] `json:"line_items"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A boolean to determine if NSF Protection is enabled for this payment order. Note
	// that this setting must also be turned on in your organization settings page.
	NsfProtected param.Field[bool] `json:"nsf_protected"`
	// The ID of one of your organization's internal accounts.
	OriginatingAccountID param.Field[string] `json:"originating_account_id" format:"uuid"`
	// If present, this will replace your default company name on receiver's bank
	// statement. This field can only be used for ACH payments currently. For ACH, only
	// the first 16 characters of this string will be used. Any additional characters
	// will be truncated.
	OriginatingPartyName param.Field[string] `json:"originating_party_name"`
	// Either `normal` or `high`. For ACH and EFT payments, `high` represents a
	// same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
	// an overnight check rather than standard mail.
	Priority param.Field[PaymentOrderUpdateParamsPriority] `json:"priority"`
	// If present, Modern Treasury will not process the payment until after this time.
	// If `process_after` is past the cutoff for `effective_date`, `process_after` will
	// take precedence and `effective_date` will automatically update to reflect the
	// earliest possible sending date after `process_after`. Format is ISO8601
	// timestamp.
	ProcessAfter param.Field[time.Time] `json:"process_after" format:"date-time"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. For `eft`, this field is the 3
	// digit CPA Code that will be attached to the payment.
	Purpose param.Field[string] `json:"purpose"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccount param.Field[PaymentOrderUpdateParamsReceivingAccount] `json:"receiving_account"`
	// Either `receiving_account` or `receiving_account_id` must be present. When using
	// `receiving_account_id`, you may pass the id of an external account or an
	// internal account.
	ReceivingAccountID param.Field[string] `json:"receiving_account_id" format:"uuid"`
	// For `ach`, this field will be passed through on an addenda record. For `wire`
	// payments the field will be passed through as the "Originator to Beneficiary
	// Information", also known as OBI or Fedwire tag 6000.
	RemittanceInformation param.Field[string] `json:"remittance_information"`
	// Send an email to the counterparty when the payment order is sent to the bank. If
	// `null`, `send_remittance_advice` on the Counterparty is used.
	SendRemittanceAdvice param.Field[bool] `json:"send_remittance_advice"`
	// An optional descriptor which will appear in the receiver's statement. For
	// `check` payments this field will be used as the memo line. For `ach` the maximum
	// length is 10 characters. Note that for ACH payments, the name on your bank
	// account will be included automatically by the bank, so you can use the
	// characters for other useful information. For `eft` the maximum length is 15
	// characters.
	StatementDescriptor param.Field[string] `json:"statement_descriptor"`
	// To cancel a payment order, use `cancelled`. To redraft a returned payment order,
	// use `approved`. To undo approval on a denied or approved payment order, use
	// `needs_approval`.
	Status param.Field[PaymentOrderUpdateParamsStatus] `json:"status"`
	// An additional layer of classification for the type of payment order you are
	// doing. This field is only used for `ach` payment orders currently. For `ach`
	// payment orders, the `subtype` represents the SEC code. We currently support
	// `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
	Subtype param.Field[PaymentOrderSubtype] `json:"subtype"`
	// One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
	// `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`,
	// `sic`, `signet`, `provexchange`, `zengin`.
	Type param.Field[PaymentOrderType] `json:"type"`
	// This represents the identifier by which the person is known to the receiver when
	// using the CIE subtype for ACH payments. Only the first 22 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateOriginatingPartyIdentifier param.Field[string] `json:"ultimate_originating_party_identifier"`
	// This represents the name of the person that the payment is on behalf of when
	// using the CIE subtype for ACH payments. Only the first 15 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateOriginatingPartyName param.Field[string] `json:"ultimate_originating_party_name"`
	// This represents the name of the merchant that the payment is being sent to when
	// using the CIE subtype for ACH payments. Only the first 22 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateReceivingPartyIdentifier param.Field[string] `json:"ultimate_receiving_party_identifier"`
	// This represents the identifier by which the merchant is known to the person
	// initiating an ACH payment with CIE subtype. Only the first 15 characters of this
	// string will be used. Any additional characters will be truncated.
	UltimateReceivingPartyName param.Field[string] `json:"ultimate_receiving_party_name"`
}

func (PaymentOrderUpdateParams) MarshalJSON

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

type PaymentOrderUpdateParamsAccounting

type PaymentOrderUpdateParamsAccounting struct {
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountID param.Field[string] `json:"account_id" format:"uuid"`
	// The ID of one of the class objects in your accounting system. Class objects
	// track segments of your business independent of client or project. Note that
	// these will only be accessible if your accounting system has been connected.
	ClassID param.Field[string] `json:"class_id" format:"uuid"`
}

func (PaymentOrderUpdateParamsAccounting) MarshalJSON

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

type PaymentOrderUpdateParamsChargeBearer

type PaymentOrderUpdateParamsChargeBearer string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.

const (
	PaymentOrderUpdateParamsChargeBearerShared   PaymentOrderUpdateParamsChargeBearer = "shared"
	PaymentOrderUpdateParamsChargeBearerSender   PaymentOrderUpdateParamsChargeBearer = "sender"
	PaymentOrderUpdateParamsChargeBearerReceiver PaymentOrderUpdateParamsChargeBearer = "receiver"
)

func (PaymentOrderUpdateParamsChargeBearer) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsDirection

type PaymentOrderUpdateParamsDirection string

One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be `credit`.

const (
	PaymentOrderUpdateParamsDirectionCredit PaymentOrderUpdateParamsDirection = "credit"
	PaymentOrderUpdateParamsDirectionDebit  PaymentOrderUpdateParamsDirection = "debit"
)

func (PaymentOrderUpdateParamsDirection) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsFallbackType

type PaymentOrderUpdateParamsFallbackType string

A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)

const (
	PaymentOrderUpdateParamsFallbackTypeACH PaymentOrderUpdateParamsFallbackType = "ach"
)

func (PaymentOrderUpdateParamsFallbackType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsForeignExchangeIndicator

type PaymentOrderUpdateParamsForeignExchangeIndicator string

Indicates the type of FX transfer to initiate, can be either `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.

const (
	PaymentOrderUpdateParamsForeignExchangeIndicatorFixedToVariable PaymentOrderUpdateParamsForeignExchangeIndicator = "fixed_to_variable"
	PaymentOrderUpdateParamsForeignExchangeIndicatorVariableToFixed PaymentOrderUpdateParamsForeignExchangeIndicator = "variable_to_fixed"
)

func (PaymentOrderUpdateParamsForeignExchangeIndicator) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsLineItem

type PaymentOrderUpdateParamsLineItem struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of one of your accounting categories. Note that these will only be
	// accessible if your accounting system has been connected.
	AccountingCategoryID param.Field[string] `json:"accounting_category_id"`
	// A free-form description of the line item.
	Description param.Field[string] `json:"description"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PaymentOrderUpdateParamsLineItem) MarshalJSON

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

type PaymentOrderUpdateParamsPriority

type PaymentOrderUpdateParamsPriority string

Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.

const (
	PaymentOrderUpdateParamsPriorityHigh   PaymentOrderUpdateParamsPriority = "high"
	PaymentOrderUpdateParamsPriorityNormal PaymentOrderUpdateParamsPriority = "normal"
)

func (PaymentOrderUpdateParamsPriority) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccount

type PaymentOrderUpdateParamsReceivingAccount struct {
	AccountDetails param.Field[[]PaymentOrderUpdateParamsReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                     `json:"account_type"`
	ContactDetails param.Field[[]PaymentOrderUpdateParamsReceivingAccountContactDetail] `json:"contact_details"`
	// Specifies a ledger account object that will be created with the external
	// account. The resulting ledger account is linked to the external account for
	// auto-ledgering Payment objects. See
	// https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
	// for more details.
	LedgerAccount param.Field[PaymentOrderUpdateParamsReceivingAccountLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// A nickname for the external account. This is only for internal usage and won't
	// affect any payments
	Name param.Field[string] `json:"name"`
	// Required if receiving wire payments.
	PartyAddress    param.Field[PaymentOrderUpdateParamsReceivingAccountPartyAddress] `json:"party_address"`
	PartyIdentifier param.Field[string]                                               `json:"party_identifier"`
	// If this value isn't provided, it will be inherited from the counterparty's name.
	PartyName param.Field[string] `json:"party_name"`
	// Either `individual` or `business`.
	PartyType param.Field[PaymentOrderUpdateParamsReceivingAccountPartyType] `json:"party_type"`
	// If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
	// you can pass the processor token in this field.
	PlaidProcessorToken param.Field[string]                                                  `json:"plaid_processor_token"`
	RoutingDetails      param.Field[[]PaymentOrderUpdateParamsReceivingAccountRoutingDetail] `json:"routing_details"`
}

Either `receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.

func (PaymentOrderUpdateParamsReceivingAccount) MarshalJSON

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

type PaymentOrderUpdateParamsReceivingAccountAccountDetail

type PaymentOrderUpdateParamsReceivingAccountAccountDetail struct {
	AccountNumber     param.Field[string]                                                                  `json:"account_number,required"`
	AccountNumberType param.Field[PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (PaymentOrderUpdateParamsReceivingAccountAccountDetail) MarshalJSON

type PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType

type PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType string
const (
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeAuNumber      PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "au_number"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeHkNumber      PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "hk_number"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeIDNumber      PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "id_number"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeNzNumber      PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "nz_number"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "other"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeSgNumber      PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "sg_number"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
)

func (PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccountContactDetail

type PaymentOrderUpdateParamsReceivingAccountContactDetail struct {
	ContactIdentifier     param.Field[string]                                                                      `json:"contact_identifier"`
	ContactIdentifierType param.Field[PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType] `json:"contact_identifier_type"`
}

func (PaymentOrderUpdateParamsReceivingAccountContactDetail) MarshalJSON

type PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType

type PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType string
const (
	PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierTypeEmail       PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType = "email"
	PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierTypePhoneNumber PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierTypeWebsite     PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType = "website"
)

func (PaymentOrderUpdateParamsReceivingAccountContactDetailsContactIdentifierType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccountLedgerAccount

type PaymentOrderUpdateParamsReceivingAccountLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the external account. The resulting ledger account is linked to the external account for auto-ledgering Payment objects. See https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects for more details.

func (PaymentOrderUpdateParamsReceivingAccountLedgerAccount) MarshalJSON

type PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType

type PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeCounterparty    PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "counterparty"
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeVirtualAccount  PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "virtual_account"
)

func (PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccountPartyAddress

type PaymentOrderUpdateParamsReceivingAccountPartyAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country param.Field[string] `json:"country"`
	Line1   param.Field[string] `json:"line1"`
	Line2   param.Field[string] `json:"line2"`
	// Locality or City.
	Locality param.Field[string] `json:"locality"`
	// The postal code of the address.
	PostalCode param.Field[string] `json:"postal_code"`
	// Region or State.
	Region param.Field[string] `json:"region"`
}

Required if receiving wire payments.

func (PaymentOrderUpdateParamsReceivingAccountPartyAddress) MarshalJSON

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

type PaymentOrderUpdateParamsReceivingAccountPartyType

type PaymentOrderUpdateParamsReceivingAccountPartyType string

Either `individual` or `business`.

const (
	PaymentOrderUpdateParamsReceivingAccountPartyTypeBusiness   PaymentOrderUpdateParamsReceivingAccountPartyType = "business"
	PaymentOrderUpdateParamsReceivingAccountPartyTypeIndividual PaymentOrderUpdateParamsReceivingAccountPartyType = "individual"
)

func (PaymentOrderUpdateParamsReceivingAccountPartyType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccountRoutingDetail

type PaymentOrderUpdateParamsReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                  `json:"routing_number,required"`
	RoutingNumberType param.Field[PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (PaymentOrderUpdateParamsReceivingAccountRoutingDetail) MarshalJSON

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType string
const (
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeACH         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "ach"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeAuBecs      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "au_becs"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeBacs        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "bacs"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeBook        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "book"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeCard        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "card"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeChats       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "chats"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeCheck       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "check"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeCrossBorder PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "cross_border"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeDkNets      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeEft         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "eft"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeHuIcs       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "hu_ics"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeMxCcen      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "mx_ccen"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypePlElixir    PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "pl_elixir"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeRoSent      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "ro_sent"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSknbi       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sknbi"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

func (PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeChips                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeHuInterbankClearingCode PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeIDSknbiCode             PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "id_sknbi_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeMxBankIdentifier        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypePlNationalClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeZaNationalClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type PaymentOrderUpdateParamsStatus

type PaymentOrderUpdateParamsStatus string

To cancel a payment order, use `cancelled`. To redraft a returned payment order, use `approved`. To undo approval on a denied or approved payment order, use `needs_approval`.

const (
	PaymentOrderUpdateParamsStatusApproved      PaymentOrderUpdateParamsStatus = "approved"
	PaymentOrderUpdateParamsStatusCancelled     PaymentOrderUpdateParamsStatus = "cancelled"
	PaymentOrderUpdateParamsStatusCompleted     PaymentOrderUpdateParamsStatus = "completed"
	PaymentOrderUpdateParamsStatusDenied        PaymentOrderUpdateParamsStatus = "denied"
	PaymentOrderUpdateParamsStatusFailed        PaymentOrderUpdateParamsStatus = "failed"
	PaymentOrderUpdateParamsStatusNeedsApproval PaymentOrderUpdateParamsStatus = "needs_approval"
	PaymentOrderUpdateParamsStatusPending       PaymentOrderUpdateParamsStatus = "pending"
	PaymentOrderUpdateParamsStatusProcessing    PaymentOrderUpdateParamsStatus = "processing"
	PaymentOrderUpdateParamsStatusReturned      PaymentOrderUpdateParamsStatus = "returned"
	PaymentOrderUpdateParamsStatusReversed      PaymentOrderUpdateParamsStatus = "reversed"
	PaymentOrderUpdateParamsStatusSent          PaymentOrderUpdateParamsStatus = "sent"
)

func (PaymentOrderUpdateParamsStatus) IsKnown added in v2.10.0

type PaymentReference

type PaymentReference struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The actual reference number assigned by the bank.
	ReferenceNumber string `json:"reference_number,required"`
	// The type of reference number.
	ReferenceNumberType PaymentReferenceReferenceNumberType `json:"reference_number_type,required"`
	// The id of the referenceable to search for. Must be accompanied by the
	// referenceable_type or will return an error.
	ReferenceableID string `json:"referenceable_id,required"`
	// One of the referenceable types. This must be accompanied by the id of the
	// referenceable or will return an error.
	ReferenceableType PaymentReferenceReferenceableType `json:"referenceable_type,required"`
	UpdatedAt         time.Time                         `json:"updated_at,required" format:"date-time"`
	JSON              paymentReferenceJSON              `json:"-"`
}

func (*PaymentReference) UnmarshalJSON

func (r *PaymentReference) UnmarshalJSON(data []byte) (err error)

type PaymentReferenceListParams

type PaymentReferenceListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
	// The actual reference number assigned by the bank.
	ReferenceNumber param.Field[string] `query:"reference_number"`
	// The id of the referenceable to search for. Must be accompanied by the
	// referenceable_type or will return an error.
	ReferenceableID param.Field[string] `query:"referenceable_id"`
	// One of the referenceable types. This must be accompanied by the id of the
	// referenceable or will return an error.
	ReferenceableType param.Field[PaymentReferenceListParamsReferenceableType] `query:"referenceable_type"`
}

func (PaymentReferenceListParams) URLQuery

func (r PaymentReferenceListParams) URLQuery() (v url.Values)

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

type PaymentReferenceListParamsReferenceableType

type PaymentReferenceListParamsReferenceableType string

One of the referenceable types. This must be accompanied by the id of the referenceable or will return an error.

const (
	PaymentReferenceListParamsReferenceableTypePaymentOrder PaymentReferenceListParamsReferenceableType = "payment_order"
	PaymentReferenceListParamsReferenceableTypeReturn       PaymentReferenceListParamsReferenceableType = "return"
	PaymentReferenceListParamsReferenceableTypeReversal     PaymentReferenceListParamsReferenceableType = "reversal"
)

func (PaymentReferenceListParamsReferenceableType) IsKnown added in v2.10.0

type PaymentReferenceReferenceNumberType

type PaymentReferenceReferenceNumberType string

The type of reference number.

const (
	PaymentReferenceReferenceNumberTypeACHOriginalTraceNumber                         PaymentReferenceReferenceNumberType = "ach_original_trace_number"
	PaymentReferenceReferenceNumberTypeACHTraceNumber                                 PaymentReferenceReferenceNumberType = "ach_trace_number"
	PaymentReferenceReferenceNumberTypeBankprovPaymentActivityDate                    PaymentReferenceReferenceNumberType = "bankprov_payment_activity_date"
	PaymentReferenceReferenceNumberTypeBankprovPaymentID                              PaymentReferenceReferenceNumberType = "bankprov_payment_id"
	PaymentReferenceReferenceNumberTypeBnkDevPrenotificationID                        PaymentReferenceReferenceNumberType = "bnk_dev_prenotification_id"
	PaymentReferenceReferenceNumberTypeBnkDevTransferID                               PaymentReferenceReferenceNumberType = "bnk_dev_transfer_id"
	PaymentReferenceReferenceNumberTypeBofaEndToEndID                                 PaymentReferenceReferenceNumberType = "bofa_end_to_end_id"
	PaymentReferenceReferenceNumberTypeBofaTransactionID                              PaymentReferenceReferenceNumberType = "bofa_transaction_id"
	PaymentReferenceReferenceNumberTypeCheckNumber                                    PaymentReferenceReferenceNumberType = "check_number"
	PaymentReferenceReferenceNumberTypeCitibankReferenceNumber                        PaymentReferenceReferenceNumberType = "citibank_reference_number"
	PaymentReferenceReferenceNumberTypeCitibankWorldlinkClearingSystemReferenceNumber PaymentReferenceReferenceNumberType = "citibank_worldlink_clearing_system_reference_number"
	PaymentReferenceReferenceNumberTypeColumnFxQuoteID                                PaymentReferenceReferenceNumberType = "column_fx_quote_id"
	PaymentReferenceReferenceNumberTypeColumnReversalPairTransferID                   PaymentReferenceReferenceNumberType = "column_reversal_pair_transfer_id"
	PaymentReferenceReferenceNumberTypeColumnTransferID                               PaymentReferenceReferenceNumberType = "column_transfer_id"
	PaymentReferenceReferenceNumberTypeCrossRiverPaymentID                            PaymentReferenceReferenceNumberType = "cross_river_payment_id"
	PaymentReferenceReferenceNumberTypeCrossRiverServiceMessage                       PaymentReferenceReferenceNumberType = "cross_river_service_message"
	PaymentReferenceReferenceNumberTypeCrossRiverTransactionID                        PaymentReferenceReferenceNumberType = "cross_river_transaction_id"
	PaymentReferenceReferenceNumberTypeCurrencycloudConversionID                      PaymentReferenceReferenceNumberType = "currencycloud_conversion_id"
	PaymentReferenceReferenceNumberTypeCurrencycloudPaymentID                         PaymentReferenceReferenceNumberType = "currencycloud_payment_id"
	PaymentReferenceReferenceNumberTypeDcBankTransactionID                            PaymentReferenceReferenceNumberType = "dc_bank_transaction_id"
	PaymentReferenceReferenceNumberTypeDwollaTransactionID                            PaymentReferenceReferenceNumberType = "dwolla_transaction_id"
	PaymentReferenceReferenceNumberTypeEftTraceNumber                                 PaymentReferenceReferenceNumberType = "eft_trace_number"
	PaymentReferenceReferenceNumberTypeEvolveTransactionID                            PaymentReferenceReferenceNumberType = "evolve_transaction_id"
	PaymentReferenceReferenceNumberTypeFedwireImad                                    PaymentReferenceReferenceNumberType = "fedwire_imad"
	PaymentReferenceReferenceNumberTypeFedwireOmad                                    PaymentReferenceReferenceNumberType = "fedwire_omad"
	PaymentReferenceReferenceNumberTypeFirstRepublicInternalID                        PaymentReferenceReferenceNumberType = "first_republic_internal_id"
	PaymentReferenceReferenceNumberTypeGoldmanSachsCollectionRequestID                PaymentReferenceReferenceNumberType = "goldman_sachs_collection_request_id"
	PaymentReferenceReferenceNumberTypeGoldmanSachsEndToEndID                         PaymentReferenceReferenceNumberType = "goldman_sachs_end_to_end_id"
	PaymentReferenceReferenceNumberTypeGoldmanSachsPaymentRequestID                   PaymentReferenceReferenceNumberType = "goldman_sachs_payment_request_id"
	PaymentReferenceReferenceNumberTypeGoldmanSachsRequestID                          PaymentReferenceReferenceNumberType = "goldman_sachs_request_id"
	PaymentReferenceReferenceNumberTypeGoldmanSachsUniquePaymentID                    PaymentReferenceReferenceNumberType = "goldman_sachs_unique_payment_id"
	PaymentReferenceReferenceNumberTypeInteracMessageID                               PaymentReferenceReferenceNumberType = "interac_message_id"
	PaymentReferenceReferenceNumberTypeJpmcCcn                                        PaymentReferenceReferenceNumberType = "jpmc_ccn"
	PaymentReferenceReferenceNumberTypeJpmcClearingSystemReference                    PaymentReferenceReferenceNumberType = "jpmc_clearing_system_reference"
	PaymentReferenceReferenceNumberTypeJpmcCustomerReferenceID                        PaymentReferenceReferenceNumberType = "jpmc_customer_reference_id"
	PaymentReferenceReferenceNumberTypeJpmcEndToEndID                                 PaymentReferenceReferenceNumberType = "jpmc_end_to_end_id"
	PaymentReferenceReferenceNumberTypeJpmcFirmRootID                                 PaymentReferenceReferenceNumberType = "jpmc_firm_root_id"
	PaymentReferenceReferenceNumberTypeJpmcP3ID                                       PaymentReferenceReferenceNumberType = "jpmc_p3_id"
	PaymentReferenceReferenceNumberTypeJpmcPaymentBatchID                             PaymentReferenceReferenceNumberType = "jpmc_payment_batch_id"
	PaymentReferenceReferenceNumberTypeJpmcPaymentInformationID                       PaymentReferenceReferenceNumberType = "jpmc_payment_information_id"
	PaymentReferenceReferenceNumberTypeJpmcPaymentReturnedDatetime                    PaymentReferenceReferenceNumberType = "jpmc_payment_returned_datetime"
	PaymentReferenceReferenceNumberTypeLobCheckID                                     PaymentReferenceReferenceNumberType = "lob_check_id"
	PaymentReferenceReferenceNumberTypeOther                                          PaymentReferenceReferenceNumberType = "other"
	PaymentReferenceReferenceNumberTypePartialSwiftMir                                PaymentReferenceReferenceNumberType = "partial_swift_mir"
	PaymentReferenceReferenceNumberTypePncClearingReference                           PaymentReferenceReferenceNumberType = "pnc_clearing_reference"
	PaymentReferenceReferenceNumberTypePncInstructionID                               PaymentReferenceReferenceNumberType = "pnc_instruction_id"
	PaymentReferenceReferenceNumberTypePncMultipaymentID                              PaymentReferenceReferenceNumberType = "pnc_multipayment_id"
	PaymentReferenceReferenceNumberTypePncPaymentTraceID                              PaymentReferenceReferenceNumberType = "pnc_payment_trace_id"
	PaymentReferenceReferenceNumberTypeRspecVendorPaymentID                           PaymentReferenceReferenceNumberType = "rspec_vendor_payment_id"
	PaymentReferenceReferenceNumberTypeRtpInstructionID                               PaymentReferenceReferenceNumberType = "rtp_instruction_id"
	PaymentReferenceReferenceNumberTypeSignetAPIReferenceID                           PaymentReferenceReferenceNumberType = "signet_api_reference_id"
	PaymentReferenceReferenceNumberTypeSignetConfirmationID                           PaymentReferenceReferenceNumberType = "signet_confirmation_id"
	PaymentReferenceReferenceNumberTypeSignetRequestID                                PaymentReferenceReferenceNumberType = "signet_request_id"
	PaymentReferenceReferenceNumberTypeSilvergatePaymentID                            PaymentReferenceReferenceNumberType = "silvergate_payment_id"
	PaymentReferenceReferenceNumberTypeSvbEndToEndID                                  PaymentReferenceReferenceNumberType = "svb_end_to_end_id"
	PaymentReferenceReferenceNumberTypeSvbPaymentID                                   PaymentReferenceReferenceNumberType = "svb_payment_id"
	PaymentReferenceReferenceNumberTypeSvbTransactionClearedForSanctionsReview        PaymentReferenceReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	PaymentReferenceReferenceNumberTypeSvbTransactionHeldForSanctionsReview           PaymentReferenceReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	PaymentReferenceReferenceNumberTypeSwiftMir                                       PaymentReferenceReferenceNumberType = "swift_mir"
	PaymentReferenceReferenceNumberTypeSwiftUetr                                      PaymentReferenceReferenceNumberType = "swift_uetr"
	PaymentReferenceReferenceNumberTypeUmbProductPartnerAccountNumber                 PaymentReferenceReferenceNumberType = "umb_product_partner_account_number"
	PaymentReferenceReferenceNumberTypeUsbankPaymentID                                PaymentReferenceReferenceNumberType = "usbank_payment_id"
	PaymentReferenceReferenceNumberTypeWellsFargoPaymentID                            PaymentReferenceReferenceNumberType = "wells_fargo_payment_id"
	PaymentReferenceReferenceNumberTypeWellsFargoTraceNumber                          PaymentReferenceReferenceNumberType = "wells_fargo_trace_number"
)

func (PaymentReferenceReferenceNumberType) IsKnown added in v2.10.0

type PaymentReferenceReferenceableType

type PaymentReferenceReferenceableType string

One of the referenceable types. This must be accompanied by the id of the referenceable or will return an error.

const (
	PaymentReferenceReferenceableTypePaymentOrder PaymentReferenceReferenceableType = "payment_order"
	PaymentReferenceReferenceableTypeReversal     PaymentReferenceReferenceableType = "reversal"
	PaymentReferenceReferenceableTypeReturn       PaymentReferenceReferenceableType = "return"
)

func (PaymentReferenceReferenceableType) IsKnown added in v2.10.0

type PaymentReferenceService

type PaymentReferenceService struct {
	Options []option.RequestOption
}

PaymentReferenceService contains methods and other services that help with interacting with the Modern Treasury 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 NewPaymentReferenceService method instead.

func NewPaymentReferenceService

func NewPaymentReferenceService(opts ...option.RequestOption) (r *PaymentReferenceService)

NewPaymentReferenceService 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 (*PaymentReferenceService) Get

get payment_reference

func (*PaymentReferenceService) List

list payment_references

func (*PaymentReferenceService) ListAutoPaging

list payment_references

func (*PaymentReferenceService) Retireve deprecated

func (r *PaymentReferenceService) Retireve(ctx context.Context, id string, opts ...option.RequestOption) (res *PaymentReference, err error)

get payment_reference

Deprecated: use `Get` instead

type PingResponse

type PingResponse struct {
	Ping string           `json:"ping,required"`
	JSON pingResponseJSON `json:"-"`
}

func (*PingResponse) UnmarshalJSON

func (r *PingResponse) UnmarshalJSON(data []byte) (err error)

type ReturnListParams

type ReturnListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Specify `counterparty_id` if you wish to see returns that occurred with a
	// specific counterparty.
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// Specify `internal_account_id` if you wish to see returns to/from a specific
	// account.
	InternalAccountID param.Field[string] `query:"internal_account_id"`
	PerPage           param.Field[int64]  `query:"per_page"`
	// The ID of a valid returnable. Must be accompanied by `returnable_type`.
	ReturnableID param.Field[string] `query:"returnable_id"`
	// One of `payment_order`, `paper_item`, `reversal`, or `incoming_payment_detail`.
	// Must be accompanied by `returnable_id`.
	ReturnableType param.Field[ReturnListParamsReturnableType] `query:"returnable_type"`
}

func (ReturnListParams) URLQuery

func (r ReturnListParams) URLQuery() (v url.Values)

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

type ReturnListParamsReturnableType

type ReturnListParamsReturnableType string

One of `payment_order`, `paper_item`, `reversal`, or `incoming_payment_detail`. Must be accompanied by `returnable_id`.

const (
	ReturnListParamsReturnableTypeIncomingPaymentDetail ReturnListParamsReturnableType = "incoming_payment_detail"
	ReturnListParamsReturnableTypePaperItem             ReturnListParamsReturnableType = "paper_item"
	ReturnListParamsReturnableTypePaymentOrder          ReturnListParamsReturnableType = "payment_order"
	ReturnListParamsReturnableTypeReturn                ReturnListParamsReturnableType = "return"
	ReturnListParamsReturnableTypeReversal              ReturnListParamsReturnableType = "reversal"
)

func (ReturnListParamsReturnableType) IsKnown added in v2.10.0

type ReturnNewParams

type ReturnNewParams struct {
	// The ID of the object being returned or `null`.
	ReturnableID param.Field[string] `json:"returnable_id,required" format:"uuid"`
	// The type of object being returned. Currently, this may only be
	// incoming_payment_detail.
	ReturnableType param.Field[ReturnNewParamsReturnableType] `json:"returnable_type,required"`
	// Some returns may include additional information from the bank. In these cases,
	// this string will be present.
	AdditionalInformation param.Field[string] `json:"additional_information"`
	// The return code. For ACH returns, this is the required ACH return code.
	Code param.Field[ReturnNewParamsCode] `json:"code"`
	// If the return code is `R14` or `R15` this is the date the deceased counterparty
	// passed away.
	DateOfDeath param.Field[time.Time] `json:"date_of_death" format:"date"`
	// An optional description of the reason for the return. This is for internal usage
	// and will not be transmitted to the bank.”
	Reason param.Field[string] `json:"reason"`
}

func (ReturnNewParams) MarshalJSON

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

type ReturnNewParamsCode

type ReturnNewParamsCode string

The return code. For ACH returns, this is the required ACH return code.

const (
	ReturnNewParamsCode901           ReturnNewParamsCode = "901"
	ReturnNewParamsCode902           ReturnNewParamsCode = "902"
	ReturnNewParamsCode903           ReturnNewParamsCode = "903"
	ReturnNewParamsCode904           ReturnNewParamsCode = "904"
	ReturnNewParamsCode905           ReturnNewParamsCode = "905"
	ReturnNewParamsCode907           ReturnNewParamsCode = "907"
	ReturnNewParamsCode908           ReturnNewParamsCode = "908"
	ReturnNewParamsCode909           ReturnNewParamsCode = "909"
	ReturnNewParamsCode910           ReturnNewParamsCode = "910"
	ReturnNewParamsCode911           ReturnNewParamsCode = "911"
	ReturnNewParamsCode912           ReturnNewParamsCode = "912"
	ReturnNewParamsCode914           ReturnNewParamsCode = "914"
	ReturnNewParamsCodeC01           ReturnNewParamsCode = "C01"
	ReturnNewParamsCodeC02           ReturnNewParamsCode = "C02"
	ReturnNewParamsCodeC03           ReturnNewParamsCode = "C03"
	ReturnNewParamsCodeC05           ReturnNewParamsCode = "C05"
	ReturnNewParamsCodeC06           ReturnNewParamsCode = "C06"
	ReturnNewParamsCodeC07           ReturnNewParamsCode = "C07"
	ReturnNewParamsCodeC08           ReturnNewParamsCode = "C08"
	ReturnNewParamsCodeC09           ReturnNewParamsCode = "C09"
	ReturnNewParamsCodeC13           ReturnNewParamsCode = "C13"
	ReturnNewParamsCodeC14           ReturnNewParamsCode = "C14"
	ReturnNewParamsCodeR01           ReturnNewParamsCode = "R01"
	ReturnNewParamsCodeR02           ReturnNewParamsCode = "R02"
	ReturnNewParamsCodeR03           ReturnNewParamsCode = "R03"
	ReturnNewParamsCodeR04           ReturnNewParamsCode = "R04"
	ReturnNewParamsCodeR05           ReturnNewParamsCode = "R05"
	ReturnNewParamsCodeR06           ReturnNewParamsCode = "R06"
	ReturnNewParamsCodeR07           ReturnNewParamsCode = "R07"
	ReturnNewParamsCodeR08           ReturnNewParamsCode = "R08"
	ReturnNewParamsCodeR09           ReturnNewParamsCode = "R09"
	ReturnNewParamsCodeR10           ReturnNewParamsCode = "R10"
	ReturnNewParamsCodeR11           ReturnNewParamsCode = "R11"
	ReturnNewParamsCodeR12           ReturnNewParamsCode = "R12"
	ReturnNewParamsCodeR14           ReturnNewParamsCode = "R14"
	ReturnNewParamsCodeR15           ReturnNewParamsCode = "R15"
	ReturnNewParamsCodeR16           ReturnNewParamsCode = "R16"
	ReturnNewParamsCodeR17           ReturnNewParamsCode = "R17"
	ReturnNewParamsCodeR20           ReturnNewParamsCode = "R20"
	ReturnNewParamsCodeR21           ReturnNewParamsCode = "R21"
	ReturnNewParamsCodeR22           ReturnNewParamsCode = "R22"
	ReturnNewParamsCodeR23           ReturnNewParamsCode = "R23"
	ReturnNewParamsCodeR24           ReturnNewParamsCode = "R24"
	ReturnNewParamsCodeR29           ReturnNewParamsCode = "R29"
	ReturnNewParamsCodeR31           ReturnNewParamsCode = "R31"
	ReturnNewParamsCodeR33           ReturnNewParamsCode = "R33"
	ReturnNewParamsCodeR37           ReturnNewParamsCode = "R37"
	ReturnNewParamsCodeR38           ReturnNewParamsCode = "R38"
	ReturnNewParamsCodeR39           ReturnNewParamsCode = "R39"
	ReturnNewParamsCodeR51           ReturnNewParamsCode = "R51"
	ReturnNewParamsCodeR52           ReturnNewParamsCode = "R52"
	ReturnNewParamsCodeR53           ReturnNewParamsCode = "R53"
	ReturnNewParamsCodeCurrencycloud ReturnNewParamsCode = "currencycloud"
)

func (ReturnNewParamsCode) IsKnown added in v2.10.0

func (r ReturnNewParamsCode) IsKnown() bool

type ReturnNewParamsReturnableType

type ReturnNewParamsReturnableType string

The type of object being returned. Currently, this may only be incoming_payment_detail.

const (
	ReturnNewParamsReturnableTypeIncomingPaymentDetail ReturnNewParamsReturnableType = "incoming_payment_detail"
)

func (ReturnNewParamsReturnableType) IsKnown added in v2.10.0

func (r ReturnNewParamsReturnableType) IsKnown() bool

type ReturnObject

type ReturnObject struct {
	ID string `json:"id,required" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount int64 `json:"amount,required"`
	// The return code. For ACH returns, this is the required ACH return code.
	Code      ReturnObjectCode `json:"code,required,nullable"`
	CreatedAt time.Time        `json:"created_at,required" format:"date-time"`
	// Currency that this transaction is denominated in.
	Currency shared.Currency `json:"currency,required"`
	// If the return's status is `returned`, this will include the return object's data
	// that is returning this return.
	CurrentReturn *ReturnObject `json:"current_return,required,nullable"`
	// If the return code is `R14` or `R15` this is the date the deceased counterparty
	// passed away.
	DateOfDeath time.Time `json:"date_of_death,required,nullable" format:"date"`
	// If an originating return failed to be processed by the bank, a description of
	// the failure reason will be available.
	FailureReason string `json:"failure_reason,required,nullable"`
	// The ID of the relevant Internal Account.
	InternalAccountID string `json:"internal_account_id,required,nullable" format:"uuid"`
	// The ID of the ledger transaction linked to the return.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// Often the bank will provide an explanation for the return, which is a short
	// human readable string.
	Reason string `json:"reason,required,nullable"`
	// An array of Payment Reference objects.
	ReferenceNumbers []ReturnObjectReferenceNumber `json:"reference_numbers,required"`
	// The ID of the object being returned or `null`.
	ReturnableID string `json:"returnable_id,required,nullable" format:"uuid"`
	// The type of object being returned or `null`.
	ReturnableType ReturnObjectReturnableType `json:"returnable_type,required,nullable"`
	// The role of the return, can be `originating` or `receiving`.
	Role ReturnObjectRole `json:"role,required"`
	// The current status of the return.
	Status ReturnObjectStatus `json:"status,required"`
	// The ID of the relevant Transaction or `null`.
	TransactionID string `json:"transaction_id,required,nullable" format:"uuid"`
	// The ID of the relevant Transaction Line Item or `null`.
	TransactionLineItemID string `json:"transaction_line_item_id,required,nullable" format:"uuid"`
	// The type of return. Can be one of: `ach`, `ach_noc`, `au_becs`, `bacs`, `eft`,
	// `interac`, `manual`, `paper_item`, `wire`.
	Type      ReturnObjectType `json:"type,required"`
	UpdatedAt time.Time        `json:"updated_at,required" format:"date-time"`
	// Some returns may include additional information from the bank. In these cases,
	// this string will be present.
	AdditionalInformation string           `json:"additional_information,nullable"`
	JSON                  returnObjectJSON `json:"-"`
}

func (*ReturnObject) UnmarshalJSON

func (r *ReturnObject) UnmarshalJSON(data []byte) (err error)

type ReturnObjectCode

type ReturnObjectCode string

The return code. For ACH returns, this is the required ACH return code.

const (
	ReturnObjectCode901           ReturnObjectCode = "901"
	ReturnObjectCode902           ReturnObjectCode = "902"
	ReturnObjectCode903           ReturnObjectCode = "903"
	ReturnObjectCode904           ReturnObjectCode = "904"
	ReturnObjectCode905           ReturnObjectCode = "905"
	ReturnObjectCode907           ReturnObjectCode = "907"
	ReturnObjectCode908           ReturnObjectCode = "908"
	ReturnObjectCode909           ReturnObjectCode = "909"
	ReturnObjectCode910           ReturnObjectCode = "910"
	ReturnObjectCode911           ReturnObjectCode = "911"
	ReturnObjectCode912           ReturnObjectCode = "912"
	ReturnObjectCode914           ReturnObjectCode = "914"
	ReturnObjectCodeC01           ReturnObjectCode = "C01"
	ReturnObjectCodeC02           ReturnObjectCode = "C02"
	ReturnObjectCodeC03           ReturnObjectCode = "C03"
	ReturnObjectCodeC05           ReturnObjectCode = "C05"
	ReturnObjectCodeC06           ReturnObjectCode = "C06"
	ReturnObjectCodeC07           ReturnObjectCode = "C07"
	ReturnObjectCodeC08           ReturnObjectCode = "C08"
	ReturnObjectCodeC09           ReturnObjectCode = "C09"
	ReturnObjectCodeC13           ReturnObjectCode = "C13"
	ReturnObjectCodeC14           ReturnObjectCode = "C14"
	ReturnObjectCodeR01           ReturnObjectCode = "R01"
	ReturnObjectCodeR02           ReturnObjectCode = "R02"
	ReturnObjectCodeR03           ReturnObjectCode = "R03"
	ReturnObjectCodeR04           ReturnObjectCode = "R04"
	ReturnObjectCodeR05           ReturnObjectCode = "R05"
	ReturnObjectCodeR06           ReturnObjectCode = "R06"
	ReturnObjectCodeR07           ReturnObjectCode = "R07"
	ReturnObjectCodeR08           ReturnObjectCode = "R08"
	ReturnObjectCodeR09           ReturnObjectCode = "R09"
	ReturnObjectCodeR10           ReturnObjectCode = "R10"
	ReturnObjectCodeR11           ReturnObjectCode = "R11"
	ReturnObjectCodeR12           ReturnObjectCode = "R12"
	ReturnObjectCodeR14           ReturnObjectCode = "R14"
	ReturnObjectCodeR15           ReturnObjectCode = "R15"
	ReturnObjectCodeR16           ReturnObjectCode = "R16"
	ReturnObjectCodeR17           ReturnObjectCode = "R17"
	ReturnObjectCodeR20           ReturnObjectCode = "R20"
	ReturnObjectCodeR21           ReturnObjectCode = "R21"
	ReturnObjectCodeR22           ReturnObjectCode = "R22"
	ReturnObjectCodeR23           ReturnObjectCode = "R23"
	ReturnObjectCodeR24           ReturnObjectCode = "R24"
	ReturnObjectCodeR29           ReturnObjectCode = "R29"
	ReturnObjectCodeR31           ReturnObjectCode = "R31"
	ReturnObjectCodeR33           ReturnObjectCode = "R33"
	ReturnObjectCodeR37           ReturnObjectCode = "R37"
	ReturnObjectCodeR38           ReturnObjectCode = "R38"
	ReturnObjectCodeR39           ReturnObjectCode = "R39"
	ReturnObjectCodeR51           ReturnObjectCode = "R51"
	ReturnObjectCodeR52           ReturnObjectCode = "R52"
	ReturnObjectCodeR53           ReturnObjectCode = "R53"
	ReturnObjectCodeCurrencycloud ReturnObjectCode = "currencycloud"
)

func (ReturnObjectCode) IsKnown added in v2.10.0

func (r ReturnObjectCode) IsKnown() bool

type ReturnObjectReferenceNumber

type ReturnObjectReferenceNumber struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// The vendor reference number.
	ReferenceNumber string `json:"reference_number,required"`
	// The type of the reference number. Referring to the vendor payment id.
	ReferenceNumberType ReturnObjectReferenceNumbersReferenceNumberType `json:"reference_number_type,required"`
	UpdatedAt           time.Time                                       `json:"updated_at,required" format:"date-time"`
	JSON                returnObjectReferenceNumberJSON                 `json:"-"`
}

func (*ReturnObjectReferenceNumber) UnmarshalJSON

func (r *ReturnObjectReferenceNumber) UnmarshalJSON(data []byte) (err error)

type ReturnObjectReferenceNumbersReferenceNumberType

type ReturnObjectReferenceNumbersReferenceNumberType string

The type of the reference number. Referring to the vendor payment id.

const (
	ReturnObjectReferenceNumbersReferenceNumberTypeACHOriginalTraceNumber                         ReturnObjectReferenceNumbersReferenceNumberType = "ach_original_trace_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeACHTraceNumber                                 ReturnObjectReferenceNumbersReferenceNumberType = "ach_trace_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeBankprovPaymentActivityDate                    ReturnObjectReferenceNumbersReferenceNumberType = "bankprov_payment_activity_date"
	ReturnObjectReferenceNumbersReferenceNumberTypeBankprovPaymentID                              ReturnObjectReferenceNumbersReferenceNumberType = "bankprov_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeBnkDevPrenotificationID                        ReturnObjectReferenceNumbersReferenceNumberType = "bnk_dev_prenotification_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeBnkDevTransferID                               ReturnObjectReferenceNumbersReferenceNumberType = "bnk_dev_transfer_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeBofaEndToEndID                                 ReturnObjectReferenceNumbersReferenceNumberType = "bofa_end_to_end_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeBofaTransactionID                              ReturnObjectReferenceNumbersReferenceNumberType = "bofa_transaction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCheckNumber                                    ReturnObjectReferenceNumbersReferenceNumberType = "check_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeCitibankReferenceNumber                        ReturnObjectReferenceNumbersReferenceNumberType = "citibank_reference_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeCitibankWorldlinkClearingSystemReferenceNumber ReturnObjectReferenceNumbersReferenceNumberType = "citibank_worldlink_clearing_system_reference_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnFxQuoteID                                ReturnObjectReferenceNumbersReferenceNumberType = "column_fx_quote_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnReversalPairTransferID                   ReturnObjectReferenceNumbersReferenceNumberType = "column_reversal_pair_transfer_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnTransferID                               ReturnObjectReferenceNumbersReferenceNumberType = "column_transfer_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCrossRiverPaymentID                            ReturnObjectReferenceNumbersReferenceNumberType = "cross_river_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCrossRiverServiceMessage                       ReturnObjectReferenceNumbersReferenceNumberType = "cross_river_service_message"
	ReturnObjectReferenceNumbersReferenceNumberTypeCrossRiverTransactionID                        ReturnObjectReferenceNumbersReferenceNumberType = "cross_river_transaction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCurrencycloudConversionID                      ReturnObjectReferenceNumbersReferenceNumberType = "currencycloud_conversion_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCurrencycloudPaymentID                         ReturnObjectReferenceNumbersReferenceNumberType = "currencycloud_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeDcBankTransactionID                            ReturnObjectReferenceNumbersReferenceNumberType = "dc_bank_transaction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeDwollaTransactionID                            ReturnObjectReferenceNumbersReferenceNumberType = "dwolla_transaction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeEftTraceNumber                                 ReturnObjectReferenceNumbersReferenceNumberType = "eft_trace_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeEvolveTransactionID                            ReturnObjectReferenceNumbersReferenceNumberType = "evolve_transaction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeFedwireImad                                    ReturnObjectReferenceNumbersReferenceNumberType = "fedwire_imad"
	ReturnObjectReferenceNumbersReferenceNumberTypeFedwireOmad                                    ReturnObjectReferenceNumbersReferenceNumberType = "fedwire_omad"
	ReturnObjectReferenceNumbersReferenceNumberTypeFirstRepublicInternalID                        ReturnObjectReferenceNumbersReferenceNumberType = "first_republic_internal_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeGoldmanSachsCollectionRequestID                ReturnObjectReferenceNumbersReferenceNumberType = "goldman_sachs_collection_request_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeGoldmanSachsEndToEndID                         ReturnObjectReferenceNumbersReferenceNumberType = "goldman_sachs_end_to_end_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeGoldmanSachsPaymentRequestID                   ReturnObjectReferenceNumbersReferenceNumberType = "goldman_sachs_payment_request_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeGoldmanSachsRequestID                          ReturnObjectReferenceNumbersReferenceNumberType = "goldman_sachs_request_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeGoldmanSachsUniquePaymentID                    ReturnObjectReferenceNumbersReferenceNumberType = "goldman_sachs_unique_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeInteracMessageID                               ReturnObjectReferenceNumbersReferenceNumberType = "interac_message_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcCcn                                        ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_ccn"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcClearingSystemReference                    ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_clearing_system_reference"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcCustomerReferenceID                        ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_customer_reference_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcEndToEndID                                 ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_end_to_end_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcFirmRootID                                 ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_firm_root_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcP3ID                                       ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_p3_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcPaymentBatchID                             ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_payment_batch_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcPaymentInformationID                       ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_payment_information_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeJpmcPaymentReturnedDatetime                    ReturnObjectReferenceNumbersReferenceNumberType = "jpmc_payment_returned_datetime"
	ReturnObjectReferenceNumbersReferenceNumberTypeLobCheckID                                     ReturnObjectReferenceNumbersReferenceNumberType = "lob_check_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeOther                                          ReturnObjectReferenceNumbersReferenceNumberType = "other"
	ReturnObjectReferenceNumbersReferenceNumberTypePartialSwiftMir                                ReturnObjectReferenceNumbersReferenceNumberType = "partial_swift_mir"
	ReturnObjectReferenceNumbersReferenceNumberTypePncClearingReference                           ReturnObjectReferenceNumbersReferenceNumberType = "pnc_clearing_reference"
	ReturnObjectReferenceNumbersReferenceNumberTypePncInstructionID                               ReturnObjectReferenceNumbersReferenceNumberType = "pnc_instruction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypePncMultipaymentID                              ReturnObjectReferenceNumbersReferenceNumberType = "pnc_multipayment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypePncPaymentTraceID                              ReturnObjectReferenceNumbersReferenceNumberType = "pnc_payment_trace_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeRspecVendorPaymentID                           ReturnObjectReferenceNumbersReferenceNumberType = "rspec_vendor_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeRtpInstructionID                               ReturnObjectReferenceNumbersReferenceNumberType = "rtp_instruction_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSignetAPIReferenceID                           ReturnObjectReferenceNumbersReferenceNumberType = "signet_api_reference_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSignetConfirmationID                           ReturnObjectReferenceNumbersReferenceNumberType = "signet_confirmation_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSignetRequestID                                ReturnObjectReferenceNumbersReferenceNumberType = "signet_request_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSilvergatePaymentID                            ReturnObjectReferenceNumbersReferenceNumberType = "silvergate_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbEndToEndID                                  ReturnObjectReferenceNumbersReferenceNumberType = "svb_end_to_end_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbPaymentID                                   ReturnObjectReferenceNumbersReferenceNumberType = "svb_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbTransactionClearedForSanctionsReview        ReturnObjectReferenceNumbersReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbTransactionHeldForSanctionsReview           ReturnObjectReferenceNumbersReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	ReturnObjectReferenceNumbersReferenceNumberTypeSwiftMir                                       ReturnObjectReferenceNumbersReferenceNumberType = "swift_mir"
	ReturnObjectReferenceNumbersReferenceNumberTypeSwiftUetr                                      ReturnObjectReferenceNumbersReferenceNumberType = "swift_uetr"
	ReturnObjectReferenceNumbersReferenceNumberTypeUmbProductPartnerAccountNumber                 ReturnObjectReferenceNumbersReferenceNumberType = "umb_product_partner_account_number"
	ReturnObjectReferenceNumbersReferenceNumberTypeUsbankPaymentID                                ReturnObjectReferenceNumbersReferenceNumberType = "usbank_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeWellsFargoPaymentID                            ReturnObjectReferenceNumbersReferenceNumberType = "wells_fargo_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeWellsFargoTraceNumber                          ReturnObjectReferenceNumbersReferenceNumberType = "wells_fargo_trace_number"
)

func (ReturnObjectReferenceNumbersReferenceNumberType) IsKnown added in v2.10.0

type ReturnObjectReturnableType

type ReturnObjectReturnableType string

The type of object being returned or `null`.

const (
	ReturnObjectReturnableTypeIncomingPaymentDetail ReturnObjectReturnableType = "incoming_payment_detail"
	ReturnObjectReturnableTypePaperItem             ReturnObjectReturnableType = "paper_item"
	ReturnObjectReturnableTypePaymentOrder          ReturnObjectReturnableType = "payment_order"
	ReturnObjectReturnableTypeReturn                ReturnObjectReturnableType = "return"
	ReturnObjectReturnableTypeReversal              ReturnObjectReturnableType = "reversal"
)

func (ReturnObjectReturnableType) IsKnown added in v2.10.0

func (r ReturnObjectReturnableType) IsKnown() bool

type ReturnObjectRole

type ReturnObjectRole string

The role of the return, can be `originating` or `receiving`.

const (
	ReturnObjectRoleOriginating ReturnObjectRole = "originating"
	ReturnObjectRoleReceiving   ReturnObjectRole = "receiving"
)

func (ReturnObjectRole) IsKnown added in v2.10.0

func (r ReturnObjectRole) IsKnown() bool

type ReturnObjectStatus

type ReturnObjectStatus string

The current status of the return.

const (
	ReturnObjectStatusCompleted  ReturnObjectStatus = "completed"
	ReturnObjectStatusFailed     ReturnObjectStatus = "failed"
	ReturnObjectStatusPending    ReturnObjectStatus = "pending"
	ReturnObjectStatusProcessing ReturnObjectStatus = "processing"
	ReturnObjectStatusReturned   ReturnObjectStatus = "returned"
	ReturnObjectStatusSent       ReturnObjectStatus = "sent"
)

func (ReturnObjectStatus) IsKnown added in v2.10.0

func (r ReturnObjectStatus) IsKnown() bool

type ReturnObjectType

type ReturnObjectType string

The type of return. Can be one of: `ach`, `ach_noc`, `au_becs`, `bacs`, `eft`, `interac`, `manual`, `paper_item`, `wire`.

const (
	ReturnObjectTypeACH         ReturnObjectType = "ach"
	ReturnObjectTypeACHNoc      ReturnObjectType = "ach_noc"
	ReturnObjectTypeAuBecs      ReturnObjectType = "au_becs"
	ReturnObjectTypeBacs        ReturnObjectType = "bacs"
	ReturnObjectTypeBook        ReturnObjectType = "book"
	ReturnObjectTypeCheck       ReturnObjectType = "check"
	ReturnObjectTypeCrossBorder ReturnObjectType = "cross_border"
	ReturnObjectTypeEft         ReturnObjectType = "eft"
	ReturnObjectTypeInterac     ReturnObjectType = "interac"
	ReturnObjectTypeManual      ReturnObjectType = "manual"
	ReturnObjectTypePaperItem   ReturnObjectType = "paper_item"
	ReturnObjectTypeSepa        ReturnObjectType = "sepa"
	ReturnObjectTypeWire        ReturnObjectType = "wire"
)

func (ReturnObjectType) IsKnown added in v2.10.0

func (r ReturnObjectType) IsKnown() bool

type ReturnService

type ReturnService struct {
	Options []option.RequestOption
}

ReturnService contains methods and other services that help with interacting with the Modern Treasury 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 NewReturnService method instead.

func NewReturnService

func NewReturnService(opts ...option.RequestOption) (r *ReturnService)

NewReturnService 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 (*ReturnService) Get

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

Get a single return.

func (*ReturnService) List

Get a list of returns.

func (*ReturnService) ListAutoPaging

Get a list of returns.

func (*ReturnService) New

func (r *ReturnService) New(ctx context.Context, body ReturnNewParams, opts ...option.RequestOption) (res *ReturnObject, err error)

Create a return.

type Reversal

type Reversal struct {
	ID        string    `json:"id,required" format:"uuid"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The ID of the ledger transaction linked to the reversal.
	LedgerTransactionID string `json:"ledger_transaction_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// The ID of the relevant Payment Order.
	PaymentOrderID string `json:"payment_order_id,required,nullable" format:"uuid"`
	// The reason for the reversal.
	Reason ReversalReason `json:"reason,required"`
	// The current status of the reversal.
	Status    ReversalStatus `json:"status,required"`
	UpdatedAt time.Time      `json:"updated_at,required" format:"date-time"`
	JSON      reversalJSON   `json:"-"`
}

func (*Reversal) UnmarshalJSON

func (r *Reversal) UnmarshalJSON(data []byte) (err error)

type ReversalReason

type ReversalReason string

The reason for the reversal.

const (
	ReversalReasonDuplicate                 ReversalReason = "duplicate"
	ReversalReasonIncorrectAmount           ReversalReason = "incorrect_amount"
	ReversalReasonIncorrectReceivingAccount ReversalReason = "incorrect_receiving_account"
	ReversalReasonDateEarlierThanIntended   ReversalReason = "date_earlier_than_intended"
	ReversalReasonDateLaterThanIntended     ReversalReason = "date_later_than_intended"
)

func (ReversalReason) IsKnown added in v2.10.0

func (r ReversalReason) IsKnown() bool

type ReversalStatus

type ReversalStatus string

The current status of the reversal.

const (
	ReversalStatusCompleted  ReversalStatus = "completed"
	ReversalStatusFailed     ReversalStatus = "failed"
	ReversalStatusPending    ReversalStatus = "pending"
	ReversalStatusProcessing ReversalStatus = "processing"
	ReversalStatusReturned   ReversalStatus = "returned"
	ReversalStatusSent       ReversalStatus = "sent"
)

func (ReversalStatus) IsKnown added in v2.10.0

func (r ReversalStatus) IsKnown() bool

type RoutingDetail

type RoutingDetail struct {
	ID          string                   `json:"id,required" format:"uuid"`
	BankAddress RoutingDetailBankAddress `json:"bank_address,required,nullable"`
	// The name of the bank.
	BankName    string    `json:"bank_name,required"`
	CreatedAt   time.Time `json:"created_at,required" format:"date-time"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// If the routing detail is to be used for a specific payment type this field will
	// be populated, otherwise null.
	PaymentType RoutingDetailPaymentType `json:"payment_type,required,nullable"`
	// The routing number of the bank.
	RoutingNumber string `json:"routing_number,required"`
	// The type of routing number. See
	// https://docs.moderntreasury.com/platform/reference/routing-detail-object for
	// more details.
	RoutingNumberType RoutingDetailRoutingNumberType `json:"routing_number_type,required"`
	UpdatedAt         time.Time                      `json:"updated_at,required" format:"date-time"`
	JSON              routingDetailJSON              `json:"-"`
}

func (*RoutingDetail) UnmarshalJSON

func (r *RoutingDetail) UnmarshalJSON(data []byte) (err error)

type RoutingDetailBankAddress

type RoutingDetailBankAddress struct {
	ID string `json:"id,required" format:"uuid"`
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country   string    `json:"country,required,nullable"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	Line1     string    `json:"line1,required,nullable"`
	Line2     string    `json:"line2,required,nullable"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Locality or City.
	Locality string `json:"locality,required,nullable"`
	Object   string `json:"object,required"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,required,nullable"`
	// Region or State.
	Region    string                       `json:"region,required,nullable"`
	UpdatedAt time.Time                    `json:"updated_at,required" format:"date-time"`
	JSON      routingDetailBankAddressJSON `json:"-"`
}

func (*RoutingDetailBankAddress) UnmarshalJSON

func (r *RoutingDetailBankAddress) UnmarshalJSON(data []byte) (err error)

type RoutingDetailDeleteParamsAccountsType

type RoutingDetailDeleteParamsAccountsType string
const (
	RoutingDetailDeleteParamsAccountsTypeExternalAccounts RoutingDetailDeleteParamsAccountsType = "external_accounts"
)

func (RoutingDetailDeleteParamsAccountsType) IsKnown added in v2.10.0

type RoutingDetailListParams

type RoutingDetailListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (RoutingDetailListParams) URLQuery

func (r RoutingDetailListParams) URLQuery() (v url.Values)

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

type RoutingDetailNewParams

type RoutingDetailNewParams struct {
	// The routing number of the bank.
	RoutingNumber param.Field[string] `json:"routing_number,required"`
	// The type of routing number. See
	// https://docs.moderntreasury.com/platform/reference/routing-detail-object for
	// more details.
	RoutingNumberType param.Field[RoutingDetailNewParamsRoutingNumberType] `json:"routing_number_type,required"`
	// If the routing detail is to be used for a specific payment type this field will
	// be populated, otherwise null.
	PaymentType param.Field[RoutingDetailNewParamsPaymentType] `json:"payment_type"`
}

func (RoutingDetailNewParams) MarshalJSON

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

type RoutingDetailNewParamsAccountsType

type RoutingDetailNewParamsAccountsType string
const (
	RoutingDetailNewParamsAccountsTypeExternalAccounts RoutingDetailNewParamsAccountsType = "external_accounts"
)

func (RoutingDetailNewParamsAccountsType) IsKnown added in v2.10.0

type RoutingDetailNewParamsPaymentType

type RoutingDetailNewParamsPaymentType string

If the routing detail is to be used for a specific payment type this field will be populated, otherwise null.

const (
	RoutingDetailNewParamsPaymentTypeACH         RoutingDetailNewParamsPaymentType = "ach"
	RoutingDetailNewParamsPaymentTypeAuBecs      RoutingDetailNewParamsPaymentType = "au_becs"
	RoutingDetailNewParamsPaymentTypeBacs        RoutingDetailNewParamsPaymentType = "bacs"
	RoutingDetailNewParamsPaymentTypeBook        RoutingDetailNewParamsPaymentType = "book"
	RoutingDetailNewParamsPaymentTypeCard        RoutingDetailNewParamsPaymentType = "card"
	RoutingDetailNewParamsPaymentTypeChats       RoutingDetailNewParamsPaymentType = "chats"
	RoutingDetailNewParamsPaymentTypeCheck       RoutingDetailNewParamsPaymentType = "check"
	RoutingDetailNewParamsPaymentTypeCrossBorder RoutingDetailNewParamsPaymentType = "cross_border"
	RoutingDetailNewParamsPaymentTypeDkNets      RoutingDetailNewParamsPaymentType = "dk_nets"
	RoutingDetailNewParamsPaymentTypeEft         RoutingDetailNewParamsPaymentType = "eft"
	RoutingDetailNewParamsPaymentTypeHuIcs       RoutingDetailNewParamsPaymentType = "hu_ics"
	RoutingDetailNewParamsPaymentTypeInterac     RoutingDetailNewParamsPaymentType = "interac"
	RoutingDetailNewParamsPaymentTypeMasav       RoutingDetailNewParamsPaymentType = "masav"
	RoutingDetailNewParamsPaymentTypeMxCcen      RoutingDetailNewParamsPaymentType = "mx_ccen"
	RoutingDetailNewParamsPaymentTypeNeft        RoutingDetailNewParamsPaymentType = "neft"
	RoutingDetailNewParamsPaymentTypeNics        RoutingDetailNewParamsPaymentType = "nics"
	RoutingDetailNewParamsPaymentTypeNzBecs      RoutingDetailNewParamsPaymentType = "nz_becs"
	RoutingDetailNewParamsPaymentTypePlElixir    RoutingDetailNewParamsPaymentType = "pl_elixir"
	RoutingDetailNewParamsPaymentTypeProvxchange RoutingDetailNewParamsPaymentType = "provxchange"
	RoutingDetailNewParamsPaymentTypeRoSent      RoutingDetailNewParamsPaymentType = "ro_sent"
	RoutingDetailNewParamsPaymentTypeRtp         RoutingDetailNewParamsPaymentType = "rtp"
	RoutingDetailNewParamsPaymentTypeSeBankgirot RoutingDetailNewParamsPaymentType = "se_bankgirot"
	RoutingDetailNewParamsPaymentTypeSen         RoutingDetailNewParamsPaymentType = "sen"
	RoutingDetailNewParamsPaymentTypeSepa        RoutingDetailNewParamsPaymentType = "sepa"
	RoutingDetailNewParamsPaymentTypeSgGiro      RoutingDetailNewParamsPaymentType = "sg_giro"
	RoutingDetailNewParamsPaymentTypeSic         RoutingDetailNewParamsPaymentType = "sic"
	RoutingDetailNewParamsPaymentTypeSignet      RoutingDetailNewParamsPaymentType = "signet"
	RoutingDetailNewParamsPaymentTypeSknbi       RoutingDetailNewParamsPaymentType = "sknbi"
	RoutingDetailNewParamsPaymentTypeWire        RoutingDetailNewParamsPaymentType = "wire"
	RoutingDetailNewParamsPaymentTypeZengin      RoutingDetailNewParamsPaymentType = "zengin"
)

func (RoutingDetailNewParamsPaymentType) IsKnown added in v2.10.0

type RoutingDetailNewParamsRoutingNumberType

type RoutingDetailNewParamsRoutingNumberType string

The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details.

const (
	RoutingDetailNewParamsRoutingNumberTypeAba                     RoutingDetailNewParamsRoutingNumberType = "aba"
	RoutingDetailNewParamsRoutingNumberTypeAuBsb                   RoutingDetailNewParamsRoutingNumberType = "au_bsb"
	RoutingDetailNewParamsRoutingNumberTypeBrCodigo                RoutingDetailNewParamsRoutingNumberType = "br_codigo"
	RoutingDetailNewParamsRoutingNumberTypeCaCpa                   RoutingDetailNewParamsRoutingNumberType = "ca_cpa"
	RoutingDetailNewParamsRoutingNumberTypeChips                   RoutingDetailNewParamsRoutingNumberType = "chips"
	RoutingDetailNewParamsRoutingNumberTypeCnaps                   RoutingDetailNewParamsRoutingNumberType = "cnaps"
	RoutingDetailNewParamsRoutingNumberTypeDkInterbankClearingCode RoutingDetailNewParamsRoutingNumberType = "dk_interbank_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeGBSortCode              RoutingDetailNewParamsRoutingNumberType = "gb_sort_code"
	RoutingDetailNewParamsRoutingNumberTypeHkInterbankClearingCode RoutingDetailNewParamsRoutingNumberType = "hk_interbank_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeHuInterbankClearingCode RoutingDetailNewParamsRoutingNumberType = "hu_interbank_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeIDSknbiCode             RoutingDetailNewParamsRoutingNumberType = "id_sknbi_code"
	RoutingDetailNewParamsRoutingNumberTypeInIfsc                  RoutingDetailNewParamsRoutingNumberType = "in_ifsc"
	RoutingDetailNewParamsRoutingNumberTypeJpZenginCode            RoutingDetailNewParamsRoutingNumberType = "jp_zengin_code"
	RoutingDetailNewParamsRoutingNumberTypeMxBankIdentifier        RoutingDetailNewParamsRoutingNumberType = "mx_bank_identifier"
	RoutingDetailNewParamsRoutingNumberTypeMyBranchCode            RoutingDetailNewParamsRoutingNumberType = "my_branch_code"
	RoutingDetailNewParamsRoutingNumberTypeNzNationalClearingCode  RoutingDetailNewParamsRoutingNumberType = "nz_national_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypePlNationalClearingCode  RoutingDetailNewParamsRoutingNumberType = "pl_national_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeSeBankgiroClearingCode  RoutingDetailNewParamsRoutingNumberType = "se_bankgiro_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeSwift                   RoutingDetailNewParamsRoutingNumberType = "swift"
	RoutingDetailNewParamsRoutingNumberTypeZaNationalClearingCode  RoutingDetailNewParamsRoutingNumberType = "za_national_clearing_code"
)

func (RoutingDetailNewParamsRoutingNumberType) IsKnown added in v2.10.0

type RoutingDetailPaymentType

type RoutingDetailPaymentType string

If the routing detail is to be used for a specific payment type this field will be populated, otherwise null.

const (
	RoutingDetailPaymentTypeACH         RoutingDetailPaymentType = "ach"
	RoutingDetailPaymentTypeAuBecs      RoutingDetailPaymentType = "au_becs"
	RoutingDetailPaymentTypeBacs        RoutingDetailPaymentType = "bacs"
	RoutingDetailPaymentTypeBook        RoutingDetailPaymentType = "book"
	RoutingDetailPaymentTypeCard        RoutingDetailPaymentType = "card"
	RoutingDetailPaymentTypeChats       RoutingDetailPaymentType = "chats"
	RoutingDetailPaymentTypeCheck       RoutingDetailPaymentType = "check"
	RoutingDetailPaymentTypeCrossBorder RoutingDetailPaymentType = "cross_border"
	RoutingDetailPaymentTypeDkNets      RoutingDetailPaymentType = "dk_nets"
	RoutingDetailPaymentTypeEft         RoutingDetailPaymentType = "eft"
	RoutingDetailPaymentTypeHuIcs       RoutingDetailPaymentType = "hu_ics"
	RoutingDetailPaymentTypeInterac     RoutingDetailPaymentType = "interac"
	RoutingDetailPaymentTypeMasav       RoutingDetailPaymentType = "masav"
	RoutingDetailPaymentTypeMxCcen      RoutingDetailPaymentType = "mx_ccen"
	RoutingDetailPaymentTypeNeft        RoutingDetailPaymentType = "neft"
	RoutingDetailPaymentTypeNics        RoutingDetailPaymentType = "nics"
	RoutingDetailPaymentTypeNzBecs      RoutingDetailPaymentType = "nz_becs"
	RoutingDetailPaymentTypePlElixir    RoutingDetailPaymentType = "pl_elixir"
	RoutingDetailPaymentTypeProvxchange RoutingDetailPaymentType = "provxchange"
	RoutingDetailPaymentTypeRoSent      RoutingDetailPaymentType = "ro_sent"
	RoutingDetailPaymentTypeRtp         RoutingDetailPaymentType = "rtp"
	RoutingDetailPaymentTypeSeBankgirot RoutingDetailPaymentType = "se_bankgirot"
	RoutingDetailPaymentTypeSen         RoutingDetailPaymentType = "sen"
	RoutingDetailPaymentTypeSepa        RoutingDetailPaymentType = "sepa"
	RoutingDetailPaymentTypeSgGiro      RoutingDetailPaymentType = "sg_giro"
	RoutingDetailPaymentTypeSic         RoutingDetailPaymentType = "sic"
	RoutingDetailPaymentTypeSignet      RoutingDetailPaymentType = "signet"
	RoutingDetailPaymentTypeSknbi       RoutingDetailPaymentType = "sknbi"
	RoutingDetailPaymentTypeWire        RoutingDetailPaymentType = "wire"
	RoutingDetailPaymentTypeZengin      RoutingDetailPaymentType = "zengin"
)

func (RoutingDetailPaymentType) IsKnown added in v2.10.0

func (r RoutingDetailPaymentType) IsKnown() bool

type RoutingDetailRoutingNumberType

type RoutingDetailRoutingNumberType string

The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details.

const (
	RoutingDetailRoutingNumberTypeAba                     RoutingDetailRoutingNumberType = "aba"
	RoutingDetailRoutingNumberTypeAuBsb                   RoutingDetailRoutingNumberType = "au_bsb"
	RoutingDetailRoutingNumberTypeBrCodigo                RoutingDetailRoutingNumberType = "br_codigo"
	RoutingDetailRoutingNumberTypeCaCpa                   RoutingDetailRoutingNumberType = "ca_cpa"
	RoutingDetailRoutingNumberTypeChips                   RoutingDetailRoutingNumberType = "chips"
	RoutingDetailRoutingNumberTypeCnaps                   RoutingDetailRoutingNumberType = "cnaps"
	RoutingDetailRoutingNumberTypeDkInterbankClearingCode RoutingDetailRoutingNumberType = "dk_interbank_clearing_code"
	RoutingDetailRoutingNumberTypeGBSortCode              RoutingDetailRoutingNumberType = "gb_sort_code"
	RoutingDetailRoutingNumberTypeHkInterbankClearingCode RoutingDetailRoutingNumberType = "hk_interbank_clearing_code"
	RoutingDetailRoutingNumberTypeHuInterbankClearingCode RoutingDetailRoutingNumberType = "hu_interbank_clearing_code"
	RoutingDetailRoutingNumberTypeIDSknbiCode             RoutingDetailRoutingNumberType = "id_sknbi_code"
	RoutingDetailRoutingNumberTypeInIfsc                  RoutingDetailRoutingNumberType = "in_ifsc"
	RoutingDetailRoutingNumberTypeJpZenginCode            RoutingDetailRoutingNumberType = "jp_zengin_code"
	RoutingDetailRoutingNumberTypeMxBankIdentifier        RoutingDetailRoutingNumberType = "mx_bank_identifier"
	RoutingDetailRoutingNumberTypeMyBranchCode            RoutingDetailRoutingNumberType = "my_branch_code"
	RoutingDetailRoutingNumberTypeNzNationalClearingCode  RoutingDetailRoutingNumberType = "nz_national_clearing_code"
	RoutingDetailRoutingNumberTypePlNationalClearingCode  RoutingDetailRoutingNumberType = "pl_national_clearing_code"
	RoutingDetailRoutingNumberTypeSeBankgiroClearingCode  RoutingDetailRoutingNumberType = "se_bankgiro_clearing_code"
	RoutingDetailRoutingNumberTypeSwift                   RoutingDetailRoutingNumberType = "swift"
	RoutingDetailRoutingNumberTypeZaNationalClearingCode  RoutingDetailRoutingNumberType = "za_national_clearing_code"
)

func (RoutingDetailRoutingNumberType) IsKnown added in v2.10.0

type RoutingDetailService

type RoutingDetailService struct {
	Options []option.RequestOption
}

RoutingDetailService contains methods and other services that help with interacting with the Modern Treasury 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 NewRoutingDetailService method instead.

func NewRoutingDetailService

func NewRoutingDetailService(opts ...option.RequestOption) (r *RoutingDetailService)

NewRoutingDetailService 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 (*RoutingDetailService) Delete

func (r *RoutingDetailService) Delete(ctx context.Context, accountsType RoutingDetailDeleteParamsAccountsType, accountID string, id string, opts ...option.RequestOption) (err error)

Delete a routing detail for a single external account.

func (*RoutingDetailService) Get

func (r *RoutingDetailService) Get(ctx context.Context, accountsType shared.AccountsType, accountID string, id string, opts ...option.RequestOption) (res *RoutingDetail, err error)

Get a single routing detail for a single internal or external account.

func (*RoutingDetailService) List

func (r *RoutingDetailService) List(ctx context.Context, accountsType shared.AccountsType, accountID string, query RoutingDetailListParams, opts ...option.RequestOption) (res *pagination.Page[RoutingDetail], err error)

Get a list of routing details for a single internal or external account.

func (*RoutingDetailService) ListAutoPaging

Get a list of routing details for a single internal or external account.

func (*RoutingDetailService) New

Create a routing detail for a single external account.

type RoutingNumberLookupRequest

type RoutingNumberLookupRequest struct {
	// The address of the bank.
	BankAddress RoutingNumberLookupRequestBankAddress `json:"bank_address"`
	// The name of the bank.
	BankName string `json:"bank_name"`
	// The routing number of the bank.
	RoutingNumber string `json:"routing_number"`
	// The type of routing number. See
	// https://docs.moderntreasury.com/platform/reference/routing-detail-object for
	// more details. In sandbox mode we currently only support `aba` and `swift` with
	// routing numbers '123456789' and 'GRINUST0XXX' respectively.
	RoutingNumberType RoutingNumberLookupRequestRoutingNumberType `json:"routing_number_type"`
	// An object containing key-value pairs, each with a sanctions list as the key and
	// a boolean value representing whether the bank is on that particular sanctions
	// list. Currently, this includes eu_con, uk_hmt, us_ofac, and un sanctions lists.
	Sanctions map[string]interface{} `json:"sanctions"`
	// An array of payment types that are supported for this routing number. This can
	// include `ach`, `wire`, `rtp`, `sepa`, `bacs`, `au_becs` currently.
	SupportedPaymentTypes []RoutingNumberLookupRequestSupportedPaymentType `json:"supported_payment_types"`
	JSON                  routingNumberLookupRequestJSON                   `json:"-"`
}

func (*RoutingNumberLookupRequest) UnmarshalJSON

func (r *RoutingNumberLookupRequest) UnmarshalJSON(data []byte) (err error)

type RoutingNumberLookupRequestBankAddress

type RoutingNumberLookupRequestBankAddress struct {
	// Country code conforms to [ISO 3166-1 alpha-2]
	Country string `json:"country,nullable"`
	Line1   string `json:"line1,nullable"`
	Line2   string `json:"line2,nullable"`
	// Locality or City.
	Locality string `json:"locality,nullable"`
	// The postal code of the address.
	PostalCode string `json:"postal_code,nullable"`
	// Region or State.
	Region string                                    `json:"region,nullable"`
	JSON   routingNumberLookupRequestBankAddressJSON `json:"-"`
}

The address of the bank.

func (*RoutingNumberLookupRequestBankAddress) UnmarshalJSON

func (r *RoutingNumberLookupRequestBankAddress) UnmarshalJSON(data []byte) (err error)

type RoutingNumberLookupRequestRoutingNumberType

type RoutingNumberLookupRequestRoutingNumberType string

The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details. In sandbox mode we currently only support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' respectively.

const (
	RoutingNumberLookupRequestRoutingNumberTypeAba                    RoutingNumberLookupRequestRoutingNumberType = "aba"
	RoutingNumberLookupRequestRoutingNumberTypeAuBsb                  RoutingNumberLookupRequestRoutingNumberType = "au_bsb"
	RoutingNumberLookupRequestRoutingNumberTypeCaCpa                  RoutingNumberLookupRequestRoutingNumberType = "ca_cpa"
	RoutingNumberLookupRequestRoutingNumberTypeGBSortCode             RoutingNumberLookupRequestRoutingNumberType = "gb_sort_code"
	RoutingNumberLookupRequestRoutingNumberTypeInIfsc                 RoutingNumberLookupRequestRoutingNumberType = "in_ifsc"
	RoutingNumberLookupRequestRoutingNumberTypeNzNationalClearingCode RoutingNumberLookupRequestRoutingNumberType = "nz_national_clearing_code"
	RoutingNumberLookupRequestRoutingNumberTypeSeBankgiroClearingCode RoutingNumberLookupRequestRoutingNumberType = "se_bankgiro_clearing_code"
	RoutingNumberLookupRequestRoutingNumberTypeSwift                  RoutingNumberLookupRequestRoutingNumberType = "swift"
)

func (RoutingNumberLookupRequestRoutingNumberType) IsKnown added in v2.10.0

type RoutingNumberLookupRequestSupportedPaymentType

type RoutingNumberLookupRequestSupportedPaymentType string
const (
	RoutingNumberLookupRequestSupportedPaymentTypeACH         RoutingNumberLookupRequestSupportedPaymentType = "ach"
	RoutingNumberLookupRequestSupportedPaymentTypeAuBecs      RoutingNumberLookupRequestSupportedPaymentType = "au_becs"
	RoutingNumberLookupRequestSupportedPaymentTypeBacs        RoutingNumberLookupRequestSupportedPaymentType = "bacs"
	RoutingNumberLookupRequestSupportedPaymentTypeBook        RoutingNumberLookupRequestSupportedPaymentType = "book"
	RoutingNumberLookupRequestSupportedPaymentTypeCard        RoutingNumberLookupRequestSupportedPaymentType = "card"
	RoutingNumberLookupRequestSupportedPaymentTypeChats       RoutingNumberLookupRequestSupportedPaymentType = "chats"
	RoutingNumberLookupRequestSupportedPaymentTypeCheck       RoutingNumberLookupRequestSupportedPaymentType = "check"
	RoutingNumberLookupRequestSupportedPaymentTypeCrossBorder RoutingNumberLookupRequestSupportedPaymentType = "cross_border"
	RoutingNumberLookupRequestSupportedPaymentTypeDkNets      RoutingNumberLookupRequestSupportedPaymentType = "dk_nets"
	RoutingNumberLookupRequestSupportedPaymentTypeEft         RoutingNumberLookupRequestSupportedPaymentType = "eft"
	RoutingNumberLookupRequestSupportedPaymentTypeHuIcs       RoutingNumberLookupRequestSupportedPaymentType = "hu_ics"
	RoutingNumberLookupRequestSupportedPaymentTypeInterac     RoutingNumberLookupRequestSupportedPaymentType = "interac"
	RoutingNumberLookupRequestSupportedPaymentTypeMasav       RoutingNumberLookupRequestSupportedPaymentType = "masav"
	RoutingNumberLookupRequestSupportedPaymentTypeMxCcen      RoutingNumberLookupRequestSupportedPaymentType = "mx_ccen"
	RoutingNumberLookupRequestSupportedPaymentTypeNeft        RoutingNumberLookupRequestSupportedPaymentType = "neft"
	RoutingNumberLookupRequestSupportedPaymentTypeNics        RoutingNumberLookupRequestSupportedPaymentType = "nics"
	RoutingNumberLookupRequestSupportedPaymentTypeNzBecs      RoutingNumberLookupRequestSupportedPaymentType = "nz_becs"
	RoutingNumberLookupRequestSupportedPaymentTypePlElixir    RoutingNumberLookupRequestSupportedPaymentType = "pl_elixir"
	RoutingNumberLookupRequestSupportedPaymentTypeProvxchange RoutingNumberLookupRequestSupportedPaymentType = "provxchange"
	RoutingNumberLookupRequestSupportedPaymentTypeRoSent      RoutingNumberLookupRequestSupportedPaymentType = "ro_sent"
	RoutingNumberLookupRequestSupportedPaymentTypeRtp         RoutingNumberLookupRequestSupportedPaymentType = "rtp"
	RoutingNumberLookupRequestSupportedPaymentTypeSeBankgirot RoutingNumberLookupRequestSupportedPaymentType = "se_bankgirot"
	RoutingNumberLookupRequestSupportedPaymentTypeSen         RoutingNumberLookupRequestSupportedPaymentType = "sen"
	RoutingNumberLookupRequestSupportedPaymentTypeSepa        RoutingNumberLookupRequestSupportedPaymentType = "sepa"
	RoutingNumberLookupRequestSupportedPaymentTypeSgGiro      RoutingNumberLookupRequestSupportedPaymentType = "sg_giro"
	RoutingNumberLookupRequestSupportedPaymentTypeSic         RoutingNumberLookupRequestSupportedPaymentType = "sic"
	RoutingNumberLookupRequestSupportedPaymentTypeSignet      RoutingNumberLookupRequestSupportedPaymentType = "signet"
	RoutingNumberLookupRequestSupportedPaymentTypeSknbi       RoutingNumberLookupRequestSupportedPaymentType = "sknbi"
	RoutingNumberLookupRequestSupportedPaymentTypeWire        RoutingNumberLookupRequestSupportedPaymentType = "wire"
	RoutingNumberLookupRequestSupportedPaymentTypeZengin      RoutingNumberLookupRequestSupportedPaymentType = "zengin"
)

func (RoutingNumberLookupRequestSupportedPaymentType) IsKnown added in v2.10.0

type Transaction

type Transaction struct {
	ID string `json:"id,required" format:"uuid"`
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount int64 `json:"amount,required"`
	// The date on which the transaction occurred.
	AsOfDate time.Time `json:"as_of_date,required,nullable" format:"date"`
	// The time on which the transaction occurred. Depending on the granularity of the
	// timestamp information received from the bank, it may be `null`.
	AsOfTime  string    `json:"as_of_time,required,nullable" format:"time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Currency that this transaction is denominated in.
	Currency shared.Currency `json:"currency,required"`
	// Either `credit` or `debit`.
	Direction   string    `json:"direction,required"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// Associated serialized foreign exchange rate information.
	ForeignExchangeRate TransactionForeignExchangeRate `json:"foreign_exchange_rate,required,nullable"`
	// The ID of the relevant Internal Account.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	Object   string            `json:"object,required"`
	// This field will be `true` if the transaction has posted to the account.
	Posted bool `json:"posted,required"`
	// This field will be `true` if a transaction is reconciled by the Modern Treasury
	// system. This means that it has transaction line items that sum up to the
	// transaction's amount.
	Reconciled bool `json:"reconciled,required"`
	// The type of the transaction. Examples could be
	// `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.
	Type      TransactionType `json:"type,required"`
	UpdatedAt time.Time       `json:"updated_at,required" format:"date-time"`
	// When applicable, the bank-given code that determines the transaction's category.
	// For most banks this is the BAI2/BTRS transaction code.
	VendorCode string `json:"vendor_code,required,nullable"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, `us_bank`, or others.
	VendorCodeType TransactionVendorCodeType `json:"vendor_code_type,required,nullable"`
	// An identifier given to this transaction by the bank, often `null`.
	VendorCustomerID string `json:"vendor_customer_id,required,nullable"`
	// An identifier given to this transaction by the bank.
	VendorID string `json:"vendor_id,required,nullable"`
	// This field contains additional information that the bank provided about the
	// transaction. This is structured data. Some of the data in here might overlap
	// with what is in the `vendor_description`. For example, the OBI could be a part
	// of the vendor description, and it would also be included in here. The attributes
	// that are passed through the details field will vary based on your banking
	// partner. Currently, the following keys may be in the details object:
	// `originator_name`, `originator_to_beneficiary_information`.
	Details map[string]string `json:"details"`
	// The transaction detail text that often appears in on your bank statement and in
	// your banking portal.
	VendorDescription string          `json:"vendor_description,nullable"`
	JSON              transactionJSON `json:"-"`
}

func (*Transaction) UnmarshalJSON

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

type TransactionDirection

type TransactionDirection = shared.TransactionDirection

This is an alias to an internal type.

type TransactionForeignExchangeRate added in v2.10.0

type TransactionForeignExchangeRate struct {
	// Amount in the lowest denomination of the `base_currency` to convert, often
	// called the "sell" amount.
	BaseAmount int64 `json:"base_amount,required"`
	// Currency to convert, often called the "sell" currency.
	BaseCurrency shared.Currency `json:"base_currency,required"`
	// The exponent component of the rate. The decimal is calculated as `value` / (10 ^
	// `exponent`).
	Exponent int64 `json:"exponent,required"`
	// A string representation of the rate.
	RateString string `json:"rate_string,required"`
	// Amount in the lowest denomination of the `target_currency`, often called the
	// "buy" amount.
	TargetAmount int64 `json:"target_amount,required"`
	// Currency to convert the `base_currency` to, often called the "buy" currency.
	TargetCurrency shared.Currency `json:"target_currency,required"`
	// The whole number component of the rate. The decimal is calculated as `value` /
	// (10 ^ `exponent`).
	Value int64                              `json:"value,required"`
	JSON  transactionForeignExchangeRateJSON `json:"-"`
}

Associated serialized foreign exchange rate information.

func (*TransactionForeignExchangeRate) UnmarshalJSON added in v2.10.0

func (r *TransactionForeignExchangeRate) UnmarshalJSON(data []byte) (err error)

type TransactionLineItem

type TransactionLineItem struct {
	ID string `json:"id,required" format:"uuid"`
	// If a matching object exists in Modern Treasury, `amount` will be populated.
	// Value in specified currency's smallest unit (taken from parent Transaction).
	Amount int64 `json:"amount,required"`
	// The ID for the counterparty for this transaction line item.
	CounterpartyID string    `json:"counterparty_id,required,nullable"`
	CreatedAt      time.Time `json:"created_at,required" format:"date-time"`
	// If no matching object is found, `description` will be a free-form text field
	// describing the line item. This field may contain personally identifiable
	// information (PII) and is not included in API responses by default. Learn more
	// about changing your settings at
	// https://docs.moderntreasury.com/reference/personally-identifiable-information.
	Description string    `json:"description,required"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The ID of the reconciled Expected Payment, otherwise `null`.
	ExpectedPaymentID string `json:"expected_payment_id,required,nullable"`
	// This field will be true if this object exists in the live environment, or false
	// if it exists in the test environment.
	LiveMode bool   `json:"live_mode,required"`
	Object   string `json:"object,required"`
	// Describes whether this line item should be counted towards the corresponding
	// transaction’s reconciliation.
	Reconcilable bool `json:"reconcilable,required"`
	// If a matching object exists in Modern Treasury, the ID will be populated here,
	// otherwise `null`.
	TransactableID string `json:"transactable_id,required,nullable"`
	// If a matching object exists in Modern Treasury, the type will be populated here,
	// otherwise `null`.
	TransactableType TransactionLineItemTransactableType `json:"transactable_type,required,nullable"`
	// The ID of the parent transaction.
	TransactionID string `json:"transaction_id,required"`
	// Indicates whether the line item is `originating` or `receiving` (see
	// https://www.moderntreasury.com/journal/beginners-guide-to-ach for more).
	Type      TransactionLineItemType `json:"type,required"`
	UpdatedAt time.Time               `json:"updated_at,required" format:"date-time"`
	JSON      transactionLineItemJSON `json:"-"`
}

func (*TransactionLineItem) UnmarshalJSON

func (r *TransactionLineItem) UnmarshalJSON(data []byte) (err error)

type TransactionLineItemListParams

type TransactionLineItemListParams struct {
	ID            param.Field[map[string]string]                 `query:"id"`
	AfterCursor   param.Field[string]                            `query:"after_cursor"`
	PerPage       param.Field[int64]                             `query:"per_page"`
	TransactionID param.Field[string]                            `query:"transaction_id"`
	Type          param.Field[TransactionLineItemListParamsType] `query:"type"`
}

func (TransactionLineItemListParams) URLQuery

func (r TransactionLineItemListParams) URLQuery() (v url.Values)

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

type TransactionLineItemListParamsType

type TransactionLineItemListParamsType string
const (
	TransactionLineItemListParamsTypeOriginating TransactionLineItemListParamsType = "originating"
	TransactionLineItemListParamsTypeReceiving   TransactionLineItemListParamsType = "receiving"
)

func (TransactionLineItemListParamsType) IsKnown added in v2.10.0

type TransactionLineItemNewParams added in v2.13.0

type TransactionLineItemNewParams struct {
	// If a matching object exists in Modern Treasury, `amount` will be populated.
	// Value in specified currency's smallest unit (taken from parent Transaction).
	Amount param.Field[int64] `json:"amount,required"`
	// The ID of the reconciled Expected Payment, otherwise `null`.
	ExpectedPaymentID param.Field[string] `json:"expected_payment_id,required" format:"uuid"`
	// The ID of the parent transaction.
	TransactionID param.Field[string] `json:"transaction_id,required" format:"uuid"`
}

func (TransactionLineItemNewParams) MarshalJSON added in v2.13.0

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

type TransactionLineItemService

type TransactionLineItemService struct {
	Options []option.RequestOption
}

TransactionLineItemService contains methods and other services that help with interacting with the Modern Treasury 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 NewTransactionLineItemService method instead.

func NewTransactionLineItemService

func NewTransactionLineItemService(opts ...option.RequestOption) (r *TransactionLineItemService)

NewTransactionLineItemService 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 (*TransactionLineItemService) Delete added in v2.13.0

func (r *TransactionLineItemService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

delete transaction line item

func (*TransactionLineItemService) Get

get transaction line item

func (*TransactionLineItemService) List

list transaction_line_items

func (*TransactionLineItemService) ListAutoPaging

list transaction_line_items

func (*TransactionLineItemService) New added in v2.13.0

create transaction line items

type TransactionLineItemTransactableType

type TransactionLineItemTransactableType string

If a matching object exists in Modern Treasury, the type will be populated here, otherwise `null`.

const (
	TransactionLineItemTransactableTypeIncomingPaymentDetail TransactionLineItemTransactableType = "incoming_payment_detail"
	TransactionLineItemTransactableTypePaperItem             TransactionLineItemTransactableType = "paper_item"
	TransactionLineItemTransactableTypePaymentOrder          TransactionLineItemTransactableType = "payment_order"
	TransactionLineItemTransactableTypePaymentOrderAttempt   TransactionLineItemTransactableType = "payment_order_attempt"
	TransactionLineItemTransactableTypeReturn                TransactionLineItemTransactableType = "return"
	TransactionLineItemTransactableTypeReversal              TransactionLineItemTransactableType = "reversal"
)

func (TransactionLineItemTransactableType) IsKnown added in v2.10.0

type TransactionLineItemType

type TransactionLineItemType string

Indicates whether the line item is `originating` or `receiving` (see https://www.moderntreasury.com/journal/beginners-guide-to-ach for more).

const (
	TransactionLineItemTypeOriginating TransactionLineItemType = "originating"
	TransactionLineItemTypeReceiving   TransactionLineItemType = "receiving"
)

func (TransactionLineItemType) IsKnown added in v2.10.0

func (r TransactionLineItemType) IsKnown() bool

type TransactionListParams

type TransactionListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// Filters transactions with an `as_of_date` starting on or before the specified
	// date (YYYY-MM-DD).
	AsOfDateEnd param.Field[time.Time] `query:"as_of_date_end" format:"date"`
	// Filters transactions with an `as_of_date` starting on or after the specified
	// date (YYYY-MM-DD).
	AsOfDateStart  param.Field[time.Time] `query:"as_of_date_start" format:"date"`
	CounterpartyID param.Field[string]    `query:"counterparty_id"`
	// Filters for transactions including the queried string in the description.
	Description param.Field[string] `query:"description"`
	Direction   param.Field[string] `query:"direction"`
	// Specify `internal_account_id` if you wish to see transactions to/from a specific
	// account.
	InternalAccountID param.Field[string] `query:"internal_account_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata    param.Field[map[string]string] `query:"metadata"`
	PaymentType param.Field[string]            `query:"payment_type"`
	PerPage     param.Field[int64]             `query:"per_page"`
	// Either `true` or `false`.
	Posted           param.Field[bool]   `query:"posted"`
	TransactableType param.Field[string] `query:"transactable_type"`
	// Filters for transactions including the queried vendor id (an identifier given to
	// transactions by the bank).
	VendorID         param.Field[string] `query:"vendor_id"`
	VirtualAccountID param.Field[string] `query:"virtual_account_id"`
}

func (TransactionListParams) URLQuery

func (r TransactionListParams) URLQuery() (v url.Values)

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

type TransactionNewParams added in v2.3.0

type TransactionNewParams struct {
	// Value in specified currency's smallest unit. e.g. $10 would be represented
	// as 1000.
	Amount param.Field[int64] `json:"amount,required"`
	// The date on which the transaction occurred.
	AsOfDate param.Field[time.Time] `json:"as_of_date,required" format:"date"`
	// Either `credit` or `debit`.
	Direction param.Field[string] `json:"direction,required"`
	// The ID of the relevant Internal Account.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// When applicable, the bank-given code that determines the transaction's category.
	// For most banks this is the BAI2/BTRS transaction code.
	VendorCode param.Field[string] `json:"vendor_code,required"`
	// The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`,
	// `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`,
	// `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`,
	// `swift`, `us_bank`, or others.
	VendorCodeType param.Field[string] `json:"vendor_code_type,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// This field will be `true` if the transaction has posted to the account.
	Posted param.Field[bool] `json:"posted"`
	// The type of the transaction. Examples could be
	// `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.
	Type param.Field[TransactionNewParamsType] `json:"type"`
	// The transaction detail text that often appears in on your bank statement and in
	// your banking portal.
	VendorDescription param.Field[string] `json:"vendor_description"`
}

func (TransactionNewParams) MarshalJSON added in v2.3.0

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

type TransactionNewParamsType added in v2.13.0

type TransactionNewParamsType string

The type of the transaction. Examples could be `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.

const (
	TransactionNewParamsTypeACH         TransactionNewParamsType = "ach"
	TransactionNewParamsTypeAuBecs      TransactionNewParamsType = "au_becs"
	TransactionNewParamsTypeBacs        TransactionNewParamsType = "bacs"
	TransactionNewParamsTypeBook        TransactionNewParamsType = "book"
	TransactionNewParamsTypeCard        TransactionNewParamsType = "card"
	TransactionNewParamsTypeChats       TransactionNewParamsType = "chats"
	TransactionNewParamsTypeCheck       TransactionNewParamsType = "check"
	TransactionNewParamsTypeCrossBorder TransactionNewParamsType = "cross_border"
	TransactionNewParamsTypeDkNets      TransactionNewParamsType = "dk_nets"
	TransactionNewParamsTypeEft         TransactionNewParamsType = "eft"
	TransactionNewParamsTypeHuIcs       TransactionNewParamsType = "hu_ics"
	TransactionNewParamsTypeInterac     TransactionNewParamsType = "interac"
	TransactionNewParamsTypeMasav       TransactionNewParamsType = "masav"
	TransactionNewParamsTypeMxCcen      TransactionNewParamsType = "mx_ccen"
	TransactionNewParamsTypeNeft        TransactionNewParamsType = "neft"
	TransactionNewParamsTypeNics        TransactionNewParamsType = "nics"
	TransactionNewParamsTypeNzBecs      TransactionNewParamsType = "nz_becs"
	TransactionNewParamsTypePlElixir    TransactionNewParamsType = "pl_elixir"
	TransactionNewParamsTypeProvxchange TransactionNewParamsType = "provxchange"
	TransactionNewParamsTypeRoSent      TransactionNewParamsType = "ro_sent"
	TransactionNewParamsTypeRtp         TransactionNewParamsType = "rtp"
	TransactionNewParamsTypeSeBankgirot TransactionNewParamsType = "se_bankgirot"
	TransactionNewParamsTypeSen         TransactionNewParamsType = "sen"
	TransactionNewParamsTypeSepa        TransactionNewParamsType = "sepa"
	TransactionNewParamsTypeSgGiro      TransactionNewParamsType = "sg_giro"
	TransactionNewParamsTypeSic         TransactionNewParamsType = "sic"
	TransactionNewParamsTypeSignet      TransactionNewParamsType = "signet"
	TransactionNewParamsTypeSknbi       TransactionNewParamsType = "sknbi"
	TransactionNewParamsTypeWire        TransactionNewParamsType = "wire"
	TransactionNewParamsTypeZengin      TransactionNewParamsType = "zengin"
	TransactionNewParamsTypeOther       TransactionNewParamsType = "other"
)

func (TransactionNewParamsType) IsKnown added in v2.13.0

func (r TransactionNewParamsType) IsKnown() bool

type TransactionService

type TransactionService struct {
	Options   []option.RequestOption
	LineItems *TransactionLineItemService
}

TransactionService contains methods and other services that help with interacting with the Modern Treasury 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) Delete added in v2.3.0

func (r *TransactionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

delete transaction

func (*TransactionService) Get

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

Get details on a single transaction.

func (*TransactionService) List

Get a list of all transactions.

func (*TransactionService) ListAutoPaging

Get a list of all transactions.

func (*TransactionService) New added in v2.3.0

create transaction

func (*TransactionService) Update

Update a single transaction.

type TransactionType

type TransactionType string

The type of the transaction. Examples could be `card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.

const (
	TransactionTypeACH         TransactionType = "ach"
	TransactionTypeAuBecs      TransactionType = "au_becs"
	TransactionTypeBacs        TransactionType = "bacs"
	TransactionTypeBook        TransactionType = "book"
	TransactionTypeCard        TransactionType = "card"
	TransactionTypeChats       TransactionType = "chats"
	TransactionTypeCheck       TransactionType = "check"
	TransactionTypeCrossBorder TransactionType = "cross_border"
	TransactionTypeDkNets      TransactionType = "dk_nets"
	TransactionTypeEft         TransactionType = "eft"
	TransactionTypeHuIcs       TransactionType = "hu_ics"
	TransactionTypeInterac     TransactionType = "interac"
	TransactionTypeMasav       TransactionType = "masav"
	TransactionTypeMxCcen      TransactionType = "mx_ccen"
	TransactionTypeNeft        TransactionType = "neft"
	TransactionTypeNics        TransactionType = "nics"
	TransactionTypeNzBecs      TransactionType = "nz_becs"
	TransactionTypePlElixir    TransactionType = "pl_elixir"
	TransactionTypeProvxchange TransactionType = "provxchange"
	TransactionTypeRoSent      TransactionType = "ro_sent"
	TransactionTypeRtp         TransactionType = "rtp"
	TransactionTypeSeBankgirot TransactionType = "se_bankgirot"
	TransactionTypeSen         TransactionType = "sen"
	TransactionTypeSepa        TransactionType = "sepa"
	TransactionTypeSgGiro      TransactionType = "sg_giro"
	TransactionTypeSic         TransactionType = "sic"
	TransactionTypeSignet      TransactionType = "signet"
	TransactionTypeSknbi       TransactionType = "sknbi"
	TransactionTypeWire        TransactionType = "wire"
	TransactionTypeZengin      TransactionType = "zengin"
	TransactionTypeOther       TransactionType = "other"
)

func (TransactionType) IsKnown added in v2.10.0

func (r TransactionType) IsKnown() bool

type TransactionUpdateParams

type TransactionUpdateParams struct {
	// Additional data in the form of key-value pairs. Pairs can be removed by passing
	// an empty string or `null` as the value.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (TransactionUpdateParams) MarshalJSON

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

type TransactionVendorCodeType

type TransactionVendorCodeType string

The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`, `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`, `swift`, `us_bank`, or others.

const (
	TransactionVendorCodeTypeBai2          TransactionVendorCodeType = "bai2"
	TransactionVendorCodeTypeBankprov      TransactionVendorCodeType = "bankprov"
	TransactionVendorCodeTypeBnkDev        TransactionVendorCodeType = "bnk_dev"
	TransactionVendorCodeTypeCleartouch    TransactionVendorCodeType = "cleartouch"
	TransactionVendorCodeTypeColumn        TransactionVendorCodeType = "column"
	TransactionVendorCodeTypeCrossRiver    TransactionVendorCodeType = "cross_river"
	TransactionVendorCodeTypeCurrencycloud TransactionVendorCodeType = "currencycloud"
	TransactionVendorCodeTypeDcBank        TransactionVendorCodeType = "dc_bank"
	TransactionVendorCodeTypeDwolla        TransactionVendorCodeType = "dwolla"
	TransactionVendorCodeTypeEvolve        TransactionVendorCodeType = "evolve"
	TransactionVendorCodeTypeGoldmanSachs  TransactionVendorCodeType = "goldman_sachs"
	TransactionVendorCodeTypeIso20022      TransactionVendorCodeType = "iso20022"
	TransactionVendorCodeTypeJpmc          TransactionVendorCodeType = "jpmc"
	TransactionVendorCodeTypeMx            TransactionVendorCodeType = "mx"
	TransactionVendorCodeTypePlaid         TransactionVendorCodeType = "plaid"
	TransactionVendorCodeTypePnc           TransactionVendorCodeType = "pnc"
	TransactionVendorCodeTypeRspecVendor   TransactionVendorCodeType = "rspec_vendor"
	TransactionVendorCodeTypeSignet        TransactionVendorCodeType = "signet"
	TransactionVendorCodeTypeSilvergate    TransactionVendorCodeType = "silvergate"
	TransactionVendorCodeTypeSwift         TransactionVendorCodeType = "swift"
	TransactionVendorCodeTypeUsBank        TransactionVendorCodeType = "us_bank"
	TransactionVendorCodeTypeUser          TransactionVendorCodeType = "user"
)

func (TransactionVendorCodeType) IsKnown added in v2.10.0

func (r TransactionVendorCodeType) IsKnown() bool

type ValidationService

type ValidationService struct {
	Options []option.RequestOption
}

ValidationService contains methods and other services that help with interacting with the Modern Treasury 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 NewValidationService method instead.

func NewValidationService

func NewValidationService(opts ...option.RequestOption) (r *ValidationService)

NewValidationService 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 (*ValidationService) ValidateRoutingNumber

Validates the routing number information supplied without creating a routing detail

type ValidationValidateRoutingNumberParams

type ValidationValidateRoutingNumberParams struct {
	// The routing number that is being validated.
	RoutingNumber param.Field[string] `query:"routing_number,required"`
	// The type of routing number. See
	// https://docs.moderntreasury.com/platform/reference/routing-detail-object for
	// more details. In sandbox mode we currently only support `aba` and `swift` with
	// routing numbers '123456789' and 'GRINUST0XXX' respectively.
	RoutingNumberType param.Field[ValidationValidateRoutingNumberParamsRoutingNumberType] `query:"routing_number_type,required"`
}

func (ValidationValidateRoutingNumberParams) URLQuery

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

type ValidationValidateRoutingNumberParamsRoutingNumberType

type ValidationValidateRoutingNumberParamsRoutingNumberType string

The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details. In sandbox mode we currently only support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' respectively.

const (
	ValidationValidateRoutingNumberParamsRoutingNumberTypeAba                     ValidationValidateRoutingNumberParamsRoutingNumberType = "aba"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeAuBsb                   ValidationValidateRoutingNumberParamsRoutingNumberType = "au_bsb"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeBrCodigo                ValidationValidateRoutingNumberParamsRoutingNumberType = "br_codigo"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeCaCpa                   ValidationValidateRoutingNumberParamsRoutingNumberType = "ca_cpa"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeChips                   ValidationValidateRoutingNumberParamsRoutingNumberType = "chips"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeCnaps                   ValidationValidateRoutingNumberParamsRoutingNumberType = "cnaps"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeDkInterbankClearingCode ValidationValidateRoutingNumberParamsRoutingNumberType = "dk_interbank_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeGBSortCode              ValidationValidateRoutingNumberParamsRoutingNumberType = "gb_sort_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeHkInterbankClearingCode ValidationValidateRoutingNumberParamsRoutingNumberType = "hk_interbank_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeHuInterbankClearingCode ValidationValidateRoutingNumberParamsRoutingNumberType = "hu_interbank_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeIDSknbiCode             ValidationValidateRoutingNumberParamsRoutingNumberType = "id_sknbi_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeInIfsc                  ValidationValidateRoutingNumberParamsRoutingNumberType = "in_ifsc"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeJpZenginCode            ValidationValidateRoutingNumberParamsRoutingNumberType = "jp_zengin_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeMxBankIdentifier        ValidationValidateRoutingNumberParamsRoutingNumberType = "mx_bank_identifier"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeMyBranchCode            ValidationValidateRoutingNumberParamsRoutingNumberType = "my_branch_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeNzNationalClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "nz_national_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypePlNationalClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "pl_national_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeSeBankgiroClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "se_bankgiro_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeSwift                   ValidationValidateRoutingNumberParamsRoutingNumberType = "swift"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeZaNationalClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "za_national_clearing_code"
)

func (ValidationValidateRoutingNumberParamsRoutingNumberType) IsKnown added in v2.10.0

type VirtualAccount

type VirtualAccount struct {
	ID string `json:"id,required" format:"uuid"`
	// An array of account detail objects.
	AccountDetails []AccountDetail `json:"account_details,required"`
	// The ID of a counterparty that the virtual account belongs to. Optional.
	CounterpartyID string    `json:"counterparty_id,required,nullable" format:"uuid"`
	CreatedAt      time.Time `json:"created_at,required" format:"date-time"`
	// The ID of a credit normal ledger account. When money enters the virtual account,
	// this ledger account will be credited. Must be accompanied by a
	// debit_ledger_account_id if present.
	CreditLedgerAccountID string `json:"credit_ledger_account_id,required,nullable" format:"uuid"`
	// The ID of a debit normal ledger account. When money enters the virtual account,
	// this ledger account will be debited. Must be accompanied by a
	// credit_ledger_account_id if present.
	DebitLedgerAccountID string `json:"debit_ledger_account_id,required,nullable" format:"uuid"`
	// An optional free-form description for internal use.
	Description string    `json:"description,required,nullable"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// The ID of the internal account that the virtual account is in.
	InternalAccountID string `json:"internal_account_id,required" format:"uuid"`
	// If the virtual account links to a ledger account in Modern Treasury, the id of
	// the ledger account will be populated here.
	LedgerAccountID string `json:"ledger_account_id,required,nullable" format:"uuid"`
	// This field will be true if this object exists in the live environment or false
	// if it exists in the test environment.
	LiveMode bool `json:"live_mode,required"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata map[string]string `json:"metadata,required"`
	// The name of the virtual account.
	Name   string `json:"name,required"`
	Object string `json:"object,required"`
	// An array of routing detail objects. These will be the routing details of the
	// internal account.
	RoutingDetails []RoutingDetail    `json:"routing_details,required"`
	UpdatedAt      time.Time          `json:"updated_at,required" format:"date-time"`
	JSON           virtualAccountJSON `json:"-"`
}

func (*VirtualAccount) UnmarshalJSON

func (r *VirtualAccount) UnmarshalJSON(data []byte) (err error)

type VirtualAccountListParams

type VirtualAccountListParams struct {
	AfterCursor       param.Field[string] `query:"after_cursor"`
	CounterpartyID    param.Field[string] `query:"counterparty_id"`
	InternalAccountID param.Field[string] `query:"internal_account_id"`
	// For example, if you want to query for records with metadata key `Type` and value
	// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
	// parameters.
	Metadata param.Field[map[string]string] `query:"metadata"`
	PerPage  param.Field[int64]             `query:"per_page"`
}

func (VirtualAccountListParams) URLQuery

func (r VirtualAccountListParams) URLQuery() (v url.Values)

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

type VirtualAccountNewParams

type VirtualAccountNewParams struct {
	// The ID of the internal account that this virtual account is associated with.
	InternalAccountID param.Field[string] `json:"internal_account_id,required" format:"uuid"`
	// The name of the virtual account.
	Name param.Field[string] `json:"name,required"`
	// An array of account detail objects.
	AccountDetails param.Field[[]VirtualAccountNewParamsAccountDetail] `json:"account_details"`
	// The ID of the counterparty that the virtual account belongs to.
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// The ID of a credit normal ledger account. When money leaves the virtual account,
	// this ledger account will be credited. Must be accompanied by a
	// debit_ledger_account_id if present.
	CreditLedgerAccountID param.Field[string] `json:"credit_ledger_account_id" format:"uuid"`
	// The ID of a debit normal ledger account. When money enters the virtual account,
	// this ledger account will be debited. Must be accompanied by a
	// credit_ledger_account_id if present.
	DebitLedgerAccountID param.Field[string] `json:"debit_ledger_account_id" format:"uuid"`
	// An optional description for internal use.
	Description param.Field[string] `json:"description"`
	// Specifies a ledger account object that will be created with the virtual account.
	// The resulting ledger account is linked to the virtual account for auto-ledgering
	// IPDs.
	LedgerAccount param.Field[VirtualAccountNewParamsLedgerAccount] `json:"ledger_account"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// An array of routing detail objects.
	RoutingDetails param.Field[[]VirtualAccountNewParamsRoutingDetail] `json:"routing_details"`
}

func (VirtualAccountNewParams) MarshalJSON

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

type VirtualAccountNewParamsAccountDetail

type VirtualAccountNewParamsAccountDetail struct {
	// The account number for the bank account.
	AccountNumber param.Field[string] `json:"account_number,required"`
	// One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank
	// account number is in a generic format.
	AccountNumberType param.Field[VirtualAccountNewParamsAccountDetailsAccountNumberType] `json:"account_number_type"`
}

func (VirtualAccountNewParamsAccountDetail) MarshalJSON

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

type VirtualAccountNewParamsAccountDetailsAccountNumberType

type VirtualAccountNewParamsAccountDetailsAccountNumberType string

One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format.

const (
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeAuNumber      VirtualAccountNewParamsAccountDetailsAccountNumberType = "au_number"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeClabe         VirtualAccountNewParamsAccountDetailsAccountNumberType = "clabe"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeHkNumber      VirtualAccountNewParamsAccountDetailsAccountNumberType = "hk_number"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeIban          VirtualAccountNewParamsAccountDetailsAccountNumberType = "iban"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeIDNumber      VirtualAccountNewParamsAccountDetailsAccountNumberType = "id_number"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeNzNumber      VirtualAccountNewParamsAccountDetailsAccountNumberType = "nz_number"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeOther         VirtualAccountNewParamsAccountDetailsAccountNumberType = "other"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypePan           VirtualAccountNewParamsAccountDetailsAccountNumberType = "pan"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeSgNumber      VirtualAccountNewParamsAccountDetailsAccountNumberType = "sg_number"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeWalletAddress VirtualAccountNewParamsAccountDetailsAccountNumberType = "wallet_address"
)

func (VirtualAccountNewParamsAccountDetailsAccountNumberType) IsKnown added in v2.10.0

type VirtualAccountNewParamsLedgerAccount added in v2.7.0

type VirtualAccountNewParamsLedgerAccount struct {
	// The currency of the ledger account.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the ledger that this account belongs to.
	LedgerID param.Field[string] `json:"ledger_id,required" format:"uuid"`
	// The name of the ledger account.
	Name param.Field[string] `json:"name,required"`
	// The normal balance of the ledger account.
	NormalBalance param.Field[shared.TransactionDirection] `json:"normal_balance,required"`
	// The currency exponent of the ledger account.
	CurrencyExponent param.Field[int64] `json:"currency_exponent"`
	// The description of the ledger account.
	Description param.Field[string] `json:"description"`
	// The array of ledger account category ids that this ledger account should be a
	// child of.
	LedgerAccountCategoryIDs param.Field[[]string] `json:"ledger_account_category_ids" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the id will be
	// populated here, otherwise null.
	LedgerableID param.Field[string] `json:"ledgerable_id" format:"uuid"`
	// If the ledger account links to another object in Modern Treasury, the type will
	// be populated here, otherwise null. The value is one of internal_account or
	// external_account.
	LedgerableType param.Field[VirtualAccountNewParamsLedgerAccountLedgerableType] `json:"ledgerable_type"`
	// Additional data represented as key-value pairs. Both the key and value must be
	// strings.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

Specifies a ledger account object that will be created with the virtual account. The resulting ledger account is linked to the virtual account for auto-ledgering IPDs.

func (VirtualAccountNewParamsLedgerAccount) MarshalJSON added in v2.7.0

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

type VirtualAccountNewParamsLedgerAccountLedgerableType added in v2.7.0

type VirtualAccountNewParamsLedgerAccountLedgerableType string

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.

const (
	VirtualAccountNewParamsLedgerAccountLedgerableTypeCounterparty    VirtualAccountNewParamsLedgerAccountLedgerableType = "counterparty"
	VirtualAccountNewParamsLedgerAccountLedgerableTypeExternalAccount VirtualAccountNewParamsLedgerAccountLedgerableType = "external_account"
	VirtualAccountNewParamsLedgerAccountLedgerableTypeInternalAccount VirtualAccountNewParamsLedgerAccountLedgerableType = "internal_account"
	VirtualAccountNewParamsLedgerAccountLedgerableTypeVirtualAccount  VirtualAccountNewParamsLedgerAccountLedgerableType = "virtual_account"
)

func (VirtualAccountNewParamsLedgerAccountLedgerableType) IsKnown added in v2.10.0

type VirtualAccountNewParamsRoutingDetail

type VirtualAccountNewParamsRoutingDetail struct {
	// The routing number of the bank.
	RoutingNumber param.Field[string] `json:"routing_number,required"`
	// The type of routing number. See
	// https://docs.moderntreasury.com/platform/reference/routing-detail-object for
	// more details.
	RoutingNumberType param.Field[VirtualAccountNewParamsRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	// If the routing detail is to be used for a specific payment type this field will
	// be populated, otherwise null.
	PaymentType param.Field[VirtualAccountNewParamsRoutingDetailsPaymentType] `json:"payment_type"`
}

func (VirtualAccountNewParamsRoutingDetail) MarshalJSON

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

type VirtualAccountNewParamsRoutingDetailsPaymentType

type VirtualAccountNewParamsRoutingDetailsPaymentType string

If the routing detail is to be used for a specific payment type this field will be populated, otherwise null.

const (
	VirtualAccountNewParamsRoutingDetailsPaymentTypeACH         VirtualAccountNewParamsRoutingDetailsPaymentType = "ach"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeAuBecs      VirtualAccountNewParamsRoutingDetailsPaymentType = "au_becs"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeBacs        VirtualAccountNewParamsRoutingDetailsPaymentType = "bacs"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeBook        VirtualAccountNewParamsRoutingDetailsPaymentType = "book"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeCard        VirtualAccountNewParamsRoutingDetailsPaymentType = "card"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeChats       VirtualAccountNewParamsRoutingDetailsPaymentType = "chats"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeCheck       VirtualAccountNewParamsRoutingDetailsPaymentType = "check"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeCrossBorder VirtualAccountNewParamsRoutingDetailsPaymentType = "cross_border"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeDkNets      VirtualAccountNewParamsRoutingDetailsPaymentType = "dk_nets"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeEft         VirtualAccountNewParamsRoutingDetailsPaymentType = "eft"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeHuIcs       VirtualAccountNewParamsRoutingDetailsPaymentType = "hu_ics"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeInterac     VirtualAccountNewParamsRoutingDetailsPaymentType = "interac"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeMasav       VirtualAccountNewParamsRoutingDetailsPaymentType = "masav"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeMxCcen      VirtualAccountNewParamsRoutingDetailsPaymentType = "mx_ccen"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNeft        VirtualAccountNewParamsRoutingDetailsPaymentType = "neft"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNics        VirtualAccountNewParamsRoutingDetailsPaymentType = "nics"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNzBecs      VirtualAccountNewParamsRoutingDetailsPaymentType = "nz_becs"
	VirtualAccountNewParamsRoutingDetailsPaymentTypePlElixir    VirtualAccountNewParamsRoutingDetailsPaymentType = "pl_elixir"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeProvxchange VirtualAccountNewParamsRoutingDetailsPaymentType = "provxchange"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeRoSent      VirtualAccountNewParamsRoutingDetailsPaymentType = "ro_sent"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeRtp         VirtualAccountNewParamsRoutingDetailsPaymentType = "rtp"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSeBankgirot VirtualAccountNewParamsRoutingDetailsPaymentType = "se_bankgirot"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSen         VirtualAccountNewParamsRoutingDetailsPaymentType = "sen"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSepa        VirtualAccountNewParamsRoutingDetailsPaymentType = "sepa"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSgGiro      VirtualAccountNewParamsRoutingDetailsPaymentType = "sg_giro"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSic         VirtualAccountNewParamsRoutingDetailsPaymentType = "sic"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSignet      VirtualAccountNewParamsRoutingDetailsPaymentType = "signet"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSknbi       VirtualAccountNewParamsRoutingDetailsPaymentType = "sknbi"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeWire        VirtualAccountNewParamsRoutingDetailsPaymentType = "wire"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeZengin      VirtualAccountNewParamsRoutingDetailsPaymentType = "zengin"
)

func (VirtualAccountNewParamsRoutingDetailsPaymentType) IsKnown added in v2.10.0

type VirtualAccountNewParamsRoutingDetailsRoutingNumberType

type VirtualAccountNewParamsRoutingDetailsRoutingNumberType string

The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details.

const (
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeAba                     VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "aba"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeAuBsb                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "au_bsb"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeBrCodigo                VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "br_codigo"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeCaCpa                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "ca_cpa"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeChips                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "chips"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeCnaps                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "cnaps"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeDkInterbankClearingCode VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeGBSortCode              VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "gb_sort_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeHkInterbankClearingCode VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeHuInterbankClearingCode VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "hu_interbank_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeIDSknbiCode             VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "id_sknbi_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeInIfsc                  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "in_ifsc"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeJpZenginCode            VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "jp_zengin_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeMxBankIdentifier        VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "mx_bank_identifier"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeMyBranchCode            VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "my_branch_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypePlNationalClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "pl_national_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeSwift                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "swift"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeZaNationalClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "za_national_clearing_code"
)

func (VirtualAccountNewParamsRoutingDetailsRoutingNumberType) IsKnown added in v2.10.0

type VirtualAccountService

type VirtualAccountService struct {
	Options []option.RequestOption
}

VirtualAccountService contains methods and other services that help with interacting with the Modern Treasury 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 NewVirtualAccountService method instead.

func NewVirtualAccountService

func NewVirtualAccountService(opts ...option.RequestOption) (r *VirtualAccountService)

NewVirtualAccountService 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 (*VirtualAccountService) Delete

func (r *VirtualAccountService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *VirtualAccount, err error)

delete virtual_account

func (*VirtualAccountService) Get

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

get virtual_account

func (*VirtualAccountService) List

Get a list of virtual accounts.

func (*VirtualAccountService) ListAutoPaging

Get a list of virtual accounts.

func (*VirtualAccountService) New

create virtual_account

func (*VirtualAccountService) Update

update virtual_account

type VirtualAccountUpdateParams

type VirtualAccountUpdateParams struct {
	CounterpartyID param.Field[string] `json:"counterparty_id" format:"uuid"`
	// The ledger account that you'd like to link to the virtual account.
	LedgerAccountID param.Field[string]            `json:"ledger_account_id" format:"uuid"`
	Metadata        param.Field[map[string]string] `json:"metadata"`
	Name            param.Field[string]            `json:"name"`
}

func (VirtualAccountUpdateParams) MarshalJSON

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

type WebhookGetSignatureParams

type WebhookGetSignatureParams struct {
}

type WebhookService

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the Modern Treasury 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 NewWebhookService method instead.

func NewWebhookService

func NewWebhookService(opts ...option.RequestOption) (r *WebhookService)

NewWebhookService 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 (*WebhookService) GetSignature

func (r *WebhookService) GetSignature(payload []byte, key string) (res string, err error)

To verify that a webhook was actually sent by Modern Treasury, every payload is signed with a signature that is passed through the `X-Signature` HTTP header.

This method will generate a signature based off of your webhook key which can be found in the Developer Settings, https://app.moderntreasury.com/developers/webhooks, and the webhook payload.

You can then compare the generated signature with the signature sent with the request, if they match then the webhook was sent by Modern Treasury.

func (*WebhookService) ValidateSignature

func (r *WebhookService) ValidateSignature(payload []byte, key string, headers http.Header) (res bool, err error)

Returns whether or not the webhook payload was sent by Modern Treasury.

type WebhookValidateSignatureParams

type WebhookValidateSignatureParams struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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