moderntreasury

package module
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 22 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.

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.3.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")
	)
	externalAccount, err := client.ExternalAccounts.New(context.TODO(), moderntreasury.ExternalAccountNewParams{
		CounterpartyID: moderntreasury.F("9eba513a-53fd-4d6d-ad52-ccce122ab92a"),
		Name:           moderntreasury.F("my bank"),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", externalAccount.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.ExternalAccounts.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The full list of request options is here.

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.ExternalAccounts.ListAutoPaging(context.TODO(), moderntreasury.ExternalAccountListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	externalAccount := iter.Current()
	fmt.Printf("%+v\n", externalAccount)
}
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.ExternalAccounts.List(context.TODO(), moderntreasury.ExternalAccountListParams{})
for page != nil {
	for _, externalAccount := range page.Items {
		fmt.Printf("%+v\n", externalAccount)
	}
	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.ExternalAccounts.List(
	ctx,
	moderntreasury.ExternalAccountListParams{
		PartyName: moderntreasury.F("my bank"),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)

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.ExternalAccounts.List(
	context.TODO(),
	moderntreasury.ExternalAccountListParams{},
	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 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 explciitly 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"
)

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"
)

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"
)

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"
)

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"
)

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 (
	AccountDetailAccountNumberTypeClabe         AccountDetailAccountNumberType = "clabe"
	AccountDetailAccountNumberTypeIban          AccountDetailAccountNumberType = "iban"
	AccountDetailAccountNumberTypeOther         AccountDetailAccountNumberType = "other"
	AccountDetailAccountNumberTypePan           AccountDetailAccountNumberType = "pan"
	AccountDetailAccountNumberTypeWalletAddress AccountDetailAccountNumberType = "wallet_address"
)

type AccountDetailDeleteParamsAccountsType

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

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 (
	AccountDetailNewParamsAccountNumberTypeClabe         AccountDetailNewParamsAccountNumberType = "clabe"
	AccountDetailNewParamsAccountNumberTypeIban          AccountDetailNewParamsAccountNumberType = "iban"
	AccountDetailNewParamsAccountNumberTypeOther         AccountDetailNewParamsAccountNumberType = "other"
	AccountDetailNewParamsAccountNumberTypePan           AccountDetailNewParamsAccountNumberType = "pan"
	AccountDetailNewParamsAccountNumberTypeWalletAddress AccountDetailNewParamsAccountNumberType = "wallet_address"
)

type AccountDetailNewParamsAccountsType

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

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 *shared.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,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"`
	// The code used by the bank when reporting this specific balance.
	VendorCode string `json:"vendor_code,required"`
	// The code used by the bank when reporting this specific balance.
	VendorCodeType BalanceReportBalancesVendorCodeType `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"
)

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"
)

type BalanceReportBalancesVendorCodeType

type BalanceReportBalancesVendorCodeType string

The code used by the bank when reporting this specific balance.

const (
	BalanceReportBalancesVendorCodeTypeBai2          BalanceReportBalancesVendorCodeType = "bai2"
	BalanceReportBalancesVendorCodeTypeBankprov      BalanceReportBalancesVendorCodeType = "bankprov"
	BalanceReportBalancesVendorCodeTypeBnkDev        BalanceReportBalancesVendorCodeType = "bnk_dev"
	BalanceReportBalancesVendorCodeTypeCleartouch    BalanceReportBalancesVendorCodeType = "cleartouch"
	BalanceReportBalancesVendorCodeTypeColumn        BalanceReportBalancesVendorCodeType = "column"
	BalanceReportBalancesVendorCodeTypeCrossRiver    BalanceReportBalancesVendorCodeType = "cross_river"
	BalanceReportBalancesVendorCodeTypeCurrencycloud BalanceReportBalancesVendorCodeType = "currencycloud"
	BalanceReportBalancesVendorCodeTypeDcBank        BalanceReportBalancesVendorCodeType = "dc_bank"
	BalanceReportBalancesVendorCodeTypeDwolla        BalanceReportBalancesVendorCodeType = "dwolla"
	BalanceReportBalancesVendorCodeTypeEvolve        BalanceReportBalancesVendorCodeType = "evolve"
	BalanceReportBalancesVendorCodeTypeGoldmanSachs  BalanceReportBalancesVendorCodeType = "goldman_sachs"
	BalanceReportBalancesVendorCodeTypeIso20022      BalanceReportBalancesVendorCodeType = "iso20022"
	BalanceReportBalancesVendorCodeTypeJpmc          BalanceReportBalancesVendorCodeType = "jpmc"
	BalanceReportBalancesVendorCodeTypeMx            BalanceReportBalancesVendorCodeType = "mx"
	BalanceReportBalancesVendorCodeTypePlaid         BalanceReportBalancesVendorCodeType = "plaid"
	BalanceReportBalancesVendorCodeTypeRspecVendor   BalanceReportBalancesVendorCodeType = "rspec_vendor"
	BalanceReportBalancesVendorCodeTypeSignet        BalanceReportBalancesVendorCodeType = "signet"
	BalanceReportBalancesVendorCodeTypeSilvergate    BalanceReportBalancesVendorCodeType = "silvergate"
	BalanceReportBalancesVendorCodeTypeSwift         BalanceReportBalancesVendorCodeType = "swift"
	BalanceReportBalancesVendorCodeTypeUsBank        BalanceReportBalancesVendorCodeType = "us_bank"
)

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"
)

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"
)

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"
)

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"
	BulkRequestListParamsResourceTypeExpectedPayment   BulkRequestListParamsResourceType = "expected_payment"
)

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"
)

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[[]BulkRequestNewParamsResource] `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) MarshalMultipart added in v2.3.0

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

type BulkRequestNewParamsActionType added in v2.3.0

type BulkRequestNewParamsActionType string

One of create, or update.

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

type BulkRequestNewParamsResourceExpectedPaymentUpdateRequestWithID added in v2.3.0

type BulkRequestNewParamsResourceExpectedPaymentUpdateRequestWithID 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[[]interface{}] `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 (BulkRequestNewParamsResourceExpectedPaymentUpdateRequestWithID) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourceLedgerTransactionUpdateRequestWithID added in v2.3.0

type BulkRequestNewParamsResourceLedgerTransactionUpdateRequestWithID 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[[]BulkRequestNewParamsResourcesObjectLedgerEntry] `json:"ledger_entries"`
	// 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[BulkRequestNewParamsResourcesObjectStatus] `json:"status"`
}

func (BulkRequestNewParamsResourceLedgerTransactionUpdateRequestWithID) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcePaymentOrderUpdateRequestWithID added in v2.3.0

type BulkRequestNewParamsResourcePaymentOrderUpdateRequestWithID struct {
	ID         param.Field[string]                                        `json:"id" format:"uuid"`
	Accounting param.Field[BulkRequestNewParamsResourcesObjectAccounting] `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[BulkRequestNewParamsResourcesObjectChargeBearer] `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[BulkRequestNewParamsResourcesObjectDirection] `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[BulkRequestNewParamsResourcesObjectFallbackType] `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[BulkRequestNewParamsResourcesObjectForeignExchangeIndicator] `json:"foreign_exchange_indicator"`
	// An array of line items that must sum up to the amount of the payment order.
	LineItems param.Field[[]BulkRequestNewParamsResourcesObjectLineItem] `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[BulkRequestNewParamsResourcesObjectPriority] `json:"priority"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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[BulkRequestNewParamsResourcesObjectReceivingAccount] `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[BulkRequestNewParamsResourcesObjectStatus] `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 (BulkRequestNewParamsResourcePaymentOrderUpdateRequestWithID) MarshalJSON added in v2.3.0

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"
	BulkRequestNewParamsResourceTypeExpectedPayment   BulkRequestNewParamsResourceType = "expected_payment"
)

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"`
	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[[]interface{}] `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 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 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, 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, or reversal.

const (
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeCounterparty          BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "counterparty"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeInternalAccount       BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "internal_account"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeLineItem              BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "line_item"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypePaperItem             BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypePaymentOrderAttempt   BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "payment_order_attempt"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeReturn                BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "return"
	BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableTypeReversal              BulkRequestNewParamsResourcesLedgerTransactionCreateRequestLedgerableType = "reversal"
)

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"
)

type BulkRequestNewParamsResourcesObjectAccounting added in v2.3.0

type BulkRequestNewParamsResourcesObjectAccounting 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 (BulkRequestNewParamsResourcesObjectAccounting) MarshalJSON added in v2.3.0

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

type BulkRequestNewParamsResourcesObjectChargeBearer added in v2.3.0

type BulkRequestNewParamsResourcesObjectChargeBearer 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 (
	BulkRequestNewParamsResourcesObjectChargeBearerShared   BulkRequestNewParamsResourcesObjectChargeBearer = "shared"
	BulkRequestNewParamsResourcesObjectChargeBearerSender   BulkRequestNewParamsResourcesObjectChargeBearer = "sender"
	BulkRequestNewParamsResourcesObjectChargeBearerReceiver BulkRequestNewParamsResourcesObjectChargeBearer = "receiver"
)

type BulkRequestNewParamsResourcesObjectDirection added in v2.3.0

type BulkRequestNewParamsResourcesObjectDirection 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 (
	BulkRequestNewParamsResourcesObjectDirectionCredit BulkRequestNewParamsResourcesObjectDirection = "credit"
	BulkRequestNewParamsResourcesObjectDirectionDebit  BulkRequestNewParamsResourcesObjectDirection = "debit"
)

type BulkRequestNewParamsResourcesObjectFallbackType added in v2.3.0

type BulkRequestNewParamsResourcesObjectFallbackType 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 (
	BulkRequestNewParamsResourcesObjectFallbackTypeACH BulkRequestNewParamsResourcesObjectFallbackType = "ach"
)

type BulkRequestNewParamsResourcesObjectForeignExchangeIndicator added in v2.3.0

type BulkRequestNewParamsResourcesObjectForeignExchangeIndicator 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 (
	BulkRequestNewParamsResourcesObjectForeignExchangeIndicatorFixedToVariable BulkRequestNewParamsResourcesObjectForeignExchangeIndicator = "fixed_to_variable"
	BulkRequestNewParamsResourcesObjectForeignExchangeIndicatorVariableToFixed BulkRequestNewParamsResourcesObjectForeignExchangeIndicator = "variable_to_fixed"
)

type BulkRequestNewParamsResourcesObjectLedgerEntry added in v2.3.0

type BulkRequestNewParamsResourcesObjectLedgerEntry 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 (BulkRequestNewParamsResourcesObjectLedgerEntry) MarshalJSON added in v2.3.0

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

type BulkRequestNewParamsResourcesObjectLineItem added in v2.3.0

type BulkRequestNewParamsResourcesObjectLineItem 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 (BulkRequestNewParamsResourcesObjectLineItem) MarshalJSON added in v2.3.0

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

type BulkRequestNewParamsResourcesObjectPriority added in v2.3.0

type BulkRequestNewParamsResourcesObjectPriority 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 (
	BulkRequestNewParamsResourcesObjectPriorityHigh   BulkRequestNewParamsResourcesObjectPriority = "high"
	BulkRequestNewParamsResourcesObjectPriorityNormal BulkRequestNewParamsResourcesObjectPriority = "normal"
)

type BulkRequestNewParamsResourcesObjectReceivingAccount added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccount struct {
	AccountDetails param.Field[[]BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                                `json:"account_type"`
	ContactDetails param.Field[[]BulkRequestNewParamsResourcesObjectReceivingAccountContactDetail] `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[BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccount] `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[BulkRequestNewParamsResourcesObjectReceivingAccountPartyAddress] `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[BulkRequestNewParamsResourcesObjectReceivingAccountPartyType] `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[[]BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetail] `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 (BulkRequestNewParamsResourcesObjectReceivingAccount) MarshalJSON added in v2.3.0

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

type BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetail added in v2.3.0

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

func (BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType string
const (
	BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberTypeIban          BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType = "iban"
	BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberTypeClabe         BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType = "clabe"
	BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberTypeWalletAddress BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
	BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberTypePan           BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType = "pan"
	BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberTypeOther         BulkRequestNewParamsResourcesObjectReceivingAccountAccountDetailsAccountNumberType = "other"
)

type BulkRequestNewParamsResourcesObjectReceivingAccountContactDetail added in v2.3.0

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

func (BulkRequestNewParamsResourcesObjectReceivingAccountContactDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierType string
const (
	BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierTypeEmail       BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierType = "email"
	BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierTypePhoneNumber BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierTypeWebsite     BulkRequestNewParamsResourcesObjectReceivingAccountContactDetailsContactIdentifierType = "website"
)

type BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccount added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccount 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"`
	// 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[BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableType] `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 (BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccount) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableType 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 (
	BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableTypeExternalAccount BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableType = "external_account"
	BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableTypeInternalAccount BulkRequestNewParamsResourcesObjectReceivingAccountLedgerAccountLedgerableType = "internal_account"
)

type BulkRequestNewParamsResourcesObjectReceivingAccountPartyAddress added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountPartyAddress 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 (BulkRequestNewParamsResourcesObjectReceivingAccountPartyAddress) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountPartyType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountPartyType string

Either `individual` or `business`.

const (
	BulkRequestNewParamsResourcesObjectReceivingAccountPartyTypeBusiness   BulkRequestNewParamsResourcesObjectReceivingAccountPartyType = "business"
	BulkRequestNewParamsResourcesObjectReceivingAccountPartyTypeIndividual BulkRequestNewParamsResourcesObjectReceivingAccountPartyType = "individual"
)

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetail added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                             `json:"routing_number,required"`
	RoutingNumberType param.Field[BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType string
const (
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeACH         BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "ach"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeAuBecs      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "au_becs"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeBacs        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "bacs"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeBook        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "book"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeCard        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "card"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeChats       BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "chats"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeCheck       BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "check"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeCrossBorder BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "cross_border"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeDkNets      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeEft         BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "eft"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeInterac     BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "interac"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeMasav       BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "masav"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeNeft        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "neft"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeNics        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "nics"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeNzBecs      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeProvxchange BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "provxchange"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeRtp         BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "rtp"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSgGiro      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSeBankgirot BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSen         BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "sen"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSepa        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "sepa"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSic         BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "sic"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeSignet      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "signet"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeWire        BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "wire"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentTypeZengin      BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsPaymentType = "zengin"
)

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType added in v2.3.0

type BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType string
const (
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeAba                     BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeChips                   BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            BulkRequestNewParamsResourcesObjectReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

type BulkRequestNewParamsResourcesObjectStatus added in v2.3.0

type BulkRequestNewParamsResourcesObjectStatus 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 (
	BulkRequestNewParamsResourcesObjectStatusApproved      BulkRequestNewParamsResourcesObjectStatus = "approved"
	BulkRequestNewParamsResourcesObjectStatusCancelled     BulkRequestNewParamsResourcesObjectStatus = "cancelled"
	BulkRequestNewParamsResourcesObjectStatusCompleted     BulkRequestNewParamsResourcesObjectStatus = "completed"
	BulkRequestNewParamsResourcesObjectStatusDenied        BulkRequestNewParamsResourcesObjectStatus = "denied"
	BulkRequestNewParamsResourcesObjectStatusFailed        BulkRequestNewParamsResourcesObjectStatus = "failed"
	BulkRequestNewParamsResourcesObjectStatusNeedsApproval BulkRequestNewParamsResourcesObjectStatus = "needs_approval"
	BulkRequestNewParamsResourcesObjectStatusPending       BulkRequestNewParamsResourcesObjectStatus = "pending"
	BulkRequestNewParamsResourcesObjectStatusProcessing    BulkRequestNewParamsResourcesObjectStatus = "processing"
	BulkRequestNewParamsResourcesObjectStatusReturned      BulkRequestNewParamsResourcesObjectStatus = "returned"
	BulkRequestNewParamsResourcesObjectStatusReversed      BulkRequestNewParamsResourcesObjectStatus = "reversed"
	BulkRequestNewParamsResourcesObjectStatusSent          BulkRequestNewParamsResourcesObjectStatus = "sent"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequest added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequest 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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirection] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestAccounting] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer] `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[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocument] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestFallbackType] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicator] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransaction] `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[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestLineItem] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriority] `json:"priority"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccount] `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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequest) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestAccounting added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestAccounting 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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestAccounting) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearerShared   BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer = "shared"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearerSender   BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer = "sender"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearerReceiver BulkRequestNewParamsResourcesPaymentOrderCreateRequestChargeBearer = "receiver"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirection added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirection 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirectionCredit BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirection = "credit"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirectionDebit  BulkRequestNewParamsResourcesPaymentOrderCreateRequestDirection = "debit"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocument added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocument struct {
	// The unique identifier for the associated object.
	DocumentableID   param.Field[string]                                                                          `json:"documentable_id,required"`
	DocumentableType param.Field[BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType] `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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocument) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType string
const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeCases                  BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "cases"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeCounterparties         BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "counterparties"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeExpectedPayments       BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "expected_payments"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeExternalAccounts       BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "external_accounts"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeIncomingPaymentDetails BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "incoming_payment_details"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeInternalAccounts       BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "internal_accounts"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeOrganizations          BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "organizations"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypePaperItems             BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "paper_items"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypePaymentOrders          BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "payment_orders"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeTransactions           BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "transactions"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeDecisions              BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "decisions"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableTypeConnections            BulkRequestNewParamsResourcesPaymentOrderCreateRequestDocumentsDocumentableType = "connections"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestFallbackType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestFallbackType 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestFallbackTypeACH BulkRequestNewParamsResourcesPaymentOrderCreateRequestFallbackType = "ach"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicator added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicator 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicatorFixedToVariable BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicator = "fixed_to_variable"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicatorVariableToFixed BulkRequestNewParamsResourcesPaymentOrderCreateRequestForeignExchangeIndicator = "variable_to_fixed"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransaction added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransaction struct {
	// An array of ledger entry objects.
	LedgerEntries param.Field[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerEntry] `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, or reversal.
	LedgerableType param.Field[BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus] `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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransaction) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerEntry added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerEntry 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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerEntry) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeCounterparty          BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "counterparty"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeExpectedPayment       BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "expected_payment"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeIncomingPaymentDetail BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "incoming_payment_detail"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeInternalAccount       BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "internal_account"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeLineItem              BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "line_item"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypePaperItem             BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "paper_item"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypePaymentOrder          BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "payment_order"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypePaymentOrderAttempt   BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "payment_order_attempt"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeReturn                BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "return"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableTypeReversal              BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionLedgerableType = "reversal"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus string

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

const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatusArchived BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus = "archived"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatusPending  BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus = "pending"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatusPosted   BulkRequestNewParamsResourcesPaymentOrderCreateRequestLedgerTransactionStatus = "posted"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLineItem added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestLineItem 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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestLineItem) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriority added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriority 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriorityHigh   BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriority = "high"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriorityNormal BulkRequestNewParamsResourcesPaymentOrderCreateRequestPriority = "normal"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccount added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccount struct {
	AccountDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetail] `json:"account_details"`
	// Can be `checking`, `savings` or `other`.
	AccountType    param.Field[ExternalAccountType]                                                                   `json:"account_type"`
	ContactDetails param.Field[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetail] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccount] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyAddress] `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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyType] `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[[]BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetail] `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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccount) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetail added in v2.3.0

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

func (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberTypeIban          BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType = "iban"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberTypeClabe         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType = "clabe"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberTypeWalletAddress BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberTypePan           BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType = "pan"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberTypeOther         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountAccountDetailsAccountNumberType = "other"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetail added in v2.3.0

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

func (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierType string
const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierTypeEmail       BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierType = "email"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierTypePhoneNumber BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierType = "phone_number"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierTypeWebsite     BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountContactDetailsContactIdentifierType = "website"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccount added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccount 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"`
	// 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[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableType] `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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccount) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableType 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 (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableTypeExternalAccount BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableType = "external_account"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableTypeInternalAccount BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountLedgerAccountLedgerableType = "internal_account"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyAddress added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyAddress 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 (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyAddress) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyType string

Either `individual` or `business`.

const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyTypeBusiness   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyType = "business"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyTypeIndividual BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountPartyType = "individual"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetail added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetail struct {
	RoutingNumber     param.Field[string]                                                                                                `json:"routing_number,required"`
	RoutingNumberType param.Field[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType] `json:"routing_number_type,required"`
	PaymentType       param.Field[BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType]       `json:"payment_type"`
}

func (BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetail) MarshalJSON added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType string
const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeACH         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "ach"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeAuBecs      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "au_becs"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeBacs        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "bacs"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeBook        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "book"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeCard        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "card"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeChats       BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "chats"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeCheck       BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "check"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeCrossBorder BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "cross_border"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeDkNets      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "dk_nets"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeEft         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "eft"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeInterac     BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "interac"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeMasav       BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "masav"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeNeft        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "neft"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeNics        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "nics"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeNzBecs      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeProvxchange BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "provxchange"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeRtp         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "rtp"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSgGiro      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSeBankgirot BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSen         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "sen"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSepa        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "sepa"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSic         BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "sic"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeSignet      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "signet"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeWire        BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "wire"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentTypeZengin      BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsPaymentType = "zengin"
)

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType added in v2.3.0

type BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType string
const (
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeAba                     BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeBrCodigo                BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "br_codigo"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeCaCpa                   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "ca_cpa"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeChips                   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "chips"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeCnaps                   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "cnaps"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeDkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "dk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeGBSortCode              BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "gb_sort_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeHkInterbankClearingCode BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "hk_interbank_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            BulkRequestNewParamsResourcesPaymentOrderCreateRequestReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"
	BulkRequestResourceTypeExpectedPayment   BulkRequestResourceType = "expected_payment"
)

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"
)

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 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 or BulkResultEntityBulkError.

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 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"
	BulkResultEntityTypeExpectedPayment   BulkResultEntityType = "expected_payment"
	BulkResultEntityTypeBulkError         BulkResultEntityType = "bulk_error"
)

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"
	BulkResultListParamsEntityTypeExpectedPayment   BulkResultListParamsEntityType = "expected_payment"
	BulkResultListParamsEntityTypeBulkError         BulkResultListParamsEntityType = "bulk_error"
)

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"
)

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"
)

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"
)

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"
)

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
	LedgerAccountPayouts         *LedgerAccountPayoutService
	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
}

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

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 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"`
	// 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"`
	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"
)

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"
)

