rainhelloworld

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

README

Rain Go API Library

Go Reference

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

It is generated with Stainless.

Installation

import (
	"github.com/SignifyHQ/rain-sdk-go" // imported as rainhelloworld
)

Or to pin the version:

go get -u 'github.com/SignifyHQ/rain-sdk-go@v0.1.0'

Requirements

This library requires Go 1.22+.

Usage

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

package main

import (
	"context"
	"fmt"

	"github.com/SignifyHQ/rain-sdk-go"
	"github.com/SignifyHQ/rain-sdk-go/option"
)

func main() {
	client := rainhelloworld.NewClient(
		option.WithAPIKey("My API Key"),    // defaults to os.LookupEnv("RAIN_API_KEY")
		option.WithEnvironmentProduction(), // defaults to option.WithEnvironmentDev()
	)
	issuingChargeCreateResponse, err := client.Companies.Charge(
		context.TODO(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		rainhelloworld.CompanyChargeParams{
			IssuingChargeCreateBody: rainhelloworld.IssuingChargeCreateBodyParam{
				Amount:      1,
				Description: "description",
			},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", issuingChargeCreateResponse.ID)
}

Request fields

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// Accessing regular fields

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

// Optional field checks

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

// Raw JSON values

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

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

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

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

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

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

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

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

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

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

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

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

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

See the full list of request options.

Pagination

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

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

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

Errors

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

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

_, err := client.Companies.Charge(
	context.TODO(),
	"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	rainhelloworld.CompanyChargeParams{
		IssuingChargeCreateBody: rainhelloworld.IssuingChargeCreateBodyParam{
			Amount:      1,
			Description: "description",
		},
	},
)
if err != nil {
	var apierr *rainhelloworld.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/companies/{companyId}/charges": 400 Bad Request { ... }
}

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

Timeouts

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

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

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Companies.Charge(
	ctx,
	"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	rainhelloworld.CompanyChargeParams{
		IssuingChargeCreateBody: rainhelloworld.IssuingChargeCreateBodyParam{
			Amount:      1,
			Description: "description",
		},
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

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

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

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

// A file from the file system
file, err := os.Open("/path/to/file")
rainhelloworld.ApplicationCompanyUploadDocumentParams{
	Document: file,
}

// A file from a string
rainhelloworld.ApplicationCompanyUploadDocumentParams{
	Document: strings.NewReader("my file contents"),
}

// With a custom filename and contentType
rainhelloworld.ApplicationCompanyUploadDocumentParams{
	Document: rainhelloworld.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}
Retries

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

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

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

// Override per-request:
client.Companies.Charge(
	context.TODO(),
	"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	rainhelloworld.CompanyChargeParams{
		IssuingChargeCreateBody: rainhelloworld.IssuingChargeCreateBodyParam{
			Amount:      1,
			Description: "description",
		},
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

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

// Create a variable to store the HTTP response
var response *http.Response
issuingChargeCreateResponse, err := client.Companies.Charge(
	context.TODO(),
	"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	rainhelloworld.CompanyChargeParams{
		IssuingChargeCreateBody: rainhelloworld.IssuingChargeCreateBodyParam{
			Amount:      1,
			Description: "description",
		},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", issuingChargeCreateResponse)

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

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

Undocumented endpoints

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

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

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

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

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

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

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

Middleware

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

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

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

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

    return res, err
}

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

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

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

Semantic versioning

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

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

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

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

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

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

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

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

func File

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

func Float

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

func FloatPtr

func FloatPtr(v float64) *float64

func Int

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

func IntPtr

func IntPtr(v int64) *int64

func Opt

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

func Ptr

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

func String

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

func StringPtr

func StringPtr(v string) *string

func Time

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

func TimePtr

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

Types

type ApplicationCompanyGetResponse

type ApplicationCompanyGetResponse struct {
	// The identifier of the company application
	ID string `json:"id" api:"required" format:"uuid"`
	// The company's ultimate beneficial owners (UBOs)
	UltimateBeneficialOwners []ApplicationCompanyGetResponseUltimateBeneficialOwner `json:"ultimateBeneficialOwners" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		UltimateBeneficialOwners respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	IssuingApplication
}

The details of an issuing application.

func (ApplicationCompanyGetResponse) RawJSON

Returns the unmodified JSON received from the API

func (*ApplicationCompanyGetResponse) UnmarshalJSON

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

type ApplicationCompanyGetResponseUltimateBeneficialOwner

type ApplicationCompanyGetResponseUltimateBeneficialOwner struct {
	// The UBO's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The UBO's email address
	Email string `json:"email" format:"email"`
	// The UBO's first name
	FirstName string `json:"firstName"`
	// The UBO's last name
	LastName string `json:"lastName"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Email       respjson.Field
		FirstName   respjson.Field
		LastName    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	IssuingApplication
}

The details of an issuing application.

func (ApplicationCompanyGetResponseUltimateBeneficialOwner) RawJSON

Returns the unmodified JSON received from the API

func (*ApplicationCompanyGetResponseUltimateBeneficialOwner) UnmarshalJSON

type ApplicationCompanyNewParams

type ApplicationCompanyNewParams struct {
	// The company's physical address
	Address PhysicalAddressParam `json:"address,omitzero" api:"required"`
	// The company's legal entity details.
	Entity ApplicationCompanyNewParamsEntity `json:"entity,omitzero" api:"required"`
	// The initial user of the company. This user must have a wallet address, and their
	// wallet address will be associated as an owner on the company's Rain smart
	// contract.
	InitialUser ApplicationCompanyNewParamsInitialUser `json:"initialUser,omitzero" api:"required"`
	// The name of the company requesting to create an account
	Name string `json:"name" api:"required"`
	// The company's representatives
	Representatives []IssuingApplicationPersonParam `json:"representatives,omitzero" api:"required"`
	// The company's ultimate beneficial owners (UBOs)
	UltimateBeneficialOwners []IssuingApplicationPersonParam `json:"ultimateBeneficialOwners,omitzero" api:"required"`
	// The chain ID of the external collateral contract, if used. Not required when
	// using Rain's collateral contracts.
	ChainID param.Opt[string] `json:"chainId,omitzero"`
	// The address of the external collateral contract, if used. Not required when
	// using Rain's collateral contracts.
	ContractAddress param.Opt[string] `json:"contractAddress,omitzero"`
	// A unique identifier for the origin of the user
	SourceKey param.Opt[string] `json:"sourceKey,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyNewParams) MarshalJSON

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

func (*ApplicationCompanyNewParams) UnmarshalJSON

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

type ApplicationCompanyNewParamsEntity

type ApplicationCompanyNewParamsEntity struct {
	// The legal entity's name
	Name string `json:"name" api:"required"`
	// The legal entity's registration number
	RegistrationNumber string `json:"registrationNumber" api:"required"`
	// The legal entity's national tax id
	TaxID string `json:"taxId" api:"required"`
	// The legal entity's website
	Website string `json:"website" api:"required"`
	// A brief description of the legal entity and its activities
	Description param.Opt[string] `json:"description,omitzero"`
	// The estimated monthly spending by the legal entity
	ExpectedSpend param.Opt[string] `json:"expectedSpend,omitzero"`
	// The type of legal entity (e.g., LLC, S Corp)
	Type param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

The company's legal entity details.

The properties Name, RegistrationNumber, TaxID, Website are required.

func (ApplicationCompanyNewParamsEntity) MarshalJSON

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

func (*ApplicationCompanyNewParamsEntity) UnmarshalJSON

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

type ApplicationCompanyNewParamsInitialUser

type ApplicationCompanyNewParamsInitialUser struct {
	// This user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// This user's role at their company (not their role on the Rain platform)
	Role param.Opt[string] `json:"role,omitzero"`
	// The user's Solana address. Either this or a EVM address is required if using a
	// Rain-managed solution, but optional otherwise.
	SolanaAddress param.Opt[string] `json:"solanaAddress,omitzero"`
	// The user's Ethereum Virtual Machine (EVM) address. Either this or a Solana
	// address is required if using a Rain-managed solution, but optional otherwise.
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	IssuingApplicationPersonParam
}

The initial user of the company. This user must have a wallet address, and their wallet address will be associated as an owner on the company's Rain smart contract.

func (ApplicationCompanyNewParamsInitialUser) MarshalJSON

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

type ApplicationCompanyReapplyParams

type ApplicationCompanyReapplyParams struct {
	// The company's physical address
	Address PhysicalAddressParam `json:"address,omitzero" api:"required"`
	// The company's legal entity details.
	Entity ApplicationCompanyReapplyParamsEntity `json:"entity,omitzero" api:"required"`
	// The initial user of the company who will be the owner on the Rain smart
	// contract. This user must provide various personal details.
	InitialUser ApplicationCompanyReapplyParamsInitialUser `json:"initialUser,omitzero" api:"required"`
	// The name of the company reapplying for the corporate application
	Name string `json:"name" api:"required"`
	// The company's representatives
	Representatives []IssuingApplicationPersonParam `json:"representatives,omitzero" api:"required"`
	// The company's ultimate beneficial owners (UBOs)
	UltimateBeneficialOwners []IssuingApplicationPersonParam `json:"ultimateBeneficialOwners,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyReapplyParams) MarshalJSON

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

func (*ApplicationCompanyReapplyParams) UnmarshalJSON

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

type ApplicationCompanyReapplyParamsEntity

type ApplicationCompanyReapplyParamsEntity struct {
	// The legal entity's website
	Website string `json:"website" api:"required"`
	// A brief description of the legal entity, and its activities
	Description param.Opt[string] `json:"description,omitzero"`
	// The estimated monthly spending by the legal entity
	ExpectedSpend param.Opt[string] `json:"expectedSpend,omitzero"`
	// The type of legal entity (e.g., LLC, S Corp)
	Type param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

The company's legal entity details.

The property Website is required.

func (ApplicationCompanyReapplyParamsEntity) MarshalJSON

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

func (*ApplicationCompanyReapplyParamsEntity) UnmarshalJSON

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

type ApplicationCompanyReapplyParamsInitialUser

type ApplicationCompanyReapplyParamsInitialUser struct {
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero" api:"required"`
	// The user's birth date
	BirthDate time.Time `json:"birthDate" api:"required" format:"date"`
	// The 2-digit country code of the user's national ID issuer
	CountryOfIssue string `json:"countryOfIssue" api:"required"`
	// The user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	//
	// Any of true.
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// The user's national ID number. For the US, this is a 9-digit SSN
	NationalID string `json:"nationalId" api:"required"`
	// This user's role at their company (not their role on the Rain platform)
	Role param.Opt[string] `json:"role,omitzero"`
	// contains filtered or unexported fields
}

The initial user of the company who will be the owner on the Rain smart contract. This user must provide various personal details.

The properties Address, BirthDate, CountryOfIssue, IPAddress, IsTermsOfServiceAccepted, NationalID are required.

func (ApplicationCompanyReapplyParamsInitialUser) MarshalJSON

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

func (*ApplicationCompanyReapplyParamsInitialUser) UnmarshalJSON

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

type ApplicationCompanyService

type ApplicationCompanyService struct {
	Ubo ApplicationCompanyUboService
	// contains filtered or unexported fields
}

ApplicationCompanyService contains methods and other services that help with interacting with the rain 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 NewApplicationCompanyService method instead.

func NewApplicationCompanyService

func NewApplicationCompanyService(opts ...option.RequestOption) (r ApplicationCompanyService)

NewApplicationCompanyService 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 (*ApplicationCompanyService) Get

Retrieves the current status and details of a company's corporate application, including the company's ultimate beneficial owners and application progress.

func (*ApplicationCompanyService) New

Submits an application to create a corporate account. The application requires details about the company, its legal entity, representatives, and beneficial owners. The initial user must provide a wallet address.

func (*ApplicationCompanyService) Reapply deprecated

Allows a company to reapply or respond to a request for information after submitting their corporate application. This endpoint is typically used when additional information or corrections are needed.

Deprecated: deprecated

func (*ApplicationCompanyService) Update

Updates the information for an existing corporate account application. The company's details, including name, address, and legal entity information, can be modified through this endpoint.

func (*ApplicationCompanyService) UploadDocument

Uploads a document that supports a company's corporate application. This is typically used to provide additional documentation, such as proof of address, incorporation certificates, or other required legal documents.

type ApplicationCompanyUboDocumentService

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

ApplicationCompanyUboDocumentService contains methods and other services that help with interacting with the rain 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 NewApplicationCompanyUboDocumentService method instead.

func NewApplicationCompanyUboDocumentService

func NewApplicationCompanyUboDocumentService(opts ...option.RequestOption) (r ApplicationCompanyUboDocumentService)

NewApplicationCompanyUboDocumentService 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 (*ApplicationCompanyUboDocumentService) Upload

Uploads a document for a company's Ultimate Beneficial Owner (UBO) to support the company's corporate application. This endpoint allows for the submission of various legal and identification documents.

type ApplicationCompanyUboDocumentUploadParams

type ApplicationCompanyUboDocumentUploadParams struct {
	CompanyID string `path:"companyId" api:"required" format:"uuid" json:"-"`
	// The actual document file to be uploaded. The document must be in binary format,
	// and the maximum allowed size is 20 MB.
	Document io.Reader `json:"document,omitzero" api:"required" format:"binary"`
	// The country where the document was issued
	Country param.Opt[string] `json:"country,omitzero"`
	// The side of the document being uploaded
	//
	// Any of "front", "back".
	Side ApplicationCompanyUboDocumentUploadParamsSide `json:"side,omitzero"`
	// The type of the document being uploaded
	//
	// Any of "idCard", "passport", "drivers", "residencePermit", "utilityBill",
	// "selfie", "videoSelfie", "profileImage", "idDocPhoto", "agreement", "contract",
	// "driversTranslation", "investorDoc", "vehicleRegistrationCertificate",
	// "incomeSource", "paymentMethod", "bankCard", "covidVaccinationForm", "other".
	Type ApplicationCompanyUboDocumentUploadParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyUboDocumentUploadParams) MarshalMultipart

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

type ApplicationCompanyUboDocumentUploadParamsSide

type ApplicationCompanyUboDocumentUploadParamsSide string

The side of the document being uploaded

const (
	ApplicationCompanyUboDocumentUploadParamsSideFront ApplicationCompanyUboDocumentUploadParamsSide = "front"
	ApplicationCompanyUboDocumentUploadParamsSideBack  ApplicationCompanyUboDocumentUploadParamsSide = "back"
)

type ApplicationCompanyUboDocumentUploadParamsType

type ApplicationCompanyUboDocumentUploadParamsType string

The type of the document being uploaded

const (
	ApplicationCompanyUboDocumentUploadParamsTypeIDCard                         ApplicationCompanyUboDocumentUploadParamsType = "idCard"
	ApplicationCompanyUboDocumentUploadParamsTypePassport                       ApplicationCompanyUboDocumentUploadParamsType = "passport"
	ApplicationCompanyUboDocumentUploadParamsTypeDrivers                        ApplicationCompanyUboDocumentUploadParamsType = "drivers"
	ApplicationCompanyUboDocumentUploadParamsTypeResidencePermit                ApplicationCompanyUboDocumentUploadParamsType = "residencePermit"
	ApplicationCompanyUboDocumentUploadParamsTypeUtilityBill                    ApplicationCompanyUboDocumentUploadParamsType = "utilityBill"
	ApplicationCompanyUboDocumentUploadParamsTypeSelfie                         ApplicationCompanyUboDocumentUploadParamsType = "selfie"
	ApplicationCompanyUboDocumentUploadParamsTypeVideoSelfie                    ApplicationCompanyUboDocumentUploadParamsType = "videoSelfie"
	ApplicationCompanyUboDocumentUploadParamsTypeProfileImage                   ApplicationCompanyUboDocumentUploadParamsType = "profileImage"
	ApplicationCompanyUboDocumentUploadParamsTypeIDDocPhoto                     ApplicationCompanyUboDocumentUploadParamsType = "idDocPhoto"
	ApplicationCompanyUboDocumentUploadParamsTypeAgreement                      ApplicationCompanyUboDocumentUploadParamsType = "agreement"
	ApplicationCompanyUboDocumentUploadParamsTypeContract                       ApplicationCompanyUboDocumentUploadParamsType = "contract"
	ApplicationCompanyUboDocumentUploadParamsTypeDriversTranslation             ApplicationCompanyUboDocumentUploadParamsType = "driversTranslation"
	ApplicationCompanyUboDocumentUploadParamsTypeInvestorDoc                    ApplicationCompanyUboDocumentUploadParamsType = "investorDoc"
	ApplicationCompanyUboDocumentUploadParamsTypeVehicleRegistrationCertificate ApplicationCompanyUboDocumentUploadParamsType = "vehicleRegistrationCertificate"
	ApplicationCompanyUboDocumentUploadParamsTypeIncomeSource                   ApplicationCompanyUboDocumentUploadParamsType = "incomeSource"
	ApplicationCompanyUboDocumentUploadParamsTypePaymentMethod                  ApplicationCompanyUboDocumentUploadParamsType = "paymentMethod"
	ApplicationCompanyUboDocumentUploadParamsTypeBankCard                       ApplicationCompanyUboDocumentUploadParamsType = "bankCard"
	ApplicationCompanyUboDocumentUploadParamsTypeCovidVaccinationForm           ApplicationCompanyUboDocumentUploadParamsType = "covidVaccinationForm"
	ApplicationCompanyUboDocumentUploadParamsTypeOther                          ApplicationCompanyUboDocumentUploadParamsType = "other"
)

type ApplicationCompanyUboService

type ApplicationCompanyUboService struct {
	Document ApplicationCompanyUboDocumentService
	// contains filtered or unexported fields
}

ApplicationCompanyUboService contains methods and other services that help with interacting with the rain 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 NewApplicationCompanyUboService method instead.

func NewApplicationCompanyUboService

func NewApplicationCompanyUboService(opts ...option.RequestOption) (r ApplicationCompanyUboService)

NewApplicationCompanyUboService 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 (*ApplicationCompanyUboService) Update

Updates the application information for a company's Ultimate Beneficial Owner (UBO). This allows modification of the UBO's personal details such as name, birth date, national ID, and address.

func (*ApplicationCompanyUboService) UploadDocument deprecated

This deprecated endpoint allows the upload of a document for a UBO to support a company's corporate application. It is recommended to use the newer endpoint for document uploads.

Deprecated: deprecated

type ApplicationCompanyUboUpdateParams

type ApplicationCompanyUboUpdateParams struct {
	CompanyID string `path:"companyId" api:"required" format:"uuid" json:"-"`
	// The UBO's birth date
	BirthDate param.Opt[time.Time] `json:"birthDate,omitzero" format:"date"`
	// The 2-digit country code of the user's national ID issuer
	CountryOfIssue param.Opt[string] `json:"countryOfIssue,omitzero"`
	// The UBO's email address
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// The UBO's first name
	FirstName param.Opt[string] `json:"firstName,omitzero"`
	// The UBO's last name
	LastName param.Opt[string] `json:"lastName,omitzero"`
	// The UBO's national ID number. For the US, this is a 9-digit SSN
	NationalID param.Opt[string] `json:"nationalId,omitzero"`
	// The UBO's address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyUboUpdateParams) MarshalJSON

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

func (*ApplicationCompanyUboUpdateParams) UnmarshalJSON

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

type ApplicationCompanyUboUploadDocumentParams

type ApplicationCompanyUboUploadDocumentParams struct {
	// The actual document file to be uploaded. The document must be in binary format,
	// and the maximum allowed size is 20 MB.
	Document io.Reader `json:"document,omitzero" api:"required" format:"binary"`
	// The UBO's email address
	Email string `json:"email" api:"required"`
	// The country where the document was issued
	Country param.Opt[string] `json:"country,omitzero"`
	// The side of the document being uploaded
	//
	// Any of "front", "back".
	Side ApplicationCompanyUboUploadDocumentParamsSide `json:"side,omitzero"`
	// The type of the document being uploaded
	//
	// Any of "idCard", "passport", "drivers", "residencePermit", "utilityBill",
	// "selfie", "videoSelfie", "profileImage", "idDocPhoto", "agreement", "contract",
	// "driversTranslation", "investorDoc", "vehicleRegistrationCertificate",
	// "incomeSource", "paymentMethod", "bankCard", "covidVaccinationForm", "other".
	Type ApplicationCompanyUboUploadDocumentParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyUboUploadDocumentParams) MarshalMultipart

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

type ApplicationCompanyUboUploadDocumentParamsSide

type ApplicationCompanyUboUploadDocumentParamsSide string

The side of the document being uploaded

const (
	ApplicationCompanyUboUploadDocumentParamsSideFront ApplicationCompanyUboUploadDocumentParamsSide = "front"
	ApplicationCompanyUboUploadDocumentParamsSideBack  ApplicationCompanyUboUploadDocumentParamsSide = "back"
)

type ApplicationCompanyUboUploadDocumentParamsType

type ApplicationCompanyUboUploadDocumentParamsType string

The type of the document being uploaded

const (
	ApplicationCompanyUboUploadDocumentParamsTypeIDCard                         ApplicationCompanyUboUploadDocumentParamsType = "idCard"
	ApplicationCompanyUboUploadDocumentParamsTypePassport                       ApplicationCompanyUboUploadDocumentParamsType = "passport"
	ApplicationCompanyUboUploadDocumentParamsTypeDrivers                        ApplicationCompanyUboUploadDocumentParamsType = "drivers"
	ApplicationCompanyUboUploadDocumentParamsTypeResidencePermit                ApplicationCompanyUboUploadDocumentParamsType = "residencePermit"
	ApplicationCompanyUboUploadDocumentParamsTypeUtilityBill                    ApplicationCompanyUboUploadDocumentParamsType = "utilityBill"
	ApplicationCompanyUboUploadDocumentParamsTypeSelfie                         ApplicationCompanyUboUploadDocumentParamsType = "selfie"
	ApplicationCompanyUboUploadDocumentParamsTypeVideoSelfie                    ApplicationCompanyUboUploadDocumentParamsType = "videoSelfie"
	ApplicationCompanyUboUploadDocumentParamsTypeProfileImage                   ApplicationCompanyUboUploadDocumentParamsType = "profileImage"
	ApplicationCompanyUboUploadDocumentParamsTypeIDDocPhoto                     ApplicationCompanyUboUploadDocumentParamsType = "idDocPhoto"
	ApplicationCompanyUboUploadDocumentParamsTypeAgreement                      ApplicationCompanyUboUploadDocumentParamsType = "agreement"
	ApplicationCompanyUboUploadDocumentParamsTypeContract                       ApplicationCompanyUboUploadDocumentParamsType = "contract"
	ApplicationCompanyUboUploadDocumentParamsTypeDriversTranslation             ApplicationCompanyUboUploadDocumentParamsType = "driversTranslation"
	ApplicationCompanyUboUploadDocumentParamsTypeInvestorDoc                    ApplicationCompanyUboUploadDocumentParamsType = "investorDoc"
	ApplicationCompanyUboUploadDocumentParamsTypeVehicleRegistrationCertificate ApplicationCompanyUboUploadDocumentParamsType = "vehicleRegistrationCertificate"
	ApplicationCompanyUboUploadDocumentParamsTypeIncomeSource                   ApplicationCompanyUboUploadDocumentParamsType = "incomeSource"
	ApplicationCompanyUboUploadDocumentParamsTypePaymentMethod                  ApplicationCompanyUboUploadDocumentParamsType = "paymentMethod"
	ApplicationCompanyUboUploadDocumentParamsTypeBankCard                       ApplicationCompanyUboUploadDocumentParamsType = "bankCard"
	ApplicationCompanyUboUploadDocumentParamsTypeCovidVaccinationForm           ApplicationCompanyUboUploadDocumentParamsType = "covidVaccinationForm"
	ApplicationCompanyUboUploadDocumentParamsTypeOther                          ApplicationCompanyUboUploadDocumentParamsType = "other"
)

type ApplicationCompanyUpdateParams

type ApplicationCompanyUpdateParams struct {
	// The name of the company for the corporate application
	Name param.Opt[string] `json:"name,omitzero"`
	// The company's physical address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// The company's legal entity details.
	Entity ApplicationCompanyUpdateParamsEntity `json:"entity,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyUpdateParams) MarshalJSON

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

func (*ApplicationCompanyUpdateParams) UnmarshalJSON

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

type ApplicationCompanyUpdateParamsEntity

type ApplicationCompanyUpdateParamsEntity struct {
	// A brief description of the legal entity and its activities
	Description param.Opt[string] `json:"description,omitzero"`
	// The estimated monthly spending by the legal entity
	ExpectedSpend param.Opt[string] `json:"expectedSpend,omitzero"`
	// The legal entity's registration number
	RegistrationNumber param.Opt[string] `json:"registrationNumber,omitzero"`
	// The legal entity's national tax ID
	TaxID param.Opt[string] `json:"taxId,omitzero"`
	// The type of legal entity (e.g., LLC, S Corp)
	Type param.Opt[string] `json:"type,omitzero"`
	// The legal entity's website
	Website param.Opt[string] `json:"website,omitzero"`
	// contains filtered or unexported fields
}

The company's legal entity details.

func (ApplicationCompanyUpdateParamsEntity) MarshalJSON

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

func (*ApplicationCompanyUpdateParamsEntity) UnmarshalJSON

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

type ApplicationCompanyUploadDocumentParams

type ApplicationCompanyUploadDocumentParams struct {
	// The actual document file to be uploaded. The document must be in binary format,
	// and the maximum allowed size is 20 MB.
	Document io.Reader `json:"document,omitzero" api:"required" format:"binary"`
	// The country where the document was issued
	Country param.Opt[string] `json:"country,omitzero"`
	// The name of the document being uploaded
	Name param.Opt[string] `json:"name,omitzero"`
	// The side of the document being uploaded
	//
	// Any of "front", "back".
	Side ApplicationCompanyUploadDocumentParamsSide `json:"side,omitzero"`
	// The type of the document being uploaded
	//
	// Any of "directorsRegistry", "stateRegistry", "incumbencyCert", "proofOfAddress",
	// "trustAgreement", "informationStatement", "incorporationCert",
	// "incorporationArticles", "shareholderRegistry", "goodStandingCert",
	// "powerOfAttorney", "other".
	Type ApplicationCompanyUploadDocumentParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationCompanyUploadDocumentParams) MarshalMultipart

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

type ApplicationCompanyUploadDocumentParamsSide

type ApplicationCompanyUploadDocumentParamsSide string

The side of the document being uploaded

const (
	ApplicationCompanyUploadDocumentParamsSideFront ApplicationCompanyUploadDocumentParamsSide = "front"
	ApplicationCompanyUploadDocumentParamsSideBack  ApplicationCompanyUploadDocumentParamsSide = "back"
)

type ApplicationCompanyUploadDocumentParamsType

type ApplicationCompanyUploadDocumentParamsType string

The type of the document being uploaded

const (
	ApplicationCompanyUploadDocumentParamsTypeDirectorsRegistry     ApplicationCompanyUploadDocumentParamsType = "directorsRegistry"
	ApplicationCompanyUploadDocumentParamsTypeStateRegistry         ApplicationCompanyUploadDocumentParamsType = "stateRegistry"
	ApplicationCompanyUploadDocumentParamsTypeIncumbencyCert        ApplicationCompanyUploadDocumentParamsType = "incumbencyCert"
	ApplicationCompanyUploadDocumentParamsTypeProofOfAddress        ApplicationCompanyUploadDocumentParamsType = "proofOfAddress"
	ApplicationCompanyUploadDocumentParamsTypeTrustAgreement        ApplicationCompanyUploadDocumentParamsType = "trustAgreement"
	ApplicationCompanyUploadDocumentParamsTypeInformationStatement  ApplicationCompanyUploadDocumentParamsType = "informationStatement"
	ApplicationCompanyUploadDocumentParamsTypeIncorporationCert     ApplicationCompanyUploadDocumentParamsType = "incorporationCert"
	ApplicationCompanyUploadDocumentParamsTypeIncorporationArticles ApplicationCompanyUploadDocumentParamsType = "incorporationArticles"
	ApplicationCompanyUploadDocumentParamsTypeShareholderRegistry   ApplicationCompanyUploadDocumentParamsType = "shareholderRegistry"
	ApplicationCompanyUploadDocumentParamsTypeGoodStandingCert      ApplicationCompanyUploadDocumentParamsType = "goodStandingCert"
	ApplicationCompanyUploadDocumentParamsTypePowerOfAttorney       ApplicationCompanyUploadDocumentParamsType = "powerOfAttorney"
	ApplicationCompanyUploadDocumentParamsTypeOther                 ApplicationCompanyUploadDocumentParamsType = "other"
)

type ApplicationService

type ApplicationService struct {
	Company ApplicationCompanyService
	User    ApplicationUserService
	// contains filtered or unexported fields
}

ApplicationService contains methods and other services that help with interacting with the rain 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 NewApplicationService method instead.

func NewApplicationService

func NewApplicationService(opts ...option.RequestOption) (r ApplicationService)

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

type ApplicationUserGetResponse

type ApplicationUserGetResponse struct {
	// The identifier of the user's application
	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:"-"`
	IssuingApplication
}

The details of an issuing application.

func (ApplicationUserGetResponse) RawJSON

func (r ApplicationUserGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ApplicationUserGetResponse) UnmarshalJSON

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

type ApplicationUserInitiateParams

type ApplicationUserInitiateParams struct {
	// The user's email address
	Email param.Opt[string] `json:"email,omitzero"`
	// The user's first name
	FirstName param.Opt[string] `json:"firstName,omitzero"`
	// The user's last name
	LastName param.Opt[string] `json:"lastName,omitzero"`
	// The user's wallet address. Required if using the hosted completion flow and a
	// Rain-managed solution. Not required otherwise.
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationUserInitiateParams) MarshalJSON

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

func (*ApplicationUserInitiateParams) UnmarshalJSON

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

type ApplicationUserNewParams

type ApplicationUserNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfUsingSumsubShareToken *ApplicationUserNewParamsBodyUsingSumsubShareToken `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfObject *ApplicationUserNewParamsBodyObject `json:",inline"`
	// This field is a request body variant, only one variant field can be set. The
	// user seeking to create an account. The user must have a wallet, and their wallet
	// will be linked as an owner on their Rain smart contract.
	OfUsingAPI *ApplicationUserNewParamsBodyUsingAPI `json:",inline"`
	// contains filtered or unexported fields
}

func (ApplicationUserNewParams) MarshalJSON

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

func (*ApplicationUserNewParams) UnmarshalJSON

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

type ApplicationUserNewParamsBodyObject

type ApplicationUserNewParamsBodyObject struct {
	// The purpose of the user's account
	AccountPurpose string `json:"accountPurpose" api:"required"`
	// The user's annual salary
	AnnualSalary string `json:"annualSalary" api:"required"`
	// The estimated monthly spending amount for the user
	ExpectedMonthlyVolume string `json:"expectedMonthlyVolume" api:"required"`
	// This user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	//
	// Any of true.
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// The user's occupation
	Occupation string `json:"occupation" api:"required"`
	// The Persona inquiry ID
	PersonaShareToken string `json:"personaShareToken" api:"required"`
	// The chain ID of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ChainID param.Opt[string] `json:"chainId,omitzero"`
	// The address of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ContractAddress param.Opt[string] `json:"contractAddress,omitzero"`
	// Indicates whether the user will use existing documents for additional
	// verification
	HasExistingDocuments param.Opt[bool] `json:"hasExistingDocuments,omitzero"`
	// The user's Solana address. Either walletAddress or solanaAddress is required if
	// using a Rain-managed solution, but optional otherwise.
	SolanaAddress param.Opt[string] `json:"solanaAddress,omitzero"`
	// A unique identifier for the source of this user.
	SourceKey param.Opt[string] `json:"sourceKey,omitzero"`
	// The user's Ethereum Virtual Machine (EVM) address. Either walletAddress or
	// solanaAddress is required if using a Rain-managed solution, but optional
	// otherwise.
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	// contains filtered or unexported fields
}

The properties AccountPurpose, AnnualSalary, ExpectedMonthlyVolume, IPAddress, IsTermsOfServiceAccepted, Occupation, PersonaShareToken are required.

func (ApplicationUserNewParamsBodyObject) MarshalJSON

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

func (*ApplicationUserNewParamsBodyObject) UnmarshalJSON

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

type ApplicationUserNewParamsBodyUsingAPI

type ApplicationUserNewParamsBodyUsingAPI struct {
	// The purpose of the user's account
	AccountPurpose string `json:"accountPurpose" api:"required"`
	// The user's annual salary
	AnnualSalary string `json:"annualSalary" api:"required"`
	// The estimated monthly spending amount for the user
	ExpectedMonthlyVolume string `json:"expectedMonthlyVolume" api:"required"`
	// This user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// The user's occupation
	Occupation string `json:"occupation" api:"required"`
	// The chain ID of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ChainID param.Opt[string] `json:"chainId,omitzero"`
	// The address of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ContractAddress param.Opt[string] `json:"contractAddress,omitzero"`
	// Indicates whether the user will use existing documents for additional
	// verification
	HasExistingDocuments param.Opt[bool] `json:"hasExistingDocuments,omitzero"`
	// The user's Solana address. Either walletAddress or solanaAddress is required if
	// using a Rain-managed solution, but optional otherwise.
	SolanaAddress param.Opt[string] `json:"solanaAddress,omitzero"`
	// A unique identifier for the source of this user.
	SourceKey param.Opt[string] `json:"sourceKey,omitzero"`
	// The user's Ethereum Virtual Machine (EVM) address. Either walletAddress or
	// solanaAddress is required if using a Rain-managed solution, but optional
	// otherwise.
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	IssuingApplicationPersonParam
}

The user seeking to create an account. The user must have a wallet, and their wallet will be linked as an owner on their Rain smart contract.

func (ApplicationUserNewParamsBodyUsingAPI) MarshalJSON

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

type ApplicationUserNewParamsBodyUsingSumsubShareToken

type ApplicationUserNewParamsBodyUsingSumsubShareToken struct {
	// The purpose of the user's account
	AccountPurpose string `json:"accountPurpose" api:"required"`
	// The user's annual salary
	AnnualSalary string `json:"annualSalary" api:"required"`
	// The estimated monthly spending amount for the user
	ExpectedMonthlyVolume string `json:"expectedMonthlyVolume" api:"required"`
	// This user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	//
	// Any of true.
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// The user's occupation
	Occupation string `json:"occupation" api:"required"`
	// The Sumsub share token used for user verification
	SumsubShareToken string `json:"sumsubShareToken" api:"required"`
	// The chain ID of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ChainID param.Opt[string] `json:"chainId,omitzero"`
	// The address of the user's external collateral contract, if applicable. Not
	// required when using Rain's collateral contracts.
	ContractAddress param.Opt[string] `json:"contractAddress,omitzero"`
	// Indicates whether the user will use existing documents for additional
	// verification
	HasExistingDocuments param.Opt[bool] `json:"hasExistingDocuments,omitzero"`
	// The user's Solana address. Either walletAddress or solanaAddress is required if
	// using a Rain-managed solution, but optional otherwise.
	SolanaAddress param.Opt[string] `json:"solanaAddress,omitzero"`
	// A unique identifier for the source of this user.
	SourceKey param.Opt[string] `json:"sourceKey,omitzero"`
	// The user's Ethereum Virtual Machine (EVM) address. Either walletAddress or
	// solanaAddress is required if using a Rain-managed solution, but optional
	// otherwise.
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	// contains filtered or unexported fields
}

The properties AccountPurpose, AnnualSalary, ExpectedMonthlyVolume, IPAddress, IsTermsOfServiceAccepted, Occupation, SumsubShareToken are required.

func (ApplicationUserNewParamsBodyUsingSumsubShareToken) MarshalJSON

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

func (*ApplicationUserNewParamsBodyUsingSumsubShareToken) UnmarshalJSON

type ApplicationUserReapplyParams

type ApplicationUserReapplyParams struct {
	// The purpose of the user's account
	AccountPurpose string `json:"accountPurpose" api:"required"`
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero" api:"required"`
	// The user's annual salary
	AnnualSalary string `json:"annualSalary" api:"required"`
	// The user's birth date
	BirthDate time.Time `json:"birthDate" api:"required" format:"date"`
	// The 2-digit country code of the user's national ID issuer
	CountryOfIssue string `json:"countryOfIssue" api:"required"`
	// The estimated monthly spending amount for the user
	ExpectedMonthlyVolume string `json:"expectedMonthlyVolume" api:"required"`
	// The user's IP address
	IPAddress string `json:"ipAddress" api:"required"`
	// Indicates whether the user has accepted the terms of service
	//
	// Any of true.
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero" api:"required"`
	// The user's national ID number. For the US, this is a 9-digit SSN
	NationalID string `json:"nationalId" api:"required"`
	// The user's occupation
	Occupation string `json:"occupation" api:"required"`
	// Indicates whether the user will use existing documents for additional
	// verification
	HasExistingDocuments param.Opt[bool] `json:"hasExistingDocuments,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationUserReapplyParams) MarshalJSON

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

func (*ApplicationUserReapplyParams) UnmarshalJSON

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

type ApplicationUserService

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

ApplicationUserService contains methods and other services that help with interacting with the rain 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 NewApplicationUserService method instead.

func NewApplicationUserService

func NewApplicationUserService(opts ...option.RequestOption) (r ApplicationUserService)

NewApplicationUserService 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 (*ApplicationUserService) Get

Retrieves the current status and details of a user's consumer application. This includes the user's application progress and related information.

func (*ApplicationUserService) Initiate

Submits an initial application for creating a consumer account. This request gathers basic personal details of the user, including their first and last name, email address, and optional wallet address if using a Rain-managed solution or hosted completion flow.

func (*ApplicationUserService) New

Submits an application to create a consumer account for a user. The application can be submitted using a Sumsub share token, Persona share token, or directly via API. The user must provide details about their wallet, occupation, salary, and other account-related information.

func (*ApplicationUserService) Reapply deprecated

Allows a user to reapply or respond to a request for additional information regarding their consumer application. This is used when the initial application needs updating or more information is required.

Deprecated: deprecated

func (*ApplicationUserService) Update

Updates the application information for a user, including personal details such as name, birth date, occupation, national ID, and account purpose.

func (*ApplicationUserService) UploadDocument

func (r *ApplicationUserService) UploadDocument(ctx context.Context, userID string, body ApplicationUserUploadDocumentParams, opts ...option.RequestOption) (err error)

Uploads a document for a user to support their consumer application. This is used to provide additional verification documents such as IDs, utility bills, and other required legal documents.

type ApplicationUserUpdateParams

type ApplicationUserUpdateParams struct {
	// The purpose of the user's account
	AccountPurpose param.Opt[string] `json:"accountPurpose,omitzero"`
	// The user's annual salary
	AnnualSalary param.Opt[string] `json:"annualSalary,omitzero"`
	// The user's birth date
	BirthDate param.Opt[time.Time] `json:"birthDate,omitzero" format:"date"`
	// The 2-digit country code of the user's national ID issuer
	CountryOfIssue param.Opt[string] `json:"countryOfIssue,omitzero"`
	// The estimated monthly spending amount for the user
	ExpectedMonthlyVolume param.Opt[string] `json:"expectedMonthlyVolume,omitzero"`
	// The user's first name
	FirstName param.Opt[string] `json:"firstName,omitzero"`
	// Indicates whether the user will use existing documents for additional
	// verification
	HasExistingDocuments param.Opt[bool] `json:"hasExistingDocuments,omitzero"`
	// The user's IP address
	IPAddress param.Opt[string] `json:"ipAddress,omitzero"`
	// The user's last name
	LastName param.Opt[string] `json:"lastName,omitzero"`
	// The user's national ID number. For the US, this is a 9-digit SSN.
	NationalID param.Opt[string] `json:"nationalId,omitzero"`
	// The user's occupation
	Occupation param.Opt[string] `json:"occupation,omitzero"`
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// Indicates whether the user has accepted the terms of service
	//
	// Any of true.
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationUserUpdateParams) MarshalJSON

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

func (*ApplicationUserUpdateParams) UnmarshalJSON

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

type ApplicationUserUploadDocumentParams

type ApplicationUserUploadDocumentParams struct {
	// The actual document file to be uploaded. The document must be in binary format,
	// and the maximum allowed size is 20 MB.
	Document io.Reader `json:"document,omitzero" api:"required" format:"binary"`
	// The country where the document was issued
	Country param.Opt[string] `json:"country,omitzero"`
	// The name or title of the document being uploaded
	Name param.Opt[string] `json:"name,omitzero"`
	// The side of the document being uploaded
	//
	// Any of "front", "back".
	Side ApplicationUserUploadDocumentParamsSide `json:"side,omitzero"`
	// The type of the document being uploaded
	//
	// Any of "idCard", "passport", "drivers", "residencePermit", "utilityBill",
	// "selfie", "videoSelfie", "profileImage", "idDocPhoto", "agreement", "contract",
	// "driversTranslation", "investorDoc", "vehicleRegistrationCertificate",
	// "incomeSource", "paymentMethod", "bankCard", "covidVaccinationForm", "other".
	Type ApplicationUserUploadDocumentParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ApplicationUserUploadDocumentParams) MarshalMultipart

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

type ApplicationUserUploadDocumentParamsSide

type ApplicationUserUploadDocumentParamsSide string

The side of the document being uploaded

const (
	ApplicationUserUploadDocumentParamsSideFront ApplicationUserUploadDocumentParamsSide = "front"
	ApplicationUserUploadDocumentParamsSideBack  ApplicationUserUploadDocumentParamsSide = "back"
)

type ApplicationUserUploadDocumentParamsType

type ApplicationUserUploadDocumentParamsType string

The type of the document being uploaded

const (
	ApplicationUserUploadDocumentParamsTypeIDCard                         ApplicationUserUploadDocumentParamsType = "idCard"
	ApplicationUserUploadDocumentParamsTypePassport                       ApplicationUserUploadDocumentParamsType = "passport"
	ApplicationUserUploadDocumentParamsTypeDrivers                        ApplicationUserUploadDocumentParamsType = "drivers"
	ApplicationUserUploadDocumentParamsTypeResidencePermit                ApplicationUserUploadDocumentParamsType = "residencePermit"
	ApplicationUserUploadDocumentParamsTypeUtilityBill                    ApplicationUserUploadDocumentParamsType = "utilityBill"
	ApplicationUserUploadDocumentParamsTypeSelfie                         ApplicationUserUploadDocumentParamsType = "selfie"
	ApplicationUserUploadDocumentParamsTypeVideoSelfie                    ApplicationUserUploadDocumentParamsType = "videoSelfie"
	ApplicationUserUploadDocumentParamsTypeProfileImage                   ApplicationUserUploadDocumentParamsType = "profileImage"
	ApplicationUserUploadDocumentParamsTypeIDDocPhoto                     ApplicationUserUploadDocumentParamsType = "idDocPhoto"
	ApplicationUserUploadDocumentParamsTypeAgreement                      ApplicationUserUploadDocumentParamsType = "agreement"
	ApplicationUserUploadDocumentParamsTypeContract                       ApplicationUserUploadDocumentParamsType = "contract"
	ApplicationUserUploadDocumentParamsTypeDriversTranslation             ApplicationUserUploadDocumentParamsType = "driversTranslation"
	ApplicationUserUploadDocumentParamsTypeInvestorDoc                    ApplicationUserUploadDocumentParamsType = "investorDoc"
	ApplicationUserUploadDocumentParamsTypeVehicleRegistrationCertificate ApplicationUserUploadDocumentParamsType = "vehicleRegistrationCertificate"
	ApplicationUserUploadDocumentParamsTypeIncomeSource                   ApplicationUserUploadDocumentParamsType = "incomeSource"
	ApplicationUserUploadDocumentParamsTypePaymentMethod                  ApplicationUserUploadDocumentParamsType = "paymentMethod"
	ApplicationUserUploadDocumentParamsTypeBankCard                       ApplicationUserUploadDocumentParamsType = "bankCard"
	ApplicationUserUploadDocumentParamsTypeCovidVaccinationForm           ApplicationUserUploadDocumentParamsType = "covidVaccinationForm"
	ApplicationUserUploadDocumentParamsTypeOther                          ApplicationUserUploadDocumentParamsType = "other"
)

type BalanceGetResponse

type BalanceGetResponse struct {
	// Balance due of the company, in cents
	BalanceDue int64 `json:"balanceDue" api:"required"`
	// Credit limit of the company, in cents
	CreditLimit int64 `json:"creditLimit" api:"required"`
	// Pending charges of the company, in cents
	PendingCharges int64 `json:"pendingCharges" api:"required"`
	// Posted charges of the company, in cents
	PostedCharges int64 `json:"postedCharges" api:"required"`
	// The amount of money the company can spend, in cents
	SpendingPower int64 `json:"spendingPower" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BalanceDue     respjson.Field
		CreditLimit    respjson.Field
		PendingCharges respjson.Field
		PostedCharges  respjson.Field
		SpendingPower  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BalanceGetResponse) RawJSON

func (r BalanceGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BalanceGetResponse) UnmarshalJSON

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

type BalanceService

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

BalanceService contains methods and other services that help with interacting with the rain 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 NewBalanceService method instead.

func NewBalanceService

func NewBalanceService(opts ...option.RequestOption) (r BalanceService)

NewBalanceService 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 (*BalanceService) Get

func (r *BalanceService) Get(ctx context.Context, opts ...option.RequestOption) (res *BalanceGetResponse, err error)

Retrieves the credit balances for an authorized user tenant. This includes details such as credit limit, pending charges, posted charges, balance due, and spending power.

type CardGetSecretsParams

type CardGetSecretsParams struct {
	SessionID string `header:"SessionId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CardGetSecretsResponse

type CardGetSecretsResponse struct {
	// The encrypted CVC
	EncryptedCvc CardGetSecretsResponseEncryptedCvc `json:"encryptedCvc" api:"required"`
	// The encrypted PAN
	EncryptedPan CardGetSecretsResponseEncryptedPan `json:"encryptedPan" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EncryptedCvc respjson.Field
		EncryptedPan respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The encrypted data for the card

func (CardGetSecretsResponse) RawJSON

func (r CardGetSecretsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CardGetSecretsResponse) UnmarshalJSON

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

type CardGetSecretsResponseEncryptedCvc

type CardGetSecretsResponseEncryptedCvc struct {
	// The encrypted data
	Data string `json:"data" api:"required"`
	// The initialization vector
	Iv string `json:"iv" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Iv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The encrypted CVC

func (CardGetSecretsResponseEncryptedCvc) RawJSON

Returns the unmodified JSON received from the API

func (*CardGetSecretsResponseEncryptedCvc) UnmarshalJSON

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

type CardGetSecretsResponseEncryptedPan

type CardGetSecretsResponseEncryptedPan struct {
	// The encrypted data
	Data string `json:"data" api:"required"`
	// The initialization vector
	Iv string `json:"iv" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Iv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The encrypted PAN

func (CardGetSecretsResponseEncryptedPan) RawJSON

Returns the unmodified JSON received from the API

func (*CardGetSecretsResponseEncryptedPan) UnmarshalJSON

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

type CardListParams

type CardListParams struct {
	// For corporate cards, the identifier of the company to get cards for
	CompanyID param.Opt[string] `query:"companyId,omitzero" format:"uuid" json:"-"`
	// The ID of the resource after which to start fetching
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// The number of resources to fetch
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The identifier of the user to get cards for
	UserID param.Opt[string] `query:"userId,omitzero" format:"uuid" json:"-"`
	// Filter cards by status
	//
	// Any of "notActivated", "active", "locked", "canceled".
	Status IssuingCardStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CardListParams) URLQuery

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

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

type CardPinGetParams

type CardPinGetParams struct {
	SessionID string `header:"SessionId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CardPinGetResponse

type CardPinGetResponse struct {
	// The encrypted pin
	EncryptedPin CardPinGetResponseEncryptedPin `json:"encryptedPin" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EncryptedPin respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The encrypted pin

func (CardPinGetResponse) RawJSON

func (r CardPinGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CardPinGetResponse) UnmarshalJSON

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

type CardPinGetResponseEncryptedPin

type CardPinGetResponseEncryptedPin struct {
	// The encrypted pin in base64
	Data string `json:"data" api:"required"`
	// The initialization vector in base64
	Iv string `json:"iv" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Iv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The encrypted pin

func (CardPinGetResponseEncryptedPin) RawJSON

Returns the unmodified JSON received from the API

func (*CardPinGetResponseEncryptedPin) UnmarshalJSON

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

type CardPinService

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

CardPinService contains methods and other services that help with interacting with the rain 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 NewCardPinService method instead.

func NewCardPinService

func NewCardPinService(opts ...option.RequestOption) (r CardPinService)

NewCardPinService 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 (*CardPinService) Get

func (r *CardPinService) Get(ctx context.Context, cardID string, query CardPinGetParams, opts ...option.RequestOption) (res *CardPinGetResponse, err error)

Retrieve the encrypted PIN for a specific card

func (*CardPinService) Update

func (r *CardPinService) Update(ctx context.Context, cardID string, params CardPinUpdateParams, opts ...option.RequestOption) (err error)

Updates the PIN of a specific card by setting the encrypted PIN

type CardPinUpdateParams

type CardPinUpdateParams struct {
	// The encrypted pin
	EncryptedPin CardPinUpdateParamsEncryptedPin `json:"encryptedPin,omitzero" api:"required"`
	SessionID    string                          `header:"SessionId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (CardPinUpdateParams) MarshalJSON

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

func (*CardPinUpdateParams) UnmarshalJSON

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

type CardPinUpdateParamsEncryptedPin

type CardPinUpdateParamsEncryptedPin struct {
	// The encrypted PIN data
	Data string `json:"data" api:"required"`
	// The initialization vector for encryption
	Iv string `json:"iv" api:"required"`
	// contains filtered or unexported fields
}

The encrypted pin

The properties Data, Iv are required.

func (CardPinUpdateParamsEncryptedPin) MarshalJSON

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

func (*CardPinUpdateParamsEncryptedPin) UnmarshalJSON

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

type CardService

type CardService struct {
	Pin CardPinService
	// contains filtered or unexported fields
}

CardService contains methods and other services that help with interacting with the rain 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

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

func (r *CardService) Get(ctx context.Context, cardID string, opts ...option.RequestOption) (res *IssuingCard, err error)

Retrieve detailed information for a specific card by its unique ID

func (*CardService) GetSecrets

func (r *CardService) GetSecrets(ctx context.Context, cardID string, query CardGetSecretsParams, opts ...option.RequestOption) (res *CardGetSecretsResponse, err error)

Retrieve the encrypted data for a specific card, including the encrypted PAN and CVC

func (*CardService) List

func (r *CardService) List(ctx context.Context, query CardListParams, opts ...option.RequestOption) (res *[]IssuingCard, err error)

Retrieves all cards associated with a user or company. You can filter by user or company ID and card status.

func (*CardService) Update

func (r *CardService) Update(ctx context.Context, cardID string, body CardUpdateParams, opts ...option.RequestOption) (res *IssuingCard, err error)

Update details for an existing card, such as status, limit, billing address, and configuration.

type CardUpdateParams

type CardUpdateParams struct {
	// The billing address associated with the card.
	Billing PhysicalAddressParam `json:"billing,omitzero"`
	// Configuration for the card, such as virtual card art
	Configuration CardUpdateParamsConfiguration `json:"configuration,omitzero"`
	// The limit associated with the card
	Limit IssuingCardLimitParam `json:"limit,omitzero"`
	// The current status of the card
	//
	// Any of "notActivated", "active", "locked", "canceled".
	Status IssuingCardStatus `json:"status,omitzero"`
	// contains filtered or unexported fields
}

func (CardUpdateParams) MarshalJSON

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

func (*CardUpdateParams) UnmarshalJSON

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

type CardUpdateParamsConfiguration

type CardUpdateParamsConfiguration struct {
	// The virtual card art ID used to customize the card's appearance, if applicable
	VirtualCardArt param.Opt[string] `json:"virtualCardArt,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the card, such as virtual card art

func (CardUpdateParamsConfiguration) MarshalJSON

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

func (*CardUpdateParamsConfiguration) UnmarshalJSON

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

type Client

type Client struct {
	Applications ApplicationService
	Balances     BalanceService
	Cards        CardService
	Companies    CompanyService
	Contracts    ContractService
	Disputes     DisputeService
	Keys         KeyService
	Payments     PaymentService
	Signatures   SignatureService
	Transactions TransactionService
	Users        UserService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the rain 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 (RAIN_API_KEY, RAIN_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

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

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

func (*Client) Execute

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

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

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

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

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

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

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

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

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

func (*Client) Get

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

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

func (*Client) Patch

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

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

func (*Client) Post

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

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

func (*Client) Put

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

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

type CompanyChargeParams

type CompanyChargeParams struct {
	// Represents the body of a request to create a charge, including the amount and a
	// description of the charge.
	IssuingChargeCreateBody IssuingChargeCreateBodyParam
	// contains filtered or unexported fields
}

func (CompanyChargeParams) MarshalJSON

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

func (*CompanyChargeParams) UnmarshalJSON

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

type CompanyGetBalancesResponse

type CompanyGetBalancesResponse struct {
	// Balance due of the company, in cents
	BalanceDue int64 `json:"balanceDue" api:"required"`
	// Credit limit of the company, in cents
	CreditLimit int64 `json:"creditLimit" api:"required"`
	// Pending charges of the company, in cents
	PendingCharges int64 `json:"pendingCharges" api:"required"`
	// Posted charges of the company, in cents
	PostedCharges int64 `json:"postedCharges" api:"required"`
	// The amount of money the company can spend, in cents
	SpendingPower int64 `json:"spendingPower" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BalanceDue     respjson.Field
		CreditLimit    respjson.Field
		PendingCharges respjson.Field
		PostedCharges  respjson.Field
		SpendingPower  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompanyGetBalancesResponse) RawJSON

func (r CompanyGetBalancesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompanyGetBalancesResponse) UnmarshalJSON

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

type CompanyInitiatePaymentParams

type CompanyInitiatePaymentParams struct {
	// The amount of the payment, in cents
	Amount int64 `json:"amount" api:"required"`
	// The wallet address the payment is being sent from
	WalletAddress string `json:"walletAddress" api:"required"`
	// The chain ID (base-10 number) that the payment transaction is on
	ChainID param.Opt[int64] `json:"chainId,omitzero"`
	// contains filtered or unexported fields
}

func (CompanyInitiatePaymentParams) MarshalJSON

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

func (*CompanyInitiatePaymentParams) UnmarshalJSON

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

type CompanyInitiatePaymentResponse

type CompanyInitiatePaymentResponse struct {
	// The address to send the payment to
	Address string `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 (CompanyInitiatePaymentResponse) RawJSON

Returns the unmodified JSON received from the API

func (*CompanyInitiatePaymentResponse) UnmarshalJSON

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

type CompanyListParams

type CompanyListParams struct {
	// The ID of the resource after which to start fetching
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// The number of resources to fetch
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CompanyListParams) URLQuery

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

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

type CompanyNewUserParams

type CompanyNewUserParams struct {
	// The user's email address
	Email string `json:"email" api:"required"`
	// The user's first name
	FirstName string `json:"firstName" api:"required"`
	// Indicates whether the user has accepted the terms of service
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted" api:"required"`
	// The user's last name
	LastName string `json:"lastName" api:"required"`
	// The user's birth date
	BirthDate param.Opt[time.Time] `json:"birthDate,omitzero" format:"date"`
	// The user's phone country code
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// The user's phone number
	PhoneNumber param.Opt[string] `json:"phoneNumber,omitzero"`
	// The user's wallet address
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (CompanyNewUserParams) MarshalJSON

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

func (*CompanyNewUserParams) UnmarshalJSON

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

type CompanyService

type CompanyService struct {
	Signatures CompanySignatureService
	// contains filtered or unexported fields
}

CompanyService contains methods and other services that help with interacting with the rain 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 NewCompanyService method instead.

func NewCompanyService

func NewCompanyService(opts ...option.RequestOption) (r CompanyService)

NewCompanyService 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 (*CompanyService) Charge

func (r *CompanyService) Charge(ctx context.Context, companyID string, body CompanyChargeParams, opts ...option.RequestOption) (res *IssuingChargeCreateResponse, err error)

Initiate a custom fee charge for a company.

func (*CompanyService) Get

func (r *CompanyService) Get(ctx context.Context, companyID string, opts ...option.RequestOption) (res *IssuingCompany, err error)

Retrieve detailed information about a specific company using its unique ID

func (*CompanyService) GetBalances

func (r *CompanyService) GetBalances(ctx context.Context, companyID string, opts ...option.RequestOption) (res *CompanyGetBalancesResponse, err error)

Retrieve the current credit balances of a company, including credit limits, pending charges, and the amount due.

func (*CompanyService) GetContracts

func (r *CompanyService) GetContracts(ctx context.Context, companyID string, opts ...option.RequestOption) (res *[]IssuingContract, err error)

Retrieve the smart contract details associated with a company

func (*CompanyService) InitiatePayment

func (r *CompanyService) InitiatePayment(ctx context.Context, companyID string, body CompanyInitiatePaymentParams, opts ...option.RequestOption) (res *CompanyInitiatePaymentResponse, err error)

Initiate a payment for a specific company by providing the payment amount and wallet address.

func (*CompanyService) List

func (r *CompanyService) List(ctx context.Context, query CompanyListParams, opts ...option.RequestOption) (res *[]IssuingCompany, err error)

Retrieves a list of all companies registered in the system

func (*CompanyService) NewUser

func (r *CompanyService) NewUser(ctx context.Context, companyID string, body CompanyNewUserParams, opts ...option.RequestOption) (res *IssuingUser, err error)

Creates a new user within a specific company. The user must provide details such as their name, birthdate, and contact information.

func (*CompanyService) Update

func (r *CompanyService) Update(ctx context.Context, companyID string, body CompanyUpdateParams, opts ...option.RequestOption) (res *IssuingCompany, err error)

Update the details of an existing company such as its name and address

type CompanySignatureGetPaymentSignatureParams

type CompanySignatureGetPaymentSignatureParams struct {
	// The address of the token that the payment should be made in (as a hex string for
	// EVM or base58 string for Solana)
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of tokens that are being paid
	Amount string `query:"amount" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// Indicates whether the amount is in the asset's native units. If false, the
	// amount is expressed in cents.
	IsAmountNative param.Opt[bool] `query:"isAmountNative,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CompanySignatureGetPaymentSignatureParams) URLQuery

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

type CompanySignatureGetWithdrawalSignatureParams

type CompanySignatureGetWithdrawalSignatureParams struct {
	// The address of the token that the withdrawal should be made in, as a hex string
	// for EVM or base58 string for Solana
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of tokens being withdrawn
	Amount string `query:"amount" api:"required" json:"-"`
	// The address the withdrawal should be sent to, as a hex string for EVM or base58
	// string for Solana
	RecipientAddress string `query:"recipientAddress" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// Indicates whether the amount is in the asset's native units. If false, the
	// amount is expressed in cents.
	IsAmountNative param.Opt[bool] `query:"isAmountNative,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CompanySignatureGetWithdrawalSignatureParams) URLQuery

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

type CompanySignatureService

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

CompanySignatureService contains methods and other services that help with interacting with the rain 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 NewCompanySignatureService method instead.

func NewCompanySignatureService

func NewCompanySignatureService(opts ...option.RequestOption) (r CompanySignatureService)

NewCompanySignatureService 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 (*CompanySignatureService) GetPaymentSignature

Retrieve the payment signature for a company, which is required for completing payment transactions.

func (*CompanySignatureService) GetWithdrawalSignature

Retrieve the withdrawal signature for a company, which is required for processing withdrawal requests.

type CompanyUpdateParams

type CompanyUpdateParams struct {
	// The company's name on the Rain platform
	Name param.Opt[string] `json:"name,omitzero"`
	// The company's physical address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (CompanyUpdateParams) MarshalJSON

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

func (*CompanyUpdateParams) UnmarshalJSON

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

type ContractService

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

ContractService contains methods and other services that help with interacting with the rain 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 NewContractService method instead.

func NewContractService

func NewContractService(opts ...option.RequestOption) (r ContractService)

NewContractService 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 (*ContractService) List

func (r *ContractService) List(ctx context.Context, opts ...option.RequestOption) (res *[]IssuingContract, err error)

Retrieve the smart contract information for a specific authorized user tenant.

type DisputeEvidenceService

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

DisputeEvidenceService contains methods and other services that help with interacting with the rain 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 NewDisputeEvidenceService method instead.

func NewDisputeEvidenceService

func NewDisputeEvidenceService(opts ...option.RequestOption) (r DisputeEvidenceService)

NewDisputeEvidenceService 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 (*DisputeEvidenceService) List

func (r *DisputeEvidenceService) List(ctx context.Context, disputeID string, opts ...option.RequestOption) (res *http.Response, err error)

Retrieve the file evidence associated with a dispute.

func (*DisputeEvidenceService) Upload

func (r *DisputeEvidenceService) Upload(ctx context.Context, disputeID string, body DisputeEvidenceUploadParams, opts ...option.RequestOption) (err error)

Upload a file that will serve as evidence for a dispute.

type DisputeEvidenceUploadParams

type DisputeEvidenceUploadParams struct {
	// The evidence to upload
	Evidence io.Reader `json:"evidence,omitzero" api:"required" format:"binary"`
	// The name of the evidence
	Name string `json:"name" api:"required"`
	// The type of evidence
	Type string `json:"type" api:"required"`
	// contains filtered or unexported fields
}

func (DisputeEvidenceUploadParams) MarshalMultipart

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

type DisputeListParams

type DisputeListParams struct {
	// For corporate cards, the identifier of the company to get disputes for
	CompanyID param.Opt[string] `query:"companyId,omitzero" format:"uuid" json:"-"`
	// The ID of the resource after which to start fetching
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// The number of resources to fetch
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The ID of the transaction to get disputes for
	TransactionID param.Opt[string] `query:"transactionId,omitzero" format:"uuid" json:"-"`
	// The ID of the user to get disputes for
	UserID param.Opt[string] `query:"userId,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (DisputeListParams) URLQuery

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

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

type DisputeService

type DisputeService struct {
	Evidence DisputeEvidenceService
	// contains filtered or unexported fields
}

DisputeService contains methods and other services that help with interacting with the rain 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 NewDisputeService method instead.

func NewDisputeService

func NewDisputeService(opts ...option.RequestOption) (r DisputeService)

NewDisputeService 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 (*DisputeService) Get

func (r *DisputeService) Get(ctx context.Context, disputeID string, opts ...option.RequestOption) (res *IssuingDispute, err error)

Retrieve details of a specific dispute using its unique ID.

func (*DisputeService) List

func (r *DisputeService) List(ctx context.Context, query DisputeListParams, opts ...option.RequestOption) (res *[]IssuingDispute, err error)

Retrieve all disputes, optionally filtered by company, user, or transaction ID.

func (*DisputeService) Update

func (r *DisputeService) Update(ctx context.Context, disputeID string, body DisputeUpdateParams, opts ...option.RequestOption) (err error)

Update the status or evidence of a dispute, typically to mark it as canceled or add new evidence.

type DisputeUpdateParams

type DisputeUpdateParams struct {
	// The textual evidence to add to the dispute
	TextEvidence param.Opt[string] `json:"textEvidence,omitzero"`
	// The new status of the dispute. Can only be set to 'canceled'.
	//
	// Any of "canceled".
	Status DisputeUpdateParamsStatus `json:"status,omitzero"`
	// contains filtered or unexported fields
}

func (DisputeUpdateParams) MarshalJSON

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

func (*DisputeUpdateParams) UnmarshalJSON

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

type DisputeUpdateParamsStatus

type DisputeUpdateParamsStatus string

The new status of the dispute. Can only be set to 'canceled'.

const (
	DisputeUpdateParamsStatusCanceled DisputeUpdateParamsStatus = "canceled"
)

type Error

type Error = apierror.Error

type IssuingApplication

type IssuingApplication struct {
	// Represents the possible statuses of an application.
	//
	// Any of "approved", "pending", "needsInformation", "needsVerification",
	// "manualReview", "denied", "locked", "canceled".
	ApplicationStatus IssuingApplicationApplicationStatus `json:"applicationStatus" api:"required"`
	// The link to the application completion page
	ApplicationCompletionLink IssuingApplicationApplicationCompletionLink `json:"applicationCompletionLink"`
	// The link to the external verification page for the application
	//
	// Deprecated: deprecated
	ApplicationExternalVerificationLink IssuingApplicationApplicationExternalVerificationLink `json:"applicationExternalVerificationLink"`
	// The reason behind the current application status
	ApplicationReason string `json:"applicationReason"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ApplicationStatus                   respjson.Field
		ApplicationCompletionLink           respjson.Field
		ApplicationExternalVerificationLink respjson.Field
		ApplicationReason                   respjson.Field
		ExtraFields                         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The details of an issuing application.

func (IssuingApplication) RawJSON

func (r IssuingApplication) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingApplication) UnmarshalJSON

func (r *IssuingApplication) UnmarshalJSON(data []byte) error
type IssuingApplicationApplicationCompletionLink struct {
	// The URL for the completion page
	URL    string                                            `json:"url" api:"required" format:"uri"`
	Params IssuingApplicationApplicationCompletionLinkParams `json:"params"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Params      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The link to the application completion page

func (IssuingApplicationApplicationCompletionLink) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingApplicationApplicationCompletionLink) UnmarshalJSON

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

type IssuingApplicationApplicationCompletionLinkParams

type IssuingApplicationApplicationCompletionLinkParams struct {
	// The user's unique identifier
	UserID string `json:"userId" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IssuingApplicationApplicationCompletionLinkParams) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingApplicationApplicationCompletionLinkParams) UnmarshalJSON

type IssuingApplicationApplicationExternalVerificationLink struct {
	// The URL for the external verification page
	URL    string                                                      `json:"url" api:"required" format:"uri"`
	Params IssuingApplicationApplicationExternalVerificationLinkParams `json:"params"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Params      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The link to the external verification page for the application

Deprecated: deprecated

func (IssuingApplicationApplicationExternalVerificationLink) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingApplicationApplicationExternalVerificationLink) UnmarshalJSON

type IssuingApplicationApplicationExternalVerificationLinkParams

type IssuingApplicationApplicationExternalVerificationLinkParams struct {
	// The user's unique identifier
	UserID string `json:"userId" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IssuingApplicationApplicationExternalVerificationLinkParams) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingApplicationApplicationExternalVerificationLinkParams) UnmarshalJSON

type IssuingApplicationApplicationStatus

type IssuingApplicationApplicationStatus string

Represents the possible statuses of an application.

const (
	IssuingApplicationApplicationStatusApproved          IssuingApplicationApplicationStatus = "approved"
	IssuingApplicationApplicationStatusPending           IssuingApplicationApplicationStatus = "pending"
	IssuingApplicationApplicationStatusNeedsInformation  IssuingApplicationApplicationStatus = "needsInformation"
	IssuingApplicationApplicationStatusNeedsVerification IssuingApplicationApplicationStatus = "needsVerification"
	IssuingApplicationApplicationStatusManualReview      IssuingApplicationApplicationStatus = "manualReview"
	IssuingApplicationApplicationStatusDenied            IssuingApplicationApplicationStatus = "denied"
	IssuingApplicationApplicationStatusLocked            IssuingApplicationApplicationStatus = "locked"
	IssuingApplicationApplicationStatusCanceled          IssuingApplicationApplicationStatus = "canceled"
)

type IssuingApplicationPersonParam

type IssuingApplicationPersonParam struct {
	// The person's address
	Address PhysicalAddressParam `json:"address,omitzero" api:"required"`
	// The person's birth date
	BirthDate time.Time `json:"birthDate" api:"required" format:"date"`
	// The 2-digit country code of the person's national ID issuer
	CountryOfIssue string `json:"countryOfIssue" api:"required"`
	// The user's email address
	Email string `json:"email" api:"required"`
	// The person's first name
	FirstName string `json:"firstName" api:"required"`
	// The person's last name
	LastName string `json:"lastName" api:"required"`
	// The person's national ID number. For the US, this is a 9-digit SSN
	NationalID string `json:"nationalId" api:"required"`
	// The person's unique identifier
	ID param.Opt[string] `json:"id,omitzero" format:"uuid"`
	// The country code for the phone number
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// The phone number of the person
	PhoneNumber param.Opt[string] `json:"phoneNumber,omitzero"`
	// contains filtered or unexported fields
}

The properties Address, BirthDate, CountryOfIssue, Email, FirstName, LastName, NationalID are required.

func (IssuingApplicationPersonParam) MarshalJSON

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

func (*IssuingApplicationPersonParam) UnmarshalJSON

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

type IssuingCard

type IssuingCard struct {
	// The card's ID
	ID string `json:"id" api:"required" format:"uuid"`
	// The ID of the company that issued the card
	CompanyID string `json:"companyId" api:"required" format:"uuid"`
	// The expiration month of the card
	ExpirationMonth string `json:"expirationMonth" api:"required"`
	// The expiration year of the card
	ExpirationYear string `json:"expirationYear" api:"required"`
	// The last four digits of the card number
	Last4 string `json:"last4" api:"required"`
	// The card's current status
	//
	// Any of "notActivated", "active", "locked", "canceled".
	Status IssuingCardStatus `json:"status" api:"required"`
	// The type of the card (physical or virtual)
	//
	// Any of "physical", "virtual".
	Type IssuingCardType `json:"type" api:"required"`
	// The userID to whom the card was issued
	UserID string `json:"userId" api:"required" format:"uuid"`
	// The card's spending limit
	Limit        IssuingCardLimit `json:"limit"`
	TokenWallets []string         `json:"tokenWallets"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CompanyID       respjson.Field
		ExpirationMonth respjson.Field
		ExpirationYear  respjson.Field
		Last4           respjson.Field
		Status          respjson.Field
		Type            respjson.Field
		UserID          respjson.Field
		Limit           respjson.Field
		TokenWallets    respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IssuingCard) RawJSON

func (r IssuingCard) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingCard) UnmarshalJSON

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

type IssuingCardLimit

type IssuingCardLimit struct {
	// The maximum spending amount in cents
	Amount int64 `json:"amount" api:"required"`
	// The frequency at which the spending limit resets
	//
	// Any of "per24HourPeriod", "per7DayPeriod", "per30DayPeriod", "perYearPeriod",
	// "allTime", "perAuthorization".
	Frequency IssuingCardLimitFrequency `json:"frequency" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Frequency   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents the spending limit and frequency for a card.

func (IssuingCardLimit) RawJSON

func (r IssuingCardLimit) RawJSON() string

Returns the unmodified JSON received from the API

func (IssuingCardLimit) ToParam

ToParam converts this IssuingCardLimit to a IssuingCardLimitParam.

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 IssuingCardLimitParam.Overrides()

func (*IssuingCardLimit) UnmarshalJSON

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

type IssuingCardLimitFrequency

type IssuingCardLimitFrequency string

The frequency at which the spending limit resets

const (
	IssuingCardLimitFrequencyPer24HourPeriod  IssuingCardLimitFrequency = "per24HourPeriod"
	IssuingCardLimitFrequencyPer7DayPeriod    IssuingCardLimitFrequency = "per7DayPeriod"
	IssuingCardLimitFrequencyPer30DayPeriod   IssuingCardLimitFrequency = "per30DayPeriod"
	IssuingCardLimitFrequencyPerYearPeriod    IssuingCardLimitFrequency = "perYearPeriod"
	IssuingCardLimitFrequencyAllTime          IssuingCardLimitFrequency = "allTime"
	IssuingCardLimitFrequencyPerAuthorization IssuingCardLimitFrequency = "perAuthorization"
)

type IssuingCardLimitParam

type IssuingCardLimitParam struct {
	// The maximum spending amount in cents
	Amount int64 `json:"amount" api:"required"`
	// The frequency at which the spending limit resets
	//
	// Any of "per24HourPeriod", "per7DayPeriod", "per30DayPeriod", "perYearPeriod",
	// "allTime", "perAuthorization".
	Frequency IssuingCardLimitFrequency `json:"frequency,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Represents the spending limit and frequency for a card.

The properties Amount, Frequency are required.

func (IssuingCardLimitParam) MarshalJSON

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

func (*IssuingCardLimitParam) UnmarshalJSON

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

type IssuingCardStatus

type IssuingCardStatus string

The current status of the card

const (
	IssuingCardStatusNotActivated IssuingCardStatus = "notActivated"
	IssuingCardStatusActive       IssuingCardStatus = "active"
	IssuingCardStatusLocked       IssuingCardStatus = "locked"
	IssuingCardStatusCanceled     IssuingCardStatus = "canceled"
)

type IssuingCardType

type IssuingCardType string

The type of the card (physical or virtual)

const (
	IssuingCardTypePhysical IssuingCardType = "physical"
	IssuingCardTypeVirtual  IssuingCardType = "virtual"
)

type IssuingChargeCreateBodyParam

type IssuingChargeCreateBodyParam struct {
	// The amount of the charge, in cents
	Amount int64 `json:"amount" api:"required"`
	// The description of the charge
	Description string `json:"description" api:"required"`
	// contains filtered or unexported fields
}

Represents the body of a request to create a charge, including the amount and a description of the charge.

The properties Amount, Description are required.

func (IssuingChargeCreateBodyParam) MarshalJSON

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

func (*IssuingChargeCreateBodyParam) UnmarshalJSON

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

type IssuingChargeCreateResponse

type IssuingChargeCreateResponse struct {
	// The identifier of the charge
	ID string `json:"id" api:"required" format:"uuid"`
	// The date and time when the charge was created
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// The amount of the charge, in cents
	Amount int64 `json:"amount"`
	// The description of the charge
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Amount      respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents the response body returned after a charge is created, including the charge ID, creation timestamp, and charge details.

func (IssuingChargeCreateResponse) RawJSON

func (r IssuingChargeCreateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingChargeCreateResponse) UnmarshalJSON

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

type IssuingCompany

type IssuingCompany struct {
	// The company's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The company's physical address
	Address PhysicalAddress `json:"address" api:"required"`
	// The company's name on the Rain platform
	Name string `json:"name" api:"required"`
	// The company's ultimate beneficial owners (UBOs)
	UltimateBeneficialOwners []IssuingCompanyUltimateBeneficialOwner `json:"ultimateBeneficialOwners"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		Address                  respjson.Field
		Name                     respjson.Field
		UltimateBeneficialOwners respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	IssuingApplication
}

The details of an issuing application.

func (IssuingCompany) RawJSON

func (r IssuingCompany) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingCompany) UnmarshalJSON

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

type IssuingCompanyUltimateBeneficialOwner

type IssuingCompanyUltimateBeneficialOwner struct {
	// The UBO's unique identifier
	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:"-"`
	IssuingApplication
}

The details of an issuing application.

func (IssuingCompanyUltimateBeneficialOwner) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingCompanyUltimateBeneficialOwner) UnmarshalJSON

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

type IssuingContract

type IssuingContract struct {
	// The contract's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID int64 `json:"chainId" api:"required"`
	// Version of the contract
	ContractVersion int64 `json:"contractVersion" api:"required"`
	// The address of the contract's controller
	ControllerAddress string `json:"controllerAddress" api:"required"`
	// The proxy address of the contract
	ProxyAddress string `json:"proxyAddress" api:"required"`
	// Tokens that the contract accepts for transactions
	Tokens []IssuingContractToken `json:"tokens" api:"required"`
	// The address where funds should be deposited
	DepositAddress string `json:"depositAddress"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		ChainID           respjson.Field
		ContractVersion   respjson.Field
		ControllerAddress respjson.Field
		ProxyAddress      respjson.Field
		Tokens            respjson.Field
		DepositAddress    respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents an issuing contract with details about its deployment and token handling.

func (IssuingContract) RawJSON

func (r IssuingContract) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingContract) UnmarshalJSON

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

type IssuingContractToken

type IssuingContractToken struct {
	// The address of the token contract
	Address string `json:"address" api:"required"`
	// The advance rate for the token
	AdvanceRate float64 `json:"advanceRate"`
	// The balance of the token
	Balance string `json:"balance"`
	// The exchange rate for the token
	ExchangeRate float64 `json:"exchangeRate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address      respjson.Field
		AdvanceRate  respjson.Field
		Balance      respjson.Field
		ExchangeRate respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IssuingContractToken) RawJSON

func (r IssuingContractToken) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingContractToken) UnmarshalJSON

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

type IssuingDispute

type IssuingDispute struct {
	// The dispute's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The date and time when the dispute was created
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// The current status of the dispute
	//
	// Any of "pending", "inReview", "accepted", "rejected", "canceled".
	Status IssuingDisputeStatus `json:"status" api:"required"`
	// The transaction's unique identifier
	TransactionID string `json:"transactionId" api:"required" format:"uuid"`
	// The date and time when the dispute was resolved, if applicable
	ResolvedAt time.Time `json:"resolvedAt" format:"date-time"`
	// Textual evidence provided by the parties involved in the dispute
	TextEvidence string `json:"textEvidence"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		Status        respjson.Field
		TransactionID respjson.Field
		ResolvedAt    respjson.Field
		TextEvidence  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a dispute related to an issuing transaction.

func (IssuingDispute) RawJSON

func (r IssuingDispute) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingDispute) UnmarshalJSON

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

type IssuingDisputeStatus

type IssuingDisputeStatus string

The current status of the dispute

const (
	IssuingDisputeStatusPending  IssuingDisputeStatus = "pending"
	IssuingDisputeStatusInReview IssuingDisputeStatus = "inReview"
	IssuingDisputeStatusAccepted IssuingDisputeStatus = "accepted"
	IssuingDisputeStatusRejected IssuingDisputeStatus = "rejected"
	IssuingDisputeStatusCanceled IssuingDisputeStatus = "canceled"
)

type IssuingSignatureIfSignatureIsPending

type IssuingSignatureIfSignatureIsPending struct {
	// The number of seconds after which the signature can be retried
	RetryAfter int64 `json:"retryAfter" api:"required"`
	// The status of the signature
	//
	// Any of "pending".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RetryAfter  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the signature is pending and provides the time after which a retry is possible.

func (IssuingSignatureIfSignatureIsPending) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingSignatureIfSignatureIsPending) UnmarshalJSON

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

type IssuingSignatureIfSignatureIsReady

type IssuingSignatureIfSignatureIsReady struct {
	Signature IssuingSignatureIfSignatureIsReadySignature `json:"signature" api:"required"`
	// The status of the signature
	//
	// Any of "ready".
	Status string `json:"status" api:"required"`
	// The time at which the signature will expire
	ExpiresAt time.Time `json:"expiresAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Signature   respjson.Field
		Status      respjson.Field
		ExpiresAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates that the signature is ready and includes the signature data and expiration time.

func (IssuingSignatureIfSignatureIsReady) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingSignatureIfSignatureIsReady) UnmarshalJSON

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

type IssuingSignatureIfSignatureIsReadySignature

type IssuingSignatureIfSignatureIsReadySignature struct {
	// The actual signature data
	Data string `json:"data" api:"required"`
	// The salt used to generate the signature
	Salt string `json:"salt" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Salt        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IssuingSignatureIfSignatureIsReadySignature) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingSignatureIfSignatureIsReadySignature) UnmarshalJSON

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

type IssuingSignatureUnion

type IssuingSignatureUnion struct {
	// This field is from variant [IssuingSignatureIfSignatureIsPending].
	RetryAfter int64  `json:"retryAfter"`
	Status     string `json:"status"`
	// This field is from variant [IssuingSignatureIfSignatureIsReady].
	Signature IssuingSignatureIfSignatureIsReadySignature `json:"signature"`
	// This field is from variant [IssuingSignatureIfSignatureIsReady].
	ExpiresAt time.Time `json:"expiresAt"`
	JSON      struct {
		RetryAfter respjson.Field
		Status     respjson.Field
		Signature  respjson.Field
		ExpiresAt  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

IssuingSignatureUnion contains all possible properties and values from IssuingSignatureIfSignatureIsPending, IssuingSignatureIfSignatureIsReady.

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

func (IssuingSignatureUnion) AsIfSignatureIsPending

func (u IssuingSignatureUnion) AsIfSignatureIsPending() (v IssuingSignatureIfSignatureIsPending)

func (IssuingSignatureUnion) AsIfSignatureIsReady

func (u IssuingSignatureUnion) AsIfSignatureIsReady() (v IssuingSignatureIfSignatureIsReady)

func (IssuingSignatureUnion) RawJSON

func (u IssuingSignatureUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingSignatureUnion) UnmarshalJSON

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

type IssuingTransactionCollateral

type IssuingTransactionCollateral struct {
	// The unique identifier of the transaction
	ID string `json:"id" api:"required" format:"uuid"`
	// Details of the collateral transaction, including amount, currency, and
	// transaction details.
	Collateral IssuingTransactionCollateralCollateral `json:"collateral" api:"required"`
	// The type of transaction, in this case, a collateral transaction
	Type constant.Collateral `json:"type" default:"collateral"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collateral  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a collateral transaction, where a user provides collateral for a transaction.

func (IssuingTransactionCollateral) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingTransactionCollateral) UnmarshalJSON

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

type IssuingTransactionCollateralCollateral

type IssuingTransactionCollateralCollateral struct {
	// The amount of the collateral transaction, in cents
	Amount float64 `json:"amount" api:"required"`
	// The chain ID (base-10 number) that the collateral transaction is on
	ChainID int64 `json:"chainId" api:"required"`
	// The currency of the collateral transaction
	Currency string `json:"currency" api:"required"`
	// The hash of the collateral transaction
	TransactionHash string `json:"transactionHash" api:"required"`
	// The wallet address the collateral was added from
	WalletAddress string `json:"walletAddress" api:"required"`
	// The identifier of the company under which the collateral transaction was made
	CompanyID string `json:"companyId" format:"uuid"`
	// A memo or note associated with the collateral transaction
	Memo string `json:"memo"`
	// The time at which the collateral transaction was posted
	PostedAt time.Time `json:"postedAt" format:"date-time"`
	// The identifier of the user who provided the collateral
	UserID string `json:"userId" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount          respjson.Field
		ChainID         respjson.Field
		Currency        respjson.Field
		TransactionHash respjson.Field
		WalletAddress   respjson.Field
		CompanyID       respjson.Field
		Memo            respjson.Field
		PostedAt        respjson.Field
		UserID          respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details of the collateral transaction, including amount, currency, and transaction details.

func (IssuingTransactionCollateralCollateral) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingTransactionCollateralCollateral) UnmarshalJSON

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

type IssuingTransactionFee

type IssuingTransactionFee struct {
	// The identifier of the fee transaction
	ID string `json:"id" api:"required" format:"uuid"`
	// Details of the fee transaction, including amount, description, and status.
	Fee IssuingTransactionFeeFee `json:"fee" api:"required"`
	// The type of transaction, in this case, a fee transaction
	Type constant.Fee `json:"type" default:"fee"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Fee         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a fee transaction, where a fee is charged for a service or product.

func (IssuingTransactionFee) RawJSON

func (r IssuingTransactionFee) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingTransactionFee) UnmarshalJSON

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

type IssuingTransactionFeeFee

type IssuingTransactionFeeFee struct {
	// The amount of the fee, in cents
	Amount int64 `json:"amount" api:"required"`
	// The identifier of the company to which the fee was charged
	CompanyID string `json:"companyId" format:"uuid"`
	// The description of the fee
	Description string `json:"description"`
	// The time at which the fee was posted
	PostedAt time.Time `json:"postedAt" format:"date-time"`
	// The identifier of the user to whom the fee was charged
	UserID string `json:"userId" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		CompanyID   respjson.Field
		Description respjson.Field
		PostedAt    respjson.Field
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details of the fee transaction, including amount, description, and status.

func (IssuingTransactionFeeFee) RawJSON

func (r IssuingTransactionFeeFee) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingTransactionFeeFee) UnmarshalJSON

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

type IssuingTransactionPayment

type IssuingTransactionPayment struct {
	// The unique identifier of the payment transaction
	ID string `json:"id" api:"required" format:"uuid"`
	// Details of the payment transaction, including amount, currency, and status.
	Payment IssuingTransactionPaymentPayment `json:"payment" api:"required"`
	// The type of transaction
	Type constant.Payment `json:"type" default:"payment"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Payment     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a payment transaction, where a payment is made for a particular service or product.

func (IssuingTransactionPayment) RawJSON

func (r IssuingTransactionPayment) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingTransactionPayment) UnmarshalJSON

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

type IssuingTransactionPaymentPayment

type IssuingTransactionPaymentPayment struct {
	// The amount of the transaction, in cents
	Amount int64 `json:"amount" api:"required"`
	// The currency of the transaction
	Currency string `json:"currency" api:"required"`
	// The status of the transaction
	//
	// Any of "pending", "completed".
	Status string `json:"status" api:"required"`
	// The chain ID (base-10 number) that the payment transaction is on
	ChainID int64 `json:"chainId"`
	// The identifier of the company under which the payment transaction was made
	CompanyID string `json:"companyId" format:"uuid"`
	// The memo or note associated with the transaction
	Memo string `json:"memo"`
	// The time at which the payment transaction was posted
	PostedAt string `json:"postedAt"`
	// The hash of the payment transaction
	TransactionHash string `json:"transactionHash"`
	// The identifier of the user who made the payment
	UserID string `json:"userId" format:"uuid"`
	// The wallet address from which the payment was made
	WalletAddress string `json:"walletAddress"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount          respjson.Field
		Currency        respjson.Field
		Status          respjson.Field
		ChainID         respjson.Field
		CompanyID       respjson.Field
		Memo            respjson.Field
		PostedAt        respjson.Field
		TransactionHash respjson.Field
		UserID          respjson.Field
		WalletAddress   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details of the payment transaction, including amount, currency, and status.

func (IssuingTransactionPaymentPayment) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingTransactionPaymentPayment) UnmarshalJSON

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

type IssuingTransactionSpend

type IssuingTransactionSpend struct {
	// The unique identifier of the transaction
	ID string `json:"id" api:"required" format:"uuid"`
	// Details specific to a spend transaction, including merchant, amount, and user
	// information.
	Spend IssuingTransactionSpendSpend `json:"spend" api:"required"`
	// The type of transaction
	Type constant.Spend `json:"type" default:"spend"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Spend       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a transaction of type 'spend'. This includes details such as the transaction amount, merchant, and the associated user.

func (IssuingTransactionSpend) RawJSON

func (r IssuingTransactionSpend) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingTransactionSpend) UnmarshalJSON

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

type IssuingTransactionSpendSpend

type IssuingTransactionSpendSpend struct {
	// The amount of the transaction, in cents
	Amount int64 `json:"amount" api:"required"`
	// The time at which the transaction was authorized
	AuthorizedAt string `json:"authorizedAt" api:"required"`
	// The unique identifier of the card used for the transaction
	CardID string `json:"cardId" api:"required" format:"uuid"`
	// The type of card used for the transaction
	//
	// Any of "physical", "virtual".
	CardType string `json:"cardType" api:"required"`
	// The currency of the transaction
	Currency string `json:"currency" api:"required"`
	// The category of the merchant (e.g., electronics, food)
	MerchantCategory string `json:"merchantCategory" api:"required"`
	// The merchant's category code
	MerchantCategoryCode string `json:"merchantCategoryCode" api:"required"`
	// The name of the merchant where the transaction took place
	MerchantName string `json:"merchantName" api:"required"`
	// Indicates whether a receipt was generated for the transaction
	Receipt bool `json:"receipt" api:"required"`
	// The status of the transaction
	//
	// Any of "pending", "reversed", "declined", "completed".
	Status string `json:"status" api:"required"`
	// The email address of the user who made the transaction
	UserEmail string `json:"userEmail" api:"required"`
	// The first name of the user who made the transaction
	UserFirstName string `json:"userFirstName" api:"required"`
	// The identifier of the user who made the transaction
	UserID string `json:"userId" api:"required" format:"uuid"`
	// The last name of the user who made the transaction
	UserLastName string `json:"userLastName" api:"required"`
	// The method used for authorization of the transaction
	AuthorizationMethod string `json:"authorizationMethod"`
	// The authorized amount of the transaction, in cents
	AuthorizedAmount int64 `json:"authorizedAmount"`
	// The identifier of the company under which the transaction was made
	CompanyID string `json:"companyId" format:"uuid"`
	// The reason why the transaction was declined
	DeclinedReason string `json:"declinedReason"`
	// An enriched category of the merchant, providing further details
	EnrichedMerchantCategory string `json:"enrichedMerchantCategory"`
	// The enriched icon of the merchant
	EnrichedMerchantIcon string `json:"enrichedMerchantIcon"`
	// An enriched name of the merchant, possibly with additional information
	EnrichedMerchantName string `json:"enrichedMerchantName"`
	// The amount of the transaction in local currency, in cents
	LocalAmount int64 `json:"localAmount"`
	// The local currency of the transaction
	LocalCurrency string `json:"localCurrency"`
	// A memo or note associated with the transaction
	Memo string `json:"memo"`
	// The time at which the transaction was posted
	PostedAt string `json:"postedAt"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount                   respjson.Field
		AuthorizedAt             respjson.Field
		CardID                   respjson.Field
		CardType                 respjson.Field
		Currency                 respjson.Field
		MerchantCategory         respjson.Field
		MerchantCategoryCode     respjson.Field
		MerchantName             respjson.Field
		Receipt                  respjson.Field
		Status                   respjson.Field
		UserEmail                respjson.Field
		UserFirstName            respjson.Field
		UserID                   respjson.Field
		UserLastName             respjson.Field
		AuthorizationMethod      respjson.Field
		AuthorizedAmount         respjson.Field
		CompanyID                respjson.Field
		DeclinedReason           respjson.Field
		EnrichedMerchantCategory respjson.Field
		EnrichedMerchantIcon     respjson.Field
		EnrichedMerchantName     respjson.Field
		LocalAmount              respjson.Field
		LocalCurrency            respjson.Field
		Memo                     respjson.Field
		PostedAt                 respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details specific to a spend transaction, including merchant, amount, and user information.

func (IssuingTransactionSpendSpend) RawJSON

Returns the unmodified JSON received from the API

func (*IssuingTransactionSpendSpend) UnmarshalJSON

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

type IssuingTransactionUnion

type IssuingTransactionUnion struct {
	ID string `json:"id"`
	// This field is from variant [IssuingTransactionSpend].
	Spend IssuingTransactionSpendSpend `json:"spend"`
	// Any of "spend", "collateral", "payment", "fee".
	Type string `json:"type"`
	// This field is from variant [IssuingTransactionCollateral].
	Collateral IssuingTransactionCollateralCollateral `json:"collateral"`
	// This field is from variant [IssuingTransactionPayment].
	Payment IssuingTransactionPaymentPayment `json:"payment"`
	// This field is from variant [IssuingTransactionFee].
	Fee  IssuingTransactionFeeFee `json:"fee"`
	JSON struct {
		ID         respjson.Field
		Spend      respjson.Field
		Type       respjson.Field
		Collateral respjson.Field
		Payment    respjson.Field
		Fee        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

IssuingTransactionUnion contains all possible properties and values from IssuingTransactionSpend, IssuingTransactionCollateral, IssuingTransactionPayment, IssuingTransactionFee.

Use the IssuingTransactionUnion.AsAny method to switch on the variant.

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

func (IssuingTransactionUnion) AsAny

func (u IssuingTransactionUnion) AsAny() anyIssuingTransaction

Use the following switch statement to find the correct variant

switch variant := IssuingTransactionUnion.AsAny().(type) {
case rainhelloworld.IssuingTransactionSpend:
case rainhelloworld.IssuingTransactionCollateral:
case rainhelloworld.IssuingTransactionPayment:
case rainhelloworld.IssuingTransactionFee:
default:
  fmt.Errorf("no variant present")
}

func (IssuingTransactionUnion) AsCollateral

func (IssuingTransactionUnion) AsFee

func (IssuingTransactionUnion) AsPayment

func (IssuingTransactionUnion) AsSpend

func (IssuingTransactionUnion) RawJSON

func (u IssuingTransactionUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingTransactionUnion) UnmarshalJSON

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

type IssuingUser

type IssuingUser struct {
	// The user's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The user's email address
	Email string `json:"email" api:"required"`
	// The user's first name
	FirstName string `json:"firstName" api:"required"`
	// Indicates whether the user account is active
	IsActive bool `json:"isActive" api:"required"`
	// Indicates whether the user has accepted the terms of service
	IsTermsOfServiceAccepted bool `json:"isTermsOfServiceAccepted" api:"required"`
	// The user's last name
	LastName string `json:"lastName" api:"required"`
	// The user's address
	Address PhysicalAddress `json:"address"`
	// The identifier of the company the user belongs to, if applicable
	CompanyID string `json:"companyId" format:"uuid"`
	// The country code for the user's phone number
	PhoneCountryCode string `json:"phoneCountryCode"`
	// The user's phone number
	PhoneNumber string `json:"phoneNumber"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		Email                    respjson.Field
		FirstName                respjson.Field
		IsActive                 respjson.Field
		IsTermsOfServiceAccepted respjson.Field
		LastName                 respjson.Field
		Address                  respjson.Field
		CompanyID                respjson.Field
		PhoneCountryCode         respjson.Field
		PhoneNumber              respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	IssuingApplication
}

The details of an issuing application.

func (IssuingUser) RawJSON

func (r IssuingUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*IssuingUser) UnmarshalJSON

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

type KeyNewParams

type KeyNewParams struct {
	// The expiration timestamp of the key
	ExpiresAt string `json:"expiresAt" api:"required"`
	// The name of the key being created
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (KeyNewParams) MarshalJSON

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

func (*KeyNewParams) UnmarshalJSON

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

type KeyNewResponse

type KeyNewResponse struct {
	// The key's unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The expiration date and time of the key
	ExpiresAt time.Time `json:"expiresAt" api:"required" format:"date-time"`
	// The actual key used for the issuing process
	Key string `json:"key" api:"required"`
	// The name assigned to the key
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExpiresAt   respjson.Field
		Key         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a unique key used for issuing, typically used for authentication or encryption purposes.

func (KeyNewResponse) RawJSON

func (r KeyNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*KeyNewResponse) UnmarshalJSON

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

type KeyService

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

KeyService contains methods and other services that help with interacting with the rain 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 NewKeyService method instead.

func NewKeyService

func NewKeyService(opts ...option.RequestOption) (r KeyService)

NewKeyService 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 (*KeyService) Delete

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

This endpoint allows for the deletion of a specific key using its unique ID.

func (*KeyService) New

func (r *KeyService) New(ctx context.Context, body KeyNewParams, opts ...option.RequestOption) (res *KeyNewResponse, err error)

This endpoint allows for the creation of a new key with a specified name and expiration time. The key is used for various security operations within the system.

type PaymentInitiateParams

type PaymentInitiateParams struct {
	// The amount of the payment, in cents
	Amount int64 `json:"amount" api:"required"`
	// The wallet address the payment is being sent from
	WalletAddress string `json:"walletAddress" api:"required"`
	// The chain ID (base-10 number) that the payment transaction is on
	ChainID param.Opt[int64] `json:"chainId,omitzero"`
	// contains filtered or unexported fields
}

func (PaymentInitiateParams) MarshalJSON

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

func (*PaymentInitiateParams) UnmarshalJSON

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

type PaymentInitiateResponse

type PaymentInitiateResponse struct {
	// The address to send the payment to
	Address string `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 (PaymentInitiateResponse) RawJSON

func (r PaymentInitiateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaymentInitiateResponse) UnmarshalJSON

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

type PaymentService

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

PaymentService contains methods and other services that help with interacting with the rain API.

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

func NewPaymentService

func NewPaymentService(opts ...option.RequestOption) (r PaymentService)

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

func (*PaymentService) Initiate

This endpoint initiates a payment for an authorized user tenant. The request includes the amount to be transferred and the wallet address to send the payment from.

type PhysicalAddress

type PhysicalAddress struct {
	// The city of the address
	City string `json:"city" api:"required"`
	// The full name of the country
	Country string `json:"country" api:"required"`
	// The 2-letter country code of the address
	CountryCode string `json:"countryCode" api:"required"`
	// The first line of the street address
	Line1 string `json:"line1" api:"required"`
	// The postal or zip code of the address
	PostalCode string `json:"postalCode" api:"required"`
	// The region or state of the address
	Region string `json:"region" api:"required"`
	// The second line of the street address (optional)
	Line2 string `json:"line2"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City        respjson.Field
		Country     respjson.Field
		CountryCode respjson.Field
		Line1       respjson.Field
		PostalCode  respjson.Field
		Region      respjson.Field
		Line2       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a physical address with components like street, city, region, postal code, and country.

func (PhysicalAddress) RawJSON

func (r PhysicalAddress) RawJSON() string

Returns the unmodified JSON received from the API

func (PhysicalAddress) ToParam

ToParam converts this PhysicalAddress to a PhysicalAddressParam.

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 PhysicalAddressParam.Overrides()

func (*PhysicalAddress) UnmarshalJSON

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

type PhysicalAddressParam

type PhysicalAddressParam struct {
	// The city of the address
	City string `json:"city" api:"required"`
	// The full name of the country
	Country string `json:"country" api:"required"`
	// The 2-letter country code of the address
	CountryCode string `json:"countryCode" api:"required"`
	// The first line of the street address
	Line1 string `json:"line1" api:"required"`
	// The postal or zip code of the address
	PostalCode string `json:"postalCode" api:"required"`
	// The region or state of the address
	Region string `json:"region" api:"required"`
	// The second line of the street address (optional)
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// contains filtered or unexported fields
}

Represents a physical address with components like street, city, region, postal code, and country.

The properties City, Country, CountryCode, Line1, PostalCode, Region are required.

func (PhysicalAddressParam) MarshalJSON

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

func (*PhysicalAddressParam) UnmarshalJSON

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

type SignatureGetPaymentSignatureParams

type SignatureGetPaymentSignatureParams struct {
	// The address of the token that the payment should be made in, as a hex string for
	// EVM or base58 string for Solana
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of token that is being paid
	Amount string `query:"amount" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SignatureGetPaymentSignatureParams) URLQuery

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

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

type SignatureGetWithdrawalSignatureParams

type SignatureGetWithdrawalSignatureParams struct {
	// The address of the token that the withdrawal should be made in, as a hex string
	// for EVM or base58 string for Solana
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of token that is being withdrawn
	Amount string `query:"amount" api:"required" json:"-"`
	// The address the withdrawal should be sent to, as a hex string for EVM or base58
	// string for Solana
	RecipientAddress string `query:"recipientAddress" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SignatureGetWithdrawalSignatureParams) URLQuery

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

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

type SignatureService

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

SignatureService contains methods and other services that help with interacting with the rain 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 NewSignatureService method instead.

func NewSignatureService

func NewSignatureService(opts ...option.RequestOption) (r SignatureService)

NewSignatureService 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 (*SignatureService) GetPaymentSignature

This endpoint retrieves the payment signature for an authorized user tenant. The signature is used to authorize a payment transaction on a blockchain.

func (*SignatureService) GetWithdrawalSignature

func (r *SignatureService) GetWithdrawalSignature(ctx context.Context, query SignatureGetWithdrawalSignatureParams, opts ...option.RequestOption) (res *IssuingSignatureUnion, err error)

This endpoint retrieves the withdrawal signature for an authorized user tenant. The signature is used to authorize a withdrawal transaction on a blockchain.

type TransactionListParams

type TransactionListParams struct {
	// Filter transactions authorized after a specific date
	AuthorizedAfter param.Opt[time.Time] `query:"authorizedAfter,omitzero" format:"date-time" json:"-"`
	// Filter transactions authorized before a specific date
	AuthorizedBefore param.Opt[time.Time] `query:"authorizedBefore,omitzero" format:"date-time" json:"-"`
	// The ID of the card to get transactions for
	CardID param.Opt[string] `query:"cardId,omitzero" format:"uuid" json:"-"`
	// For corporate cards, the identifier of the company to get transactions for
	CompanyID param.Opt[string] `query:"companyId,omitzero" format:"uuid" json:"-"`
	// The ID of the resource after which to start fetching
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// The number of resources to fetch
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter transactions posted after a specific date
	PostedAfter param.Opt[time.Time] `query:"postedAfter,omitzero" format:"date-time" json:"-"`
	// Filter transactions posted before a specific date
	PostedBefore param.Opt[time.Time] `query:"postedBefore,omitzero" format:"date-time" json:"-"`
	// The hash of the transaction to retrieve
	TransactionHash param.Opt[string] `query:"transactionHash,omitzero" json:"-"`
	// The ID of the user to get transactions for
	UserID param.Opt[string] `query:"userId,omitzero" format:"uuid" json:"-"`
	// The type of transactions to retrieve
	//
	// Any of "spend", "collateral", "payment", "fee".
	Type []string `query:"type,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 TransactionNewDisputeParams

type TransactionNewDisputeParams struct {
	// The textual evidence that supports the dispute
	TextEvidence param.Opt[string] `json:"textEvidence,omitzero"`
	// contains filtered or unexported fields
}

func (TransactionNewDisputeParams) MarshalJSON

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

func (*TransactionNewDisputeParams) UnmarshalJSON

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

type TransactionReceiptService

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

TransactionReceiptService contains methods and other services that help with interacting with the rain 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 NewTransactionReceiptService method instead.

func NewTransactionReceiptService

func NewTransactionReceiptService(opts ...option.RequestOption) (r TransactionReceiptService)

NewTransactionReceiptService 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 (*TransactionReceiptService) Get

func (r *TransactionReceiptService) Get(ctx context.Context, transactionID string, opts ...option.RequestOption) (res *http.Response, err error)

This endpoint retrieves the receipt for a specific transaction. The receipt is returned as a binary file, typically in PDF or similar format.

func (*TransactionReceiptService) Upload

func (r *TransactionReceiptService) Upload(ctx context.Context, transactionID string, body TransactionReceiptUploadParams, opts ...option.RequestOption) (err error)

This endpoint allows you to upload a receipt for a specific transaction. The receipt is provided as a binary file, typically in PDF format.

type TransactionReceiptUploadParams

type TransactionReceiptUploadParams struct {
	// The receipt file to upload, typically in PDF or other binary formats
	Receipt io.Reader `json:"receipt,omitzero" api:"required" format:"binary"`
	// contains filtered or unexported fields
}

func (TransactionReceiptUploadParams) MarshalMultipart

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

type TransactionService

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

TransactionService contains methods and other services that help with interacting with the rain 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 *IssuingTransactionUnion, err error)

This endpoint retrieves a transaction by its unique ID. The transaction information returned includes details such as the transaction type, amount, and status.

func (*TransactionService) List

This endpoint retrieves all transactions associated with corporate cards, users, or specific cards.

func (*TransactionService) NewDispute

func (r *TransactionService) NewDispute(ctx context.Context, transactionID string, body TransactionNewDisputeParams, opts ...option.RequestOption) (res *IssuingDispute, err error)

This endpoint allows the creation of a dispute for a specific transaction. The dispute can include textual evidence to support the claim.

func (*TransactionService) Update

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

This endpoint allows updating a specific transaction by its ID. You can modify the transaction's memo or other editable fields.

type TransactionUpdateParams

type TransactionUpdateParams struct {
	// A memo or note to attach to the transaction, providing additional information or
	// context
	Memo param.Opt[string] `json:"memo,omitzero"`
	// contains filtered or unexported fields
}

func (TransactionUpdateParams) MarshalJSON

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

func (*TransactionUpdateParams) UnmarshalJSON

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

type UserGetBalancesResponse

type UserGetBalancesResponse struct {
	// Balance due of the user, in cents
	BalanceDue int64 `json:"balanceDue" api:"required"`
	// Credit limit of the user, in cents
	CreditLimit int64 `json:"creditLimit" api:"required"`
	// Pending charges of the user, in cents
	PendingCharges int64 `json:"pendingCharges" api:"required"`
	// Posted charges of the user, in cents
	PostedCharges int64 `json:"postedCharges" api:"required"`
	// The amount of money the user can spend, in cents
	SpendingPower int64 `json:"spendingPower" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BalanceDue     respjson.Field
		CreditLimit    respjson.Field
		PendingCharges respjson.Field
		PostedCharges  respjson.Field
		SpendingPower  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserGetBalancesResponse) RawJSON

func (r UserGetBalancesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGetBalancesResponse) UnmarshalJSON

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

type UserInitiatePaymentParams

type UserInitiatePaymentParams struct {
	// The amount of the payment, in cents
	Amount int64 `json:"amount" api:"required"`
	// The wallet address the payment is being sent from
	WalletAddress string `json:"walletAddress" api:"required"`
	// The chain ID (base-10 number) that the payment transaction is on
	ChainID param.Opt[int64] `json:"chainId,omitzero"`
	// contains filtered or unexported fields
}

func (UserInitiatePaymentParams) MarshalJSON

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

func (*UserInitiatePaymentParams) UnmarshalJSON

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

type UserInitiatePaymentResponse

type UserInitiatePaymentResponse struct {
	// The address to send the payment to
	Address string `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 (UserInitiatePaymentResponse) RawJSON

func (r UserInitiatePaymentResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInitiatePaymentResponse) UnmarshalJSON

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

type UserListParams

type UserListParams struct {
	// For corporate cards, the identifier of the company to get users for
	CompanyID param.Opt[string] `query:"companyId,omitzero" format:"uuid" json:"-"`
	// The ID of the resource after which to start fetching
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// The number of resources to fetch
	Limit param.Opt[int64] `query:"limit,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 UserNewCardParams

type UserNewCardParams struct {
	// Any of "physical", "virtual".
	Type UserNewCardParamsType `json:"type,omitzero" api:"required"`
	// The address that will serve as the billing address for the card. Defaults to the
	// shipping address or team address if not explicitly provided.
	Billing PhysicalAddressParam `json:"billing,omitzero"`
	// Configuration details for the card, including display name, product ID, and
	// virtual card art
	Configuration UserNewCardParamsConfiguration `json:"configuration,omitzero"`
	// The initial credit limit for the card, expressed in cents
	Limit IssuingCardLimitParam `json:"limit,omitzero"`
	// The address to ship the card, if it is a physical card
	Shipping UserNewCardParamsShipping `json:"shipping,omitzero"`
	// The initial status of the card
	//
	// Any of "notActivated", "active", "locked", "canceled".
	Status IssuingCardStatus `json:"status,omitzero"`
	// contains filtered or unexported fields
}

func (UserNewCardParams) MarshalJSON

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

func (*UserNewCardParams) UnmarshalJSON

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

type UserNewCardParamsConfiguration

type UserNewCardParamsConfiguration struct {
	// The name to display on the card. If omitted, it will be the user's full name
	// trimmed to 30 characters.
	DisplayName param.Opt[string] `json:"displayName,omitzero"`
	// The product ID to use for the card, denoting its BIN range. Only relevant if
	// custom product IDs or product references are part of the user's contract.
	ProductID param.Opt[string] `json:"productId,omitzero"`
	// The product reference to use for the card, denoting its appearance. Only
	// relevant if custom product IDs or product references are part of the user's
	// contract.
	ProductRef param.Opt[string] `json:"productRef,omitzero"`
	// The virtual card art ID to use for the card, denoting its virtual appearance.
	// Only relevant if custom virtual card art IDs are part of the user's contract.
	VirtualCardArt param.Opt[string] `json:"virtualCardArt,omitzero"`
	// contains filtered or unexported fields
}

Configuration details for the card, including display name, product ID, and virtual card art

func (UserNewCardParamsConfiguration) MarshalJSON

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

func (*UserNewCardParamsConfiguration) UnmarshalJSON

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

type UserNewCardParamsShipping

type UserNewCardParamsShipping struct {
	// The phone number to use for shipping, if it is a physical card
	PhoneNumber string `json:"phoneNumber" api:"required"`
	// The shipping method to use for the card. Standard and express are for US
	// addresses, while international is for non-US addresses.
	Method string `json:"method,omitzero"`
	PhysicalAddressParam
}

The address to ship the card, if it is a physical card

func (UserNewCardParamsShipping) MarshalJSON

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

type UserNewCardParamsType

type UserNewCardParamsType string
const (
	UserNewCardParamsTypePhysical UserNewCardParamsType = "physical"
	UserNewCardParamsTypeVirtual  UserNewCardParamsType = "virtual"
)

type UserNewChargeParams

type UserNewChargeParams struct {
	// Represents the body of a request to create a charge, including the amount and a
	// description of the charge.
	IssuingChargeCreateBody IssuingChargeCreateBodyParam
	// contains filtered or unexported fields
}

func (UserNewChargeParams) MarshalJSON

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

func (*UserNewChargeParams) UnmarshalJSON

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

type UserNewParams

type UserNewParams struct {
	// The user's email address
	Email string `json:"email" api:"required"`
	// The user's first name
	FirstName string `json:"firstName" api:"required"`
	// The user's last name
	LastName string `json:"lastName" api:"required"`
	// The user's phone country code
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// The user's phone number
	PhoneNumber param.Opt[string] `json:"phoneNumber,omitzero"`
	// The user's wallet address
	WalletAddress param.Opt[string] `json:"walletAddress,omitzero"`
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (UserNewParams) MarshalJSON

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

func (*UserNewParams) UnmarshalJSON

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

type UserService

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

UserService contains methods and other services that help with interacting with the rain 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) Delete

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

This endpoint deletes a user by their unique ID. Once deleted, the user will no longer have access to the system.

func (*UserService) Get

func (r *UserService) Get(ctx context.Context, userID string, opts ...option.RequestOption) (res *IssuingUser, err error)

This endpoint retrieves a specific user by their unique ID. The user details, including contact and wallet information, are returned.

func (*UserService) GetBalances

func (r *UserService) GetBalances(ctx context.Context, userID string, opts ...option.RequestOption) (res *UserGetBalancesResponse, err error)

This endpoint retrieves the credit balances for a specific user. It provides information about the user's credit limit, pending charges, posted charges, balance due, and spending power.

func (*UserService) GetContracts

func (r *UserService) GetContracts(ctx context.Context, userID string, opts ...option.RequestOption) (res *[]IssuingContract, err error)

This endpoint retrieves smart contract information for a specific user. It returns a list of contracts associated with the user.

func (*UserService) InitiatePayment

func (r *UserService) InitiatePayment(ctx context.Context, userID string, body UserInitiatePaymentParams, opts ...option.RequestOption) (res *UserInitiatePaymentResponse, err error)

This endpoint allows initiating a payment for a specific user. The payment is made from the user's wallet address to the specified recipient address.

func (*UserService) List

func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *[]IssuingUser, err error)

This endpoint retrieves all users associated with a specific company. The response will return a list of users, including their personal and contact details.

func (*UserService) New

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

This endpoint allows the creation of a new authorized user with the necessary personal details, including contact and wallet information.

func (*UserService) NewCard

func (r *UserService) NewCard(ctx context.Context, userID string, body UserNewCardParams, opts ...option.RequestOption) (res *IssuingCard, err error)

This endpoint allows the creation of a card for a specific user. The card can either be physical or virtual and can include various configuration options such as the display name and limit.

func (*UserService) NewCharge

func (r *UserService) NewCharge(ctx context.Context, userID string, body UserNewChargeParams, opts ...option.RequestOption) (res *IssuingChargeCreateResponse, err error)

This endpoint allows creating a custom fee charge for a specific user. The fee can be defined in the request body along with its details.

func (*UserService) Update

func (r *UserService) Update(ctx context.Context, userID string, body UserUpdateParams, opts ...option.RequestOption) (res *IssuingUser, err error)

This endpoint allows the update of a specific user's information, such as their name, email, and contact details.

type UserSignatureGetPaymentSignatureParams

type UserSignatureGetPaymentSignatureParams struct {
	// The address of the token that the payment should be made in, as a hex string for
	// EVM or base58 string for Solana
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of token that is being paid
	Amount string `query:"amount" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UserSignatureGetPaymentSignatureParams) URLQuery

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

type UserSignatureGetWithdrawalSignatureParams

type UserSignatureGetWithdrawalSignatureParams struct {
	// The address of the token that the withdrawal should be made in, as a hex string
	// for EVM or base58 string for Solana
	Token string `query:"token" api:"required" json:"-"`
	// The address of the admin making the payment, as a hex string for EVM or base58
	// string for Solana
	AdminAddress string `query:"adminAddress" api:"required" json:"-"`
	// The amount of token that is being withdrawn
	Amount string `query:"amount" api:"required" json:"-"`
	// The address the withdrawal should be sent to, as a hex string for EVM or base58
	// string for Solana
	RecipientAddress string `query:"recipientAddress" api:"required" json:"-"`
	// The chain ID (base-10 number) that the smart contract is deployed on
	ChainID param.Opt[int64] `query:"chainId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UserSignatureGetWithdrawalSignatureParams) URLQuery

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

type UserSignatureService

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

UserSignatureService contains methods and other services that help with interacting with the rain 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 NewUserSignatureService method instead.

func NewUserSignatureService

func NewUserSignatureService(opts ...option.RequestOption) (r UserSignatureService)

NewUserSignatureService 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 (*UserSignatureService) GetPaymentSignature

This endpoint retrieves the payment signature for a specific user. The signature is used to authorize a payment transaction for the user.

func (*UserSignatureService) GetWithdrawalSignature

func (r *UserSignatureService) GetWithdrawalSignature(ctx context.Context, userID string, query UserSignatureGetWithdrawalSignatureParams, opts ...option.RequestOption) (res *IssuingSignatureUnion, err error)

This endpoint retrieves the withdrawal signature for a specific user. The signature is required to authorize a withdrawal transaction for the user.

type UserUpdateParams

type UserUpdateParams struct {
	// The user's email address
	Email param.Opt[string] `json:"email,omitzero"`
	// The user's first name
	FirstName param.Opt[string] `json:"firstName,omitzero"`
	// Indicates whether the user is active
	IsActive param.Opt[bool] `json:"isActive,omitzero"`
	// Indicates whether the user has accepted the terms of service
	IsTermsOfServiceAccepted param.Opt[bool] `json:"isTermsOfServiceAccepted,omitzero"`
	// The user's last name
	LastName param.Opt[string] `json:"lastName,omitzero"`
	// The user's phone country code
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// The user's phone number
	PhoneNumber param.Opt[string] `json:"phoneNumber,omitzero"`
	// The user's address
	Address PhysicalAddressParam `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (UserUpdateParams) MarshalJSON

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

func (*UserUpdateParams) UnmarshalJSON

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

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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