Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Account
- type AccountListParams
- type AccountListParamsOrder
- type AccountService
- func (r *AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
- func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccounts[Account], err error)
- func (r *AccountService) ListAutoPaging(ctx context.Context, query AccountListParams, opts ...option.RequestOption) *pagination.CursorIDAccountsAutoPager[Account]
- type AccountStatus
- type AccountType
- type Address
- type AddressData
- type AddressDataParam
- type AddressInputParam
- type AddressWithoutName
- type AddressWithoutNameParam
- type Attachment
- type CardListResponse
- type CardListResponseCard
- type CardService
- type CategoryData
- type CategoryListParams
- type CategoryListParamsOrder
- type CategoryService
- func (r *CategoryService) List(ctx context.Context, query CategoryListParams, opts ...option.RequestOption) (res *pagination.CursorIDCategories[CategoryData], err error)
- func (r *CategoryService) ListAutoPaging(ctx context.Context, query CategoryListParams, opts ...option.RequestOption) *pagination.CursorIDCategoriesAutoPager[CategoryData]
- type CheckInfo
- type CheckInfoRawParam
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CreditListResponse
- type CreditListResponseAccount
- type CreditService
- type CurrencyExchangeInfo
- type Customer
- type CustomerAddress
- type CustomerListParams
- type CustomerListParamsOrder
- type CustomerNewParams
- type CustomerService
- func (r *CustomerService) Delete(ctx context.Context, customerID string, opts ...option.RequestOption) (err error)
- func (r *CustomerService) Get(ctx context.Context, customerID string, opts ...option.RequestOption) (res *Customer, err error)
- func (r *CustomerService) List(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) (res *pagination.CursorIDArCustomers[Customer], err error)
- func (r *CustomerService) ListAutoPaging(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) *pagination.CursorIDArCustomersAutoPager[Customer]
- func (r *CustomerService) New(ctx context.Context, body CustomerNewParams, opts ...option.RequestOption) (res *Customer, err error)
- func (r *CustomerService) Update(ctx context.Context, customerID string, body CustomerUpdateParams, ...) (res *Customer, err error)
- type CustomerUpdateParams
- type DomesticWireRoutingInfo
- type DomesticWireRoutingInfoRawParam
- type ElectronicAccountType
- type ElectronicRoutingInfo
- type ElectronicRoutingInfoRawParam
- type Error
- type Event
- type EventListParams
- type EventListParamsOrder
- type EventListParamsResourceType
- type EventOperationType
- type EventResourceType
- type EventService
- func (r *EventService) Get(ctx context.Context, eventID string, opts ...option.RequestOption) (res *Event, err error)
- func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *pagination.CursorIDEvents[Event], err error)
- func (r *EventService) ListAutoPaging(ctx context.Context, query EventListParams, opts ...option.RequestOption) *pagination.CursorIDEventsAutoPager[Event]
- type GlAllocation
- type InternationalWireRoutingInfo
- type InternationalWireRoutingInfoBankDetails
- type InternationalWireRoutingInfoCorrespondentInfo
- type InternationalWireRoutingInfoCountrySpecific
- type InternationalWireRoutingInfoCountrySpecificAustralia
- type InternationalWireRoutingInfoCountrySpecificBrazil
- type InternationalWireRoutingInfoCountrySpecificCanada
- type InternationalWireRoutingInfoCountrySpecificChile
- type InternationalWireRoutingInfoCountrySpecificColombia
- type InternationalWireRoutingInfoCountrySpecificDominicanRepublic
- type InternationalWireRoutingInfoCountrySpecificHonduras
- type InternationalWireRoutingInfoCountrySpecificIndia
- type InternationalWireRoutingInfoCountrySpecificKazakhstan
- type InternationalWireRoutingInfoCountrySpecificPakistan
- type InternationalWireRoutingInfoCountrySpecificParaguay
- type InternationalWireRoutingInfoCountrySpecificPhilippines
- type InternationalWireRoutingInfoCountrySpecificRussia
- type InternationalWireRoutingInfoCountrySpecificSouthAfrica
- type Invoice
- type InvoiceAttachmentListResponse
- type InvoiceAttachmentService
- type InvoiceListParams
- type InvoiceListParamsOrder
- type InvoiceListResponse
- type InvoiceNewParams
- type InvoiceNewParamsSendEmailOption
- type InvoiceService
- func (r *InvoiceService) Cancel(ctx context.Context, invoiceID string, opts ...option.RequestOption) (err error)
- func (r *InvoiceService) Download(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *InvoiceService) Get(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *Invoice, err error)
- func (r *InvoiceService) List(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) (res *pagination.CursorIDArInvoices[InvoiceListResponse], err error)
- func (r *InvoiceService) ListAutoPaging(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) *pagination.CursorIDArInvoicesAutoPager[InvoiceListResponse]
- func (r *InvoiceService) New(ctx context.Context, body InvoiceNewParams, opts ...option.RequestOption) (res *Invoice, err error)
- func (r *InvoiceService) Update(ctx context.Context, invoiceID string, body InvoiceUpdateParams, ...) (res *Invoice, err error)
- type InvoiceUpdateParams
- type LineItemData
- type LineItemDataParam
- type MerchantData
- type MercuryCategory
- type OrgGetResponse
- type OrgGetResponseOrganization
- type OrgGetResponseOrganizationDba
- type OrgService
- type PaymentLinkStatus
- type PaymentListParams
- type PaymentListParamsStatus
- type PaymentNewParams
- type PaymentNewParamsPaymentMethod
- type PaymentNewParamsPurpose
- type PaymentNewParamsPurposeSimple
- type PaymentRequestParams
- type PaymentService
- func (r *PaymentService) Get(ctx context.Context, requestID string, opts ...option.RequestOption) (res *SendMoneyApproval, err error)
- func (r *PaymentService) List(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) (res *pagination.CursorIDRequestSendMoney[SendMoneyApproval], err error)
- func (r *PaymentService) ListAutoPaging(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) *pagination.CursorIDRequestSendMoneyAutoPager[SendMoneyApproval]
- func (r *PaymentService) New(ctx context.Context, accountID string, body PaymentNewParams, ...) (res *Transaction, err error)
- func (r *PaymentService) Request(ctx context.Context, accountID string, body PaymentRequestParams, ...) (res *SendMoneyApproval, err error)
- func (r *PaymentService) Transfer(ctx context.Context, body PaymentTransferParams, opts ...option.RequestOption) (res *PaymentTransferResponse, err error)
- type PaymentTransferParams
- type PaymentTransferResponse
- type RealTimePaymentRoutingInfo
- type Recipient
- type RecipientAttachment
- type RecipientAttachmentAttachParams
- type RecipientAttachmentListParams
- type RecipientAttachmentListParamsOrder
- type RecipientAttachmentListResponse
- type RecipientAttachmentService
- func (r *RecipientAttachmentService) Attach(ctx context.Context, recipientID string, body RecipientAttachmentAttachParams, ...) (err error)
- func (r *RecipientAttachmentService) List(ctx context.Context, query RecipientAttachmentListParams, ...) (res *pagination.CursorIDRecipientAttachments[RecipientAttachmentListResponse], ...)
- func (r *RecipientAttachmentService) ListAutoPaging(ctx context.Context, query RecipientAttachmentListParams, ...) ...
- type RecipientDefaultPaymentMethod
- type RecipientListParams
- type RecipientListParamsOrder
- type RecipientNewParams
- type RecipientService
- func (r *RecipientService) Get(ctx context.Context, recipientID string, opts ...option.RequestOption) (res *Recipient, err error)
- func (r *RecipientService) List(ctx context.Context, query RecipientListParams, opts ...option.RequestOption) (res *pagination.CursorIDRecipients[Recipient], err error)
- func (r *RecipientService) ListAutoPaging(ctx context.Context, query RecipientListParams, opts ...option.RequestOption) *pagination.CursorIDRecipientsAutoPager[Recipient]
- func (r *RecipientService) New(ctx context.Context, body RecipientNewParams, opts ...option.RequestOption) (res *Recipient, err error)
- func (r *RecipientService) Update(ctx context.Context, recipientID string, body RecipientUpdateParams, ...) (res *Recipient, err error)
- type RecipientStatus
- type RecipientUpdateParams
- type RelatedTransactionData
- type RelatedTransactionDataRelationKind
- type SafeRequest
- type SafeRequestInvestor
- type SafeRequestOrganization
- type SafeRequestValuationType
- type SafeService
- func (r *SafeService) Download(ctx context.Context, safeRequestID string, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *SafeService) Get(ctx context.Context, safeRequestID string, opts ...option.RequestOption) (res *SafeRequest, err error)
- func (r *SafeService) List(ctx context.Context, opts ...option.RequestOption) (res *[]SafeRequest, err error)
- type SendMoneyApproval
- type SendMoneyApprovalStatus
- type SendMoneyPaymentMethod
- type StatementAccountListParams
- type StatementAccountListParamsOrder
- type StatementAccountListResponse
- type StatementAccountListResponseTransaction
- type StatementAccountService
- func (r *StatementAccountService) List(ctx context.Context, accountID string, query StatementAccountListParams, ...) (res *pagination.CursorIDAccountStatements[StatementAccountListResponse], ...)
- func (r *StatementAccountService) ListAutoPaging(ctx context.Context, accountID string, query StatementAccountListParams, ...) *pagination.CursorIDAccountStatementsAutoPager[StatementAccountListResponse]
- type StatementService
- type StatementTreasuryListParams
- type StatementTreasuryListParamsDocumentType
- type StatementTreasuryListParamsOrder
- type StatementTreasuryListResponse
- type StatementTreasuryListResponseDocumentType
- type StatementTreasuryService
- func (r *StatementTreasuryService) List(ctx context.Context, treasuryID string, query StatementTreasuryListParams, ...) (res *pagination.CursorIDAccountStatements[StatementTreasuryListResponse], ...)
- func (r *StatementTreasuryService) ListAutoPaging(ctx context.Context, treasuryID string, query StatementTreasuryListParams, ...) *pagination.CursorIDAccountStatementsAutoPager[StatementTreasuryListResponse]
- type SwiftBankAccountType
- type TaxFormType
- type Transaction
- type TransactionAttachment
- type TransactionAttachmentAttachParams
- type TransactionAttachmentAttachParamsAttachmentType
- type TransactionAttachmentAttachmentType
- type TransactionAttachmentService
- type TransactionKind
- type TransactionListParams
- type TransactionListParamsOrder
- type TransactionMethodData
- type TransactionMethodDataCreditCardInfo
- type TransactionMethodDataDebitCardInfo
- type TransactionService
- func (r *TransactionService) Get(ctx context.Context, transactionID string, opts ...option.RequestOption) (res *Transaction, err error)
- func (r *TransactionService) List(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) (res *pagination.CursorIDTransactions[Transaction], err error)
- func (r *TransactionService) ListAutoPaging(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) *pagination.CursorIDTransactionsAutoPager[Transaction]
- func (r *TransactionService) Update(ctx context.Context, transactionID string, body TransactionUpdateParams, ...) (res *Transaction, err error)
- type TransactionStatus
- type TransactionUpdateParams
- type TreasuryListParams
- type TreasuryListParamsOrder
- type TreasuryListResponse
- type TreasuryListResponseNetReturn
- type TreasuryListResponseNetReturnDividend
- type TreasuryService
- func (r *TreasuryService) List(ctx context.Context, query TreasuryListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccounts[TreasuryListResponse], err error)
- func (r *TreasuryService) ListAutoPaging(ctx context.Context, query TreasuryListParams, opts ...option.RequestOption) *pagination.CursorIDAccountsAutoPager[TreasuryListResponse]
- func (r *TreasuryService) Transactions(ctx context.Context, treasuryID string, query TreasuryTransactionsParams, ...) (res *TreasuryTransactionsResponse, err error)
- type TreasuryTransactionsParams
- type TreasuryTransactionsParamsOrder
- type TreasuryTransactionsResponse
- type TreasuryTransactionsResponseTransaction
- type TreasuryTransactionsResponseTransactionDetails
- type UsState
- type User
- type UserListParams
- type UserListParamsOrder
- type UserOrganizationRole
- type UserService
- func (r *UserService) Get(ctx context.Context, userID string, opts ...option.RequestOption) (res *User, err error)
- func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *pagination.CursorIDUsers[User], err error)
- func (r *UserService) ListAutoPaging(ctx context.Context, query UserListParams, opts ...option.RequestOption) *pagination.CursorIDUsersAutoPager[User]
- type Webhook
- type WebhookListParams
- type WebhookListParamsOrder
- type WebhookNewParams
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookEndpointID string, opts ...option.RequestOption) (err error)
- func (r *WebhookService) Get(ctx context.Context, webhookEndpointID string, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) List(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) (res *pagination.CursorIDWebhooks[Webhook], err error)
- func (r *WebhookService) ListAutoPaging(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) *pagination.CursorIDWebhooksAutoPager[Webhook]
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) Update(ctx context.Context, webhookEndpointID string, body WebhookUpdateParams, ...) (res *Webhook, err error)
- func (r *WebhookService) Verify(ctx context.Context, webhookEndpointID string, body WebhookVerifyParams, ...) (err error)
- type WebhookStatus
- type WebhookUpdateParams
- type WebhookUpdateParamsStatus
- type WebhookVerifyParams
- type WebhookVerifyParamsEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (MERCURY_API_KEY, MERCURY_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Account ¶
type Account struct {
// ID for a Mercury account.
ID string `json:"id" api:"required" format:"uuid"`
AccountNumber string `json:"accountNumber" api:"required"`
AvailableBalance float64 `json:"availableBalance" api:"required"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
CurrentBalance float64 `json:"currentBalance" api:"required"`
DashboardLink string `json:"dashboardLink" api:"required"`
Kind string `json:"kind" api:"required"`
LegalBusinessName string `json:"legalBusinessName" api:"required"`
Name string `json:"name" api:"required"`
RoutingNumber string `json:"routingNumber" api:"required"`
// Any of "active", "deleted", "pending", "archived".
Status AccountStatus `json:"status" api:"required"`
// Any of "mercury", "external", "recipient".
Type AccountType `json:"type" api:"required"`
CanReceiveTransactions bool `json:"canReceiveTransactions" api:"nullable"`
Nickname string `json:"nickname" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountNumber respjson.Field
AvailableBalance respjson.Field
CreatedAt respjson.Field
CurrentBalance respjson.Field
DashboardLink respjson.Field
Kind respjson.Field
LegalBusinessName respjson.Field
Name respjson.Field
RoutingNumber respjson.Field
Status respjson.Field
Type respjson.Field
CanReceiveTransactions respjson.Field
Nickname respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Account) UnmarshalJSON ¶
type AccountListParams ¶
type AccountListParams struct {
// The ID of the account to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the account to start the page after (exclusive). When provided,
// results will begin with the account immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order AccountListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AccountListParams) URLQuery ¶
func (r AccountListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AccountListParams's query parameters as `url.Values`.
type AccountListParamsOrder ¶
type AccountListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( AccountListParamsOrderAsc AccountListParamsOrder = "asc" AccountListParamsOrderDesc AccountListParamsOrder = "desc" )
type AccountService ¶
type AccountService struct {
Options []option.RequestOption
}
Manage bank accounts
AccountService contains methods and other services that help with interacting with the mercury 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 NewAccountService method instead.
func NewAccountService ¶
func NewAccountService(opts ...option.RequestOption) (r AccountService)
NewAccountService 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 (*AccountService) Get ¶
func (r *AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
Get account by ID
func (*AccountService) List ¶
func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccounts[Account], err error)
Retrieve a paginated list of accounts. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*AccountService) ListAutoPaging ¶
func (r *AccountService) ListAutoPaging(ctx context.Context, query AccountListParams, opts ...option.RequestOption) *pagination.CursorIDAccountsAutoPager[Account]
Retrieve a paginated list of accounts. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
type AccountStatus ¶
type AccountStatus string
const ( AccountStatusActive AccountStatus = "active" AccountStatusDeleted AccountStatus = "deleted" AccountStatusPending AccountStatus = "pending" AccountStatusArchived AccountStatus = "archived" )
type AccountType ¶
type AccountType string
const ( AccountTypeMercury AccountType = "mercury" AccountTypeExternal AccountType = "external" AccountTypeRecipient AccountType = "recipient" )
type Address ¶
type Address struct {
Address1 string `json:"address1" api:"required"`
City string `json:"city" api:"required"`
Country string `json:"country" api:"required"`
Name string `json:"name" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
Region string `json:"region" api:"required"`
Address2 string `json:"address2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address1 respjson.Field
City respjson.Field
Country respjson.Field
Name respjson.Field
PostalCode respjson.Field
Region respjson.Field
Address2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Address) UnmarshalJSON ¶
type AddressData ¶
type AddressData struct {
Address1 string `json:"address1" api:"required"`
City string `json:"city" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
Address2 string `json:"address2" api:"nullable"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State UsState `json:"state" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address1 respjson.Field
City respjson.Field
PostalCode respjson.Field
Address2 respjson.Field
State respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AddressData) RawJSON ¶
func (r AddressData) RawJSON() string
Returns the unmodified JSON received from the API
func (AddressData) ToParam ¶
func (r AddressData) ToParam() AddressDataParam
ToParam converts this AddressData to a AddressDataParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AddressDataParam.Overrides()
func (*AddressData) UnmarshalJSON ¶
func (r *AddressData) UnmarshalJSON(data []byte) error
type AddressDataParam ¶
type AddressDataParam struct {
Address1 string `json:"address1" api:"required"`
City string `json:"city" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
Address2 param.Opt[string] `json:"address2,omitzero"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State UsState `json:"state,omitzero"`
// contains filtered or unexported fields
}
The properties Address1, City, PostalCode are required.
func (AddressDataParam) MarshalJSON ¶
func (r AddressDataParam) MarshalJSON() (data []byte, err error)
func (*AddressDataParam) UnmarshalJSON ¶
func (r *AddressDataParam) UnmarshalJSON(data []byte) error
type AddressInputParam ¶
type AddressInputParam struct {
// Primary street address line.
Address1 string `json:"address1" api:"required"`
// City name.
City string `json:"city" api:"required"`
// Two-letter country code (ISO 3166-1 alpha-2).
Country string `json:"country" api:"required"`
// The mailing name of the address.
Name string `json:"name" api:"required"`
// Postal or ZIP code.
PostalCode string `json:"postalCode" api:"required"`
// Either a two-letter US state code i.e. "CA" for California or a free-form
// identification of a particular region worldwide.
Region string `json:"region" api:"required"`
// Secondary street address line (optional).
Address2 param.Opt[string] `json:"address2,omitzero"`
// contains filtered or unexported fields
}
Address input for creating or updating customers
The properties Address1, City, Country, Name, PostalCode, Region are required.
func (AddressInputParam) MarshalJSON ¶
func (r AddressInputParam) MarshalJSON() (data []byte, err error)
func (*AddressInputParam) UnmarshalJSON ¶
func (r *AddressInputParam) UnmarshalJSON(data []byte) error
type AddressWithoutName ¶
type AddressWithoutName struct {
Address1 string `json:"address1" api:"required"`
City string `json:"city" api:"required"`
Country string `json:"country" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
Region string `json:"region" api:"required"`
Address2 string `json:"address2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address1 respjson.Field
City respjson.Field
Country respjson.Field
PostalCode respjson.Field
Region respjson.Field
Address2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AddressWithoutName) RawJSON ¶
func (r AddressWithoutName) RawJSON() string
Returns the unmodified JSON received from the API
func (AddressWithoutName) ToParam ¶
func (r AddressWithoutName) ToParam() AddressWithoutNameParam
ToParam converts this AddressWithoutName to a AddressWithoutNameParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AddressWithoutNameParam.Overrides()
func (*AddressWithoutName) UnmarshalJSON ¶
func (r *AddressWithoutName) UnmarshalJSON(data []byte) error
type AddressWithoutNameParam ¶
type AddressWithoutNameParam struct {
Address1 string `json:"address1" api:"required"`
City string `json:"city" api:"required"`
Country string `json:"country" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
Region string `json:"region" api:"required"`
Address2 param.Opt[string] `json:"address2,omitzero"`
// contains filtered or unexported fields
}
The properties Address1, City, Country, PostalCode, Region are required.
func (AddressWithoutNameParam) MarshalJSON ¶
func (r AddressWithoutNameParam) MarshalJSON() (data []byte, err error)
func (*AddressWithoutNameParam) UnmarshalJSON ¶
func (r *AddressWithoutNameParam) UnmarshalJSON(data []byte) error
type Attachment ¶
type Attachment struct {
// ID for the attachment.
ID string `json:"id" api:"required" format:"uuid"`
// The filename for the file.
FileName string `json:"fileName" api:"required"`
// The signed download URL for the file itself.
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
FileName respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The object representing a file attachment for an invoice. The file is not a part of this object itself but information for where to download it will be in this object.
func (Attachment) RawJSON ¶
func (r Attachment) RawJSON() string
Returns the unmodified JSON received from the API
func (*Attachment) UnmarshalJSON ¶
func (r *Attachment) UnmarshalJSON(data []byte) error
type CardListResponse ¶ added in v0.3.3
type CardListResponse struct {
Cards []CardListResponseCard `json:"cards" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cards respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CardListResponse) RawJSON ¶ added in v0.3.3
func (r CardListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CardListResponse) UnmarshalJSON ¶ added in v0.3.3
func (r *CardListResponse) UnmarshalJSON(data []byte) error
type CardListResponseCard ¶ added in v0.3.3
type CardListResponseCard struct {
CardID string `json:"cardId" api:"required"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
LastFourDigits string `json:"lastFourDigits" api:"required"`
NameOnCard string `json:"nameOnCard" api:"required"`
// Any of "visa", "mastercard".
Network string `json:"network" api:"required"`
// Any of "active", "frozen", "cancelled", "inactive", "expired", "suspended".
Status string `json:"status" api:"required"`
// Any of "inactive", "active", "locked".
PhysicalCardStatus string `json:"physicalCardStatus" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CardID respjson.Field
CreatedAt respjson.Field
LastFourDigits respjson.Field
NameOnCard respjson.Field
Network respjson.Field
Status respjson.Field
PhysicalCardStatus respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CardListResponseCard) RawJSON ¶ added in v0.3.3
func (r CardListResponseCard) RawJSON() string
Returns the unmodified JSON received from the API
func (*CardListResponseCard) UnmarshalJSON ¶ added in v0.3.3
func (r *CardListResponseCard) UnmarshalJSON(data []byte) error
type CardService ¶ added in v0.3.3
type CardService struct {
Options []option.RequestOption
}
Manage bank accounts
CardService contains methods and other services that help with interacting with the mercury 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 NewCardService method instead.
func NewCardService ¶ added in v0.3.3
func NewCardService(opts ...option.RequestOption) (r CardService)
NewCardService 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 (*CardService) List ¶ added in v0.3.3
func (r *CardService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *CardListResponse, err error)
Retrieve all debit and credit cards associated with a specific account.
type CategoryData ¶
type CategoryData struct {
// ID for the category
ID string `json:"id" api:"required" format:"uuid"`
// The name of the category
Name string `json:"name" api:"required"`
// Whether this category is applicable to card transactions
VisibleForCardSpend bool `json:"visibleForCardSpend" api:"required"`
// Whether this category is applicable to all other transaction kinds
VisibleForOther bool `json:"visibleForOther" api:"required"`
// Whether this category is applicable to expense reimbursement transactions
VisibleForReimbursements bool `json:"visibleForReimbursements" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
VisibleForCardSpend respjson.Field
VisibleForOther respjson.Field
VisibleForReimbursements respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Represents an expense category for transaction classification.
func (CategoryData) RawJSON ¶
func (r CategoryData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CategoryData) UnmarshalJSON ¶
func (r *CategoryData) UnmarshalJSON(data []byte) error
type CategoryListParams ¶
type CategoryListParams struct {
// The ID of the category to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the category to start the page after (exclusive). When provided,
// results will begin with the category immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order CategoryListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CategoryListParams) URLQuery ¶
func (r CategoryListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CategoryListParams's query parameters as `url.Values`.
type CategoryListParamsOrder ¶
type CategoryListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( CategoryListParamsOrderAsc CategoryListParamsOrder = "asc" CategoryListParamsOrderDesc CategoryListParamsOrder = "desc" )
type CategoryService ¶
type CategoryService struct {
Options []option.RequestOption
}
Manage expense categories
CategoryService contains methods and other services that help with interacting with the mercury 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 NewCategoryService method instead.
func NewCategoryService ¶
func NewCategoryService(opts ...option.RequestOption) (r CategoryService)
NewCategoryService 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 (*CategoryService) List ¶
func (r *CategoryService) List(ctx context.Context, query CategoryListParams, opts ...option.RequestOption) (res *pagination.CursorIDCategories[CategoryData], err error)
Retrieve a paginated list of all available custom expense categories for the organization. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*CategoryService) ListAutoPaging ¶
func (r *CategoryService) ListAutoPaging(ctx context.Context, query CategoryListParams, opts ...option.RequestOption) *pagination.CursorIDCategoriesAutoPager[CategoryData]
Retrieve a paginated list of all available custom expense categories for the organization. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
type CheckInfo ¶
type CheckInfo struct {
Address AddressWithoutName `json:"address" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*CheckInfo) UnmarshalJSON ¶
type CheckInfoRawParam ¶
type CheckInfoRawParam struct {
// Mailing address for sending a physical check.
Address AddressWithoutNameParam `json:"address,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property Address is required.
func (CheckInfoRawParam) MarshalJSON ¶
func (r CheckInfoRawParam) MarshalJSON() (data []byte, err error)
func (*CheckInfoRawParam) UnmarshalJSON ¶
func (r *CheckInfoRawParam) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
// Manage customers
Customers CustomerService
// Manage invoices
Invoices InvoiceService
// Manage bank accounts
Cards CardService
// Manage expense categories
Categories CategoryService
// Manage credit accounts
Credit CreditService
// Manage API events
Events EventService
// Organization information
Org OrgService
Payments PaymentService
// Manage SAFE (Simple Agreement for Future Equity) requests
Safes SafeService
// Download account statements
Statements StatementService
// Manage treasury accounts and transactions
Treasury TreasuryService
// Manage organization team members
Users UserService
// Manage webhooks
Webhooks WebhookService
// Manage bank accounts
Accounts AccountService
// Manage payment recipients
Recipients RecipientService
// Manage transactions
Transactions TransactionService
}
Client creates a struct with services and top level methods that help with interacting with the mercury 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 (MERCURY_API_KEY, MERCURY_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CreditListResponse ¶
type CreditListResponse struct {
Accounts []CreditListResponseAccount `json:"accounts" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Accounts respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CreditListResponse) RawJSON ¶
func (r CreditListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreditListResponse) UnmarshalJSON ¶
func (r *CreditListResponse) UnmarshalJSON(data []byte) error
type CreditListResponseAccount ¶
type CreditListResponseAccount struct {
// ID for a Mercury account.
ID string `json:"id" api:"required" format:"uuid"`
AvailableBalance float64 `json:"availableBalance" api:"required"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
CurrentBalance float64 `json:"currentBalance" api:"required"`
// Any of "active", "deleted", "pending", "archived".
Status AccountStatus `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AvailableBalance respjson.Field
CreatedAt respjson.Field
CurrentBalance respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CreditListResponseAccount) RawJSON ¶
func (r CreditListResponseAccount) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreditListResponseAccount) UnmarshalJSON ¶
func (r *CreditListResponseAccount) UnmarshalJSON(data []byte) error
type CreditService ¶
type CreditService struct {
Options []option.RequestOption
}
Manage credit accounts
CreditService contains methods and other services that help with interacting with the mercury 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 NewCreditService method instead.
func NewCreditService ¶
func NewCreditService(opts ...option.RequestOption) (r CreditService)
NewCreditService 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 (*CreditService) List ¶
func (r *CreditService) List(ctx context.Context, opts ...option.RequestOption) (res *CreditListResponse, err error)
Retrieve a list of all credit accounts for the organization.
type CurrencyExchangeInfo ¶
type CurrencyExchangeInfo struct {
ConvertedFromAmount float64 `json:"convertedFromAmount" api:"required"`
ConvertedFromCurrency string `json:"convertedFromCurrency" api:"required"`
ConvertedToAmount float64 `json:"convertedToAmount" api:"required"`
ConvertedToCurrency string `json:"convertedToCurrency" api:"required"`
// Exchange rate goes from "from currency" to "to currency" (ie from currency \*
// exchange rate = to currency)
ExchangeRate float64 `json:"exchangeRate" api:"required"`
FeeAmount float64 `json:"feeAmount" api:"required"`
FeePercentage float64 `json:"feePercentage" api:"required"`
// ID for this transaction
FeeTransactionID string `json:"feeTransactionId" api:"nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ConvertedFromAmount respjson.Field
ConvertedFromCurrency respjson.Field
ConvertedToAmount respjson.Field
ConvertedToCurrency respjson.Field
ExchangeRate respjson.Field
FeeAmount respjson.Field
FeePercentage respjson.Field
FeeTransactionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CurrencyExchangeInfo) RawJSON ¶
func (r CurrencyExchangeInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*CurrencyExchangeInfo) UnmarshalJSON ¶
func (r *CurrencyExchangeInfo) UnmarshalJSON(data []byte) error
type Customer ¶
type Customer struct {
// The customer who will receive the invoice. Use the /api/v1/ar/customers endpoint
// to list your customers and find the corresponding id, or create a new customer
// first.
ID string `json:"id" api:"required" format:"uuid"`
// Email of customer.
Email string `json:"email" api:"required"`
// Name of customer.
Name string `json:"name" api:"required"`
// Customer address information for Accounts Receivable API
Address CustomerAddress `json:"address" api:"nullable"`
// The time the customer was deleted, if it was deleted.
DeletedAt string `json:"deletedAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Email respjson.Field
Name respjson.Field
Address respjson.Field
DeletedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response data for Accounts Receivable customer API endpoints
func (*Customer) UnmarshalJSON ¶
type CustomerAddress ¶
type CustomerAddress struct {
// Primary street address line.
Address1 string `json:"address1" api:"required"`
// City name.
City string `json:"city" api:"required"`
// Two-letter country code (ISO 3166-1 alpha-2).
Country string `json:"country" api:"required"`
// Postal or ZIP code
PostalCode string `json:"postalCode" api:"required"`
// State, province, or region.
Region string `json:"region" api:"required"`
// Secondary street address line (optional).
Address2 string `json:"address2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address1 respjson.Field
City respjson.Field
Country respjson.Field
PostalCode respjson.Field
Region respjson.Field
Address2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Customer address information for Accounts Receivable API
func (CustomerAddress) RawJSON ¶
func (r CustomerAddress) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomerAddress) UnmarshalJSON ¶
func (r *CustomerAddress) UnmarshalJSON(data []byte) error
type CustomerListParams ¶ added in v0.3.3
type CustomerListParams struct {
// The ID of the customer to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the customer to start the page after (exclusive). When provided,
// results will begin with the customer immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order CustomerListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CustomerListParams) URLQuery ¶ added in v0.3.3
func (r CustomerListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CustomerListParams's query parameters as `url.Values`.
type CustomerListParamsOrder ¶ added in v0.3.3
type CustomerListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( CustomerListParamsOrderAsc CustomerListParamsOrder = "asc" CustomerListParamsOrderDesc CustomerListParamsOrder = "desc" )
type CustomerNewParams ¶ added in v0.3.3
type CustomerNewParams struct {
// The email address for the customer.
Email string `json:"email" api:"required"`
// The name of the customer.
Name string `json:"name" api:"required"`
// Address input for creating or updating customers
Address AddressInputParam `json:"address,omitzero"`
// contains filtered or unexported fields
}
func (CustomerNewParams) MarshalJSON ¶ added in v0.3.3
func (r CustomerNewParams) MarshalJSON() (data []byte, err error)
func (*CustomerNewParams) UnmarshalJSON ¶ added in v0.3.3
func (r *CustomerNewParams) UnmarshalJSON(data []byte) error
type CustomerService ¶ added in v0.3.3
type CustomerService struct {
Options []option.RequestOption
}
Manage customers
CustomerService contains methods and other services that help with interacting with the mercury API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerService method instead.
func NewCustomerService ¶ added in v0.3.3
func NewCustomerService(opts ...option.RequestOption) (r CustomerService)
NewCustomerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CustomerService) Delete ¶ added in v0.3.3
func (r *CustomerService) Delete(ctx context.Context, customerID string, opts ...option.RequestOption) (err error)
Delete a customer. This action cannot be undone.
func (*CustomerService) Get ¶ added in v0.3.3
func (r *CustomerService) Get(ctx context.Context, customerID string, opts ...option.RequestOption) (res *Customer, err error)
Retrieve details of a specific customer by their ID
func (*CustomerService) List ¶ added in v0.3.3
func (r *CustomerService) List(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) (res *pagination.CursorIDArCustomers[Customer], err error)
Retrieve a paginated list of customers. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*CustomerService) ListAutoPaging ¶ added in v0.3.3
func (r *CustomerService) ListAutoPaging(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) *pagination.CursorIDArCustomersAutoPager[Customer]
Retrieve a paginated list of customers. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*CustomerService) New ¶ added in v0.3.3
func (r *CustomerService) New(ctx context.Context, body CustomerNewParams, opts ...option.RequestOption) (res *Customer, err error)
Create a new customer for the organization
func (*CustomerService) Update ¶ added in v0.3.3
func (r *CustomerService) Update(ctx context.Context, customerID string, body CustomerUpdateParams, opts ...option.RequestOption) (res *Customer, err error)
Update an existing customer
type CustomerUpdateParams ¶ added in v0.3.3
type CustomerUpdateParams struct {
// The email address for the customer.
Email string `json:"email" api:"required"`
// The name of the customer.
Name string `json:"name" api:"required"`
// Open invoices for the customer will be resent with updated data when this is
// true.
ResendOpenInvoices bool `json:"resendOpenInvoices" api:"required"`
// Address input for creating or updating customers
Address AddressInputParam `json:"address,omitzero"`
// contains filtered or unexported fields
}
func (CustomerUpdateParams) MarshalJSON ¶ added in v0.3.3
func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error)
func (*CustomerUpdateParams) UnmarshalJSON ¶ added in v0.3.3
func (r *CustomerUpdateParams) UnmarshalJSON(data []byte) error
type DomesticWireRoutingInfo ¶
type DomesticWireRoutingInfo struct {
AccountNumber string `json:"accountNumber" api:"required"`
RoutingNumber string `json:"routingNumber" api:"required"`
Address AddressWithoutName `json:"address" api:"nullable"`
BankName string `json:"bankName" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountNumber respjson.Field
RoutingNumber respjson.Field
Address respjson.Field
BankName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomesticWireRoutingInfo) RawJSON ¶
func (r DomesticWireRoutingInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomesticWireRoutingInfo) UnmarshalJSON ¶
func (r *DomesticWireRoutingInfo) UnmarshalJSON(data []byte) error
type DomesticWireRoutingInfoRawParam ¶
type DomesticWireRoutingInfoRawParam struct {
// The account number of the bank account to use for domestic wire payments.
AccountNumber string `json:"accountNumber" api:"required"`
// The address of the bank account to use for domestic wire payments. This has to
// be the recipient's legal address.
Address AddressWithoutNameParam `json:"address,omitzero" api:"required"`
// The routing number of the bank account to use for domestic wire payments.
RoutingNumber string `json:"routingNumber" api:"required"`
// The name of the beneficiary of the domestic wire. This is the name of the entity
// that will receive the domestic wire.
DefaultForBenefitOf param.Opt[string] `json:"defaultForBenefitOf,omitzero"`
// contains filtered or unexported fields
}
The properties AccountNumber, Address, RoutingNumber are required.
func (DomesticWireRoutingInfoRawParam) MarshalJSON ¶
func (r DomesticWireRoutingInfoRawParam) MarshalJSON() (data []byte, err error)
func (*DomesticWireRoutingInfoRawParam) UnmarshalJSON ¶
func (r *DomesticWireRoutingInfoRawParam) UnmarshalJSON(data []byte) error
type ElectronicAccountType ¶
type ElectronicAccountType string
const ( ElectronicAccountTypeBusinessChecking ElectronicAccountType = "businessChecking" ElectronicAccountTypeBusinessSavings ElectronicAccountType = "businessSavings" ElectronicAccountTypePersonalChecking ElectronicAccountType = "personalChecking" ElectronicAccountTypePersonalSavings ElectronicAccountType = "personalSavings" )
type ElectronicRoutingInfo ¶
type ElectronicRoutingInfo struct {
AccountNumber string `json:"accountNumber" api:"required"`
// Any of "businessChecking", "businessSavings", "personalChecking",
// "personalSavings".
ElectronicAccountType ElectronicAccountType `json:"electronicAccountType" api:"required"`
RoutingNumber string `json:"routingNumber" api:"required"`
Address AddressWithoutName `json:"address" api:"nullable"`
BankName string `json:"bankName" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountNumber respjson.Field
ElectronicAccountType respjson.Field
RoutingNumber respjson.Field
Address respjson.Field
BankName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ElectronicRoutingInfo) RawJSON ¶
func (r ElectronicRoutingInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*ElectronicRoutingInfo) UnmarshalJSON ¶
func (r *ElectronicRoutingInfo) UnmarshalJSON(data []byte) error
type ElectronicRoutingInfoRawParam ¶
type ElectronicRoutingInfoRawParam struct {
// The account number of the bank account to use for ACH payments.
AccountNumber string `json:"accountNumber" api:"required"`
// The address of the bank account to use for ACH payments. This has to be the
// recipient's legal address.
Address AddressWithoutNameParam `json:"address,omitzero" api:"required"`
// The type of bank account to use for ACH payments.
//
// Any of "businessChecking", "businessSavings", "personalChecking",
// "personalSavings".
ElectronicAccountType ElectronicAccountType `json:"electronicAccountType,omitzero" api:"required"`
// The routing number of the bank account to use for ACH payments.
RoutingNumber string `json:"routingNumber" api:"required"`
// contains filtered or unexported fields
}
The properties AccountNumber, Address, ElectronicAccountType, RoutingNumber are required.
func (ElectronicRoutingInfoRawParam) MarshalJSON ¶
func (r ElectronicRoutingInfoRawParam) MarshalJSON() (data []byte, err error)
func (*ElectronicRoutingInfoRawParam) UnmarshalJSON ¶
func (r *ElectronicRoutingInfoRawParam) UnmarshalJSON(data []byte) error
type Event ¶
type Event struct {
// ID for the API event
ID string `json:"id" api:"required" format:"uuid"`
// List of JSON paths that were modified in this event
ChangedPaths []string `json:"changedPaths" api:"required"`
// JSON object containing the fields that were changed and their new values
MergePatch any `json:"mergePatch" api:"required"`
// Timestamp when the event occurred
OccurredAt string `json:"occurredAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// The type of operation performed (e.g., create, update, delete)
//
// Any of "create", "update", "delete".
OperationType EventOperationType `json:"operationType" api:"required"`
// The ID of the resource that was affected
ResourceID string `json:"resourceId" api:"required" format:"uuid"`
// The type of resource that was affected (e.g., transaction, account)
//
// Any of "transaction", "checkingAccount", "savingsAccount", "treasuryAccount",
// "investmentAccount", "creditAccount".
ResourceType EventResourceType `json:"resourceType" api:"required"`
// Version number of the resource after this change
ResourceVersion int64 `json:"resourceVersion" api:"required"`
// JSON object containing the fields that were changed and their previous values
// before the update
PreviousValues any `json:"previousValues" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ChangedPaths respjson.Field
MergePatch respjson.Field
OccurredAt respjson.Field
OperationType respjson.Field
ResourceID respjson.Field
ResourceType respjson.Field
ResourceVersion respjson.Field
PreviousValues respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Represents a single event in the Mercury API event stream. | Events track changes to resources over time, providing an audit trail | of all modifications with before/after values and metadata about what changed.
func (*Event) UnmarshalJSON ¶
type EventListParams ¶
type EventListParams struct {
// The ID of the event to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
ResourceID param.Opt[string] `query:"resourceId,omitzero" format:"uuid" json:"-"`
// The ID of the event to start the page after (exclusive). When provided, results
// will begin with the event immediately following this ID. Use this for standard
// forward pagination to get the next page of results. Cannot be combined with
// end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order EventListParamsOrder `query:"order,omitzero" json:"-"`
// Any of "transaction", "checkingAccount", "savingsAccount", "treasuryAccount",
// "investmentAccount", "creditAccount".
ResourceType EventListParamsResourceType `query:"resourceType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EventListParams) URLQuery ¶
func (r EventListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EventListParams's query parameters as `url.Values`.
type EventListParamsOrder ¶
type EventListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( EventListParamsOrderAsc EventListParamsOrder = "asc" EventListParamsOrderDesc EventListParamsOrder = "desc" )
type EventListParamsResourceType ¶
type EventListParamsResourceType string
const ( EventListParamsResourceTypeTransaction EventListParamsResourceType = "transaction" EventListParamsResourceTypeCheckingAccount EventListParamsResourceType = "checkingAccount" EventListParamsResourceTypeSavingsAccount EventListParamsResourceType = "savingsAccount" EventListParamsResourceTypeTreasuryAccount EventListParamsResourceType = "treasuryAccount" EventListParamsResourceTypeInvestmentAccount EventListParamsResourceType = "investmentAccount" EventListParamsResourceTypeCreditAccount EventListParamsResourceType = "creditAccount" )
type EventOperationType ¶
type EventOperationType string
The type of operation performed (e.g., create, update, delete)
const ( EventOperationTypeCreate EventOperationType = "create" EventOperationTypeUpdate EventOperationType = "update" EventOperationTypeDelete EventOperationType = "delete" )
type EventResourceType ¶
type EventResourceType string
The type of resource that was affected (e.g., transaction, account)
const ( EventResourceTypeTransaction EventResourceType = "transaction" EventResourceTypeCheckingAccount EventResourceType = "checkingAccount" EventResourceTypeSavingsAccount EventResourceType = "savingsAccount" EventResourceTypeTreasuryAccount EventResourceType = "treasuryAccount" EventResourceTypeInvestmentAccount EventResourceType = "investmentAccount" EventResourceTypeCreditAccount EventResourceType = "creditAccount" )
type EventService ¶
type EventService struct {
Options []option.RequestOption
}
Manage API events
EventService contains methods and other services that help with interacting with the mercury 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, eventID string, opts ...option.RequestOption) (res *Event, err error)
Get event by ID
func (*EventService) List ¶
func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *pagination.CursorIDEvents[Event], err error)
Get all events
func (*EventService) ListAutoPaging ¶
func (r *EventService) ListAutoPaging(ctx context.Context, query EventListParams, opts ...option.RequestOption) *pagination.CursorIDEventsAutoPager[Event]
Get all events
type GlAllocation ¶
type GlAllocation struct {
// The amount allocated to this GL code
Amount float64 `json:"amount" api:"required"`
// The name of the GL code from the connected accounting integration
GlCodeName string `json:"glCodeName" api:"required"`
// Optional user-provided description for this allocation
Description string `json:"description" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
GlCodeName respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A GL code allocation on a transaction — a GL code name paired with the amount allocated to it. When a transaction is fully categorized, the amounts across all allocations sum to the transaction total.
func (GlAllocation) RawJSON ¶
func (r GlAllocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*GlAllocation) UnmarshalJSON ¶
func (r *GlAllocation) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfo ¶
type InternationalWireRoutingInfo struct {
CountrySpecific InternationalWireRoutingInfoCountrySpecific `json:"countrySpecific" api:"required"`
Iban string `json:"iban" api:"required"`
SwiftCode string `json:"swiftCode" api:"required"`
Address AddressWithoutName `json:"address" api:"nullable"`
BankDetails InternationalWireRoutingInfoBankDetails `json:"bankDetails" api:"nullable"`
CorrespondentInfo InternationalWireRoutingInfoCorrespondentInfo `json:"correspondentInfo" api:"nullable"`
EmailAddress string `json:"emailAddress" api:"nullable"`
PhoneNumber string `json:"phoneNumber" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CountrySpecific respjson.Field
Iban respjson.Field
SwiftCode respjson.Field
Address respjson.Field
BankDetails respjson.Field
CorrespondentInfo respjson.Field
EmailAddress respjson.Field
PhoneNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfo) RawJSON ¶
func (r InternationalWireRoutingInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfo) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfo) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoBankDetails ¶
type InternationalWireRoutingInfoBankDetails struct {
BankCityState string `json:"bankCityState" api:"required"`
BankCountry string `json:"bankCountry" api:"required"`
BankName string `json:"bankName" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BankCityState respjson.Field
BankCountry respjson.Field
BankName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoBankDetails) RawJSON ¶
func (r InternationalWireRoutingInfoBankDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoBankDetails) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoBankDetails) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCorrespondentInfo ¶
type InternationalWireRoutingInfoCorrespondentInfo struct {
BankName string `json:"bankName" api:"nullable"`
RoutingNumber string `json:"routingNumber" api:"nullable"`
SwiftCode string `json:"swiftCode" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BankName respjson.Field
RoutingNumber respjson.Field
SwiftCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCorrespondentInfo) RawJSON ¶
func (r InternationalWireRoutingInfoCorrespondentInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCorrespondentInfo) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCorrespondentInfo) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecific ¶
type InternationalWireRoutingInfoCountrySpecific struct {
Australia InternationalWireRoutingInfoCountrySpecificAustralia `json:"australia" api:"nullable"`
Brazil InternationalWireRoutingInfoCountrySpecificBrazil `json:"brazil" api:"nullable"`
Canada InternationalWireRoutingInfoCountrySpecificCanada `json:"canada" api:"nullable"`
Chile InternationalWireRoutingInfoCountrySpecificChile `json:"chile" api:"nullable"`
Colombia InternationalWireRoutingInfoCountrySpecificColombia `json:"colombia" api:"nullable"`
DominicanRepublic InternationalWireRoutingInfoCountrySpecificDominicanRepublic `json:"dominicanRepublic" api:"nullable"`
Honduras InternationalWireRoutingInfoCountrySpecificHonduras `json:"honduras" api:"nullable"`
India InternationalWireRoutingInfoCountrySpecificIndia `json:"india" api:"nullable"`
Kazakhstan InternationalWireRoutingInfoCountrySpecificKazakhstan `json:"kazakhstan" api:"nullable"`
Pakistan InternationalWireRoutingInfoCountrySpecificPakistan `json:"pakistan" api:"nullable"`
Paraguay InternationalWireRoutingInfoCountrySpecificParaguay `json:"paraguay" api:"nullable"`
Philippines InternationalWireRoutingInfoCountrySpecificPhilippines `json:"philippines" api:"nullable"`
Russia InternationalWireRoutingInfoCountrySpecificRussia `json:"russia" api:"nullable"`
SouthAfrica InternationalWireRoutingInfoCountrySpecificSouthAfrica `json:"southAfrica" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Australia respjson.Field
Brazil respjson.Field
Canada respjson.Field
Chile respjson.Field
Colombia respjson.Field
DominicanRepublic respjson.Field
Honduras respjson.Field
India respjson.Field
Kazakhstan respjson.Field
Pakistan respjson.Field
Paraguay respjson.Field
Philippines respjson.Field
Russia respjson.Field
SouthAfrica respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecific) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecific) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecific) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecific) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificAustralia ¶
type InternationalWireRoutingInfoCountrySpecificAustralia struct {
BsbCode string `json:"bsbCode" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BsbCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificAustralia) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificAustralia) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificAustralia) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificAustralia) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificBrazil ¶
type InternationalWireRoutingInfoCountrySpecificBrazil struct {
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificBrazil) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificBrazil) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificBrazil) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificBrazil) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificCanada ¶
type InternationalWireRoutingInfoCountrySpecificCanada struct {
BankCode string `json:"bankCode" api:"required"`
TransitNumber string `json:"transitNumber" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BankCode respjson.Field
TransitNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificCanada) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificCanada) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificCanada) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificCanada) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificChile ¶
type InternationalWireRoutingInfoCountrySpecificChile struct {
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificChile) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificChile) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificChile) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificChile) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificColombia ¶
type InternationalWireRoutingInfoCountrySpecificColombia struct {
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificColombia) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificColombia) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificColombia) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificColombia) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificDominicanRepublic ¶
type InternationalWireRoutingInfoCountrySpecificDominicanRepublic struct {
// Any of "checking", "savings".
AccountType SwiftBankAccountType `json:"accountType" api:"required"`
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountType respjson.Field
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificDominicanRepublic) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificDominicanRepublic) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificDominicanRepublic) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificDominicanRepublic) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificHonduras ¶
type InternationalWireRoutingInfoCountrySpecificHonduras struct {
// Any of "checking", "savings".
AccountType SwiftBankAccountType `json:"accountType" api:"required"`
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountType respjson.Field
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificHonduras) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificHonduras) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificHonduras) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificHonduras) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificIndia ¶
type InternationalWireRoutingInfoCountrySpecificIndia struct {
IfscCode string `json:"ifscCode" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IfscCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificIndia) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificIndia) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificIndia) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificIndia) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificKazakhstan ¶
type InternationalWireRoutingInfoCountrySpecificKazakhstan struct {
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificKazakhstan) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificKazakhstan) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificKazakhstan) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificKazakhstan) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificPakistan ¶
type InternationalWireRoutingInfoCountrySpecificPakistan struct {
LegalID string `json:"legalId" api:"required"`
// Any of "CNIC", "SNIC", "Passport", "NTN".
LegalIDType string `json:"legalIdType" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
LegalIDType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificPakistan) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificPakistan) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificPakistan) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificPakistan) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificParaguay ¶
type InternationalWireRoutingInfoCountrySpecificParaguay struct {
LegalID string `json:"legalId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificParaguay) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificParaguay) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificParaguay) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificParaguay) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificPhilippines ¶
type InternationalWireRoutingInfoCountrySpecificPhilippines struct {
RoutingNumber string `json:"routingNumber" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
RoutingNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificPhilippines) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificPhilippines) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificPhilippines) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificPhilippines) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificRussia ¶
type InternationalWireRoutingInfoCountrySpecificRussia struct {
Inn string `json:"inn" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Inn respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificRussia) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificRussia) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificRussia) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificRussia) UnmarshalJSON(data []byte) error
type InternationalWireRoutingInfoCountrySpecificSouthAfrica ¶
type InternationalWireRoutingInfoCountrySpecificSouthAfrica struct {
BranchCode string `json:"branchCode" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BranchCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InternationalWireRoutingInfoCountrySpecificSouthAfrica) RawJSON ¶
func (r InternationalWireRoutingInfoCountrySpecificSouthAfrica) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternationalWireRoutingInfoCountrySpecificSouthAfrica) UnmarshalJSON ¶
func (r *InternationalWireRoutingInfoCountrySpecificSouthAfrica) UnmarshalJSON(data []byte) error
type Invoice ¶
type Invoice struct {
// ID for the invoice.
ID string `json:"id" api:"required" format:"uuid"`
// Whether or not the invoice can be paid via ach debit.
ACHDebitEnabled bool `json:"achDebitEnabled" api:"required"`
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// Emails to be CCed on invoice notifications/reminders.
CcEmails []string `json:"ccEmails" api:"required"`
// The timestamp when the invoice was created.
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Whether or not the invoice can be paid via credit card. Requires stripe to be
// setup for the Mercury account.
CreditCardEnabled bool `json:"creditCardEnabled" api:"required"`
// The customer who will receive the invoice. Use the /api/v1/ar/customers endpoint
// to list your customers and find the corresponding id, or create a new customer
// first.
CustomerID string `json:"customerId" api:"required" format:"uuid"`
// ID for a Mercury account.
DestinationAccountID string `json:"destinationAccountId" api:"required" format:"uuid"`
// The due date the invoice should be paid by.
DueDate time.Time `json:"dueDate" api:"required" format:"date"`
// The date of the invoice, set by the invoice creator and likely to be context
// specific to the type of transaction. i.e. it could be a date a service was
// performed, it does not need to be the date the invoice was created.
InvoiceDate time.Time `json:"invoiceDate" api:"required" format:"date"`
// The payer facing invoice number/identifier.
InvoiceNumber string `json:"invoiceNumber" api:"required"`
// The line items for the invoice.
LineItems []LineItemData `json:"lineItems" api:"required"`
// Public slug for an invoice. Used to construct the pay page URL as well as the
// URL to retrieve the PDF of the invoice.
Slug string `json:"slug" api:"required"`
// The status of the invoice.
//
// Any of "Unpaid", "Paid", "Cancelled", "Processing".
Status PaymentLinkStatus `json:"status" api:"required"`
// The timestamp when the invoice was updated.
UpdatedAt string `json:"updatedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Whether or not the invoice payment instructions will show the real account and
// routing number for the destination account or use virtual account numbers
// instead.
UseRealAccountNumber bool `json:"useRealAccountNumber" api:"required"`
// The time when the invoice was canceled.
CanceledAt string `json:"canceledAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// Internal note for the invoice, visible by users in the mercury organization but
// not visible to payers.
InternalNote string `json:"internalNote" api:"nullable"`
// Memo for the payer of the invoice.
PayerMemo string `json:"payerMemo" api:"nullable"`
// Purchase order number for the invoice if applicable.
PoNumber string `json:"poNumber" api:"nullable"`
// The end date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodEndDate time.Time `json:"servicePeriodEndDate" api:"nullable" format:"date"`
// The start date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodStartDate time.Time `json:"servicePeriodStartDate" api:"nullable" format:"date"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ACHDebitEnabled respjson.Field
Amount respjson.Field
CcEmails respjson.Field
CreatedAt respjson.Field
CreditCardEnabled respjson.Field
CustomerID respjson.Field
DestinationAccountID respjson.Field
DueDate respjson.Field
InvoiceDate respjson.Field
InvoiceNumber respjson.Field
LineItems respjson.Field
Slug respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
UseRealAccountNumber respjson.Field
CanceledAt respjson.Field
InternalNote respjson.Field
PayerMemo respjson.Field
PoNumber respjson.Field
ServicePeriodEndDate respjson.Field
ServicePeriodStartDate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response type for an invoice in the api.
func (*Invoice) UnmarshalJSON ¶
type InvoiceAttachmentListResponse ¶ added in v0.4.1
type InvoiceAttachmentListResponse struct {
// The list of attachments
Attachments []Attachment `json:"attachments" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attachments respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response type for fetching attachments related to an AR Invoice.
func (InvoiceAttachmentListResponse) RawJSON ¶ added in v0.4.1
func (r InvoiceAttachmentListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvoiceAttachmentListResponse) UnmarshalJSON ¶ added in v0.4.1
func (r *InvoiceAttachmentListResponse) UnmarshalJSON(data []byte) error
type InvoiceAttachmentService ¶ added in v0.4.1
type InvoiceAttachmentService struct {
Options []option.RequestOption
}
Manage invoices
InvoiceAttachmentService contains methods and other services that help with interacting with the mercury 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 NewInvoiceAttachmentService method instead.
func NewInvoiceAttachmentService ¶ added in v0.4.1
func NewInvoiceAttachmentService(opts ...option.RequestOption) (r InvoiceAttachmentService)
NewInvoiceAttachmentService 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 (*InvoiceAttachmentService) Get ¶ added in v0.4.1
func (r *InvoiceAttachmentService) Get(ctx context.Context, attachmentID string, opts ...option.RequestOption) (res *Attachment, err error)
Retrieve attachment details including download URL
func (*InvoiceAttachmentService) List ¶ added in v0.4.1
func (r *InvoiceAttachmentService) List(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *InvoiceAttachmentListResponse, err error)
Retrieve a list of all attachments for a specific invoice
type InvoiceListParams ¶ added in v0.3.3
type InvoiceListParams struct {
// The ID of the invoice to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the invoice to start the page after (exclusive). When provided,
// results will begin with the invoice immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order InvoiceListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InvoiceListParams) URLQuery ¶ added in v0.3.3
func (r InvoiceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes InvoiceListParams's query parameters as `url.Values`.
type InvoiceListParamsOrder ¶ added in v0.3.3
type InvoiceListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( InvoiceListParamsOrderAsc InvoiceListParamsOrder = "asc" InvoiceListParamsOrderDesc InvoiceListParamsOrder = "desc" )
type InvoiceListResponse ¶ added in v0.3.3
type InvoiceListResponse struct {
// ID for the invoice.
ID string `json:"id" api:"required" format:"uuid"`
// Whether or not the invoice can be paid via ach debit.
ACHDebitEnabled bool `json:"achDebitEnabled" api:"required"`
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// Emails to be CCed on invoice notifications/reminders.
CcEmails []string `json:"ccEmails" api:"required"`
// The timestamp when the invoice was created.
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Whether or not the invoice can be paid via credit card. Requires stripe to be
// setup for the Mercury account.
CreditCardEnabled bool `json:"creditCardEnabled" api:"required"`
// The customer who will receive the invoice. Use the /api/v1/ar/customers endpoint
// to list your customers and find the corresponding id, or create a new customer
// first.
CustomerID string `json:"customerId" api:"required" format:"uuid"`
// ID for a Mercury account.
DestinationAccountID string `json:"destinationAccountId" api:"required" format:"uuid"`
// The due date the invoice should be paid by.
DueDate time.Time `json:"dueDate" api:"required" format:"date"`
// The date of the invoice, set by the invoice creator and likely to be context
// specific to the type of transaction. i.e. it could be a date a service was
// performed, it does not need to be the date the invoice was created.
InvoiceDate time.Time `json:"invoiceDate" api:"required" format:"date"`
// The payer facing invoice number/identifier.
InvoiceNumber string `json:"invoiceNumber" api:"required"`
// A unique identifier used to build public URLs for this invoice. Use it to
// construct the payment page URL (https://app.mercury.com/pay/{slug}) or fetch the
// invoice PDF via /api/v1/ar/invoices/{slug}/pdf.
Slug string `json:"slug" api:"required"`
// The status of the invoice.
//
// Any of "Unpaid", "Paid", "Cancelled", "Processing".
Status PaymentLinkStatus `json:"status" api:"required"`
// The timestamp when the invoice was updated.
UpdatedAt string `json:"updatedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Whether or not the invoice payment instructions will show the real account and
// routing number for the destination account or use virtual account numbers
// instead.
UseRealAccountNumber bool `json:"useRealAccountNumber" api:"required"`
// The time when the invoice was canceled.
CanceledAt string `json:"canceledAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// Internal note for the invoice, visible by users in the mercury organization but
// not visible to payers.
InternalNote string `json:"internalNote" api:"nullable"`
// Memo for the payer of the invoice.
PayerMemo string `json:"payerMemo" api:"nullable"`
// Purchase order number for the invoice if applicable.
PoNumber string `json:"poNumber" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ACHDebitEnabled respjson.Field
Amount respjson.Field
CcEmails respjson.Field
CreatedAt respjson.Field
CreditCardEnabled respjson.Field
CustomerID respjson.Field
DestinationAccountID respjson.Field
DueDate respjson.Field
InvoiceDate respjson.Field
InvoiceNumber respjson.Field
Slug respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
UseRealAccountNumber respjson.Field
CanceledAt respjson.Field
InternalNote respjson.Field
PayerMemo respjson.Field
PoNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response data for Accounts Receivable invoices API Endpoint
func (InvoiceListResponse) RawJSON ¶ added in v0.3.3
func (r InvoiceListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvoiceListResponse) UnmarshalJSON ¶ added in v0.3.3
func (r *InvoiceListResponse) UnmarshalJSON(data []byte) error
type InvoiceNewParams ¶ added in v0.3.3
type InvoiceNewParams struct {
// Whether or not the invoice can be paid via ACH debit.
ACHDebitEnabled bool `json:"achDebitEnabled" api:"required"`
// Emails to be CCed on invoice notifications/reminders.
CcEmails []string `json:"ccEmails,omitzero" api:"required"`
// Whether or not the invoice can be paid via credit card. Requires Stripe to be
// setup for the Mercury account.
CreditCardEnabled bool `json:"creditCardEnabled" api:"required"`
// The customer who will receive the invoice. Use the /api/v1/ar/customers endpoint
// to list your customers and find the corresponding id, or create a new customer
// first.
CustomerID string `json:"customerId" api:"required" format:"uuid"`
// ID for a Mercury account.
DestinationAccountID string `json:"destinationAccountId" api:"required" format:"uuid"`
// The due date the invoice should be paid by. YYYY-MM-DD
DueDate time.Time `json:"dueDate" api:"required" format:"date"`
// The date of the invoice, set by the invoice creator and likely to be context
// specific to the type of transaction. For example, it could be a date a service
// was performed. YYYY-MM-DD
InvoiceDate time.Time `json:"invoiceDate" api:"required" format:"date"`
// The line items for the invoice
LineItems []LineItemDataParam `json:"lineItems,omitzero" api:"required"`
// Whether or not the invoice payment instructions will show the real account and
// routing number for the destination account or use virtual account numbers
// instead. Virtual accounts are safer and are preferred in most cases.
UseRealAccountNumber bool `json:"useRealAccountNumber" api:"required"`
// Internal note for the invoice, visible by users in the organization but not
// visible to payers.
InternalNote param.Opt[string] `json:"internalNote,omitzero"`
// The payer facing invoice number/identifier.
InvoiceNumber param.Opt[string] `json:"invoiceNumber,omitzero"`
// Memo for the payer of the invoice.
PayerMemo param.Opt[string] `json:"payerMemo,omitzero"`
// Purchase order number for the invoice, if applicable.
PoNumber param.Opt[string] `json:"poNumber,omitzero"`
// The end date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodEndDate param.Opt[time.Time] `json:"servicePeriodEndDate,omitzero" format:"date"`
// The start date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodStartDate param.Opt[time.Time] `json:"servicePeriodStartDate,omitzero" format:"date"`
// Rules for emailing the new invoice to payers. Can be "DontSend" to skip sending
// or "SendNow" to send immediately. If omitted, defaults to sending immediately.
//
// Any of "DontSend", "SendNow".
SendEmailOption InvoiceNewParamsSendEmailOption `json:"sendEmailOption,omitzero"`
// contains filtered or unexported fields
}
func (InvoiceNewParams) MarshalJSON ¶ added in v0.3.3
func (r InvoiceNewParams) MarshalJSON() (data []byte, err error)
func (*InvoiceNewParams) UnmarshalJSON ¶ added in v0.3.3
func (r *InvoiceNewParams) UnmarshalJSON(data []byte) error
type InvoiceNewParamsSendEmailOption ¶ added in v0.3.3
type InvoiceNewParamsSendEmailOption string
Rules for emailing the new invoice to payers. Can be "DontSend" to skip sending or "SendNow" to send immediately. If omitted, defaults to sending immediately.
const ( InvoiceNewParamsSendEmailOptionDontSend InvoiceNewParamsSendEmailOption = "DontSend" InvoiceNewParamsSendEmailOptionSendNow InvoiceNewParamsSendEmailOption = "SendNow" )
type InvoiceService ¶ added in v0.3.3
type InvoiceService struct {
Options []option.RequestOption
// Manage invoices
Attachments InvoiceAttachmentService
}
Manage invoices
InvoiceService contains methods and other services that help with interacting with the mercury 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 ¶ added in v0.3.3
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) Cancel ¶ added in v0.3.3
func (r *InvoiceService) Cancel(ctx context.Context, invoiceID string, opts ...option.RequestOption) (err error)
Cancel an invoice. This action cannot be undone.
func (*InvoiceService) Download ¶ added in v0.3.3
func (r *InvoiceService) Download(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *http.Response, err error)
Downloads a PDF file for the specified invoice. The response includes a Content-Disposition header set to 'attachment' with the filename.
func (*InvoiceService) Get ¶ added in v0.3.3
func (r *InvoiceService) Get(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *Invoice, err error)
Retrieve details of an invoice by its ID
func (*InvoiceService) List ¶ added in v0.3.3
func (r *InvoiceService) List(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) (res *pagination.CursorIDArInvoices[InvoiceListResponse], err error)
Retrieve a paginated list of invoices. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*InvoiceService) ListAutoPaging ¶ added in v0.3.3
func (r *InvoiceService) ListAutoPaging(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) *pagination.CursorIDArInvoicesAutoPager[InvoiceListResponse]
Retrieve a paginated list of invoices. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.
func (*InvoiceService) New ¶ added in v0.3.3
func (r *InvoiceService) New(ctx context.Context, body InvoiceNewParams, opts ...option.RequestOption) (res *Invoice, err error)
Create a new invoice for the organization
func (*InvoiceService) Update ¶ added in v0.3.3
func (r *InvoiceService) Update(ctx context.Context, invoiceID string, body InvoiceUpdateParams, opts ...option.RequestOption) (res *Invoice, err error)
Update an existing invoice
type InvoiceUpdateParams ¶ added in v0.3.3
type InvoiceUpdateParams struct {
// Whether or not the invoice can be paid via ACH debit.
ACHDebitEnabled bool `json:"achDebitEnabled" api:"required"`
// List of emails to be CCed on notifications/reminders.
CcEmails []string `json:"ccEmails,omitzero" api:"required"`
// Whether or not the invoice can be paid via credit card. Requires Stripe to be
// setup for the Mercury account.
CreditCardEnabled bool `json:"creditCardEnabled" api:"required"`
// The date the invoice should be paid by. YYYY-MM-DD
DueDate time.Time `json:"dueDate" api:"required" format:"date"`
// The date of the invoice, set by the invoice creator. Does not have to be the day
// the invoice was created. It can be business specific i.e. service/sale date.
// YYYY-MM-DD
InvoiceDate time.Time `json:"invoiceDate" api:"required" format:"date"`
// The invoice number.
InvoiceNumber string `json:"invoiceNumber" api:"required"`
// The line items for the invoice
LineItems []LineItemDataParam `json:"lineItems,omitzero" api:"required"`
// Whether or not the invoice payment instructions will show the real account and
// routing number for the destination account or use virtual account numbers
// instead.
UseRealAccountNumber bool `json:"useRealAccountNumber" api:"required"`
// Internal note for the invoice, visible by users in the organization but not
// visible to payers.
InternalNote param.Opt[string] `json:"internalNote,omitzero"`
// Memo for the payer of the invoice.
PayerMemo param.Opt[string] `json:"payerMemo,omitzero"`
// The purchase order number for the invoice if applicable.
PoNumber param.Opt[string] `json:"poNumber,omitzero"`
// The end date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodEndDate param.Opt[time.Time] `json:"servicePeriodEndDate,omitzero" format:"date"`
// The start date for the service period this invoice covers, if applicable.
// YYYY-MM-DD
ServicePeriodStartDate param.Opt[time.Time] `json:"servicePeriodStartDate,omitzero" format:"date"`
// contains filtered or unexported fields
}
func (InvoiceUpdateParams) MarshalJSON ¶ added in v0.3.3
func (r InvoiceUpdateParams) MarshalJSON() (data []byte, err error)
func (*InvoiceUpdateParams) UnmarshalJSON ¶ added in v0.3.3
func (r *InvoiceUpdateParams) UnmarshalJSON(data []byte) error
type LineItemData ¶
type LineItemData struct {
// the name of the line item
Name string `json:"name" api:"required"`
// the quantity of this item
Quantity float64 `json:"quantity" api:"required"`
// A dollar amount
UnitPrice float64 `json:"unitPrice" api:"required"`
// the sales tax applied to this item
SalesTaxRate float64 `json:"salesTaxRate" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Quantity respjson.Field
UnitPrice respjson.Field
SalesTaxRate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Data for an invoice line item
func (LineItemData) RawJSON ¶
func (r LineItemData) RawJSON() string
Returns the unmodified JSON received from the API
func (LineItemData) ToParam ¶
func (r LineItemData) ToParam() LineItemDataParam
ToParam converts this LineItemData to a LineItemDataParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with LineItemDataParam.Overrides()
func (*LineItemData) UnmarshalJSON ¶
func (r *LineItemData) UnmarshalJSON(data []byte) error
type LineItemDataParam ¶
type LineItemDataParam struct {
// the name of the line item
Name string `json:"name" api:"required"`
// the quantity of this item
Quantity float64 `json:"quantity" api:"required"`
// A dollar amount
UnitPrice float64 `json:"unitPrice" api:"required"`
// the sales tax applied to this item
SalesTaxRate param.Opt[float64] `json:"salesTaxRate,omitzero"`
// contains filtered or unexported fields
}
Data for an invoice line item
The properties Name, Quantity, UnitPrice are required.
func (LineItemDataParam) MarshalJSON ¶
func (r LineItemDataParam) MarshalJSON() (data []byte, err error)
func (*LineItemDataParam) UnmarshalJSON ¶
func (r *LineItemDataParam) UnmarshalJSON(data []byte) error
type MerchantData ¶
type MerchantData struct {
// Merchant ID for card transactions
ID string `json:"id" api:"nullable"`
// Mercury category for the merchant (e.g., "Restaurants", "Software")
//
// Any of "Other", "Advertising", "Airlines", "AlcoholAndBars",
// "BooksAndNewspaper", "CarRental", "Charity", "Clothing", "Conferences",
// "Education", "Electronics", "Entertainment", "FacilitiesExpenses", "Fees",
// "FoodDelivery", "FuelAndGas", "Gambling", "GovernmentServices", "Grocery",
// "GroundTransportation", "Insurance", "InternetAndTelephone", "Legal", "Lodging",
// "Medical", "Memberships", "OfficeSupplies", "OtherTravel", "Parking",
// "Political", "ProfessionalServices", "Restaurants", "Retail",
// "RideshareAndTaxis", "Shipping", "Software", "Taxes", "Utilities",
// "VehicleExpenses".
Category MercuryCategory `json:"category" api:"nullable"`
// 4-digit merchant category code (MCC) for card transactions
CategoryCode string `json:"categoryCode" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Category respjson.Field
CategoryCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Merchant information for card transactions
func (MerchantData) RawJSON ¶
func (r MerchantData) RawJSON() string
Returns the unmodified JSON received from the API
func (*MerchantData) UnmarshalJSON ¶
func (r *MerchantData) UnmarshalJSON(data []byte) error
type MercuryCategory ¶
type MercuryCategory string
const ( MercuryCategoryOther MercuryCategory = "Other" MercuryCategoryAdvertising MercuryCategory = "Advertising" MercuryCategoryAirlines MercuryCategory = "Airlines" MercuryCategoryAlcoholAndBars MercuryCategory = "AlcoholAndBars" MercuryCategoryBooksAndNewspaper MercuryCategory = "BooksAndNewspaper" MercuryCategoryCarRental MercuryCategory = "CarRental" MercuryCategoryCharity MercuryCategory = "Charity" MercuryCategoryClothing MercuryCategory = "Clothing" MercuryCategoryConferences MercuryCategory = "Conferences" MercuryCategoryEducation MercuryCategory = "Education" MercuryCategoryElectronics MercuryCategory = "Electronics" MercuryCategoryEntertainment MercuryCategory = "Entertainment" MercuryCategoryFacilitiesExpenses MercuryCategory = "FacilitiesExpenses" MercuryCategoryFees MercuryCategory = "Fees" MercuryCategoryFoodDelivery MercuryCategory = "FoodDelivery" MercuryCategoryFuelAndGas MercuryCategory = "FuelAndGas" MercuryCategoryGambling MercuryCategory = "Gambling" MercuryCategoryGovernmentServices MercuryCategory = "GovernmentServices" MercuryCategoryGrocery MercuryCategory = "Grocery" MercuryCategoryGroundTransportation MercuryCategory = "GroundTransportation" MercuryCategoryInsurance MercuryCategory = "Insurance" MercuryCategoryInternetAndTelephone MercuryCategory = "InternetAndTelephone" MercuryCategoryLegal MercuryCategory = "Legal" MercuryCategoryLodging MercuryCategory = "Lodging" MercuryCategoryMedical MercuryCategory = "Medical" MercuryCategoryMemberships MercuryCategory = "Memberships" MercuryCategoryOfficeSupplies MercuryCategory = "OfficeSupplies" MercuryCategoryOtherTravel MercuryCategory = "OtherTravel" MercuryCategoryParking MercuryCategory = "Parking" MercuryCategoryPolitical MercuryCategory = "Political" MercuryCategoryProfessionalServices MercuryCategory = "ProfessionalServices" MercuryCategoryRestaurants MercuryCategory = "Restaurants" MercuryCategoryRetail MercuryCategory = "Retail" MercuryCategoryShipping MercuryCategory = "Shipping" MercuryCategorySoftware MercuryCategory = "Software" MercuryCategoryTaxes MercuryCategory = "Taxes" MercuryCategoryUtilities MercuryCategory = "Utilities" MercuryCategoryVehicleExpenses MercuryCategory = "VehicleExpenses" )
type OrgGetResponse ¶ added in v0.3.3
type OrgGetResponse struct {
// Organization information
Organization OrgGetResponseOrganization `json:"organization" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Organization respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing organization details.
func (OrgGetResponse) RawJSON ¶ added in v0.3.3
func (r OrgGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrgGetResponse) UnmarshalJSON ¶ added in v0.3.3
func (r *OrgGetResponse) UnmarshalJSON(data []byte) error
type OrgGetResponseOrganization ¶ added in v0.3.3
type OrgGetResponseOrganization struct {
// Unique identifier for the organization
ID string `json:"id" api:"required" format:"uuid"`
// List of DBAs (Doing Business As names) for this organization
Dbas []OrgGetResponseOrganizationDba `json:"dbas" api:"required"`
// Whether this is a personal or business organization
//
// Any of "personal", "business".
Kind string `json:"kind" api:"required"`
// Legal business name as registered
LegalBusinessName string `json:"legalBusinessName" api:"required"`
// Employer Identification Number (EIN), if available
Ein string `json:"ein" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Dbas respjson.Field
Kind respjson.Field
LegalBusinessName respjson.Field
Ein respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Organization information
func (OrgGetResponseOrganization) RawJSON ¶ added in v0.3.3
func (r OrgGetResponseOrganization) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrgGetResponseOrganization) UnmarshalJSON ¶ added in v0.3.3
func (r *OrgGetResponseOrganization) UnmarshalJSON(data []byte) error
type OrgGetResponseOrganizationDba ¶ added in v0.3.3
type OrgGetResponseOrganizationDba struct {
// Whether this DBA is set as the default for payments
DbaIsDefault bool `json:"dbaIsDefault" api:"required"`
// The DBA name
DbaName string `json:"dbaName" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DbaIsDefault respjson.Field
DbaName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
DBA (Doing Business As) information
func (OrgGetResponseOrganizationDba) RawJSON ¶ added in v0.3.3
func (r OrgGetResponseOrganizationDba) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrgGetResponseOrganizationDba) UnmarshalJSON ¶ added in v0.3.3
func (r *OrgGetResponseOrganizationDba) UnmarshalJSON(data []byte) error
type OrgService ¶ added in v0.3.3
type OrgService struct {
Options []option.RequestOption
}
Organization information
OrgService contains methods and other services that help with interacting with the mercury 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 NewOrgService method instead.
func NewOrgService ¶ added in v0.3.3
func NewOrgService(opts ...option.RequestOption) (r OrgService)
NewOrgService 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 (*OrgService) Get ¶ added in v0.3.3
func (r *OrgService) Get(ctx context.Context, opts ...option.RequestOption) (res *OrgGetResponse, err error)
Retrieve information about your organization including EIN, legal business name, and DBAs.
type PaymentLinkStatus ¶
type PaymentLinkStatus string
const ( PaymentLinkStatusUnpaid PaymentLinkStatus = "Unpaid" PaymentLinkStatusPaid PaymentLinkStatus = "Paid" PaymentLinkStatusCancelled PaymentLinkStatus = "Cancelled" PaymentLinkStatusProcessing PaymentLinkStatus = "Processing" )
type PaymentListParams ¶ added in v0.4.1
type PaymentListParams struct {
// ID for a Mercury account.
AccountID param.Opt[string] `query:"accountId,omitzero" format:"uuid" json:"-"`
// The ID of the send money approval request to end the page before (exclusive).
// When provided, results will end just before this ID and work backwards. Use this
// for reverse pagination or to retrieve previous pages. Cannot be combined with
// start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the send money approval request to start the page after (exclusive).
// When provided, results will begin with the send money approval request
// immediately following this ID. Use this for standard forward pagination to get
// the next page of results. Cannot be combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Any of "pendingApproval", "approved", "rejected", "cancelled".
Status PaymentListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentListParams) URLQuery ¶ added in v0.4.1
func (r PaymentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentListParams's query parameters as `url.Values`.
type PaymentListParamsStatus ¶ added in v0.4.1
type PaymentListParamsStatus string
const ( PaymentListParamsStatusPendingApproval PaymentListParamsStatus = "pendingApproval" PaymentListParamsStatusApproved PaymentListParamsStatus = "approved" PaymentListParamsStatusRejected PaymentListParamsStatus = "rejected" PaymentListParamsStatusCancelled PaymentListParamsStatus = "cancelled" )
type PaymentNewParams ¶ added in v0.4.1
type PaymentNewParams struct {
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// Unique string identifying the transaction
IdempotencyKey string `json:"idempotencyKey" api:"required"`
// If domesticWire is used, then the purpose field is required.
//
// Any of "ach", "check", "domesticWire".
PaymentMethod PaymentNewParamsPaymentMethod `json:"paymentMethod,omitzero" api:"required"`
// ID for a Mercury account.
RecipientID string `json:"recipientId" api:"required" format:"uuid"`
// Optional external memo
ExternalMemo param.Opt[string] `json:"externalMemo,omitzero"`
// Optional note
Note param.Opt[string] `json:"note,omitzero"`
// External API representation of SendMoneyPurpose. Only exposes the 'simple' field
// to decouple internal implementation from external API.
Purpose PaymentNewParamsPurpose `json:"purpose,omitzero"`
// contains filtered or unexported fields
}
func (PaymentNewParams) MarshalJSON ¶ added in v0.4.1
func (r PaymentNewParams) MarshalJSON() (data []byte, err error)
func (*PaymentNewParams) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentNewParams) UnmarshalJSON(data []byte) error
type PaymentNewParamsPaymentMethod ¶ added in v0.4.1
type PaymentNewParamsPaymentMethod string
If domesticWire is used, then the purpose field is required.
const ( PaymentNewParamsPaymentMethodACH PaymentNewParamsPaymentMethod = "ach" PaymentNewParamsPaymentMethodCheck PaymentNewParamsPaymentMethod = "check" PaymentNewParamsPaymentMethodDomesticWire PaymentNewParamsPaymentMethod = "domesticWire" )
type PaymentNewParamsPurpose ¶ added in v0.4.1
type PaymentNewParamsPurpose struct {
Simple PaymentNewParamsPurposeSimple `json:"simple,omitzero"`
// contains filtered or unexported fields
}
External API representation of SendMoneyPurpose. Only exposes the 'simple' field to decouple internal implementation from external API.
func (PaymentNewParamsPurpose) MarshalJSON ¶ added in v0.4.1
func (r PaymentNewParamsPurpose) MarshalJSON() (data []byte, err error)
func (*PaymentNewParamsPurpose) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentNewParamsPurpose) UnmarshalJSON(data []byte) error
type PaymentNewParamsPurposeSimple ¶ added in v0.4.1
type PaymentNewParamsPurposeSimple struct {
// Payment category.
//
// Any of "Employee", "Landlord", "Vendor", "Contractor", "Subsidiary",
// "TransferToMyExternalAccount", "FamilyMemberOrFriend", "ForGoodsOrServices",
// "AngelInvestment", "SavingsOrInvestments", "Expenses", "Travel", "Other".
Category string `json:"category,omitzero" api:"required"`
// Additional information. Required for: Vendor (vendor name), Contractor
// (contractor name), Other (payment description). Optional for Subsidiary
// (subsidiary name). Not accepted for any other categories.
AdditionalInfo param.Opt[string] `json:"additionalInfo,omitzero"`
// contains filtered or unexported fields
}
The property Category is required.
func (PaymentNewParamsPurposeSimple) MarshalJSON ¶ added in v0.4.1
func (r PaymentNewParamsPurposeSimple) MarshalJSON() (data []byte, err error)
func (*PaymentNewParamsPurposeSimple) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentNewParamsPurposeSimple) UnmarshalJSON(data []byte) error
type PaymentRequestParams ¶ added in v0.4.1
type PaymentRequestParams struct {
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// Unique string identifying the transaction
IdempotencyKey string `json:"idempotencyKey" api:"required"`
// Payment method to use.
//
// Any of "ach", "check", "domesticWire", "internationalWire".
PaymentMethod SendMoneyPaymentMethod `json:"paymentMethod,omitzero" api:"required"`
// ID for a Mercury account.
RecipientID string `json:"recipientId" api:"required" format:"uuid"`
// Optional external memo
ExternalMemo param.Opt[string] `json:"externalMemo,omitzero"`
// Optional note
Note param.Opt[string] `json:"note,omitzero"`
// contains filtered or unexported fields
}
func (PaymentRequestParams) MarshalJSON ¶ added in v0.4.1
func (r PaymentRequestParams) MarshalJSON() (data []byte, err error)
func (*PaymentRequestParams) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentRequestParams) UnmarshalJSON(data []byte) error
type PaymentService ¶ added in v0.4.1
type PaymentService struct {
Options []option.RequestOption
}
PaymentService contains methods and other services that help with interacting with the mercury API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentService method instead.
func NewPaymentService ¶ added in v0.4.1
func NewPaymentService(opts ...option.RequestOption) (r PaymentService)
NewPaymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PaymentService) Get ¶ added in v0.4.1
func (r *PaymentService) Get(ctx context.Context, requestID string, opts ...option.RequestOption) (res *SendMoneyApproval, err error)
Get send money approval request by ID
func (*PaymentService) List ¶ added in v0.4.1
func (r *PaymentService) List(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) (res *pagination.CursorIDRequestSendMoney[SendMoneyApproval], err error)
Retrieve a paginated list of send money approval requests for the authenticated organization. Supports filtering by account and status.
func (*PaymentService) ListAutoPaging ¶ added in v0.4.1
func (r *PaymentService) ListAutoPaging(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) *pagination.CursorIDRequestSendMoneyAutoPager[SendMoneyApproval]
Retrieve a paginated list of send money approval requests for the authenticated organization. Supports filtering by account and status.
func (*PaymentService) New ¶ added in v0.4.1
func (r *PaymentService) New(ctx context.Context, accountID string, body PaymentNewParams, opts ...option.RequestOption) (res *Transaction, err error)
Send money from an account to a recipient. Creates a transaction that will be processed immediately or may require approval.
func (*PaymentService) Request ¶ added in v0.4.1
func (r *PaymentService) Request(ctx context.Context, accountID string, body PaymentRequestParams, opts ...option.RequestOption) (res *SendMoneyApproval, err error)
Create a "request to send money" that will require approval based on your organization's approval policies.
func (*PaymentService) Transfer ¶ added in v0.4.1
func (r *PaymentService) Transfer(ctx context.Context, body PaymentTransferParams, opts ...option.RequestOption) (res *PaymentTransferResponse, err error)
Transfer funds between two accounts within the same organization. Supports transfers between depository accounts (checking/savings), from a depository account to a treasury/investment account, and from a treasury/investment account to a depository account. Creates paired debit and credit transactions.
type PaymentTransferParams ¶ added in v0.4.1
type PaymentTransferParams struct {
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// ID for a Mercury account.
DestinationAccountID string `json:"destinationAccountId" api:"required" format:"uuid"`
IdempotencyKey string `json:"idempotencyKey" api:"required"`
// ID for a Mercury account.
SourceAccountID string `json:"sourceAccountId" api:"required" format:"uuid"`
Note param.Opt[string] `json:"note,omitzero"`
// contains filtered or unexported fields
}
func (PaymentTransferParams) MarshalJSON ¶ added in v0.4.1
func (r PaymentTransferParams) MarshalJSON() (data []byte, err error)
func (*PaymentTransferParams) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentTransferParams) UnmarshalJSON(data []byte) error
type PaymentTransferResponse ¶ added in v0.4.1
type PaymentTransferResponse struct {
CreditTransaction Transaction `json:"creditTransaction" api:"required"`
DebitTransaction Transaction `json:"debitTransaction" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreditTransaction respjson.Field
DebitTransaction respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for POST /api/v1/transfer endpoint. Returns both the credit and debit transactions for the transfer (depository, treasury, or investment).
func (PaymentTransferResponse) RawJSON ¶ added in v0.4.1
func (r PaymentTransferResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentTransferResponse) UnmarshalJSON ¶ added in v0.4.1
func (r *PaymentTransferResponse) UnmarshalJSON(data []byte) error
type RealTimePaymentRoutingInfo ¶
type RealTimePaymentRoutingInfo struct {
AccountNumber string `json:"accountNumber" api:"required"`
RoutingNumber string `json:"routingNumber" api:"required"`
Address AddressWithoutName `json:"address" api:"nullable"`
BankName string `json:"bankName" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountNumber respjson.Field
RoutingNumber respjson.Field
Address respjson.Field
BankName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RealTimePaymentRoutingInfo) RawJSON ¶
func (r RealTimePaymentRoutingInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*RealTimePaymentRoutingInfo) UnmarshalJSON ¶
func (r *RealTimePaymentRoutingInfo) UnmarshalJSON(data []byte) error
type Recipient ¶
type Recipient struct {
// ID for a Mercury account.
ID string `json:"id" api:"required" format:"uuid"`
Attachments []RecipientAttachment `json:"attachments" api:"required"`
// Any of "ach", "check", "domesticWire", "internationalWire", "realTimePayment".
DefaultPaymentMethod RecipientDefaultPaymentMethod `json:"defaultPaymentMethod" api:"required"`
Emails []string `json:"emails" api:"required"`
Name string `json:"name" api:"required"`
// Any of "active", "deleted".
Status RecipientStatus `json:"status" api:"required"`
Address Address `json:"address" api:"nullable"`
CheckInfo CheckInfo `json:"checkInfo" api:"nullable"`
ContactEmail string `json:"contactEmail" api:"nullable"`
DateLastPaid string `json:"dateLastPaid" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
DefaultAddress AddressWithoutName `json:"defaultAddress" api:"nullable"`
DomesticWireRoutingInfo DomesticWireRoutingInfo `json:"domesticWireRoutingInfo" api:"nullable"`
ElectronicRoutingInfo ElectronicRoutingInfo `json:"electronicRoutingInfo" api:"nullable"`
InternationalWireRoutingInfo InternationalWireRoutingInfo `json:"internationalWireRoutingInfo" api:"nullable"`
IsBusiness bool `json:"isBusiness" api:"nullable"`
Nickname string `json:"nickname" api:"nullable"`
RealTimePaymentRoutingInfo RealTimePaymentRoutingInfo `json:"realTimePaymentRoutingInfo" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Attachments respjson.Field
DefaultPaymentMethod respjson.Field
Emails respjson.Field
Name respjson.Field
Status respjson.Field
Address respjson.Field
CheckInfo respjson.Field
ContactEmail respjson.Field
DateLastPaid respjson.Field
DefaultAddress respjson.Field
DomesticWireRoutingInfo respjson.Field
ElectronicRoutingInfo respjson.Field
InternationalWireRoutingInfo respjson.Field
IsBusiness respjson.Field
Nickname respjson.Field
RealTimePaymentRoutingInfo respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Recipient) UnmarshalJSON ¶
type RecipientAttachment ¶
type RecipientAttachment struct {
// Name of the uploaded file
FileName string `json:"fileName" api:"required"`
// Timestamp when the attachment was uploaded
UploadedAt string `json:"uploadedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Presigned URL to download the attachment (valid for 12 hours)
URL string `json:"url" api:"required"`
// The tax form type (W-9 for US persons, W-8BEN for foreign individuals, W-8BEN-E
// for foreign entities)
//
// Any of "w9", "w8BEN", "w8BENE", "unknown".
FormType TaxFormType `json:"formType" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileName respjson.Field
UploadedAt respjson.Field
URL respjson.Field
FormType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RecipientAttachment) RawJSON ¶
func (r RecipientAttachment) RawJSON() string
Returns the unmodified JSON received from the API
func (*RecipientAttachment) UnmarshalJSON ¶
func (r *RecipientAttachment) UnmarshalJSON(data []byte) error
type RecipientAttachmentAttachParams ¶ added in v0.4.2
type RecipientAttachmentAttachParams struct {
// The file to upload (tax form document)
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
// contains filtered or unexported fields
}
func (RecipientAttachmentAttachParams) MarshalMultipart ¶ added in v0.4.2
func (r RecipientAttachmentAttachParams) MarshalMultipart() (data []byte, contentType string, err error)
type RecipientAttachmentListParams ¶ added in v0.4.2
type RecipientAttachmentListParams struct {
// The ID of the recipient attachment to end the page before (exclusive). When
// provided, results will end just before this ID and work backwards. Use this for
// reverse pagination or to retrieve previous pages. Cannot be combined with
// start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the recipient attachment to start the page after (exclusive). When
// provided, results will begin with the recipient attachment immediately following
// this ID. Use this for standard forward pagination to get the next page of
// results. Cannot be combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order RecipientAttachmentListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RecipientAttachmentListParams) URLQuery ¶ added in v0.4.2
func (r RecipientAttachmentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RecipientAttachmentListParams's query parameters as `url.Values`.
type RecipientAttachmentListParamsOrder ¶ added in v0.4.2
type RecipientAttachmentListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( RecipientAttachmentListParamsOrderAsc RecipientAttachmentListParamsOrder = "asc" RecipientAttachmentListParamsOrderDesc RecipientAttachmentListParamsOrder = "desc" )
type RecipientAttachmentListResponse ¶ added in v0.4.2
type RecipientAttachmentListResponse struct {
// ID for the recipient tax form attachment
ID string `json:"id" api:"required" format:"uuid"`
// Name of the uploaded file
FileName string `json:"fileName" api:"required"`
// ID for a Mercury account.
RecipientID string `json:"recipientId" api:"required" format:"uuid"`
// Timestamp when the attachment was uploaded
UploadedAt string `json:"uploadedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Presigned URL to download the attachment (valid for 12 hours)
URL string `json:"url" api:"required"`
// The tax form type (W-9, W-8BEN, W-8BEN-E, or Unknown)
//
// Any of "w9", "w8BEN", "w8BENE", "unknown".
FormType TaxFormType `json:"formType" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
FileName respjson.Field
RecipientID respjson.Field
UploadedAt respjson.Field
URL respjson.Field
FormType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RecipientAttachmentListResponse) RawJSON ¶ added in v0.4.2
func (r RecipientAttachmentListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RecipientAttachmentListResponse) UnmarshalJSON ¶ added in v0.4.2
func (r *RecipientAttachmentListResponse) UnmarshalJSON(data []byte) error
type RecipientAttachmentService ¶ added in v0.4.2
type RecipientAttachmentService struct {
Options []option.RequestOption
}
Manage payment recipients
RecipientAttachmentService contains methods and other services that help with interacting with the mercury 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 NewRecipientAttachmentService method instead.
func NewRecipientAttachmentService ¶ added in v0.4.2
func NewRecipientAttachmentService(opts ...option.RequestOption) (r RecipientAttachmentService)
NewRecipientAttachmentService 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 (*RecipientAttachmentService) Attach ¶ added in v0.4.2
func (r *RecipientAttachmentService) Attach(ctx context.Context, recipientID string, body RecipientAttachmentAttachParams, opts ...option.RequestOption) (err error)
Upload a tax form attachment for a recipient. The file is uploaded via multipart/form-data. Supported file types include PDF, images (PNG, JPG, GIF), and common document formats. The attachment will be associated as a tax document for the recipient.
func (*RecipientAttachmentService) List ¶ added in v0.4.2
func (r *RecipientAttachmentService) List(ctx context.Context, query RecipientAttachmentListParams, opts ...option.RequestOption) (res *pagination.CursorIDRecipientAttachments[RecipientAttachmentListResponse], err error)
Retrieve a paginated list of all recipient tax form attachments across all recipients in the organization. Use cursor parameters (start_after, end_before) for pagination.
func (*RecipientAttachmentService) ListAutoPaging ¶ added in v0.4.2
func (r *RecipientAttachmentService) ListAutoPaging(ctx context.Context, query RecipientAttachmentListParams, opts ...option.RequestOption) *pagination.CursorIDRecipientAttachmentsAutoPager[RecipientAttachmentListResponse]
Retrieve a paginated list of all recipient tax form attachments across all recipients in the organization. Use cursor parameters (start_after, end_before) for pagination.
type RecipientDefaultPaymentMethod ¶
type RecipientDefaultPaymentMethod string
const ( RecipientDefaultPaymentMethodACH RecipientDefaultPaymentMethod = "ach" RecipientDefaultPaymentMethodCheck RecipientDefaultPaymentMethod = "check" RecipientDefaultPaymentMethodDomesticWire RecipientDefaultPaymentMethod = "domesticWire" RecipientDefaultPaymentMethodInternationalWire RecipientDefaultPaymentMethod = "internationalWire" RecipientDefaultPaymentMethodRealTimePayment RecipientDefaultPaymentMethod = "realTimePayment" )
type RecipientListParams ¶
type RecipientListParams struct {
// The ID of the recipient to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the recipient to start the page after (exclusive). When provided,
// results will begin with the recipient immediately following this ID. Use this
// for standard forward pagination to get the next page of results. Cannot be
// combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order RecipientListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RecipientListParams) URLQuery ¶
func (r RecipientListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RecipientListParams's query parameters as `url.Values`.
type RecipientListParamsOrder ¶
type RecipientListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( RecipientListParamsOrderAsc RecipientListParamsOrder = "asc" RecipientListParamsOrderDesc RecipientListParamsOrder = "desc" )
type RecipientNewParams ¶
type RecipientNewParams struct {
Emails []string `json:"emails,omitzero" api:"required"`
Name string `json:"name" api:"required"`
// Contact email address of the recipient
ContactEmail param.Opt[string] `json:"contactEmail,omitzero"`
Nickname param.Opt[string] `json:"nickname,omitzero"`
// Deprecated. Use checkInfo instead.
Address AddressDataParam `json:"address,omitzero"`
// Information needed to send a physical check.
CheckInfo CheckInfoRawParam `json:"checkInfo,omitzero"`
// Information needed to send a domestic wire.
DomesticWireRoutingInfo DomesticWireRoutingInfoRawParam `json:"domesticWireRoutingInfo,omitzero"`
// Information needed to send an ACH.
ElectronicRoutingInfo ElectronicRoutingInfoRawParam `json:"electronicRoutingInfo,omitzero"`
// contains filtered or unexported fields
}
func (RecipientNewParams) MarshalJSON ¶
func (r RecipientNewParams) MarshalJSON() (data []byte, err error)
func (*RecipientNewParams) UnmarshalJSON ¶
func (r *RecipientNewParams) UnmarshalJSON(data []byte) error
type RecipientService ¶
type RecipientService struct {
Options []option.RequestOption
// Manage payment recipients
Attachments RecipientAttachmentService
}
Manage payment recipients
RecipientService contains methods and other services that help with interacting with the mercury 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 NewRecipientService method instead.
func NewRecipientService ¶
func NewRecipientService(opts ...option.RequestOption) (r RecipientService)
NewRecipientService 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 (*RecipientService) Get ¶
func (r *RecipientService) Get(ctx context.Context, recipientID string, opts ...option.RequestOption) (res *Recipient, err error)
Retrieve details of a specific recipient by ID
func (*RecipientService) List ¶
func (r *RecipientService) List(ctx context.Context, query RecipientListParams, opts ...option.RequestOption) (res *pagination.CursorIDRecipients[Recipient], err error)
Retrieve a paginated list of all recipients. Use cursor parameters (start_after, end_before) for pagination.
func (*RecipientService) ListAutoPaging ¶
func (r *RecipientService) ListAutoPaging(ctx context.Context, query RecipientListParams, opts ...option.RequestOption) *pagination.CursorIDRecipientsAutoPager[Recipient]
Retrieve a paginated list of all recipients. Use cursor parameters (start_after, end_before) for pagination.
func (*RecipientService) New ¶
func (r *RecipientService) New(ctx context.Context, body RecipientNewParams, opts ...option.RequestOption) (res *Recipient, err error)
Create a new recipient for making payments
func (*RecipientService) Update ¶
func (r *RecipientService) Update(ctx context.Context, recipientID string, body RecipientUpdateParams, opts ...option.RequestOption) (res *Recipient, err error)
Update an existing recipient's information
type RecipientStatus ¶
type RecipientStatus string
const ( RecipientStatusActive RecipientStatus = "active" RecipientStatusDeleted RecipientStatus = "deleted" )
type RecipientUpdateParams ¶
type RecipientUpdateParams struct {
// Contact email address of the recipient
ContactEmail param.Opt[string] `json:"contactEmail,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
Nickname param.Opt[string] `json:"nickname,omitzero"`
// Deprecated. Use checkInfo instead.
Address AddressDataParam `json:"address,omitzero"`
// Information needed to send a check.
CheckInfo CheckInfoRawParam `json:"checkInfo,omitzero"`
// Information needed to send a domestic wire.
DomesticWireRoutingInfo DomesticWireRoutingInfoRawParam `json:"domesticWireRoutingInfo,omitzero"`
// Information needed to send an ACH.
ElectronicRoutingInfo ElectronicRoutingInfoRawParam `json:"electronicRoutingInfo,omitzero"`
Emails []string `json:"emails,omitzero"`
// contains filtered or unexported fields
}
func (RecipientUpdateParams) MarshalJSON ¶
func (r RecipientUpdateParams) MarshalJSON() (data []byte, err error)
func (*RecipientUpdateParams) UnmarshalJSON ¶
func (r *RecipientUpdateParams) UnmarshalJSON(data []byte) error
type RelatedTransactionData ¶
type RelatedTransactionData struct {
// ID for this transaction
ID string `json:"id" api:"required" format:"uuid"`
// ID for a Mercury account.
AccountID string `json:"accountId" api:"required" format:"uuid"`
Amount float64 `json:"amount" api:"required"`
// Any of "ProvisionalCreditReversalToMerchantRefund",
// "MerchantRefundToProvisionalCreditReversal", "MerchantRefundToFraudulentCharge",
// "FraudulentChargeToMerchantRefund", "PaymentRefundToFailedPayment",
// "FailedPaymentToPaymentRefund", "GiftCompensationToOriginalTransaction",
// "FeePaymentToOriginalTransaction", "OriginalTransactionToFeePayment",
// "FeePaymentToFeeRebate", "FeeRebateToFeePayment", "FeePaymentToFeeReversal",
// "FeeReversalToFeePayment", "FeeRebateToFeeRebateReversal",
// "FeeRebateReversalToFeeRebate", "TreasurySplitLiquidation",
// "ProvisionalCreditToOriginalCharge", "OriginalChargeToProvisionalCredit",
// "FeeAtmReimbursementToAtmTransaction", "AtmTransactionToFeeAtmReimbursement",
// "AtmTransactionToAtmReimbursementReversal",
// "AtmReimbursementReversalToAtmTransaction", "ReturnToOriginalTransaction",
// "OriginalTransactionToReturn", "ProvisionalCreditToReversal",
// "ReversalToProvisionalCredit".
RelationKind RelatedTransactionDataRelationKind `json:"relationKind" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
Amount respjson.Field
RelationKind respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A Public API version of RelatedTransactionData.
func (RelatedTransactionData) RawJSON ¶
func (r RelatedTransactionData) RawJSON() string
Returns the unmodified JSON received from the API
func (*RelatedTransactionData) UnmarshalJSON ¶
func (r *RelatedTransactionData) UnmarshalJSON(data []byte) error
type RelatedTransactionDataRelationKind ¶
type RelatedTransactionDataRelationKind string
const ( RelatedTransactionDataRelationKindProvisionalCreditReversalToMerchantRefund RelatedTransactionDataRelationKind = "ProvisionalCreditReversalToMerchantRefund" RelatedTransactionDataRelationKindMerchantRefundToProvisionalCreditReversal RelatedTransactionDataRelationKind = "MerchantRefundToProvisionalCreditReversal" RelatedTransactionDataRelationKindMerchantRefundToFraudulentCharge RelatedTransactionDataRelationKind = "MerchantRefundToFraudulentCharge" RelatedTransactionDataRelationKindFraudulentChargeToMerchantRefund RelatedTransactionDataRelationKind = "FraudulentChargeToMerchantRefund" RelatedTransactionDataRelationKindPaymentRefundToFailedPayment RelatedTransactionDataRelationKind = "PaymentRefundToFailedPayment" RelatedTransactionDataRelationKindFailedPaymentToPaymentRefund RelatedTransactionDataRelationKind = "FailedPaymentToPaymentRefund" RelatedTransactionDataRelationKindGiftCompensationToOriginalTransaction RelatedTransactionDataRelationKind = "GiftCompensationToOriginalTransaction" RelatedTransactionDataRelationKindFeePaymentToOriginalTransaction RelatedTransactionDataRelationKind = "FeePaymentToOriginalTransaction" RelatedTransactionDataRelationKindOriginalTransactionToFeePayment RelatedTransactionDataRelationKind = "OriginalTransactionToFeePayment" RelatedTransactionDataRelationKindFeePaymentToFeeRebate RelatedTransactionDataRelationKind = "FeePaymentToFeeRebate" RelatedTransactionDataRelationKindFeeRebateToFeePayment RelatedTransactionDataRelationKind = "FeeRebateToFeePayment" RelatedTransactionDataRelationKindFeePaymentToFeeReversal RelatedTransactionDataRelationKind = "FeePaymentToFeeReversal" RelatedTransactionDataRelationKindFeeReversalToFeePayment RelatedTransactionDataRelationKind = "FeeReversalToFeePayment" RelatedTransactionDataRelationKindFeeRebateToFeeRebateReversal RelatedTransactionDataRelationKind = "FeeRebateToFeeRebateReversal" RelatedTransactionDataRelationKindFeeRebateReversalToFeeRebate RelatedTransactionDataRelationKind = "FeeRebateReversalToFeeRebate" RelatedTransactionDataRelationKindTreasurySplitLiquidation RelatedTransactionDataRelationKind = "TreasurySplitLiquidation" RelatedTransactionDataRelationKindProvisionalCreditToOriginalCharge RelatedTransactionDataRelationKind = "ProvisionalCreditToOriginalCharge" RelatedTransactionDataRelationKindOriginalChargeToProvisionalCredit RelatedTransactionDataRelationKind = "OriginalChargeToProvisionalCredit" RelatedTransactionDataRelationKindFeeAtmReimbursementToAtmTransaction RelatedTransactionDataRelationKind = "FeeAtmReimbursementToAtmTransaction" RelatedTransactionDataRelationKindAtmTransactionToFeeAtmReimbursement RelatedTransactionDataRelationKind = "AtmTransactionToFeeAtmReimbursement" RelatedTransactionDataRelationKindAtmTransactionToAtmReimbursementReversal RelatedTransactionDataRelationKind = "AtmTransactionToAtmReimbursementReversal" RelatedTransactionDataRelationKindAtmReimbursementReversalToAtmTransaction RelatedTransactionDataRelationKind = "AtmReimbursementReversalToAtmTransaction" RelatedTransactionDataRelationKindReturnToOriginalTransaction RelatedTransactionDataRelationKind = "ReturnToOriginalTransaction" RelatedTransactionDataRelationKindOriginalTransactionToReturn RelatedTransactionDataRelationKind = "OriginalTransactionToReturn" RelatedTransactionDataRelationKindProvisionalCreditToReversal RelatedTransactionDataRelationKind = "ProvisionalCreditToReversal" RelatedTransactionDataRelationKindReversalToProvisionalCredit RelatedTransactionDataRelationKind = "ReversalToProvisionalCredit" )
type SafeRequest ¶
type SafeRequest struct {
// ID for the SAFE request
ID string `json:"id" api:"required" format:"uuid"`
DocumentURL string `json:"documentUrl" api:"required"`
ExpiresAt string `json:"expiresAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
IncludesMostFavoredNationClause bool `json:"includesMostFavoredNationClause" api:"required"`
IncludesProRataRightsLetter bool `json:"includesProRataRightsLetter" api:"required"`
// A positive dollar amount with at least 1 cent.
InvestmentAmount float64 `json:"investmentAmount" api:"required"`
InvestmentDate time.Time `json:"investmentDate" api:"required" format:"date"`
// Details about the investor buying the equity.
Investor SafeRequestInvestor `json:"investor" api:"required"`
// Details about the organization selling the equity
Organization SafeRequestOrganization `json:"organization" api:"required"`
// Any of "PreMoney", "PostMoney", "NoValuation".
ValuationType SafeRequestValuationType `json:"valuationType" api:"required"`
CanceledAt string `json:"canceledAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
DiscountRate float64 `json:"discountRate" api:"nullable"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
GoverningState UsState `json:"governingState" api:"nullable"`
PaidAt string `json:"paidAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
SignedByInvestorAt string `json:"signedByInvestorAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
SignedByOwnerAt string `json:"signedByOwnerAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// A positive dollar amount with at least 1 cent.
ValuationCap float64 `json:"valuationCap" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
DocumentURL respjson.Field
ExpiresAt respjson.Field
IncludesMostFavoredNationClause respjson.Field
IncludesProRataRightsLetter respjson.Field
InvestmentAmount respjson.Field
InvestmentDate respjson.Field
Investor respjson.Field
Organization respjson.Field
ValuationType respjson.Field
CanceledAt respjson.Field
DiscountRate respjson.Field
GoverningState respjson.Field
PaidAt respjson.Field
SignedByInvestorAt respjson.Field
SignedByOwnerAt respjson.Field
ValuationCap respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A summary of a SAFE request.
func (SafeRequest) RawJSON ¶
func (r SafeRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*SafeRequest) UnmarshalJSON ¶
func (r *SafeRequest) UnmarshalJSON(data []byte) error
type SafeRequestInvestor ¶
type SafeRequestInvestor struct {
// Any of "SafeRequestInvestorTypeIndividual",
// "SafeRequestInvestorTypeVentureFund", "SafeRequestInvestorTypeOther".
InvestorType string `json:"investorType" api:"required"`
LegalEntityName string `json:"legalEntityName" api:"required"`
SignatoryEmail string `json:"signatoryEmail" api:"required"`
SignatoryName string `json:"signatoryName" api:"required"`
AdditionalBylines string `json:"additionalBylines" api:"nullable"`
Address string `json:"address" api:"nullable"`
SignatoryTitle string `json:"signatoryTitle" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InvestorType respjson.Field
LegalEntityName respjson.Field
SignatoryEmail respjson.Field
SignatoryName respjson.Field
AdditionalBylines respjson.Field
Address respjson.Field
SignatoryTitle respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details about the investor buying the equity.
func (SafeRequestInvestor) RawJSON ¶
func (r SafeRequestInvestor) RawJSON() string
Returns the unmodified JSON received from the API
func (*SafeRequestInvestor) UnmarshalJSON ¶
func (r *SafeRequestInvestor) UnmarshalJSON(data []byte) error
type SafeRequestOrganization ¶
type SafeRequestOrganization struct {
LegalEntityName string `json:"legalEntityName" api:"required"`
SignatoryEmail string `json:"signatoryEmail" api:"required"`
SignatoryName string `json:"signatoryName" api:"required"`
SignatoryTitle string `json:"signatoryTitle" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LegalEntityName respjson.Field
SignatoryEmail respjson.Field
SignatoryName respjson.Field
SignatoryTitle respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details about the organization selling the equity
func (SafeRequestOrganization) RawJSON ¶
func (r SafeRequestOrganization) RawJSON() string
Returns the unmodified JSON received from the API
func (*SafeRequestOrganization) UnmarshalJSON ¶
func (r *SafeRequestOrganization) UnmarshalJSON(data []byte) error
type SafeRequestValuationType ¶
type SafeRequestValuationType string
const ( SafeRequestValuationTypePreMoney SafeRequestValuationType = "PreMoney" SafeRequestValuationTypePostMoney SafeRequestValuationType = "PostMoney" SafeRequestValuationTypeNoValuation SafeRequestValuationType = "NoValuation" )
type SafeService ¶
type SafeService struct {
Options []option.RequestOption
}
Manage SAFE (Simple Agreement for Future Equity) requests
SafeService contains methods and other services that help with interacting with the mercury 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 NewSafeService method instead.
func NewSafeService ¶
func NewSafeService(opts ...option.RequestOption) (r SafeService)
NewSafeService 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 (*SafeService) Download ¶ added in v0.4.0
func (r *SafeService) Download(ctx context.Context, safeRequestID string, opts ...option.RequestOption) (res *http.Response, err error)
Download the PDF document for a specific SAFE request. Returns binary PDF data with a Content-Disposition header.
func (*SafeService) Get ¶
func (r *SafeService) Get(ctx context.Context, safeRequestID string, opts ...option.RequestOption) (res *SafeRequest, err error)
Retrieve a specific SAFE request by its ID.
func (*SafeService) List ¶
func (r *SafeService) List(ctx context.Context, opts ...option.RequestOption) (res *[]SafeRequest, err error)
Retrieve all SAFE (Simple Agreement for Future Equity) requests for your organization.
type SendMoneyApproval ¶
type SendMoneyApproval struct {
// ID for a Mercury account.
AccountID string `json:"accountId" api:"required" format:"uuid"`
// A positive dollar amount with at least 1 cent.
Amount float64 `json:"amount" api:"required"`
// Any of "ach", "check", "domesticWire", "internationalWire".
PaymentMethod SendMoneyPaymentMethod `json:"paymentMethod" api:"required"`
// ID for a Mercury account.
RecipientID string `json:"recipientId" api:"required" format:"uuid"`
RequestID string `json:"requestId" api:"required"`
// Any of "pendingApproval", "approved", "rejected", "cancelled".
Status SendMoneyApprovalStatus `json:"status" api:"required"`
Memo string `json:"memo" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountID respjson.Field
Amount respjson.Field
PaymentMethod respjson.Field
RecipientID respjson.Field
RequestID respjson.Field
Status respjson.Field
Memo respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Extremely close to the internal type, but strips out potentially unwanted fields
func (SendMoneyApproval) RawJSON ¶
func (r SendMoneyApproval) RawJSON() string
Returns the unmodified JSON received from the API
func (*SendMoneyApproval) UnmarshalJSON ¶
func (r *SendMoneyApproval) UnmarshalJSON(data []byte) error
type SendMoneyApprovalStatus ¶
type SendMoneyApprovalStatus string
const ( SendMoneyApprovalStatusPendingApproval SendMoneyApprovalStatus = "pendingApproval" SendMoneyApprovalStatusApproved SendMoneyApprovalStatus = "approved" SendMoneyApprovalStatusRejected SendMoneyApprovalStatus = "rejected" SendMoneyApprovalStatusCancelled SendMoneyApprovalStatus = "cancelled" )
type SendMoneyPaymentMethod ¶
type SendMoneyPaymentMethod string
const ( SendMoneyPaymentMethodACH SendMoneyPaymentMethod = "ach" SendMoneyPaymentMethodCheck SendMoneyPaymentMethod = "check" SendMoneyPaymentMethodDomesticWire SendMoneyPaymentMethod = "domesticWire" SendMoneyPaymentMethodInternationalWire SendMoneyPaymentMethod = "internationalWire" )
type StatementAccountListParams ¶ added in v0.4.1
type StatementAccountListParams struct {
// Filter statements where the period start date is on or before this date. If the
// date is in the future, defaults to the current date. Format: YYYY-MM-DD
End param.Opt[string] `query:"end,omitzero" json:"-"`
// The ID of the statement to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter statements where the period start date is on or after this date. Format:
// YYYY-MM-DD
Start param.Opt[string] `query:"start,omitzero" json:"-"`
// The ID of the statement to start the page after (exclusive). When provided,
// results will begin with the statement immediately following this ID. Use this
// for standard forward pagination to get the next page of results. Cannot be
// combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'desc'
//
// Any of "asc", "desc".
Order StatementAccountListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatementAccountListParams) URLQuery ¶ added in v0.4.1
func (r StatementAccountListParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatementAccountListParams's query parameters as `url.Values`.
type StatementAccountListParamsOrder ¶ added in v0.4.1
type StatementAccountListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'desc'
const ( StatementAccountListParamsOrderAsc StatementAccountListParamsOrder = "asc" StatementAccountListParamsOrderDesc StatementAccountListParamsOrder = "desc" )
type StatementAccountListResponse ¶ added in v0.4.1
type StatementAccountListResponse struct {
// ID for the account statement
ID string `json:"id" api:"required" format:"uuid"`
AccountNumber string `json:"accountNumber" api:"required"`
CompanyLegalAddress Address `json:"companyLegalAddress" api:"required"`
CompanyLegalName string `json:"companyLegalName" api:"required"`
DownloadURL string `json:"downloadUrl" api:"required"`
EndDate string `json:"endDate" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// A dollar amount
EndingBalance float64 `json:"endingBalance" api:"required"`
RoutingNumber string `json:"routingNumber" api:"required"`
StartDate string `json:"startDate" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
Transactions []StatementAccountListResponseTransaction `json:"transactions" api:"required"`
Ein string `json:"ein" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountNumber respjson.Field
CompanyLegalAddress respjson.Field
CompanyLegalName respjson.Field
DownloadURL respjson.Field
EndDate respjson.Field
EndingBalance respjson.Field
RoutingNumber respjson.Field
StartDate respjson.Field
Transactions respjson.Field
Ein respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StatementAccountListResponse) RawJSON ¶ added in v0.4.1
func (r StatementAccountListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StatementAccountListResponse) UnmarshalJSON ¶ added in v0.4.1
func (r *StatementAccountListResponse) UnmarshalJSON(data []byte) error
type StatementAccountListResponseTransaction ¶ added in v0.4.1
type StatementAccountListResponseTransaction struct {
// ID for this transaction
ID string `json:"id" api:"required" format:"uuid"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
PostedAt string `json:"postedAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
PostedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StatementAccountListResponseTransaction) RawJSON ¶ added in v0.4.1
func (r StatementAccountListResponseTransaction) RawJSON() string
Returns the unmodified JSON received from the API
func (*StatementAccountListResponseTransaction) UnmarshalJSON ¶ added in v0.4.1
func (r *StatementAccountListResponseTransaction) UnmarshalJSON(data []byte) error
type StatementAccountService ¶ added in v0.4.1
type StatementAccountService struct {
Options []option.RequestOption
}
Manage bank accounts
StatementAccountService contains methods and other services that help with interacting with the mercury 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 NewStatementAccountService method instead.
func NewStatementAccountService ¶ added in v0.4.1
func NewStatementAccountService(opts ...option.RequestOption) (r StatementAccountService)
NewStatementAccountService 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 (*StatementAccountService) List ¶ added in v0.4.1
func (r *StatementAccountService) List(ctx context.Context, accountID string, query StatementAccountListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccountStatements[StatementAccountListResponse], err error)
Retrieve a paginated list of monthly statements for a specific account. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters, as well as date range filtering with start and end parameters.
func (*StatementAccountService) ListAutoPaging ¶ added in v0.4.1
func (r *StatementAccountService) ListAutoPaging(ctx context.Context, accountID string, query StatementAccountListParams, opts ...option.RequestOption) *pagination.CursorIDAccountStatementsAutoPager[StatementAccountListResponse]
Retrieve a paginated list of monthly statements for a specific account. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters, as well as date range filtering with start and end parameters.
type StatementService ¶
type StatementService struct {
Options []option.RequestOption
// Manage bank accounts
Accounts StatementAccountService
// Manage treasury accounts and transactions
Treasury StatementTreasuryService
}
Download account statements
StatementService contains methods and other services that help with interacting with the mercury 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 NewStatementService method instead.
func NewStatementService ¶
func NewStatementService(opts ...option.RequestOption) (r StatementService)
NewStatementService 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 (*StatementService) Download ¶ added in v0.4.0
func (r *StatementService) Download(ctx context.Context, statementID string, opts ...option.RequestOption) (res *http.Response, err error)
Downloads a PDF file for the specified account statement. The response includes a Content-Disposition header for proper file download handling. Returns binary PDF data.
type StatementTreasuryListParams ¶ added in v0.4.1
type StatementTreasuryListParams struct {
// The ID of the statement to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the statement to start the page after (exclusive). When provided,
// results will begin with the statement immediately following this ID. Use this
// for standard forward pagination to get the next page of results. Cannot be
// combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Filter statements by document type.
//
// Any of "MonthlyStatement", "TradeConfirmation", "1099", "1099R", "1042S",
// "5498", "5498ESA", "1099Q", "FMV", "SDIRA".
DocumentType StatementTreasuryListParamsDocumentType `query:"documentType,omitzero" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order StatementTreasuryListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatementTreasuryListParams) URLQuery ¶ added in v0.4.1
func (r StatementTreasuryListParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatementTreasuryListParams's query parameters as `url.Values`.
type StatementTreasuryListParamsDocumentType ¶ added in v0.4.1
type StatementTreasuryListParamsDocumentType string
Filter statements by document type.
const ( StatementTreasuryListParamsDocumentTypeMonthlyStatement StatementTreasuryListParamsDocumentType = "MonthlyStatement" StatementTreasuryListParamsDocumentTypeTradeConfirmation StatementTreasuryListParamsDocumentType = "TradeConfirmation" StatementTreasuryListParamsDocumentType1099 StatementTreasuryListParamsDocumentType = "1099" StatementTreasuryListParamsDocumentType1099R StatementTreasuryListParamsDocumentType = "1099R" StatementTreasuryListParamsDocumentType1042S StatementTreasuryListParamsDocumentType = "1042S" StatementTreasuryListParamsDocumentType5498 StatementTreasuryListParamsDocumentType = "5498" StatementTreasuryListParamsDocumentType5498Esa StatementTreasuryListParamsDocumentType = "5498ESA" StatementTreasuryListParamsDocumentType1099Q StatementTreasuryListParamsDocumentType = "1099Q" StatementTreasuryListParamsDocumentTypeFmv StatementTreasuryListParamsDocumentType = "FMV" StatementTreasuryListParamsDocumentTypeSdira StatementTreasuryListParamsDocumentType = "SDIRA" )
type StatementTreasuryListParamsOrder ¶ added in v0.4.1
type StatementTreasuryListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( StatementTreasuryListParamsOrderAsc StatementTreasuryListParamsOrder = "asc" StatementTreasuryListParamsOrderDesc StatementTreasuryListParamsOrder = "desc" )
type StatementTreasuryListResponse ¶ added in v0.4.1
type StatementTreasuryListResponse struct {
// ID for the account statement
ID string `json:"id" api:"required" format:"uuid"`
// ID for a Mercury account.
AccountID string `json:"accountId" api:"required" format:"uuid"`
// Timestamp when the record was created
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Date the statement was created by the custodian
CreationDate string `json:"creationDate" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// Human-readable description of the statement
Description string `json:"description" api:"required"`
// Type of document (e.g. monthly statement, trade confirmation, tax form)
//
// Any of "MonthlyStatement", "TradeConfirmation", "1099", "1099R", "1042S",
// "5498", "5498ESA", "1099Q", "FMV", "SDIRA".
DocumentType StatementTreasuryListResponseDocumentType `json:"documentType" api:"required"`
// URL to download the statement PDF
DownloadURL string `json:"downloadUrl" api:"required"`
// End of the period covered by the statement
PeriodEnd time.Time `json:"periodEnd" api:"required" format:"date"`
// Start of the period covered by the statement
PeriodStart time.Time `json:"periodStart" api:"required" format:"date"`
// Timestamp when the record was last updated
UpdatedAt string `json:"updatedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
CreatedAt respjson.Field
CreationDate respjson.Field
Description respjson.Field
DocumentType respjson.Field
DownloadURL respjson.Field
PeriodEnd respjson.Field
PeriodStart respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Individual treasury statement in the response
func (StatementTreasuryListResponse) RawJSON ¶ added in v0.4.1
func (r StatementTreasuryListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StatementTreasuryListResponse) UnmarshalJSON ¶ added in v0.4.1
func (r *StatementTreasuryListResponse) UnmarshalJSON(data []byte) error
type StatementTreasuryListResponseDocumentType ¶ added in v0.4.1
type StatementTreasuryListResponseDocumentType string
Type of document (e.g. monthly statement, trade confirmation, tax form)
const ( StatementTreasuryListResponseDocumentTypeMonthlyStatement StatementTreasuryListResponseDocumentType = "MonthlyStatement" StatementTreasuryListResponseDocumentTypeTradeConfirmation StatementTreasuryListResponseDocumentType = "TradeConfirmation" StatementTreasuryListResponseDocumentType1099 StatementTreasuryListResponseDocumentType = "1099" StatementTreasuryListResponseDocumentType1099R StatementTreasuryListResponseDocumentType = "1099R" StatementTreasuryListResponseDocumentType1042S StatementTreasuryListResponseDocumentType = "1042S" StatementTreasuryListResponseDocumentType5498 StatementTreasuryListResponseDocumentType = "5498" StatementTreasuryListResponseDocumentType5498Esa StatementTreasuryListResponseDocumentType = "5498ESA" StatementTreasuryListResponseDocumentType1099Q StatementTreasuryListResponseDocumentType = "1099Q" StatementTreasuryListResponseDocumentTypeFmv StatementTreasuryListResponseDocumentType = "FMV" StatementTreasuryListResponseDocumentTypeSdira StatementTreasuryListResponseDocumentType = "SDIRA" )
type StatementTreasuryService ¶ added in v0.4.1
type StatementTreasuryService struct {
Options []option.RequestOption
}
Manage treasury accounts and transactions
StatementTreasuryService contains methods and other services that help with interacting with the mercury 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 NewStatementTreasuryService method instead.
func NewStatementTreasuryService ¶ added in v0.4.1
func NewStatementTreasuryService(opts ...option.RequestOption) (r StatementTreasuryService)
NewStatementTreasuryService 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 (*StatementTreasuryService) List ¶ added in v0.4.1
func (r *StatementTreasuryService) List(ctx context.Context, treasuryID string, query StatementTreasuryListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccountStatements[StatementTreasuryListResponse], err error)
Retrieve a paginated list of statements for a specific treasury account. Supports cursor-based pagination and filtering by document type.
func (*StatementTreasuryService) ListAutoPaging ¶ added in v0.4.1
func (r *StatementTreasuryService) ListAutoPaging(ctx context.Context, treasuryID string, query StatementTreasuryListParams, opts ...option.RequestOption) *pagination.CursorIDAccountStatementsAutoPager[StatementTreasuryListResponse]
Retrieve a paginated list of statements for a specific treasury account. Supports cursor-based pagination and filtering by document type.
type SwiftBankAccountType ¶
type SwiftBankAccountType string
const ( SwiftBankAccountTypeChecking SwiftBankAccountType = "checking" SwiftBankAccountTypeSavings SwiftBankAccountType = "savings" )
type TaxFormType ¶
type TaxFormType string
const ( TaxFormTypeW9 TaxFormType = "w9" TaxFormTypeW8Ben TaxFormType = "w8BEN" TaxFormTypeW8Bene TaxFormType = "w8BENE" TaxFormTypeUnknown TaxFormType = "unknown" )
type Transaction ¶
type Transaction struct {
// ID for this transaction
ID string `json:"id" api:"required" format:"uuid"`
// ID for a Mercury account.
AccountID string `json:"accountId" api:"required" format:"uuid"`
Amount float64 `json:"amount" api:"required"`
Attachments []TransactionAttachment `json:"attachments" api:"required"`
CompliantWithReceiptPolicy bool `json:"compliantWithReceiptPolicy" api:"required"`
// ID for a Mercury account.
CounterpartyID string `json:"counterpartyId" api:"required" format:"uuid"`
CounterpartyName string `json:"counterpartyName" api:"required"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
DashboardLink string `json:"dashboardLink" api:"required"`
EstimatedDeliveryDate string `json:"estimatedDeliveryDate" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// GL code allocations assigned to this transaction via a connected accounting
// software integration (e.g. QuickBooks, Xero, NetSuite). Each allocation has a GL
// code name and the amount allocated to it; amounts sum to the transaction total
// when the transaction is fully categorized. Empty if no GL codes have been
// assigned. Distinct from Mercury custom categories (see transactionCategoryData).
GlAllocations []GlAllocation `json:"glAllocations" api:"required"`
HasGeneratedReceipt bool `json:"hasGeneratedReceipt" api:"required"`
// Any of "externalTransfer", "internalTransfer", "outgoingPayment",
// "creditCardCredit", "creditCardTransaction", "debitCardCredit",
// "debitCardTransaction", "cardInternationalTransactionFee",
// "cardInternationalTransactionFeeRebate",
// "cardInternationalTransactionFeeReversal",
// "cardInternationalTransactionFeeRebateReversal", "incomingDomesticWire",
// "checkDeposit", "incomingInternationalWire", "treasuryTransfer",
// "currencyCloudReturn", "wireFee", "personalBankingSubscriptionFee",
// "billingEngineSubscriptionFee", "expenseReimbursement", "exogenousWireDrawdown",
// "other".
Kind TransactionKind `json:"kind" api:"required"`
RelatedTransactions []RelatedTransactionData `json:"relatedTransactions" api:"required"`
// Any of "pending", "sent", "cancelled", "failed", "reversed", "blocked".
Status TransactionStatus `json:"status" api:"required"`
BankDescription string `json:"bankDescription" api:"nullable"`
// Represents an expense category for transaction classification.
CategoryData CategoryData `json:"categoryData" api:"nullable"`
// Present for check deposits and mailed checks; Nothing otherwise.
CheckNumber string `json:"checkNumber" api:"nullable"`
CounterpartyNickname string `json:"counterpartyNickname" api:"nullable"`
// ID for the credit statement period
CreditAccountPeriodID string `json:"creditAccountPeriodId" api:"nullable" format:"uuid"`
CurrencyExchangeInfo CurrencyExchangeInfo `json:"currencyExchangeInfo" api:"nullable"`
Details TransactionMethodData `json:"details" api:"nullable"`
ExternalMemo string `json:"externalMemo" api:"nullable"`
FailedAt string `json:"failedAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
// ID for this transaction
FeeID string `json:"feeId" api:"nullable" format:"uuid"`
// Deprecated: use transactionGlAllocations instead. This field does not reflect GL
// codes assigned via Mercury auto-categorization rules. Preserved for backwards
// compatibility.
GeneralLedgerCodeName string `json:"generalLedgerCodeName" api:"nullable"`
// Merchant information for card transactions
Merchant MerchantData `json:"merchant" api:"nullable"`
// Any of "Other", "Advertising", "Airlines", "AlcoholAndBars",
// "BooksAndNewspaper", "CarRental", "Charity", "Clothing", "Conferences",
// "Education", "Electronics", "Entertainment", "FacilitiesExpenses", "Fees",
// "FoodDelivery", "FuelAndGas", "Gambling", "GovernmentServices", "Grocery",
// "GroundTransportation", "Insurance", "InternetAndTelephone", "Legal", "Lodging",
// "Medical", "Memberships", "OfficeSupplies", "OtherTravel", "Parking",
// "Political", "ProfessionalServices", "Restaurants", "Retail",
// "RideshareAndTaxis", "Shipping", "Software", "Taxes", "Utilities",
// "VehicleExpenses".
MercuryCategory MercuryCategory `json:"mercuryCategory" api:"nullable"`
Note string `json:"note" api:"nullable"`
PostedAt string `json:"postedAt" api:"nullable" format:"yyyy-mm-ddThh:MM:ssZ"`
ReasonForFailure string `json:"reasonForFailure" api:"nullable"`
RequestID string `json:"requestId" api:"nullable"`
// Present for transactions that have tracking numbers (e.g., RTP, ACH, wires);
// Nothing otherwise.
TrackingNumber string `json:"trackingNumber" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
Amount respjson.Field
Attachments respjson.Field
CompliantWithReceiptPolicy respjson.Field
CounterpartyID respjson.Field
CounterpartyName respjson.Field
CreatedAt respjson.Field
DashboardLink respjson.Field
EstimatedDeliveryDate respjson.Field
GlAllocations respjson.Field
HasGeneratedReceipt respjson.Field
Kind respjson.Field
RelatedTransactions respjson.Field
Status respjson.Field
BankDescription respjson.Field
CategoryData respjson.Field
CheckNumber respjson.Field
CounterpartyNickname respjson.Field
CreditAccountPeriodID respjson.Field
CurrencyExchangeInfo respjson.Field
Details respjson.Field
ExternalMemo respjson.Field
FailedAt respjson.Field
FeeID respjson.Field
GeneralLedgerCodeName respjson.Field
Merchant respjson.Field
MercuryCategory respjson.Field
Note respjson.Field
PostedAt respjson.Field
ReasonForFailure respjson.Field
RequestID respjson.Field
TrackingNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Transaction) RawJSON ¶
func (r Transaction) RawJSON() string
Returns the unmodified JSON received from the API
func (*Transaction) UnmarshalJSON ¶
func (r *Transaction) UnmarshalJSON(data []byte) error
type TransactionAttachment ¶
type TransactionAttachment struct {
// Any of "checkImage", "receipt", "other".
AttachmentType TransactionAttachmentAttachmentType `json:"attachmentType" api:"required"`
FileName string `json:"fileName" api:"required"`
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AttachmentType respjson.Field
FileName respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionAttachment) RawJSON ¶
func (r TransactionAttachment) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionAttachment) UnmarshalJSON ¶
func (r *TransactionAttachment) UnmarshalJSON(data []byte) error
type TransactionAttachmentAttachParams ¶ added in v0.4.2
type TransactionAttachmentAttachParams struct {
// The file to upload
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
// Type of attachment: 'receipt', 'bill', or 'other'. Defaults to 'other'.
//
// Any of "receipt", "bill", "other".
AttachmentType TransactionAttachmentAttachParamsAttachmentType `json:"attachmentType,omitzero"`
// contains filtered or unexported fields
}
func (TransactionAttachmentAttachParams) MarshalMultipart ¶ added in v0.4.2
func (r TransactionAttachmentAttachParams) MarshalMultipart() (data []byte, contentType string, err error)
type TransactionAttachmentAttachParamsAttachmentType ¶ added in v0.4.2
type TransactionAttachmentAttachParamsAttachmentType string
Type of attachment: 'receipt', 'bill', or 'other'. Defaults to 'other'.
const ( TransactionAttachmentAttachParamsAttachmentTypeReceipt TransactionAttachmentAttachParamsAttachmentType = "receipt" TransactionAttachmentAttachParamsAttachmentTypeBill TransactionAttachmentAttachParamsAttachmentType = "bill" TransactionAttachmentAttachParamsAttachmentTypeOther TransactionAttachmentAttachParamsAttachmentType = "other" )
type TransactionAttachmentAttachmentType ¶
type TransactionAttachmentAttachmentType string
const ( TransactionAttachmentAttachmentTypeCheckImage TransactionAttachmentAttachmentType = "checkImage" TransactionAttachmentAttachmentTypeReceipt TransactionAttachmentAttachmentType = "receipt" TransactionAttachmentAttachmentTypeOther TransactionAttachmentAttachmentType = "other" )
type TransactionAttachmentService ¶ added in v0.4.2
type TransactionAttachmentService struct {
Options []option.RequestOption
}
Manage transactions
TransactionAttachmentService contains methods and other services that help with interacting with the mercury 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 NewTransactionAttachmentService method instead.
func NewTransactionAttachmentService ¶ added in v0.4.2
func NewTransactionAttachmentService(opts ...option.RequestOption) (r TransactionAttachmentService)
NewTransactionAttachmentService 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 (*TransactionAttachmentService) Attach ¶ added in v0.4.2
func (r *TransactionAttachmentService) Attach(ctx context.Context, transactionID string, body TransactionAttachmentAttachParams, opts ...option.RequestOption) (err error)
Upload a file attachment to a transaction. The file is uploaded via multipart/form-data. Supported file types include PDF, images (PNG, JPG, GIF), and common document formats.
type TransactionKind ¶
type TransactionKind string
const ( TransactionKindExternalTransfer TransactionKind = "externalTransfer" TransactionKindInternalTransfer TransactionKind = "internalTransfer" TransactionKindOutgoingPayment TransactionKind = "outgoingPayment" TransactionKindCreditCardCredit TransactionKind = "creditCardCredit" TransactionKindCreditCardTransaction TransactionKind = "creditCardTransaction" TransactionKindDebitCardCredit TransactionKind = "debitCardCredit" TransactionKindDebitCardTransaction TransactionKind = "debitCardTransaction" TransactionKindCardInternationalTransactionFee TransactionKind = "cardInternationalTransactionFee" TransactionKindCardInternationalTransactionFeeRebate TransactionKind = "cardInternationalTransactionFeeRebate" TransactionKindCardInternationalTransactionFeeReversal TransactionKind = "cardInternationalTransactionFeeReversal" TransactionKindCardInternationalTransactionFeeRebateReversal TransactionKind = "cardInternationalTransactionFeeRebateReversal" TransactionKindIncomingDomesticWire TransactionKind = "incomingDomesticWire" TransactionKindCheckDeposit TransactionKind = "checkDeposit" TransactionKindIncomingInternationalWire TransactionKind = "incomingInternationalWire" TransactionKindTreasuryTransfer TransactionKind = "treasuryTransfer" TransactionKindCurrencyCloudReturn TransactionKind = "currencyCloudReturn" TransactionKindWireFee TransactionKind = "wireFee" TransactionKindPersonalBankingSubscriptionFee TransactionKind = "personalBankingSubscriptionFee" TransactionKindBillingEngineSubscriptionFee TransactionKind = "billingEngineSubscriptionFee" TransactionKindExpenseReimbursement TransactionKind = "expenseReimbursement" TransactionKindExogenousWireDrawdown TransactionKind = "exogenousWireDrawdown" TransactionKindOther TransactionKind = "other" )
type TransactionListParams ¶
type TransactionListParams struct {
// UUID of a custom category. Can be returned from /categories endpoint.
CategoryID param.Opt[string] `query:"categoryId,omitzero" json:"-"`
// Latest createdAt date to filter for. If it’s not provided, it defaults to
// current day. Format: YYYY-MM-DD or an ISO 8601 string. Please note that your
// Mercury transactions on your Dashboard might have their postedAt date displayed,
// as opposed to createdAt
End param.Opt[string] `query:"end,omitzero" json:"-"`
// The ID of the transaction to end the page before (exclusive). When provided,
// results will end just before this ID and work backwards. Use this for reverse
// pagination or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Name of mercuryCategory you want to filter on. Merchant Type in the UI.
MercuryCategory param.Opt[string] `query:"mercuryCategory,omitzero" json:"-"`
// Latest postedAt date to filter for. Format: YYYY-MM-DD or an ISO 8601 string
PostedEnd param.Opt[string] `query:"postedEnd,omitzero" json:"-"`
// Earliest postedAt date to filter for. Format: YYYY-MM-DD or an ISO 8601 string
PostedStart param.Opt[string] `query:"postedStart,omitzero" json:"-"`
// Search term to look for in transaction descriptions.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Earliest createdAt date to filter for. If not provided, it defaults to the date
// of your first transaction. Format: YYYY-MM-DD or an ISO 8601 string. Please note
// that your Mercury transactions on your Dashboard might have their postedAt date
// displayed, as opposed to createdAt
Start param.Opt[string] `query:"start,omitzero" json:"-"`
// The ID of the transaction to start the page after (exclusive). When provided,
// results will begin with the transaction immediately following this ID. Use this
// for standard forward pagination to get the next page of results. Cannot be
// combined with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// The ID of the resource to start the page at (inclusive). When provided, results
// will begin with and include the resource with this ID. Use this to retrieve a
// specific page when you know the exact starting point. Cannot be combined with
// start_after or end_before.
StartAt param.Opt[string] `query:"start_at,omitzero" json:"-"`
AccountID []string `query:"accountId,omitzero" format:"uuid" json:"-"`
CardID []string `query:"cardId,omitzero" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order TransactionListParamsOrder `query:"order,omitzero" json:"-"`
// Any of "pending", "sent", "cancelled", "failed", "reversed", "blocked".
Status []string `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TransactionListParams) URLQuery ¶
func (r TransactionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TransactionListParams's query parameters as `url.Values`.
type TransactionListParamsOrder ¶
type TransactionListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( TransactionListParamsOrderAsc TransactionListParamsOrder = "asc" TransactionListParamsOrderDesc TransactionListParamsOrder = "desc" )
type TransactionMethodData ¶
type TransactionMethodData struct {
Address AddressData `json:"address" api:"nullable"`
CreditCardInfo TransactionMethodDataCreditCardInfo `json:"creditCardInfo" api:"nullable"`
DebitCardInfo TransactionMethodDataDebitCardInfo `json:"debitCardInfo" api:"nullable"`
DomesticWireRoutingInfo DomesticWireRoutingInfo `json:"domesticWireRoutingInfo" api:"nullable"`
ElectronicRoutingInfo ElectronicRoutingInfo `json:"electronicRoutingInfo" api:"nullable"`
InternationalWireRoutingInfo InternationalWireRoutingInfo `json:"internationalWireRoutingInfo" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
CreditCardInfo respjson.Field
DebitCardInfo respjson.Field
DomesticWireRoutingInfo respjson.Field
ElectronicRoutingInfo respjson.Field
InternationalWireRoutingInfo respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionMethodData) RawJSON ¶
func (r TransactionMethodData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionMethodData) UnmarshalJSON ¶
func (r *TransactionMethodData) UnmarshalJSON(data []byte) error
type TransactionMethodDataCreditCardInfo ¶
type TransactionMethodDataCreditCardInfo struct {
ID string `json:"id" api:"required" format:"uuid"`
PaymentMethod string `json:"paymentMethod" api:"required"`
Email string `json:"email" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
PaymentMethod respjson.Field
Email respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionMethodDataCreditCardInfo) RawJSON ¶
func (r TransactionMethodDataCreditCardInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionMethodDataCreditCardInfo) UnmarshalJSON ¶
func (r *TransactionMethodDataCreditCardInfo) UnmarshalJSON(data []byte) error
type TransactionMethodDataDebitCardInfo ¶
type TransactionMethodDataDebitCardInfo struct {
ID string `json:"id" api:"required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionMethodDataDebitCardInfo) RawJSON ¶
func (r TransactionMethodDataDebitCardInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionMethodDataDebitCardInfo) UnmarshalJSON ¶
func (r *TransactionMethodDataDebitCardInfo) UnmarshalJSON(data []byte) error
type TransactionService ¶
type TransactionService struct {
Options []option.RequestOption
// Manage transactions
Attachments TransactionAttachmentService
}
Manage transactions
TransactionService contains methods and other services that help with interacting with the mercury API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTransactionService method instead.
func NewTransactionService ¶
func NewTransactionService(opts ...option.RequestOption) (r TransactionService)
NewTransactionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TransactionService) Get ¶
func (r *TransactionService) Get(ctx context.Context, transactionID string, opts ...option.RequestOption) (res *Transaction, err error)
Retrieve a single transaction by its ID. Returns full transaction details including attachments, check images, and related metadata.
func (*TransactionService) List ¶
func (r *TransactionService) List(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) (res *pagination.CursorIDTransactions[Transaction], err error)
Retrieve a paginated list of all transactions across all accounts. Supports advanced filtering by date ranges, status, categories, and cursor-based pagination.
func (*TransactionService) ListAutoPaging ¶
func (r *TransactionService) ListAutoPaging(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) *pagination.CursorIDTransactionsAutoPager[Transaction]
Retrieve a paginated list of all transactions across all accounts. Supports advanced filtering by date ranges, status, categories, and cursor-based pagination.
func (*TransactionService) Update ¶
func (r *TransactionService) Update(ctx context.Context, transactionID string, body TransactionUpdateParams, opts ...option.RequestOption) (res *Transaction, err error)
Update the note and/or category of an existing transaction. Use null values to clear existing data.
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionStatusPending TransactionStatus = "pending" TransactionStatusSent TransactionStatus = "sent" TransactionStatusCancelled TransactionStatus = "cancelled" TransactionStatusFailed TransactionStatus = "failed" TransactionStatusReversed TransactionStatus = "reversed" TransactionStatusBlocked TransactionStatus = "blocked" )
type TransactionUpdateParams ¶
type TransactionUpdateParams struct {
// Note update action. Omit field to keep current note, send null or empty string
// to clear note, send text to set note.
Note param.Opt[string] `json:"note,omitzero" api:"required"`
// ID for the category
CategoryID string `json:"categoryId" api:"required" format:"uuid"`
// contains filtered or unexported fields
}
func (TransactionUpdateParams) MarshalJSON ¶
func (r TransactionUpdateParams) MarshalJSON() (data []byte, err error)
func (*TransactionUpdateParams) UnmarshalJSON ¶
func (r *TransactionUpdateParams) UnmarshalJSON(data []byte) error
type TreasuryListParams ¶
type TreasuryListParams struct {
// The ID of the account to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the account to start the page after (exclusive). When provided,
// results will begin with the account immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order TreasuryListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TreasuryListParams) URLQuery ¶
func (r TreasuryListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TreasuryListParams's query parameters as `url.Values`.
type TreasuryListParamsOrder ¶
type TreasuryListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( TreasuryListParamsOrderAsc TreasuryListParamsOrder = "asc" TreasuryListParamsOrderDesc TreasuryListParamsOrder = "desc" )
type TreasuryListResponse ¶
type TreasuryListResponse struct {
// ID for a Mercury account.
ID string `json:"id" api:"required" format:"uuid"`
AvailableBalance float64 `json:"availableBalance" api:"required"`
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
CurrentBalance float64 `json:"currentBalance" api:"required"`
// Monthly net return breakdown with dividend and fee details
NetReturns []TreasuryListResponseNetReturn `json:"netReturns" api:"required"`
// Any of "active", "deleted", "pending", "archived".
Status AccountStatus `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AvailableBalance respjson.Field
CreatedAt respjson.Field
CurrentBalance respjson.Field
NetReturns respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TreasuryListResponse) RawJSON ¶
func (r TreasuryListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryListResponse) UnmarshalJSON ¶
func (r *TreasuryListResponse) UnmarshalJSON(data []byte) error
type TreasuryListResponseNetReturn ¶
type TreasuryListResponseNetReturn struct {
// List of dividends received by security
Dividends []TreasuryListResponseNetReturnDividend `json:"dividends" api:"required"`
// First day of the month for this net return
Month time.Time `json:"month" api:"required" format:"date"`
// Net return amount (dividends minus fees)
NetAmount float64 `json:"netAmount" api:"required"`
// Status of this net return calculation
//
// Any of "processing", "pending", "charged", "error".
Status string `json:"status" api:"required"`
// Treasury fee charged for this period (positive value)
TreasuryFee float64 `json:"treasuryFee" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dividends respjson.Field
Month respjson.Field
NetAmount respjson.Field
Status respjson.Field
TreasuryFee respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Monthly net return breakdown for a treasury account
func (TreasuryListResponseNetReturn) RawJSON ¶
func (r TreasuryListResponseNetReturn) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryListResponseNetReturn) UnmarshalJSON ¶
func (r *TreasuryListResponseNetReturn) UnmarshalJSON(data []byte) error
type TreasuryListResponseNetReturnDividend ¶
type TreasuryListResponseNetReturnDividend struct {
// Security identifier (e.g., "617455696")
ID string `json:"id" api:"required"`
// Dividend amount for this security
Amount float64 `json:"amount" api:"required"`
// Human-readable security name (e.g., "Morgan Stanley Ultra-Short Income Portfolio
// Class IR")
SecurityName string `json:"securityName" api:"required"`
// Security identifier type
//
// Any of "cusip".
Type string `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
SecurityName respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Dividend information for a specific treasury security
func (TreasuryListResponseNetReturnDividend) RawJSON ¶
func (r TreasuryListResponseNetReturnDividend) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryListResponseNetReturnDividend) UnmarshalJSON ¶
func (r *TreasuryListResponseNetReturnDividend) UnmarshalJSON(data []byte) error
type TreasuryService ¶
type TreasuryService struct {
Options []option.RequestOption
}
Manage treasury accounts and transactions
TreasuryService contains methods and other services that help with interacting with the mercury 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 NewTreasuryService method instead.
func NewTreasuryService ¶
func NewTreasuryService(opts ...option.RequestOption) (r TreasuryService)
NewTreasuryService 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 (*TreasuryService) List ¶
func (r *TreasuryService) List(ctx context.Context, query TreasuryListParams, opts ...option.RequestOption) (res *pagination.CursorIDAccounts[TreasuryListResponse], err error)
Retrieve a paginated list of all treasury accounts associated with the authenticated organization. Use cursor parameters (start_after, end_before) for pagination.
func (*TreasuryService) ListAutoPaging ¶
func (r *TreasuryService) ListAutoPaging(ctx context.Context, query TreasuryListParams, opts ...option.RequestOption) *pagination.CursorIDAccountsAutoPager[TreasuryListResponse]
Retrieve a paginated list of all treasury accounts associated with the authenticated organization. Use cursor parameters (start_after, end_before) for pagination.
func (*TreasuryService) Transactions ¶ added in v0.4.3
func (r *TreasuryService) Transactions(ctx context.Context, treasuryID string, query TreasuryTransactionsParams, opts ...option.RequestOption) (res *TreasuryTransactionsResponse, err error)
Retrieve paginated treasury transactions for a specific treasury account.
type TreasuryTransactionsParams ¶ added in v0.4.3
type TreasuryTransactionsParams struct {
// Pagination cursor for retrieving next batch of transactions. Must be an
// integer >= 0
Cursor param.Opt[int64] `query:"cursor,omitzero" json:"-"`
// Maximum number of results to return. Defaults to 100
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort order for transactions. Can be 'asc' or 'desc'. Defaults to 'desc'
//
// Any of "asc", "desc".
Order TreasuryTransactionsParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TreasuryTransactionsParams) URLQuery ¶ added in v0.4.3
func (r TreasuryTransactionsParams) URLQuery() (v url.Values, err error)
URLQuery serializes TreasuryTransactionsParams's query parameters as `url.Values`.
type TreasuryTransactionsParamsOrder ¶ added in v0.4.3
type TreasuryTransactionsParamsOrder string
Sort order for transactions. Can be 'asc' or 'desc'. Defaults to 'desc'
const ( TreasuryTransactionsParamsOrderAsc TreasuryTransactionsParamsOrder = "asc" TreasuryTransactionsParamsOrderDesc TreasuryTransactionsParamsOrder = "desc" )
type TreasuryTransactionsResponse ¶ added in v0.4.3
type TreasuryTransactionsResponse struct {
// List of treasury transactions in the response
Transactions []TreasuryTransactionsResponseTransaction `json:"transactions" api:"required"`
// Pagination cursor for retrieving next batch of transactions
Cursor int64 `json:"cursor" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transactions respjson.Field
Cursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response type for treasury transactions API endpoint
func (TreasuryTransactionsResponse) RawJSON ¶ added in v0.4.3
func (r TreasuryTransactionsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryTransactionsResponse) UnmarshalJSON ¶ added in v0.4.3
func (r *TreasuryTransactionsResponse) UnmarshalJSON(data []byte) error
type TreasuryTransactionsResponseTransaction ¶ added in v0.4.3
type TreasuryTransactionsResponseTransaction struct {
// ID for this treasury transaction
ID string `json:"id" api:"required" format:"uuid"`
// ID for a Mercury account.
AccountID string `json:"accountId" api:"required" format:"uuid"`
Amount float64 `json:"amount" api:"required"`
Balance float64 `json:"balance" api:"required"`
CanonicalDay time.Time `json:"canonicalDay" api:"required" format:"date"`
Description string `json:"description" api:"required"`
// Any of "depositCanceled", "depositComplete", "depositFailed", "depositReturned",
// "mercuryFeePosted", "mercuryFeeFailed", "mercuryFeeRefunded",
// "mercuryFeeCanceled", "withdrawalPosted", "withdrawalFailed",
// "withdrawalCanceled", "withdrawalReturned", "revertTxn", "interestPosted",
// "interestCanceled", "manualAmendmentPosted", "mercuryCreditPosted",
// "mercuryCreditFailed", "dividendPosted", "dividendCanceled",
// "dividendReinvestmentPosted", "mutualFundTradeFailed", "mutualFundTradePosted",
// "sweepInPosted", "sweepOutPosted", "sweepReconcilePosted",
// "valuationChangePosted", "oemsMutualFundOrderSettled",
// "oemsMutualFundOrderCanceled", "oemsMutualFundOrderRejected".
Type string `json:"type" api:"required"`
AdditionalDetails string `json:"additionalDetails" api:"nullable"`
Details TreasuryTransactionsResponseTransactionDetails `json:"details" api:"nullable"`
Security string `json:"security" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
Amount respjson.Field
Balance respjson.Field
CanonicalDay respjson.Field
Description respjson.Field
Type respjson.Field
AdditionalDetails respjson.Field
Details respjson.Field
Security respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Treasury transaction data for external API consumption
func (TreasuryTransactionsResponseTransaction) RawJSON ¶ added in v0.4.3
func (r TreasuryTransactionsResponseTransaction) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryTransactionsResponseTransaction) UnmarshalJSON ¶ added in v0.4.3
func (r *TreasuryTransactionsResponseTransaction) UnmarshalJSON(data []byte) error
type TreasuryTransactionsResponseTransactionDetails ¶ added in v0.4.3
type TreasuryTransactionsResponseTransactionDetails struct {
CreditDescription string `json:"creditDescription" api:"nullable"`
// ID for a Mercury account.
DepositCounterpartyID string `json:"depositCounterpartyId" api:"nullable" format:"uuid"`
FeeDescription string `json:"feeDescription" api:"nullable"`
ManualAmendmentDescription string `json:"manualAmendmentDescription" api:"nullable"`
Security string `json:"security" api:"nullable"`
SweepDirection string `json:"sweepDirection" api:"nullable"`
TradeAction string `json:"tradeAction" api:"nullable"`
// ID for a Mercury account.
WithdrawalCounterpartyID string `json:"withdrawalCounterpartyId" api:"nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreditDescription respjson.Field
DepositCounterpartyID respjson.Field
FeeDescription respjson.Field
ManualAmendmentDescription respjson.Field
Security respjson.Field
SweepDirection respjson.Field
TradeAction respjson.Field
WithdrawalCounterpartyID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TreasuryTransactionsResponseTransactionDetails) RawJSON ¶ added in v0.4.3
func (r TreasuryTransactionsResponseTransactionDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*TreasuryTransactionsResponseTransactionDetails) UnmarshalJSON ¶ added in v0.4.3
func (r *TreasuryTransactionsResponseTransactionDetails) UnmarshalJSON(data []byte) error
type UsState ¶
type UsState string
const ( UsStateAl UsState = "AL" UsStateAk UsState = "AK" UsStateAz UsState = "AZ" UsStateAr UsState = "AR" UsStateCa UsState = "CA" UsStateCo UsState = "CO" UsStateCt UsState = "CT" UsStateDe UsState = "DE" UsStateDc UsState = "DC" UsStateFl UsState = "FL" UsStateGa UsState = "GA" UsStateHi UsState = "HI" UsStateID UsState = "ID" UsStateIl UsState = "IL" UsStateIn UsState = "IN" UsStateIa UsState = "IA" UsStateKs UsState = "KS" UsStateKy UsState = "KY" UsStateLa UsState = "LA" UsStateMe UsState = "ME" UsStateMd UsState = "MD" UsStateMa UsState = "MA" UsStateMi UsState = "MI" UsStateMn UsState = "MN" UsStateMs UsState = "MS" UsStateMo UsState = "MO" UsStateMt UsState = "MT" UsStateNe UsState = "NE" UsStateNv UsState = "NV" UsStateNh UsState = "NH" UsStateNj UsState = "NJ" UsStateNm UsState = "NM" UsStateNy UsState = "NY" UsStateNc UsState = "NC" UsStateNd UsState = "ND" UsStateOh UsState = "OH" UsStateOk UsState = "OK" UsStateOr UsState = "OR" UsStatePa UsState = "PA" UsStateRi UsState = "RI" UsStateSc UsState = "SC" UsStateSd UsState = "SD" UsStateTn UsState = "TN" UsStateTx UsState = "TX" UsStateUt UsState = "UT" UsStateVt UsState = "VT" UsStateVa UsState = "VA" UsStateWa UsState = "WA" UsStateWv UsState = "WV" UsStateWi UsState = "WI" UsStateWy UsState = "WY" )
type User ¶
type User struct {
// User's email address
Email string `json:"email" api:"required"`
// User's first name
FirstName string `json:"firstName" api:"required"`
// User's last name
LastName string `json:"lastName" api:"required"`
// User's role within the organization
//
// Any of "administrator", "bookkeeper", "customUser", "cardOnlyUser", "employee".
OrganizationRole UserOrganizationRole `json:"organizationRole" api:"required"`
// ID for the user
UserID string `json:"userId" api:"required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Email respjson.Field
FirstName respjson.Field
LastName respjson.Field
OrganizationRole respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details of a user within an organization.
func (*User) UnmarshalJSON ¶
type UserListParams ¶
type UserListParams struct {
// The ID of the user to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the user to start the page after (exclusive). When provided, results
// will begin with the user immediately following this ID. Use this for standard
// forward pagination to get the next page of results. Cannot be combined with
// end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order UserListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (UserListParams) URLQuery ¶
func (r UserListParams) URLQuery() (v url.Values, err error)
URLQuery serializes UserListParams's query parameters as `url.Values`.
type UserListParamsOrder ¶
type UserListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( UserListParamsOrderAsc UserListParamsOrder = "asc" UserListParamsOrderDesc UserListParamsOrder = "desc" )
type UserOrganizationRole ¶
type UserOrganizationRole string
User's role within the organization
const ( UserOrganizationRoleAdministrator UserOrganizationRole = "administrator" UserOrganizationRoleBookkeeper UserOrganizationRole = "bookkeeper" UserOrganizationRoleCustomUser UserOrganizationRole = "customUser" UserOrganizationRoleCardOnlyUser UserOrganizationRole = "cardOnlyUser" UserOrganizationRoleEmployee UserOrganizationRole = "employee" )
type UserService ¶
type UserService struct {
Options []option.RequestOption
}
Manage organization team members
UserService contains methods and other services that help with interacting with the mercury API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserService method instead.
func NewUserService ¶
func NewUserService(opts ...option.RequestOption) (r UserService)
NewUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*UserService) Get ¶
func (r *UserService) Get(ctx context.Context, userID string, opts ...option.RequestOption) (res *User, err error)
Get user by ID
func (*UserService) List ¶
func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *pagination.CursorIDUsers[User], err error)
Get all users
func (*UserService) ListAutoPaging ¶
func (r *UserService) ListAutoPaging(ctx context.Context, query UserListParams, opts ...option.RequestOption) *pagination.CursorIDUsersAutoPager[User]
Get all users
type Webhook ¶
type Webhook struct {
// ID for the webhook
ID string `json:"id" api:"required" format:"uuid"`
// When the webhook was created
CreatedAt string `json:"createdAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// The status of the webhook endpoint. 'active': delivering events normally.
// 'paused': paused by the user. 'disabled': automatically disabled by the system
// due to consecutive delivery failures. A disabled webhook can be reactivated by
// updating its status to 'active'.
//
// Any of "active", "paused", "disabled".
Status WebhookStatus `json:"status" api:"required"`
// When the webhook was last updated
UpdatedAt string `json:"updatedAt" api:"required" format:"yyyy-mm-ddThh:MM:ssZ"`
// The URL that will receive webhook POST requests
URL string `json:"url" api:"required"`
// Optional array of event types this webhook is subscribed to. Nothing means all
// events.
//
// Any of "transaction.created", "transaction.updated",
// "checkingAccount.balance.updated", "savingsAccount.balance.updated",
// "treasuryAccount.balance.updated", "investmentAccount.balance.updated",
// "creditAccount.balance.updated".
EventTypes []string `json:"eventTypes" api:"nullable"`
// Optional array of resource field paths to filter events by. Nothing means no
// filtering.
//
// Any of "transaction.amount", "transaction.bankDescription",
// "transaction.categoryData", "transaction.customCategory",
// "transaction.customCategory.id", "transaction.customCategory.name",
// "transaction.mercuryCategory", "transaction.estimatedDeliveryDate",
// "transaction.externalMemo", "transaction.failedAt", "transaction.note",
// "transaction.postedAt", "transaction.reasonForFailure", "transaction.status",
// "checkingAccount.availableBalance", "checkingAccount.currentBalance",
// "checkingAccount.inFlightBalance", "savingsAccount.availableBalance",
// "savingsAccount.currentBalance", "savingsAccount.inFlightBalance",
// "treasuryAccount.availableBalance", "treasuryAccount.currentBalance",
// "treasuryAccount.inFlightBalance", "investmentAccount.availableBalance",
// "investmentAccount.currentBalance", "investmentAccount.inFlightBalance",
// "creditAccount.availableBalance", "creditAccount.currentBalance",
// "creditAccount.inFlightBalance".
FilterPaths []string `json:"filterPaths" api:"nullable"`
// Webhook signing secret. Only returned on creation (POST), not on GET or UPDATE
// operations.
Secret string `json:"secret" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
URL respjson.Field
EventTypes respjson.Field
FilterPaths respjson.Field
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook configuration details
func (*Webhook) UnmarshalJSON ¶
type WebhookListParams ¶
type WebhookListParams struct {
// The ID of the webhook to end the page before (exclusive). When provided, results
// will end just before this ID and work backwards. Use this for reverse pagination
// or to retrieve previous pages. Cannot be combined with start_after.
EndBefore param.Opt[string] `query:"end_before,omitzero" format:"uuid" json:"-"`
// Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The ID of the webhook to start the page after (exclusive). When provided,
// results will begin with the webhook immediately following this ID. Use this for
// standard forward pagination to get the next page of results. Cannot be combined
// with end_before.
StartAfter param.Opt[string] `query:"start_after,omitzero" format:"uuid" json:"-"`
// Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
//
// Any of "asc", "desc".
Order WebhookListParamsOrder `query:"order,omitzero" json:"-"`
// Any of "active", "paused", "disabled", "deleted".
Status []string `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WebhookListParams) URLQuery ¶
func (r WebhookListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WebhookListParams's query parameters as `url.Values`.
type WebhookListParamsOrder ¶
type WebhookListParamsOrder string
Sort order. Can be 'asc' or 'desc'. Defaults to 'asc'
const ( WebhookListParamsOrderAsc WebhookListParamsOrder = "asc" WebhookListParamsOrderDesc WebhookListParamsOrder = "desc" )
type WebhookNewParams ¶
type WebhookNewParams struct {
// The URL to which webhook events will be delivered
URL string `json:"url" api:"required"`
// Optional array of event types to subscribe to. Nothing means subscribe to all
// event types.
//
// Any of "transaction.created", "transaction.updated",
// "checkingAccount.balance.updated", "savingsAccount.balance.updated",
// "treasuryAccount.balance.updated", "investmentAccount.balance.updated",
// "creditAccount.balance.updated".
EventTypes []string `json:"eventTypes,omitzero"`
// Optional array of resource field paths to filter events by. When specified,
// webhook events will only be sent when one of these fields changes. Nothing means
// no filtering (all events are sent).
//
// Any of "transaction.amount", "transaction.bankDescription",
// "transaction.categoryData", "transaction.customCategory",
// "transaction.customCategory.id", "transaction.customCategory.name",
// "transaction.mercuryCategory", "transaction.estimatedDeliveryDate",
// "transaction.externalMemo", "transaction.failedAt", "transaction.note",
// "transaction.postedAt", "transaction.reasonForFailure", "transaction.status",
// "checkingAccount.availableBalance", "checkingAccount.currentBalance",
// "checkingAccount.inFlightBalance", "savingsAccount.availableBalance",
// "savingsAccount.currentBalance", "savingsAccount.inFlightBalance",
// "treasuryAccount.availableBalance", "treasuryAccount.currentBalance",
// "treasuryAccount.inFlightBalance", "investmentAccount.availableBalance",
// "investmentAccount.currentBalance", "investmentAccount.inFlightBalance",
// "creditAccount.availableBalance", "creditAccount.currentBalance",
// "creditAccount.inFlightBalance".
FilterPaths []string `json:"filterPaths,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
Manage webhooks
WebhookService contains methods and other services that help with interacting with the mercury 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) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, webhookEndpointID string, opts ...option.RequestOption) (err error)
Delete a webhook endpoint
func (*WebhookService) Get ¶
func (r *WebhookService) Get(ctx context.Context, webhookEndpointID string, opts ...option.RequestOption) (res *Webhook, err error)
Retrieve details of a specific webhook endpoint by ID
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) (res *pagination.CursorIDWebhooks[Webhook], err error)
Retrieve a paginated list of all webhook endpoints for your organization. Supports filtering by status.
func (*WebhookService) ListAutoPaging ¶
func (r *WebhookService) ListAutoPaging(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) *pagination.CursorIDWebhooksAutoPager[Webhook]
Retrieve a paginated list of all webhook endpoints for your organization. Supports filtering by status.
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
Register a new webhook endpoint to receive event notifications
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, webhookEndpointID string, body WebhookUpdateParams, opts ...option.RequestOption) (res *Webhook, err error)
Update the configuration of an existing webhook endpoint. A webhook that has been disabled due to consecutive delivery failures can be reactivated by setting its status to 'active'.
func (*WebhookService) Verify ¶
func (r *WebhookService) Verify(ctx context.Context, webhookEndpointID string, body WebhookVerifyParams, opts ...option.RequestOption) (err error)
Send a test event to verify the webhook endpoint is properly configured and reachable. The request body accepts an optional 'eventType' field to specify which event type to test (e.g., 'transaction.created', 'transaction.updated'). If omitted from the request body, defaults to 'transaction.created'.
type WebhookStatus ¶
type WebhookStatus string
The status of the webhook endpoint. 'active': delivering events normally. 'paused': paused by the user. 'disabled': automatically disabled by the system due to consecutive delivery failures. A disabled webhook can be reactivated by updating its status to 'active'.
const ( WebhookStatusActive WebhookStatus = "active" WebhookStatusPaused WebhookStatus = "paused" WebhookStatusDisabled WebhookStatus = "disabled" )
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
// The URL to which webhook events will be delivered. Omit to leave unchanged.
URL param.Opt[string] `json:"url,omitzero"`
// Event types to subscribe to. Send null to subscribe to all event types. Send an
// array to subscribe to specific types. Omit to leave unchanged.
//
// Any of "transaction.created", "transaction.updated",
// "checkingAccount.balance.updated", "savingsAccount.balance.updated",
// "treasuryAccount.balance.updated", "investmentAccount.balance.updated",
// "creditAccount.balance.updated".
EventTypes []string `json:"eventTypes,omitzero"`
// Resource field paths to filter events by. When specified, webhook events will
// only be sent when one of these fields changes. Send null for no filtering. Send
// an array to filter by specific fields. Omit to leave unchanged.
//
// Any of "transaction.amount", "transaction.bankDescription",
// "transaction.categoryData", "transaction.customCategory",
// "transaction.customCategory.id", "transaction.customCategory.name",
// "transaction.mercuryCategory", "transaction.estimatedDeliveryDate",
// "transaction.externalMemo", "transaction.failedAt", "transaction.note",
// "transaction.postedAt", "transaction.reasonForFailure", "transaction.status",
// "checkingAccount.availableBalance", "checkingAccount.currentBalance",
// "checkingAccount.inFlightBalance", "savingsAccount.availableBalance",
// "savingsAccount.currentBalance", "savingsAccount.inFlightBalance",
// "treasuryAccount.availableBalance", "treasuryAccount.currentBalance",
// "treasuryAccount.inFlightBalance", "investmentAccount.availableBalance",
// "investmentAccount.currentBalance", "investmentAccount.inFlightBalance",
// "creditAccount.availableBalance", "creditAccount.currentBalance",
// "creditAccount.inFlightBalance".
FilterPaths []string `json:"filterPaths,omitzero"`
// Webhook status. Only 'active' and 'paused' values are allowed. Omit to leave
// unchanged.
//
// Any of "active", "paused".
Status WebhookUpdateParamsStatus `json:"status,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
type WebhookUpdateParamsStatus ¶
type WebhookUpdateParamsStatus string
Webhook status. Only 'active' and 'paused' values are allowed. Omit to leave unchanged.
const ( WebhookUpdateParamsStatusActive WebhookUpdateParamsStatus = "active" WebhookUpdateParamsStatusPaused WebhookUpdateParamsStatus = "paused" )
type WebhookVerifyParams ¶
type WebhookVerifyParams struct {
// Optional event type to test. If not specified, defaults to transaction.created.
//
// Any of "transaction.created", "transaction.updated",
// "checkingAccount.balance.updated", "savingsAccount.balance.updated",
// "treasuryAccount.balance.updated", "investmentAccount.balance.updated",
// "creditAccount.balance.updated".
EventType WebhookVerifyParamsEventType `json:"eventType,omitzero"`
// contains filtered or unexported fields
}
func (WebhookVerifyParams) MarshalJSON ¶
func (r WebhookVerifyParams) MarshalJSON() (data []byte, err error)
func (*WebhookVerifyParams) UnmarshalJSON ¶
func (r *WebhookVerifyParams) UnmarshalJSON(data []byte) error
type WebhookVerifyParamsEventType ¶
type WebhookVerifyParamsEventType string
Optional event type to test. If not specified, defaults to transaction.created.
const ( WebhookVerifyParamsEventTypeTransactionCreated WebhookVerifyParamsEventType = "transaction.created" WebhookVerifyParamsEventTypeTransactionUpdated WebhookVerifyParamsEventType = "transaction.updated" WebhookVerifyParamsEventTypeCheckingAccountBalanceUpdated WebhookVerifyParamsEventType = "checkingAccount.balance.updated" WebhookVerifyParamsEventTypeSavingsAccountBalanceUpdated WebhookVerifyParamsEventType = "savingsAccount.balance.updated" WebhookVerifyParamsEventTypeTreasuryAccountBalanceUpdated WebhookVerifyParamsEventType = "treasuryAccount.balance.updated" WebhookVerifyParamsEventTypeInvestmentAccountBalanceUpdated WebhookVerifyParamsEventType = "investmentAccount.balance.updated" WebhookVerifyParamsEventTypeCreditAccountBalanceUpdated WebhookVerifyParamsEventType = "creditAccount.balance.updated" )
Source Files
¶
- account.go
- aliases.go
- card.go
- category.go
- client.go
- credit.go
- customer.go
- default_http_client.go
- event.go
- field.go
- invoice.go
- invoiceattachment.go
- org.go
- payment.go
- recipient.go
- recipientattachment.go
- safe.go
- statement.go
- statementaccount.go
- statementtreasury.go
- transaction.go
- transactionattachment.go
- treasury.go
- user.go
- webhook.go
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|