type CounterpartyAccountsVerificationStatus

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

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 = "jp_zengin_code"
	CounterpartyCollectAccountParamsFieldSeBankgiroClearingCode CounterpartyCollectAccountParamsField = "se_bankgiro_clearing_code"
	CounterpartyCollectAccountParamsFieldNzNationalClearingCode CounterpartyCollectAccountParamsField = "nz_national_clearing_code"
)

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"`
	// 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"`
	// 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"
)

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 (
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeIban          CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "iban"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeClabe         CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "clabe"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeWalletAddress CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "wallet_address"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypePan           CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "pan"
	CounterpartyNewParamsAccountsAccountDetailsAccountNumberTypeOther         CounterpartyNewParamsAccountsAccountDetailsAccountNumberType = "other"
)

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"
)

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"`
	// 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 (
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeExternalAccount CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "external_account"
	CounterpartyNewParamsAccountsLedgerAccountLedgerableTypeInternalAccount CounterpartyNewParamsAccountsLedgerAccountLedgerableType = "internal_account"
)

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"
)

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"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeInterac     CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "interac"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeMasav       CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "masav"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNeft        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "neft"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNics        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "nics"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeNzBecs      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "nz_becs"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeProvxchange CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "provxchange"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeRtp         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "rtp"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSgGiro      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sg_giro"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSeBankgirot CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "se_bankgirot"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSen         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sen"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSepa        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sepa"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSic         CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "sic"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeSignet      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "signet"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeWire        CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "wire"
	CounterpartyNewParamsAccountsRoutingDetailsPaymentTypeZengin      CounterpartyNewParamsAccountsRoutingDetailsPaymentType = "zengin"
)

type CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType

type CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType string
const (
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeAba                     CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "aba"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeAuBsb                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "au_bsb"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	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"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeInIfsc                  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "in_ifsc"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeMyBranchCode            CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "my_branch_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeSwift                   CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "swift"
	CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberTypeJpZenginCode            CounterpartyNewParamsAccountsRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"
)

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"
)

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"`
	// 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"
)

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"
)

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"
)

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"
)

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

func (r *DocumentService) List(ctx context.Context, query DocumentListParams, opts ...option.RequestOption) (res *shared.Page[Document], err error)

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"`
	// 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 *shared.Page[Event], err error)

list events

func (*EventService) ListAutoPaging

func (r *EventService) ListAutoPaging(ctx context.Context, query EventListParams, opts ...option.RequestOption) *shared.PageAutoPager[Event]

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,nullable"`
	// 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 []interface{} `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, 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"
)

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"
	ExpectedPaymentListParamsTypeInterac     ExpectedPaymentListParamsType = "interac"
	ExpectedPaymentListParamsTypeMasav       ExpectedPaymentListParamsType = "masav"
	ExpectedPaymentListParamsTypeNeft        ExpectedPaymentListParamsType = "neft"
	ExpectedPaymentListParamsTypeNics        ExpectedPaymentListParamsType = "nics"
	ExpectedPaymentListParamsTypeNzBecs      ExpectedPaymentListParamsType = "nz_becs"
	ExpectedPaymentListParamsTypeProvxchange ExpectedPaymentListParamsType = "provxchange"
	ExpectedPaymentListParamsTypeRtp         ExpectedPaymentListParamsType = "rtp"
	ExpectedPaymentListParamsTypeSeBankgirot ExpectedPaymentListParamsType = "se_bankgirot"
	ExpectedPaymentListParamsTypeSen         ExpectedPaymentListParamsType = "sen"
	ExpectedPaymentListParamsTypeSepa        ExpectedPaymentListParamsType = "sepa"
	ExpectedPaymentListParamsTypeSgGiro      ExpectedPaymentListParamsType = "sg_giro"
	ExpectedPaymentListParamsTypeSic         ExpectedPaymentListParamsType = "sic"
	ExpectedPaymentListParamsTypeSignet      ExpectedPaymentListParamsType = "signet"
	ExpectedPaymentListParamsTypeWire        ExpectedPaymentListParamsType = "wire"
	ExpectedPaymentListParamsTypeZengin      ExpectedPaymentListParamsType = "zengin"
)

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"`
	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[[]interface{}] `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 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"
)

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, reconciled, or archived.

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

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"
	ExpectedPaymentTypeInterac     ExpectedPaymentType = "interac"
	ExpectedPaymentTypeMasav       ExpectedPaymentType = "masav"
	ExpectedPaymentTypeNeft        ExpectedPaymentType = "neft"
	ExpectedPaymentTypeNics        ExpectedPaymentType = "nics"
	ExpectedPaymentTypeNzBecs      ExpectedPaymentType = "nz_becs"
	ExpectedPaymentTypeProvxchange ExpectedPaymentType = "provxchange"
	ExpectedPaymentTypeRtp         ExpectedPaymentType = "rtp"
	ExpectedPaymentTypeSeBankgirot ExpectedPaymentType = "se_bankgirot"
	ExpectedPaymentTypeSen         ExpectedPaymentType = "sen"
	ExpectedPaymentTypeSepa        ExpectedPaymentType = "sepa"
	ExpectedPaymentTypeSgGiro      ExpectedPaymentType = "sg_giro"
	ExpectedPaymentTypeSic         ExpectedPaymentType = "sic"
	ExpectedPaymentTypeSignet      ExpectedPaymentType = "signet"
	ExpectedPaymentTypeWire        ExpectedPaymentType = "wire"
	ExpectedPaymentTypeZengin      ExpectedPaymentType = "zengin"
)

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[[]interface{}] `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 (ExpectedPaymentUpdateParams) MarshalJSON

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

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"`
	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"
)

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 (
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeIban          ExternalAccountNewParamsAccountDetailsAccountNumberType = "iban"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeClabe         ExternalAccountNewParamsAccountDetailsAccountNumberType = "clabe"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeWalletAddress ExternalAccountNewParamsAccountDetailsAccountNumberType = "wallet_address"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypePan           ExternalAccountNewParamsAccountDetailsAccountNumberType = "pan"
	ExternalAccountNewParamsAccountDetailsAccountNumberTypeOther         ExternalAccountNewParamsAccountDetailsAccountNumberType = "other"
)

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"
)

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"`
	// 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 (
	ExternalAccountNewParamsLedgerAccountLedgerableTypeExternalAccount ExternalAccountNewParamsLedgerAccountLedgerableType = "external_account"
	ExternalAccountNewParamsLedgerAccountLedgerableTypeInternalAccount ExternalAccountNewParamsLedgerAccountLedgerableType = "internal_account"
)

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"
)

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"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeInterac     ExternalAccountNewParamsRoutingDetailsPaymentType = "interac"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeMasav       ExternalAccountNewParamsRoutingDetailsPaymentType = "masav"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNeft        ExternalAccountNewParamsRoutingDetailsPaymentType = "neft"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNics        ExternalAccountNewParamsRoutingDetailsPaymentType = "nics"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeNzBecs      ExternalAccountNewParamsRoutingDetailsPaymentType = "nz_becs"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeProvxchange ExternalAccountNewParamsRoutingDetailsPaymentType = "provxchange"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeRtp         ExternalAccountNewParamsRoutingDetailsPaymentType = "rtp"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSgGiro      ExternalAccountNewParamsRoutingDetailsPaymentType = "sg_giro"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSeBankgirot ExternalAccountNewParamsRoutingDetailsPaymentType = "se_bankgirot"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSen         ExternalAccountNewParamsRoutingDetailsPaymentType = "sen"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSepa        ExternalAccountNewParamsRoutingDetailsPaymentType = "sepa"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSic         ExternalAccountNewParamsRoutingDetailsPaymentType = "sic"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeSignet      ExternalAccountNewParamsRoutingDetailsPaymentType = "signet"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeWire        ExternalAccountNewParamsRoutingDetailsPaymentType = "wire"
	ExternalAccountNewParamsRoutingDetailsPaymentTypeZengin      ExternalAccountNewParamsRoutingDetailsPaymentType = "zengin"
)

type ExternalAccountNewParamsRoutingDetailsRoutingNumberType

type ExternalAccountNewParamsRoutingDetailsRoutingNumberType string
const (
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeAba                     ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "aba"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeAuBsb                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "au_bsb"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	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"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeInIfsc                  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "in_ifsc"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeMyBranchCode            ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "my_branch_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeSwift                   ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "swift"
	ExternalAccountNewParamsRoutingDetailsRoutingNumberTypeJpZenginCode            ExternalAccountNewParamsRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"
)

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"
	ExternalAccountTypeLoan        ExternalAccountType = "loan"
	ExternalAccountTypeNonResident ExternalAccountType = "non_resident"
	ExternalAccountTypeOther       ExternalAccountType = "other"
	ExternalAccountTypeOverdraft   ExternalAccountType = "overdraft"
	ExternalAccountTypeSavings     ExternalAccountType = "savings"
)

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"
)

type ExternalAccountVerificationStatus

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

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"`
	// Both ach and eft are supported payment types.
	PaymentType param.Field[ExternalAccountVerifyParamsPaymentType] `json:"payment_type,required"`
	// Defaults to the currency of the originating account.
	Currency param.Field[shared.Currency] `json:"currency"`
}

func (ExternalAccountVerifyParams) MarshalJSON

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

type ExternalAccountVerifyParamsPaymentType

type ExternalAccountVerifyParamsPaymentType string

Both ach and eft are supported payment types.

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"
	ExternalAccountVerifyParamsPaymentTypeInterac     ExternalAccountVerifyParamsPaymentType = "interac"
	ExternalAccountVerifyParamsPaymentTypeMasav       ExternalAccountVerifyParamsPaymentType = "masav"
	ExternalAccountVerifyParamsPaymentTypeNeft        ExternalAccountVerifyParamsPaymentType = "neft"
	ExternalAccountVerifyParamsPaymentTypeNics        ExternalAccountVerifyParamsPaymentType = "nics"
	ExternalAccountVerifyParamsPaymentTypeNzBecs      ExternalAccountVerifyParamsPaymentType = "nz_becs"
	ExternalAccountVerifyParamsPaymentTypeProvxchange ExternalAccountVerifyParamsPaymentType = "provxchange"
	ExternalAccountVerifyParamsPaymentTypeRtp         ExternalAccountVerifyParamsPaymentType = "rtp"
	ExternalAccountVerifyParamsPaymentTypeSeBankgirot ExternalAccountVerifyParamsPaymentType = "se_bankgirot"
	ExternalAccountVerifyParamsPaymentTypeSen         ExternalAccountVerifyParamsPaymentType = "sen"
	ExternalAccountVerifyParamsPaymentTypeSepa        ExternalAccountVerifyParamsPaymentType = "sepa"
	ExternalAccountVerifyParamsPaymentTypeSgGiro      ExternalAccountVerifyParamsPaymentType = "sg_giro"
	ExternalAccountVerifyParamsPaymentTypeSic         ExternalAccountVerifyParamsPaymentType = "sic"
	ExternalAccountVerifyParamsPaymentTypeSignet      ExternalAccountVerifyParamsPaymentType = "signet"
	ExternalAccountVerifyParamsPaymentTypeWire        ExternalAccountVerifyParamsPaymentType = "wire"
	ExternalAccountVerifyParamsPaymentTypeZengin      ExternalAccountVerifyParamsPaymentType = "zengin"
)

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,nullable"`
	// 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"
)

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"
)

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"
)

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"
)

type IncomingPaymentDetailOriginatingAccountNumberType

type IncomingPaymentDetailOriginatingAccountNumberType string

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

const (
	IncomingPaymentDetailOriginatingAccountNumberTypeClabe         IncomingPaymentDetailOriginatingAccountNumberType = "clabe"
	IncomingPaymentDetailOriginatingAccountNumberTypeIban          IncomingPaymentDetailOriginatingAccountNumberType = "iban"
	IncomingPaymentDetailOriginatingAccountNumberTypeOther         IncomingPaymentDetailOriginatingAccountNumberType = "other"
	IncomingPaymentDetailOriginatingAccountNumberTypePan           IncomingPaymentDetailOriginatingAccountNumberType = "pan"
	IncomingPaymentDetailOriginatingAccountNumberTypeWalletAddress IncomingPaymentDetailOriginatingAccountNumberType = "wallet_address"
)

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"
	IncomingPaymentDetailOriginatingRoutingNumberTypeInIfsc                  IncomingPaymentDetailOriginatingRoutingNumberType = "in_ifsc"
	IncomingPaymentDetailOriginatingRoutingNumberTypeJpZenginCode            IncomingPaymentDetailOriginatingRoutingNumberType = "jp_zengin_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeMyBranchCode            IncomingPaymentDetailOriginatingRoutingNumberType = "my_branch_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeNzNationalClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "nz_national_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeSeBankgiroClearingCode  IncomingPaymentDetailOriginatingRoutingNumberType = "se_bankgiro_clearing_code"
	IncomingPaymentDetailOriginatingRoutingNumberTypeSwift                   IncomingPaymentDetailOriginatingRoutingNumberType = "swift"
)

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"
)

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"
)

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,nullable"`
	// 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"`
	// 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"
	InternalAccountAccountTypeLoan        InternalAccountAccountType = "loan"
	InternalAccountAccountTypeNonResident InternalAccountAccountType = "non_resident"
	InternalAccountAccountTypeOther       InternalAccountAccountType = "other"
	InternalAccountAccountTypeOverdraft   InternalAccountAccountType = "overdraft"
	InternalAccountAccountTypeSavings     InternalAccountAccountType = "savings"
)

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

type InternalAccountListParams

type InternalAccountListParams struct {
	AfterCursor param.Field[string] `query:"after_cursor"`
	// The counterparty associated with the internal account.
	CounterpartyID param.Field[string] `query:"counterparty_id"`
	// The currency associated with the internal account.
	Currency param.Field[shared.Currency] `query:"currency"`
	// 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"`
	// The direction of payments that can be made by internal account.
	PaymentDirection param.Field[shared.TransactionDirection] `query:"payment_direction"`
	// The type of payment that can be made by the internal account.
	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

The type of payment that can be made by the internal account.

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"
	InternalAccountListParamsPaymentTypeInterac     InternalAccountListParamsPaymentType = "interac"
	InternalAccountListParamsPaymentTypeMasav       InternalAccountListParamsPaymentType = "masav"
	InternalAccountListParamsPaymentTypeNeft        InternalAccountListParamsPaymentType = "neft"
	InternalAccountListParamsPaymentTypeNics        InternalAccountListParamsPaymentType = "nics"
	InternalAccountListParamsPaymentTypeNzBecs      InternalAccountListParamsPaymentType = "nz_becs"
	InternalAccountListParamsPaymentTypeProvxchange InternalAccountListParamsPaymentType = "provxchange"
	InternalAccountListParamsPaymentTypeRtp         InternalAccountListParamsPaymentType = "rtp"
	InternalAccountListParamsPaymentTypeSeBankgirot InternalAccountListParamsPaymentType = "se_bankgirot"
	InternalAccountListParamsPaymentTypeSen         InternalAccountListParamsPaymentType = "sen"
	InternalAccountListParamsPaymentTypeSepa        InternalAccountListParamsPaymentType = "sepa"
	InternalAccountListParamsPaymentTypeSgGiro      InternalAccountListParamsPaymentType = "sg_giro"
	InternalAccountListParamsPaymentTypeSic         InternalAccountListParamsPaymentType = "sic"
	InternalAccountListParamsPaymentTypeSignet      InternalAccountListParamsPaymentType = "signet"
	InternalAccountListParamsPaymentTypeWire        InternalAccountListParamsPaymentType = "wire"
	InternalAccountListParamsPaymentTypeZengin      InternalAccountListParamsPaymentType = "zengin"
)

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 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"
)

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"
)

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,nullable"`
	// 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"`
	// 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"`
	// 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"`
	// 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"`
	// 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"`
	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"
)

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"`
	// 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"`
	// 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"`
	// 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"`
	PerPage     param.Field[int64]  `query:"per_page"`
}

func (InvoiceListParams) URLQuery

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

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

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"`
	// The invoice issuer's business address.
	InvoicerAddress param.Field[InvoiceNewParamsInvoicerAddress] `json:"invoicer_address"`
	// 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[InvoiceNewParamsPaymentType] `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"`
	// The ID of the virtual account the invoice should be paid to.
	VirtualAccountID param.Field[string] `json:"virtual_account_id"`
}

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"
)

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 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"
)

type InvoiceNewParamsPaymentType

type InvoiceNewParamsPaymentType 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 (
	InvoiceNewParamsPaymentTypeACH         InvoiceNewParamsPaymentType = "ach"
	InvoiceNewParamsPaymentTypeAuBecs      InvoiceNewParamsPaymentType = "au_becs"
	InvoiceNewParamsPaymentTypeBacs        InvoiceNewParamsPaymentType = "bacs"
	InvoiceNewParamsPaymentTypeBook        InvoiceNewParamsPaymentType = "book"
	InvoiceNewParamsPaymentTypeCard        InvoiceNewParamsPaymentType = "card"
	InvoiceNewParamsPaymentTypeChats       InvoiceNewParamsPaymentType = "chats"
	InvoiceNewParamsPaymentTypeCheck       InvoiceNewParamsPaymentType = "check"
	InvoiceNewParamsPaymentTypeCrossBorder InvoiceNewParamsPaymentType = "cross_border"
	InvoiceNewParamsPaymentTypeDkNets      InvoiceNewParamsPaymentType = "dk_nets"
	InvoiceNewParamsPaymentTypeEft         InvoiceNewParamsPaymentType = "eft"
	InvoiceNewParamsPaymentTypeInterac     InvoiceNewParamsPaymentType = "interac"
	InvoiceNewParamsPaymentTypeMasav       InvoiceNewParamsPaymentType = "masav"
	InvoiceNewParamsPaymentTypeNeft        InvoiceNewParamsPaymentType = "neft"
	InvoiceNewParamsPaymentTypeNics        InvoiceNewParamsPaymentType = "nics"
	InvoiceNewParamsPaymentTypeNzBecs      InvoiceNewParamsPaymentType = "nz_becs"
	InvoiceNewParamsPaymentTypeProvxchange InvoiceNewParamsPaymentType = "provxchange"
	InvoiceNewParamsPaymentTypeRtp         InvoiceNewParamsPaymentType = "rtp"
	InvoiceNewParamsPaymentTypeSgGiro      InvoiceNewParamsPaymentType = "sg_giro"
	InvoiceNewParamsPaymentTypeSeBankgirot InvoiceNewParamsPaymentType = "se_bankgirot"
	InvoiceNewParamsPaymentTypeSen         InvoiceNewParamsPaymentType = "sen"
	InvoiceNewParamsPaymentTypeSepa        InvoiceNewParamsPaymentType = "sepa"
	InvoiceNewParamsPaymentTypeSic         InvoiceNewParamsPaymentType = "sic"
	InvoiceNewParamsPaymentTypeSignet      InvoiceNewParamsPaymentType = "signet"
	InvoiceNewParamsPaymentTypeWire        InvoiceNewParamsPaymentType = "wire"
	InvoiceNewParamsPaymentTypeZengin      InvoiceNewParamsPaymentType = "zengin"
)

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"
)

type InvoicePaymentType

type InvoicePaymentType string

One of `ach` or `eft`.

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

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 *shared.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"
)

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"`
	// The invoice issuer's business address.
	InvoicerAddress param.Field[InvoiceUpdateParamsInvoicerAddress] `json:"invoicer_address"`
	// 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[InvoiceUpdateParamsPaymentType] `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"`
	// 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"`
}

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"
)

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 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"
)

type InvoiceUpdateParamsPaymentType

type InvoiceUpdateParamsPaymentType 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 (
	InvoiceUpdateParamsPaymentTypeACH         InvoiceUpdateParamsPaymentType = "ach"
	InvoiceUpdateParamsPaymentTypeAuBecs      InvoiceUpdateParamsPaymentType = "au_becs"
	InvoiceUpdateParamsPaymentTypeBacs        InvoiceUpdateParamsPaymentType = "bacs"
	InvoiceUpdateParamsPaymentTypeBook        InvoiceUpdateParamsPaymentType = "book"
	InvoiceUpdateParamsPaymentTypeCard        InvoiceUpdateParamsPaymentType = "card"
	InvoiceUpdateParamsPaymentTypeChats       InvoiceUpdateParamsPaymentType = "chats"
	InvoiceUpdateParamsPaymentTypeCheck       InvoiceUpdateParamsPaymentType = "check"
	InvoiceUpdateParamsPaymentTypeCrossBorder InvoiceUpdateParamsPaymentType = "cross_border"
	InvoiceUpdateParamsPaymentTypeDkNets      InvoiceUpdateParamsPaymentType = "dk_nets"
	InvoiceUpdateParamsPaymentTypeEft         InvoiceUpdateParamsPaymentType = "eft"
	InvoiceUpdateParamsPaymentTypeInterac     InvoiceUpdateParamsPaymentType = "interac"
	InvoiceUpdateParamsPaymentTypeMasav       InvoiceUpdateParamsPaymentType = "masav"
	InvoiceUpdateParamsPaymentTypeNeft        InvoiceUpdateParamsPaymentType = "neft"
	InvoiceUpdateParamsPaymentTypeNics        InvoiceUpdateParamsPaymentType = "nics"
	InvoiceUpdateParamsPaymentTypeNzBecs      InvoiceUpdateParamsPaymentType = "nz_becs"
	InvoiceUpdateParamsPaymentTypeProvxchange InvoiceUpdateParamsPaymentType = "provxchange"
	InvoiceUpdateParamsPaymentTypeRtp         InvoiceUpdateParamsPaymentType = "rtp"
	InvoiceUpdateParamsPaymentTypeSgGiro      InvoiceUpdateParamsPaymentType = "sg_giro"
	InvoiceUpdateParamsPaymentTypeSeBankgirot InvoiceUpdateParamsPaymentType = "se_bankgirot"
	InvoiceUpdateParamsPaymentTypeSen         InvoiceUpdateParamsPaymentType = "sen"
	InvoiceUpdateParamsPaymentTypeSepa        InvoiceUpdateParamsPaymentType = "sepa"
	InvoiceUpdateParamsPaymentTypeSic         InvoiceUpdateParamsPaymentType = "sic"
	InvoiceUpdateParamsPaymentTypeSignet      InvoiceUpdateParamsPaymentType = "signet"
	InvoiceUpdateParamsPaymentTypeWire        InvoiceUpdateParamsPaymentType = "wire"
	InvoiceUpdateParamsPaymentTypeZengin      InvoiceUpdateParamsPaymentType = "zengin"
)

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"`
	// 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 (
	LedgerAccountLedgerableTypeExternalAccount LedgerAccountLedgerableType = "external_account"
	LedgerAccountLedgerableTypeInternalAccount LedgerAccountLedgerableType = "internal_account"
)

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"`
	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"`
	// 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 (
	LedgerAccountNewParamsLedgerableTypeExternalAccount LedgerAccountNewParamsLedgerableType = "external_account"
	LedgerAccountNewParamsLedgerableTypeInternalAccount LedgerAccountNewParamsLedgerableType = "internal_account"
)

type LedgerAccountPayout

type LedgerAccountPayout struct {
	ID string `json:"id,required" format:"uuid"`
	// The amount of the ledger account payout.
	Amount    int64     `json:"amount,required,nullable"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The currency of the ledger account payout.
	Currency string `json:"currency,required"`
	// The currency exponent of the ledger account payout.
	CurrencyExponent int64 `json:"currency_exponent,required,nullable"`
	// The description of the ledger account payout.
	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 payout. The default value is the created_at
	// timestamp of the ledger account payout.
	EffectiveAtUpperBound time.Time `json:"effective_at_upper_bound,required" format:"date-time"`
	// The id of the funding ledger account that sends to or receives funds from the
	// payout ledger account.
	FundingLedgerAccountID string `json:"funding_ledger_account_id,required" format:"uuid"`
	// The id of the ledger that this ledger account payout belongs to.
	LedgerID string `json:"ledger_id,required" format:"uuid"`
	// The id of the ledger transaction that this payout 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 direction of the ledger entry with the payout_ledger_account.
	PayoutEntryDirection string `json:"payout_entry_direction,required,nullable"`
	// The id of the payout ledger account whose ledger entries are queried against,
	// and its balance is reduced as a result.
	PayoutLedgerAccountID string `json:"payout_ledger_account_id,required" format:"uuid"`
	// The status of the ledger account payout. One of `processing`, `pending`,
	// `posted`, `archiving`, `archived`, `reversing` or `reversed`.
	Status    LedgerAccountPayoutStatus `json:"status,required"`
	UpdatedAt time.Time                 `json:"updated_at,required" format:"date-time"`
	JSON      ledgerAccountPayoutJSON   `json:"-"`
}

func (*LedgerAccountPayout) UnmarshalJSON

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

type LedgerAccountPayoutListParams

type LedgerAccountPayoutListParams 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"`
	PayoutEntryDirection  param.Field[string]            `query:"payout_entry_direction"`
	PayoutLedgerAccountID param.Field[string]            `query:"payout_ledger_account_id"`
	PerPage               param.Field[int64]             `query:"per_page"`
}

func (LedgerAccountPayoutListParams) URLQuery

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

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

type LedgerAccountPayoutNewParams

type LedgerAccountPayoutNewParams struct {
	// The id of the funding ledger account that sends to or receives funds from the
	// payout ledger account.
	FundingLedgerAccountID param.Field[string] `json:"funding_ledger_account_id,required" format:"uuid"`
	// The id of the payout ledger account whose ledger entries are queried against,
	// and its balance is reduced as a result.
	PayoutLedgerAccountID param.Field[string] `json:"payout_ledger_account_id,required" format:"uuid"`
	// If true, the payout amount and payout_entry_direction will bring the payout
	// 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 payout.
	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 payout. The default value is the created_at
	// timestamp of the ledger account payout.
	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 payouts.
	SkipPayoutLedgerTransaction param.Field[bool] `json:"skip_payout_ledger_transaction"`
	// The status of the ledger account payout. It is set to `pending` by default. To
	// post a ledger account payout at creation, use `posted`.
	Status param.Field[LedgerAccountPayoutNewParamsStatus] `json:"status"`
}

func (LedgerAccountPayoutNewParams) MarshalJSON

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

type LedgerAccountPayoutNewParamsStatus

type LedgerAccountPayoutNewParamsStatus string

The status of the ledger account payout. It is set to `pending` by default. To post a ledger account payout at creation, use `posted`.

const (
	LedgerAccountPayoutNewParamsStatusPending LedgerAccountPayoutNewParamsStatus = "pending"
	LedgerAccountPayoutNewParamsStatusPosted  LedgerAccountPayoutNewParamsStatus = "posted"
)

type LedgerAccountPayoutService

type LedgerAccountPayoutService struct {
	Options []option.RequestOption
}

LedgerAccountPayoutService 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 NewLedgerAccountPayoutService method instead.

func NewLedgerAccountPayoutService

func NewLedgerAccountPayoutService(opts ...option.RequestOption) (r *LedgerAccountPayoutService)

NewLedgerAccountPayoutService 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 (*LedgerAccountPayoutService) Get

Get details on a single ledger account payout.

func (*LedgerAccountPayoutService) List

Get a list of ledger account payouts.

func (*LedgerAccountPayoutService) ListAutoPaging

Get a list of ledger account payouts.

func (*LedgerAccountPayoutService) New

Create a ledger account payout.

func (*LedgerAccountPayoutService) Retireve deprecated

Get details on a single ledger account payout.

Deprecated: use `Get` instead

func (*LedgerAccountPayoutService) Update

Update the details of a ledger account payout.

type LedgerAccountPayoutStatus

type LedgerAccountPayoutStatus string

The status of the ledger account payout. One of `processing`, `pending`, `posted`, `archiving`, `archived`, `reversing` or `reversed`.

const (
	LedgerAccountPayoutStatusArchived   LedgerAccountPayoutStatus = "archived"
	LedgerAccountPayoutStatusArchiving  LedgerAccountPayoutStatus = "archiving"
	LedgerAccountPayoutStatusPending    LedgerAccountPayoutStatus = "pending"
	LedgerAccountPayoutStatusPosted     LedgerAccountPayoutStatus = "posted"
	LedgerAccountPayoutStatusProcessing LedgerAccountPayoutStatus = "processing"
	LedgerAccountPayoutStatusReversed   LedgerAccountPayoutStatus = "reversed"
	LedgerAccountPayoutStatusReversing  LedgerAccountPayoutStatus = "reversing"
)

type LedgerAccountPayoutUpdateParams

type LedgerAccountPayoutUpdateParams struct {
	// The description of the ledger account payout.
	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 payout, use `posted`. To archive a pending
	// ledger transaction, use `archived`.
	Status param.Field[LedgerAccountPayoutUpdateParamsStatus] `json:"status"`
}

func (LedgerAccountPayoutUpdateParams) MarshalJSON

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

type LedgerAccountPayoutUpdateParamsStatus

type LedgerAccountPayoutUpdateParamsStatus string

To post a pending ledger account payout, use `posted`. To archive a pending ledger transaction, use `archived`.

const (
	LedgerAccountPayoutUpdateParamsStatusPosted   LedgerAccountPayoutUpdateParamsStatus = "posted"
	LedgerAccountPayoutUpdateParamsStatusArchived LedgerAccountPayoutUpdateParamsStatus = "archived"
)

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 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"`
	// 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"
)

type LedgerEntryListParamsOrderByEffectiveAt

type LedgerEntryListParamsOrderByEffectiveAt string
const (
	LedgerEntryListParamsOrderByEffectiveAtAsc  LedgerEntryListParamsOrderByEffectiveAt = "asc"
	LedgerEntryListParamsOrderByEffectiveAtDesc LedgerEntryListParamsOrderByEffectiveAt = "desc"
)

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"
)

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.

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"
)

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 *shared.Page[Ledger], err error)

Get a list of ledgers.

func (*LedgerService) ListAutoPaging

func (r *LedgerService) ListAutoPaging(ctx context.Context, query LedgerListParams, opts ...option.RequestOption) *shared.PageAutoPager[Ledger]

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, 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 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, or reversal.

const (
	LedgerTransactionLedgerableTypeCounterparty          LedgerTransactionLedgerableType = "counterparty"
	LedgerTransactionLedgerableTypeExpectedPayment       LedgerTransactionLedgerableType = "expected_payment"
	LedgerTransactionLedgerableTypeIncomingPaymentDetail LedgerTransactionLedgerableType = "incoming_payment_detail"
	LedgerTransactionLedgerableTypeInternalAccount       LedgerTransactionLedgerableType = "internal_account"
	LedgerTransactionLedgerableTypeLineItem              LedgerTransactionLedgerableType = "line_item"
	LedgerTransactionLedgerableTypePaperItem             LedgerTransactionLedgerableType = "paper_item"
	LedgerTransactionLedgerableTypePaymentOrder          LedgerTransactionLedgerableType = "payment_order"
	LedgerTransactionLedgerableTypePaymentOrderAttempt   LedgerTransactionLedgerableType = "payment_order_attempt"
	LedgerTransactionLedgerableTypeReturn                LedgerTransactionLedgerableType = "return"
	LedgerTransactionLedgerableTypeReversal              LedgerTransactionLedgerableType = "reversal"
)

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"`
	LedgerAccountPayoutID   param.Field[string]                                    `query:"ledger_account_payout_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 (
	LedgerTransactionListParamsLedgerableTypeCounterparty          LedgerTransactionListParamsLedgerableType = "counterparty"
	LedgerTransactionListParamsLedgerableTypeExpectedPayment       LedgerTransactionListParamsLedgerableType = "expected_payment"
	LedgerTransactionListParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionListParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionListParamsLedgerableTypeInternalAccount       LedgerTransactionListParamsLedgerableType = "internal_account"
	LedgerTransactionListParamsLedgerableTypeLineItem              LedgerTransactionListParamsLedgerableType = "line_item"
	LedgerTransactionListParamsLedgerableTypePaperItem             LedgerTransactionListParamsLedgerableType = "paper_item"
	LedgerTransactionListParamsLedgerableTypePaymentOrder          LedgerTransactionListParamsLedgerableType = "payment_order"
	LedgerTransactionListParamsLedgerableTypePaymentOrderAttempt   LedgerTransactionListParamsLedgerableType = "payment_order_attempt"
	LedgerTransactionListParamsLedgerableTypeReturn                LedgerTransactionListParamsLedgerableType = "return"
	LedgerTransactionListParamsLedgerableTypeReversal              LedgerTransactionListParamsLedgerableType = "reversal"
)

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"
)

type LedgerTransactionListParamsOrderByEffectiveAt

type LedgerTransactionListParamsOrderByEffectiveAt string
const (
	LedgerTransactionListParamsOrderByEffectiveAtAsc  LedgerTransactionListParamsOrderByEffectiveAt = "asc"
	LedgerTransactionListParamsOrderByEffectiveAtDesc LedgerTransactionListParamsOrderByEffectiveAt = "desc"
)

type LedgerTransactionListParamsStatus

type LedgerTransactionListParamsStatus string
const (
	LedgerTransactionListParamsStatusPending  LedgerTransactionListParamsStatus = "pending"
	LedgerTransactionListParamsStatusPosted   LedgerTransactionListParamsStatus = "posted"
	LedgerTransactionListParamsStatusArchived LedgerTransactionListParamsStatus = "archived"
)

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, 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, or reversal.

const (
	LedgerTransactionNewParamsLedgerableTypeCounterparty          LedgerTransactionNewParamsLedgerableType = "counterparty"
	LedgerTransactionNewParamsLedgerableTypeExpectedPayment       LedgerTransactionNewParamsLedgerableType = "expected_payment"
	LedgerTransactionNewParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionNewParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionNewParamsLedgerableTypeInternalAccount       LedgerTransactionNewParamsLedgerableType = "internal_account"
	LedgerTransactionNewParamsLedgerableTypeLineItem              LedgerTransactionNewParamsLedgerableType = "line_item"
	LedgerTransactionNewParamsLedgerableTypePaperItem             LedgerTransactionNewParamsLedgerableType = "paper_item"
	LedgerTransactionNewParamsLedgerableTypePaymentOrder          LedgerTransactionNewParamsLedgerableType = "payment_order"
	LedgerTransactionNewParamsLedgerableTypePaymentOrderAttempt   LedgerTransactionNewParamsLedgerableType = "payment_order_attempt"
	LedgerTransactionNewParamsLedgerableTypeReturn                LedgerTransactionNewParamsLedgerableType = "return"
	LedgerTransactionNewParamsLedgerableTypeReversal              LedgerTransactionNewParamsLedgerableType = "reversal"
)

type LedgerTransactionNewParamsStatus

type LedgerTransactionNewParamsStatus string

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

const (
	LedgerTransactionNewParamsStatusArchived LedgerTransactionNewParamsStatus = "archived"
	LedgerTransactionNewParamsStatusPending  LedgerTransactionNewParamsStatus = "pending"
	LedgerTransactionNewParamsStatusPosted   LedgerTransactionNewParamsStatus = "posted"
)

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 (
	LedgerTransactionNewReversalParamsLedgerableTypeCounterparty          LedgerTransactionNewReversalParamsLedgerableType = "counterparty"
	LedgerTransactionNewReversalParamsLedgerableTypeExpectedPayment       LedgerTransactionNewReversalParamsLedgerableType = "expected_payment"
	LedgerTransactionNewReversalParamsLedgerableTypeIncomingPaymentDetail LedgerTransactionNewReversalParamsLedgerableType = "incoming_payment_detail"
	LedgerTransactionNewReversalParamsLedgerableTypeInternalAccount       LedgerTransactionNewReversalParamsLedgerableType = "internal_account"
	LedgerTransactionNewReversalParamsLedgerableTypeLineItem              LedgerTransactionNewReversalParamsLedgerableType = "line_item"
	LedgerTransactionNewReversalParamsLedgerableTypePaperItem             LedgerTransactionNewReversalParamsLedgerableType = "paper_item"
	LedgerTransactionNewReversalParamsLedgerableTypePaymentOrder          LedgerTransactionNewReversalParamsLedgerableType = "payment_order"
	LedgerTransactionNewReversalParamsLedgerableTypePaymentOrderAttempt   LedgerTransactionNewReversalParamsLedgerableType = "payment_order_attempt"
	LedgerTransactionNewReversalParamsLedgerableTypeReturn                LedgerTransactionNewReversalParamsLedgerableType = "return"
	LedgerTransactionNewReversalParamsLedgerableTypeReversal              LedgerTransactionNewReversalParamsLedgerableType = "reversal"
)

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"
)

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"
)

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"`
	// 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 LedgerTransactionUpdateParamsStatus

type LedgerTransactionUpdateParamsStatus string

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

const (
	LedgerTransactionUpdateParamsStatusArchived LedgerTransactionUpdateParamsStatus = "archived"
	LedgerTransactionUpdateParamsStatusPending  LedgerTransactionUpdateParamsStatus = "pending"
	LedgerTransactionUpdateParamsStatusPosted   LedgerTransactionUpdateParamsStatus = "posted"
)

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"`
	// 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"
)

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 (
	LedgerTransactionVersionLedgerableTypeCounterparty          LedgerTransactionVersionLedgerableType = "counterparty"
	LedgerTransactionVersionLedgerableTypeExpectedPayment       LedgerTransactionVersionLedgerableType = "expected_payment"
	LedgerTransactionVersionLedgerableTypeIncomingPaymentDetail LedgerTransactionVersionLedgerableType = "incoming_payment_detail"
	LedgerTransactionVersionLedgerableTypeInternalAccount       LedgerTransactionVersionLedgerableType = "internal_account"
	LedgerTransactionVersionLedgerableTypeLineItem              LedgerTransactionVersionLedgerableType = "line_item"
	LedgerTransactionVersionLedgerableTypePaperItem             LedgerTransactionVersionLedgerableType = "paper_item"
	LedgerTransactionVersionLedgerableTypePaymentOrder          LedgerTransactionVersionLedgerableType = "payment_order"
	LedgerTransactionVersionLedgerableTypePaymentOrderAttempt   LedgerTransactionVersionLedgerableType = "payment_order_attempt"
	LedgerTransactionVersionLedgerableTypeReturn                LedgerTransactionVersionLedgerableType = "return"
	LedgerTransactionVersionLedgerableTypeReversal              LedgerTransactionVersionLedgerableType = "reversal"
)

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"
)

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 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"
)

type LineItemItemizableType

type LineItemItemizableType string

One of `payment_orders` or `expected_payments`.

const (
	LineItemItemizableTypeExpectedPayment LineItemItemizableType = "ExpectedPayment"
	LineItemItemizableTypePaymentOrder    LineItemItemizableType = "PaymentOrder"
)

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"
)

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 *shared.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) *shared.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"
)

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,nullable"`
	// 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"
)

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"
)

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"
)

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"
)

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"
)

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"
)

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"
)

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,nullable"`
	// 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"`
	// 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"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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"`
	// This field will be populated if a vendor (e.g. Currencycloud) 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"
)

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"
)

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"
)

type PaymentOrderListParams

type PaymentOrderListParams struct {
	AfterCursor    param.Field[string]                      `query:"after_cursor"`
	CounterpartyID param.Field[string]                      `query:"counterparty_id"`
	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"`
	// 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"
)

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"
)

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"
	PaymentOrderListParamsTypeInterac     PaymentOrderListParamsType = "interac"
	PaymentOrderListParamsTypeMasav       PaymentOrderListParamsType = "masav"
	PaymentOrderListParamsTypeNeft        PaymentOrderListParamsType = "neft"
	PaymentOrderListParamsTypeNics        PaymentOrderListParamsType = "nics"
	PaymentOrderListParamsTypeNzBecs      PaymentOrderListParamsType = "nz_becs"
	PaymentOrderListParamsTypeProvxchange PaymentOrderListParamsType = "provxchange"
	PaymentOrderListParamsTypeRtp         PaymentOrderListParamsType = "rtp"
	PaymentOrderListParamsTypeSeBankgirot PaymentOrderListParamsType = "se_bankgirot"
	PaymentOrderListParamsTypeSen         PaymentOrderListParamsType = "sen"
	PaymentOrderListParamsTypeSepa        PaymentOrderListParamsType = "sepa"
	PaymentOrderListParamsTypeSgGiro      PaymentOrderListParamsType = "sg_giro"
	PaymentOrderListParamsTypeSic         PaymentOrderListParamsType = "sic"
	PaymentOrderListParamsTypeSignet      PaymentOrderListParamsType = "signet"
	PaymentOrderListParamsTypeWire        PaymentOrderListParamsType = "wire"
	PaymentOrderListParamsTypeZengin      PaymentOrderListParamsType = "zengin"
)

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"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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"
)

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"
)

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"
)

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"
)

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, 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, or reversal.

const (
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeCounterparty          PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "counterparty"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeInternalAccount       PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "internal_account"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeLineItem              PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "line_item"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypePaymentOrderAttempt   PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "payment_order_attempt"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderNewAsyncParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderNewAsyncParamsLedgerTransactionLedgerableType = "reversal"
)

type PaymentOrderNewAsyncParamsLedgerTransactionStatus

type PaymentOrderNewAsyncParamsLedgerTransactionStatus string

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

const (
	PaymentOrderNewAsyncParamsLedgerTransactionStatusArchived PaymentOrderNewAsyncParamsLedgerTransactionStatus = "archived"
	PaymentOrderNewAsyncParamsLedgerTransactionStatusPending  PaymentOrderNewAsyncParamsLedgerTransactionStatus = "pending"
	PaymentOrderNewAsyncParamsLedgerTransactionStatusPosted   PaymentOrderNewAsyncParamsLedgerTransactionStatus = "posted"
)

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"
)

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 (
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderNewAsyncParamsReceivingAccountAccountDetailsAccountNumberType = "other"
)

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"
)

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"`
	// 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 (
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderNewAsyncParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
)

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"
)

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"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	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"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderNewAsyncParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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"
)

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"
)

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"
)

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"
)

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"
)

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, 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, or reversal.

const (
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeCounterparty          PaymentOrderNewParamsLedgerTransactionLedgerableType = "counterparty"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderNewParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderNewParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeInternalAccount       PaymentOrderNewParamsLedgerTransactionLedgerableType = "internal_account"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeLineItem              PaymentOrderNewParamsLedgerTransactionLedgerableType = "line_item"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderNewParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderNewParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypePaymentOrderAttempt   PaymentOrderNewParamsLedgerTransactionLedgerableType = "payment_order_attempt"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderNewParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderNewParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderNewParamsLedgerTransactionLedgerableType = "reversal"
)

type PaymentOrderNewParamsLedgerTransactionStatus

type PaymentOrderNewParamsLedgerTransactionStatus string

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

const (
	PaymentOrderNewParamsLedgerTransactionStatusArchived PaymentOrderNewParamsLedgerTransactionStatus = "archived"
	PaymentOrderNewParamsLedgerTransactionStatusPending  PaymentOrderNewParamsLedgerTransactionStatus = "pending"
	PaymentOrderNewParamsLedgerTransactionStatusPosted   PaymentOrderNewParamsLedgerTransactionStatus = "posted"
)

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"
)

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 (
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderNewParamsReceivingAccountAccountDetailsAccountNumberType = "other"
)

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"
)

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"`
	// 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 (
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderNewParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
)

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"
)

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"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderNewParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

type PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	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"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderNewParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"
)

type PaymentOrderReceivingAccountType

type PaymentOrderReceivingAccountType string
const (
	PaymentOrderReceivingAccountTypeInternalAccount PaymentOrderReceivingAccountType = "internal_account"
	PaymentOrderReceivingAccountTypeExternalAccount PaymentOrderReceivingAccountType = "external_account"
)

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"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnFxQuoteID                         PaymentOrderReferenceNumbersReferenceNumberType = "column_fx_quote_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnReversalPairTransferID            PaymentOrderReferenceNumbersReferenceNumberType = "column_reversal_pair_transfer_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeColumnTransferID                        PaymentOrderReferenceNumbersReferenceNumberType = "column_transfer_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeCrossRiverPaymentID                     PaymentOrderReferenceNumbersReferenceNumberType = "cross_river_payment_id"
	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"
	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"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbTransactionClearedForSanctionsReview PaymentOrderReferenceNumbersReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	PaymentOrderReferenceNumbersReferenceNumberTypeSvbTransactionHeldForSanctionsReview    PaymentOrderReferenceNumbersReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	PaymentOrderReferenceNumbersReferenceNumberTypeSwiftMir                                PaymentOrderReferenceNumbersReferenceNumberType = "swift_mir"
	PaymentOrderReferenceNumbersReferenceNumberTypeSwiftUetr                               PaymentOrderReferenceNumbersReferenceNumberType = "swift_uetr"
	PaymentOrderReferenceNumbersReferenceNumberTypeUsbankPaymentID                         PaymentOrderReferenceNumbersReferenceNumberType = "usbank_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeWellsFargoPaymentID                     PaymentOrderReferenceNumbersReferenceNumberType = "wells_fargo_payment_id"
	PaymentOrderReferenceNumbersReferenceNumberTypeWellsFargoTraceNumber                   PaymentOrderReferenceNumbersReferenceNumberType = "wells_fargo_trace_number"
)

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, 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, or reversal.

const (
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeCounterparty          PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "counterparty"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeExpectedPayment       PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "expected_payment"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeIncomingPaymentDetail PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "incoming_payment_detail"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeInternalAccount       PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "internal_account"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeLineItem              PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "line_item"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypePaperItem             PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "paper_item"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypePaymentOrder          PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "payment_order"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypePaymentOrderAttempt   PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "payment_order_attempt"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeReturn                PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "return"
	PaymentOrderReversalNewParamsLedgerTransactionLedgerableTypeReversal              PaymentOrderReversalNewParamsLedgerTransactionLedgerableType = "reversal"
)

type PaymentOrderReversalNewParamsLedgerTransactionStatus

type PaymentOrderReversalNewParamsLedgerTransactionStatus string

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

const (
	PaymentOrderReversalNewParamsLedgerTransactionStatusArchived PaymentOrderReversalNewParamsLedgerTransactionStatus = "archived"
	PaymentOrderReversalNewParamsLedgerTransactionStatusPending  PaymentOrderReversalNewParamsLedgerTransactionStatus = "pending"
	PaymentOrderReversalNewParamsLedgerTransactionStatusPosted   PaymentOrderReversalNewParamsLedgerTransactionStatus = "posted"
)

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"
)

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"
)

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"
)

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"
	PaymentOrderTypeInterac     PaymentOrderType = "interac"
	PaymentOrderTypeMasav       PaymentOrderType = "masav"
	PaymentOrderTypeNeft        PaymentOrderType = "neft"
	PaymentOrderTypeNics        PaymentOrderType = "nics"
	PaymentOrderTypeNzBecs      PaymentOrderType = "nz_becs"
	PaymentOrderTypeProvxchange PaymentOrderType = "provxchange"
	PaymentOrderTypeRtp         PaymentOrderType = "rtp"
	PaymentOrderTypeSeBankgirot PaymentOrderType = "se_bankgirot"
	PaymentOrderTypeSen         PaymentOrderType = "sen"
	PaymentOrderTypeSepa        PaymentOrderType = "sepa"
	PaymentOrderTypeSgGiro      PaymentOrderType = "sg_giro"
	PaymentOrderTypeSic         PaymentOrderType = "sic"
	PaymentOrderTypeSignet      PaymentOrderType = "signet"
	PaymentOrderTypeWire        PaymentOrderType = "wire"
	PaymentOrderTypeZengin      PaymentOrderType = "zengin"
)

type PaymentOrderUltimateOriginatingAccount added in v2.1.0

type PaymentOrderUltimateOriginatingAccount 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 PaymentOrderUltimateOriginatingAccountType added in v2.1.0

type PaymentOrderUltimateOriginatingAccountType string
const (
	PaymentOrderUltimateOriginatingAccountTypeInternalAccount PaymentOrderUltimateOriginatingAccountType = "internal_account"
	PaymentOrderUltimateOriginatingAccountTypeVirtualAccount  PaymentOrderUltimateOriginatingAccountType = "virtual_account"
)

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"`
	// For `wire`, this is usually the purpose which is transmitted via the
	// "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
	// this is the `payment.purpose_code` field. 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"
)

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"
)

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"
)

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"
)

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"
)

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 (
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeIban          PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "iban"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeClabe         PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "clabe"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeWalletAddress PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "wallet_address"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypePan           PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "pan"
	PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberTypeOther         PaymentOrderUpdateParamsReceivingAccountAccountDetailsAccountNumberType = "other"
)

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"
)

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"`
	// 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 (
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeExternalAccount PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "external_account"
	PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableTypeInternalAccount PaymentOrderUpdateParamsReceivingAccountLedgerAccountLedgerableType = "internal_account"
)

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"
)

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"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeInterac     PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "interac"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeMasav       PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "masav"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNeft        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "neft"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNics        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "nics"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeNzBecs      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "nz_becs"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeProvxchange PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "provxchange"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeRtp         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "rtp"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSgGiro      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sg_giro"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSeBankgirot PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "se_bankgirot"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSen         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sen"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSepa        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sepa"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSic         PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "sic"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeSignet      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "signet"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeWire        PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "wire"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentTypeZengin      PaymentOrderUpdateParamsReceivingAccountRoutingDetailsPaymentType = "zengin"
)

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType

type PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType string
const (
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeAba                     PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "aba"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeAuBsb                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "au_bsb"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	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"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeInIfsc                  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "in_ifsc"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeMyBranchCode            PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "my_branch_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeNzNationalClearingCode  PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeSwift                   PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "swift"
	PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberTypeJpZenginCode            PaymentOrderUpdateParamsReceivingAccountRoutingDetailsRoutingNumberType = "jp_zengin_code"
)

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"
)

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"
)

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"
	PaymentReferenceReferenceNumberTypeColumnFxQuoteID                         PaymentReferenceReferenceNumberType = "column_fx_quote_id"
	PaymentReferenceReferenceNumberTypeColumnReversalPairTransferID            PaymentReferenceReferenceNumberType = "column_reversal_pair_transfer_id"
	PaymentReferenceReferenceNumberTypeColumnTransferID                        PaymentReferenceReferenceNumberType = "column_transfer_id"
	PaymentReferenceReferenceNumberTypeCrossRiverPaymentID                     PaymentReferenceReferenceNumberType = "cross_river_payment_id"
	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"
	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"
	PaymentReferenceReferenceNumberTypeSvbTransactionClearedForSanctionsReview PaymentReferenceReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	PaymentReferenceReferenceNumberTypeSvbTransactionHeldForSanctionsReview    PaymentReferenceReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	PaymentReferenceReferenceNumberTypeSwiftMir                                PaymentReferenceReferenceNumberType = "swift_mir"
	PaymentReferenceReferenceNumberTypeSwiftUetr                               PaymentReferenceReferenceNumberType = "swift_uetr"
	PaymentReferenceReferenceNumberTypeUsbankPaymentID                         PaymentReferenceReferenceNumberType = "usbank_payment_id"
	PaymentReferenceReferenceNumberTypeWellsFargoPaymentID                     PaymentReferenceReferenceNumberType = "wells_fargo_payment_id"
	PaymentReferenceReferenceNumberTypeWellsFargoTraceNumber                   PaymentReferenceReferenceNumberType = "wells_fargo_trace_number"
)

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"
)

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"
)

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"
	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"
)

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"
)

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,nullable"`
	// 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"
	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"
)

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"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnFxQuoteID                         ReturnObjectReferenceNumbersReferenceNumberType = "column_fx_quote_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnReversalPairTransferID            ReturnObjectReferenceNumbersReferenceNumberType = "column_reversal_pair_transfer_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeColumnTransferID                        ReturnObjectReferenceNumbersReferenceNumberType = "column_transfer_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeCrossRiverPaymentID                     ReturnObjectReferenceNumbersReferenceNumberType = "cross_river_payment_id"
	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"
	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"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbTransactionClearedForSanctionsReview ReturnObjectReferenceNumbersReferenceNumberType = "svb_transaction_cleared_for_sanctions_review"
	ReturnObjectReferenceNumbersReferenceNumberTypeSvbTransactionHeldForSanctionsReview    ReturnObjectReferenceNumbersReferenceNumberType = "svb_transaction_held_for_sanctions_review"
	ReturnObjectReferenceNumbersReferenceNumberTypeSwiftMir                                ReturnObjectReferenceNumbersReferenceNumberType = "swift_mir"
	ReturnObjectReferenceNumbersReferenceNumberTypeSwiftUetr                               ReturnObjectReferenceNumbersReferenceNumberType = "swift_uetr"
	ReturnObjectReferenceNumbersReferenceNumberTypeUsbankPaymentID                         ReturnObjectReferenceNumbersReferenceNumberType = "usbank_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeWellsFargoPaymentID                     ReturnObjectReferenceNumbersReferenceNumberType = "wells_fargo_payment_id"
	ReturnObjectReferenceNumbersReferenceNumberTypeWellsFargoTraceNumber                   ReturnObjectReferenceNumbersReferenceNumberType = "wells_fargo_trace_number"
)

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"
)

type ReturnObjectRole

type ReturnObjectRole string

The role of the return, can be `originating` or `receiving`.

const (
	ReturnObjectRoleOriginating ReturnObjectRole = "originating"
	ReturnObjectRoleReceiving   ReturnObjectRole = "receiving"
)

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"
)

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"
	ReturnObjectTypeEft       ReturnObjectType = "eft"
	ReturnObjectTypeInterac   ReturnObjectType = "interac"
	ReturnObjectTypeManual    ReturnObjectType = "manual"
	ReturnObjectTypePaperItem ReturnObjectType = "paper_item"
	ReturnObjectTypeSepa      ReturnObjectType = "sepa"
	ReturnObjectTypeWire      ReturnObjectType = "wire"
)

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

func (r *ReturnService) List(ctx context.Context, query ReturnListParams, opts ...option.RequestOption) (res *shared.Page[ReturnObject], err error)

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"`
	// 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"
)

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"
)

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"
)

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"
)

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"
	RoutingDetailNewParamsPaymentTypeInterac     RoutingDetailNewParamsPaymentType = "interac"
	RoutingDetailNewParamsPaymentTypeMasav       RoutingDetailNewParamsPaymentType = "masav"
	RoutingDetailNewParamsPaymentTypeNeft        RoutingDetailNewParamsPaymentType = "neft"
	RoutingDetailNewParamsPaymentTypeNics        RoutingDetailNewParamsPaymentType = "nics"
	RoutingDetailNewParamsPaymentTypeNzBecs      RoutingDetailNewParamsPaymentType = "nz_becs"
	RoutingDetailNewParamsPaymentTypeProvxchange RoutingDetailNewParamsPaymentType = "provxchange"
	RoutingDetailNewParamsPaymentTypeRtp         RoutingDetailNewParamsPaymentType = "rtp"
	RoutingDetailNewParamsPaymentTypeSeBankgirot RoutingDetailNewParamsPaymentType = "se_bankgirot"
	RoutingDetailNewParamsPaymentTypeSen         RoutingDetailNewParamsPaymentType = "sen"
	RoutingDetailNewParamsPaymentTypeSepa        RoutingDetailNewParamsPaymentType = "sepa"
	RoutingDetailNewParamsPaymentTypeSgGiro      RoutingDetailNewParamsPaymentType = "sg_giro"
	RoutingDetailNewParamsPaymentTypeSic         RoutingDetailNewParamsPaymentType = "sic"
	RoutingDetailNewParamsPaymentTypeSignet      RoutingDetailNewParamsPaymentType = "signet"
	RoutingDetailNewParamsPaymentTypeWire        RoutingDetailNewParamsPaymentType = "wire"
	RoutingDetailNewParamsPaymentTypeZengin      RoutingDetailNewParamsPaymentType = "zengin"
)

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"
	RoutingDetailNewParamsRoutingNumberTypeInIfsc                  RoutingDetailNewParamsRoutingNumberType = "in_ifsc"
	RoutingDetailNewParamsRoutingNumberTypeJpZenginCode            RoutingDetailNewParamsRoutingNumberType = "jp_zengin_code"
	RoutingDetailNewParamsRoutingNumberTypeMyBranchCode            RoutingDetailNewParamsRoutingNumberType = "my_branch_code"
	RoutingDetailNewParamsRoutingNumberTypeNzNationalClearingCode  RoutingDetailNewParamsRoutingNumberType = "nz_national_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeSeBankgiroClearingCode  RoutingDetailNewParamsRoutingNumberType = "se_bankgiro_clearing_code"
	RoutingDetailNewParamsRoutingNumberTypeSwift                   RoutingDetailNewParamsRoutingNumberType = "swift"
)

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"
	RoutingDetailPaymentTypeInterac     RoutingDetailPaymentType = "interac"
	RoutingDetailPaymentTypeMasav       RoutingDetailPaymentType = "masav"
	RoutingDetailPaymentTypeNeft        RoutingDetailPaymentType = "neft"
	RoutingDetailPaymentTypeNics        RoutingDetailPaymentType = "nics"
	RoutingDetailPaymentTypeNzBecs      RoutingDetailPaymentType = "nz_becs"
	RoutingDetailPaymentTypeProvxchange RoutingDetailPaymentType = "provxchange"
	RoutingDetailPaymentTypeRtp         RoutingDetailPaymentType = "rtp"
	RoutingDetailPaymentTypeSeBankgirot RoutingDetailPaymentType = "se_bankgirot"
	RoutingDetailPaymentTypeSen         RoutingDetailPaymentType = "sen"
	RoutingDetailPaymentTypeSepa        RoutingDetailPaymentType = "sepa"
	RoutingDetailPaymentTypeSgGiro      RoutingDetailPaymentType = "sg_giro"
	RoutingDetailPaymentTypeSic         RoutingDetailPaymentType = "sic"
	RoutingDetailPaymentTypeSignet      RoutingDetailPaymentType = "signet"
	RoutingDetailPaymentTypeWire        RoutingDetailPaymentType = "wire"
	RoutingDetailPaymentTypeZengin      RoutingDetailPaymentType = "zengin"
)

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"
	RoutingDetailRoutingNumberTypeInIfsc                  RoutingDetailRoutingNumberType = "in_ifsc"
	RoutingDetailRoutingNumberTypeJpZenginCode            RoutingDetailRoutingNumberType = "jp_zengin_code"
	RoutingDetailRoutingNumberTypeMyBranchCode            RoutingDetailRoutingNumberType = "my_branch_code"
	RoutingDetailRoutingNumberTypeNzNationalClearingCode  RoutingDetailRoutingNumberType = "nz_national_clearing_code"
	RoutingDetailRoutingNumberTypeSeBankgiroClearingCode  RoutingDetailRoutingNumberType = "se_bankgiro_clearing_code"
	RoutingDetailRoutingNumberTypeSwift                   RoutingDetailRoutingNumberType = "swift"
)

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 *shared.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"
)

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"
	RoutingNumberLookupRequestSupportedPaymentTypeInterac     RoutingNumberLookupRequestSupportedPaymentType = "interac"
	RoutingNumberLookupRequestSupportedPaymentTypeMasav       RoutingNumberLookupRequestSupportedPaymentType = "masav"
	RoutingNumberLookupRequestSupportedPaymentTypeNeft        RoutingNumberLookupRequestSupportedPaymentType = "neft"
	RoutingNumberLookupRequestSupportedPaymentTypeNics        RoutingNumberLookupRequestSupportedPaymentType = "nics"
	RoutingNumberLookupRequestSupportedPaymentTypeNzBecs      RoutingNumberLookupRequestSupportedPaymentType = "nz_becs"
	RoutingNumberLookupRequestSupportedPaymentTypeProvxchange RoutingNumberLookupRequestSupportedPaymentType = "provxchange"
	RoutingNumberLookupRequestSupportedPaymentTypeRtp         RoutingNumberLookupRequestSupportedPaymentType = "rtp"
	RoutingNumberLookupRequestSupportedPaymentTypeSeBankgirot RoutingNumberLookupRequestSupportedPaymentType = "se_bankgirot"
	RoutingNumberLookupRequestSupportedPaymentTypeSen         RoutingNumberLookupRequestSupportedPaymentType = "sen"
	RoutingNumberLookupRequestSupportedPaymentTypeSepa        RoutingNumberLookupRequestSupportedPaymentType = "sepa"
	RoutingNumberLookupRequestSupportedPaymentTypeSgGiro      RoutingNumberLookupRequestSupportedPaymentType = "sg_giro"
	RoutingNumberLookupRequestSupportedPaymentTypeSic         RoutingNumberLookupRequestSupportedPaymentType = "sic"
	RoutingNumberLookupRequestSupportedPaymentTypeSignet      RoutingNumberLookupRequestSupportedPaymentType = "signet"
	RoutingNumberLookupRequestSupportedPaymentTypeWire        RoutingNumberLookupRequestSupportedPaymentType = "wire"
	RoutingNumberLookupRequestSupportedPaymentTypeZengin      RoutingNumberLookupRequestSupportedPaymentType = "zengin"
)

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,nullable"`
	// Either `credit` or `debit`.
	Direction   string    `json:"direction,required"`
	DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
	// 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. Can be one of `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 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"
)

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) Get

get transaction line item

func (*TransactionLineItemService) List

list transaction_line_items

func (*TransactionLineItemService) ListAutoPaging

list 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"
)

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"
)

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 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 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. Can be one of `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"
	TransactionTypeInterac     TransactionType = "interac"
	TransactionTypeMasav       TransactionType = "masav"
	TransactionTypeNeft        TransactionType = "neft"
	TransactionTypeNics        TransactionType = "nics"
	TransactionTypeNzBecs      TransactionType = "nz_becs"
	TransactionTypeProvxchange TransactionType = "provxchange"
	TransactionTypeRtp         TransactionType = "rtp"
	TransactionTypeSeBankgirot TransactionType = "se_bankgirot"
	TransactionTypeSen         TransactionType = "sen"
	TransactionTypeSepa        TransactionType = "sepa"
	TransactionTypeSgGiro      TransactionType = "sg_giro"
	TransactionTypeSic         TransactionType = "sic"
	TransactionTypeSignet      TransactionType = "signet"
	TransactionTypeWire        TransactionType = "wire"
	TransactionTypeZengin      TransactionType = "zengin"
)

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"
	TransactionVendorCodeTypeRspecVendor   TransactionVendorCodeType = "rspec_vendor"
	TransactionVendorCodeTypeSignet        TransactionVendorCodeType = "signet"
	TransactionVendorCodeTypeSilvergate    TransactionVendorCodeType = "silvergate"
	TransactionVendorCodeTypeSwift         TransactionVendorCodeType = "swift"
	TransactionVendorCodeTypeUsBank        TransactionVendorCodeType = "us_bank"
)

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"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeInIfsc                  ValidationValidateRoutingNumberParamsRoutingNumberType = "in_ifsc"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeJpZenginCode            ValidationValidateRoutingNumberParamsRoutingNumberType = "jp_zengin_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeMyBranchCode            ValidationValidateRoutingNumberParamsRoutingNumberType = "my_branch_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeNzNationalClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "nz_national_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeSeBankgiroClearingCode  ValidationValidateRoutingNumberParamsRoutingNumberType = "se_bankgiro_clearing_code"
	ValidationValidateRoutingNumberParamsRoutingNumberTypeSwift                   ValidationValidateRoutingNumberParamsRoutingNumberType = "swift"
)

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"`
	// 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"`
	// 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 (
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeClabe         VirtualAccountNewParamsAccountDetailsAccountNumberType = "clabe"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeIban          VirtualAccountNewParamsAccountDetailsAccountNumberType = "iban"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeOther         VirtualAccountNewParamsAccountDetailsAccountNumberType = "other"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypePan           VirtualAccountNewParamsAccountDetailsAccountNumberType = "pan"
	VirtualAccountNewParamsAccountDetailsAccountNumberTypeWalletAddress VirtualAccountNewParamsAccountDetailsAccountNumberType = "wallet_address"
)

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"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeInterac     VirtualAccountNewParamsRoutingDetailsPaymentType = "interac"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeMasav       VirtualAccountNewParamsRoutingDetailsPaymentType = "masav"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNeft        VirtualAccountNewParamsRoutingDetailsPaymentType = "neft"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNics        VirtualAccountNewParamsRoutingDetailsPaymentType = "nics"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeNzBecs      VirtualAccountNewParamsRoutingDetailsPaymentType = "nz_becs"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeProvxchange VirtualAccountNewParamsRoutingDetailsPaymentType = "provxchange"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeRtp         VirtualAccountNewParamsRoutingDetailsPaymentType = "rtp"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSeBankgirot VirtualAccountNewParamsRoutingDetailsPaymentType = "se_bankgirot"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSen         VirtualAccountNewParamsRoutingDetailsPaymentType = "sen"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSepa        VirtualAccountNewParamsRoutingDetailsPaymentType = "sepa"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSgGiro      VirtualAccountNewParamsRoutingDetailsPaymentType = "sg_giro"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSic         VirtualAccountNewParamsRoutingDetailsPaymentType = "sic"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeSignet      VirtualAccountNewParamsRoutingDetailsPaymentType = "signet"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeWire        VirtualAccountNewParamsRoutingDetailsPaymentType = "wire"
	VirtualAccountNewParamsRoutingDetailsPaymentTypeZengin      VirtualAccountNewParamsRoutingDetailsPaymentType = "zengin"
)

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"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeInIfsc                  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "in_ifsc"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeJpZenginCode            VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "jp_zengin_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeMyBranchCode            VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "my_branch_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeNzNationalClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "nz_national_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeSeBankgiroClearingCode  VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "se_bankgiro_clearing_code"
	VirtualAccountNewParamsRoutingDetailsRoutingNumberTypeSwift                   VirtualAccountNewParamsRoutingDetailsRoutingNumberType = "swift"
)

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"`
	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