lithic

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Lithic Go API Library

Go Reference

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

Installation

import (
	"github.com/lithic-com/lithic-go" // imported as lithic
)

Or to pin the version:

go get -u 'github.com/lithic-com/lithic-go@v0.2.2'

Requirements

This library requires Go 1.18+.

Usage

package main

import (
	"context"
	"fmt"
	"github.com/lithic-com/lithic-go"
	"github.com/lithic-com/lithic-go/option"
)

func main() {
	client := lithic.NewClient(
		option.WithAPIKey("my api key"), // defaults to os.LookupEnv("LITHIC_API_KEY")
		option.WithEnvironmentSandbox(), // defaults to option.WithEnvironmentProduction()
	)
	card, err := client.Cards.New(context.TODO(), lithic.CardNewParams{
		Type: lithic.F(lithic.CardNewParamsTypeVirtual),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", card)
}

Request Fields

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The full list of request options is here.

Pagination

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

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

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

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

page, err := client.Cards.List(context.TODO(), lithic.CardListParams{})
for page != nil {
	for _, card := range page.Data {
		fmt.Printf("%+v\n", card)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *lithic.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.Cards.New(context.TODO(), lithic.CardNewParams{
	Type: lithic.F(lithic.CardNewParamsTypeVirtual),
})
if err != nil {
	var apierr *lithic.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
		println(apierr.Message)                    // Invalid parameter(s): type
		println(apierr.DebuggingRequestID)         // 94d5e915-xxxx-4cee-a4f5-2xd6ebd279ac
	}
	panic(err.Error()) // GET "/cards": 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.Cards.List(
	ctx,
	lithic.CardListParams{
		PageSize: lithic.F(int64(10)),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default.

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

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

// Override per-request:
client.Cards.List(
	context.TODO(),
	lithic.CardListParams{
		PageSize: lithic.F(int64(10)),
	},
	option.WithMaxRetries(5),
)
Middleware

You may apply any middleware you wish by replacing the default http.Client with option.WithHTTPClient(client). An example of a basic logging middleware is given below:

type requestLogger struct {}

func (l *requestLogger) RoundTrip(req *http.Request) (*http.Response, error) {
	b, _ := httputil.DumpRequest(req, true)
	println(string(b))
	res, err := http.DefaultClient.Do(req)
	return res, err
}

client := lithic.NewClient(
	option.WithHTTPClient(&http.Client{Transport: &requestLogger{}}),
)

Status

This package is in beta. Its internals and interfaces are not stable and subject to change without a major version bump; please reach out if you rely on any undocumented behavior.

We are keen for your feedback; please email us at sdk-feedback@lithic.com or open an issue with questions, bugs, or suggestions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func F

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

func Float

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

func Int

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

func Null

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

func Raw

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

func String

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

Types

type APIStatus

type APIStatus struct {
	Message string `json:"message"`
	JSON    apiStatusJSON
}

func (*APIStatus) UnmarshalJSON

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

type Account

type Account struct {
	// Spend limit information for the user containing the daily, monthly, and lifetime
	// spend limit of the account. Any charges to a card owned by this account will be
	// declined once their transaction volume has surpassed the value in the applicable
	// time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit
	// feature is disabled.
	SpendLimit AccountSpendLimit `json:"spend_limit,required"`
	// Account state:
	//
	//   - `ACTIVE` - Account is able to transact and create new cards.
	//   - `PAUSED` - Account will not be able to transact or create new cards. It can be
	//     set back to `ACTIVE`.
	//   - `CLOSED` - Account will permanently not be able to transact or create new
	//     cards.
	State AccountState `json:"state,required"`
	// Globally unique identifier for the account. This is the same as the
	// account_token returned by the enroll endpoint. If using this parameter, do not
	// include pagination.
	Token string `json:"token,required" format:"uuid"`
	// List of identifiers for the Auth Rule(s) that are applied on the account.
	AuthRuleTokens      []string                   `json:"auth_rule_tokens"`
	VerificationAddress AccountVerificationAddress `json:"verification_address"`
	AccountHolder       AccountAccountHolder       `json:"account_holder"`
	JSON                accountJSON
}

func (*Account) UnmarshalJSON

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

type AccountAccountHolder

type AccountAccountHolder struct {
	// Globally unique identifier for the account holder.
	Token string `json:"token,required"`
	// Phone number of the individual.
	PhoneNumber string `json:"phone_number,required"`
	// Email address.
	Email string `json:"email,required"`
	// Only applicable for customers using the KYC-Exempt workflow to enroll authorized
	// users of businesses. Account_token of the enrolled business associated with an
	// enrolled AUTHORIZED_USER individual.
	BusinessAccountToken string `json:"business_account_token,required"`
	JSON                 accountAccountHolderJSON
}

func (*AccountAccountHolder) UnmarshalJSON

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

type AccountHolder

type AccountHolder struct {
	// Globally unique identifier for the account holder.
	Token string `json:"token" format:"uuid"`
	// Globally unique identifier for the account.
	AccountToken string `json:"account_token" format:"uuid"`
	// Only applicable for customers using the KYC-Exempt workflow to enroll authorized
	// users of businesses. Pass the account_token of the enrolled business associated
	// with the AUTHORIZED_USER in this field.
	BusinessAccountToken string `json:"business_account_token" format:"uuid"`
	// KYC and KYB evaluation states.
	//
	// Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
	// `ADVANCED` workflow.
	Status AccountHolderStatus `json:"status"`
	// Reason for the evaluation status.
	StatusReasons []AccountHolderStatusReasons `json:"status_reasons"`
	JSON          accountHolderJSON
}

func (*AccountHolder) UnmarshalJSON

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

type AccountHolderCreateWebhookResponse

type AccountHolderCreateWebhookResponse struct {
	Data AccountHolderCreateWebhookResponseData `json:"data"`
	JSON accountHolderCreateWebhookResponseJSON
}

func (*AccountHolderCreateWebhookResponse) UnmarshalJSON

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

type AccountHolderCreateWebhookResponseData

type AccountHolderCreateWebhookResponseData struct {
	// Shared secret which can optionally be used to validate the authenticity of
	// incoming identity webhooks.
	HmacToken string `json:"hmac_token" format:"uuid"`
	JSON      accountHolderCreateWebhookResponseDataJSON
}

func (*AccountHolderCreateWebhookResponseData) UnmarshalJSON

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

type AccountHolderDocument

type AccountHolderDocument struct {
	// Globally unique identifier for the account holder.
	AccountHolderToken string `json:"account_holder_token" format:"uuid"`
	// Type of documentation to be submitted for verification.
	DocumentType            AccountHolderDocumentDocumentType              `json:"document_type"`
	RequiredDocumentUploads []AccountHolderDocumentRequiredDocumentUploads `json:"required_document_uploads"`
	// Globally unique identifier for the document.
	Token string `json:"token" format:"uuid"`
	JSON  accountHolderDocumentJSON
}

Describes the document and the required document image uploads required to re-run KYC.

func (*AccountHolderDocument) UnmarshalJSON

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

type AccountHolderDocumentDocumentType

type AccountHolderDocumentDocumentType string
const (
	AccountHolderDocumentDocumentTypeCommercialLicense AccountHolderDocumentDocumentType = "commercial_license"
	AccountHolderDocumentDocumentTypeDriversLicense    AccountHolderDocumentDocumentType = "drivers_license"
	AccountHolderDocumentDocumentTypePassport          AccountHolderDocumentDocumentType = "passport"
	AccountHolderDocumentDocumentTypePassportCard      AccountHolderDocumentDocumentType = "passport_card"
	AccountHolderDocumentDocumentTypeVisa              AccountHolderDocumentDocumentType = "visa"
)

type AccountHolderDocumentRequiredDocumentUploads

type AccountHolderDocumentRequiredDocumentUploads struct {
	// Type of image to upload.
	ImageType AccountHolderDocumentRequiredDocumentUploadsImageType `json:"image_type"`
	// Status of document image upload.
	Status        AccountHolderDocumentRequiredDocumentUploadsStatus          `json:"status"`
	StatusReasons []AccountHolderDocumentRequiredDocumentUploadsStatusReasons `json:"status_reasons"`
	// URL to upload document image to.
	//
	// Note that the upload URLs expire after 7 days. If an upload URL expires, you can
	// refresh the URLs by retrieving the document upload from
	// `GET /account_holders/{account_holder_token}/documents`.
	UploadURL string `json:"upload_url"`
	JSON      accountHolderDocumentRequiredDocumentUploadsJSON
}

Represents a single image of the document to upload.

func (*AccountHolderDocumentRequiredDocumentUploads) UnmarshalJSON

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

type AccountHolderDocumentRequiredDocumentUploadsImageType

type AccountHolderDocumentRequiredDocumentUploadsImageType string
const (
	AccountHolderDocumentRequiredDocumentUploadsImageTypeBack  AccountHolderDocumentRequiredDocumentUploadsImageType = "back"
	AccountHolderDocumentRequiredDocumentUploadsImageTypeFront AccountHolderDocumentRequiredDocumentUploadsImageType = "front"
)

type AccountHolderDocumentRequiredDocumentUploadsStatus

type AccountHolderDocumentRequiredDocumentUploadsStatus string
const (
	AccountHolderDocumentRequiredDocumentUploadsStatusCompleted AccountHolderDocumentRequiredDocumentUploadsStatus = "COMPLETED"
	AccountHolderDocumentRequiredDocumentUploadsStatusFailed    AccountHolderDocumentRequiredDocumentUploadsStatus = "FAILED"
	AccountHolderDocumentRequiredDocumentUploadsStatusPending   AccountHolderDocumentRequiredDocumentUploadsStatus = "PENDING"
	AccountHolderDocumentRequiredDocumentUploadsStatusUploaded  AccountHolderDocumentRequiredDocumentUploadsStatus = "UPLOADED"
)

type AccountHolderDocumentRequiredDocumentUploadsStatusReasons

type AccountHolderDocumentRequiredDocumentUploadsStatusReasons string
const (
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsBackImageBlurry  AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "BACK_IMAGE_BLURRY"
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsFileSizeTooLarge AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "FILE_SIZE_TOO_LARGE"
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsFrontImageBlurry AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "FRONT_IMAGE_BLURRY"
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsFrontImageGlare  AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "FRONT_IMAGE_GLARE"
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsInvalidFileType  AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "INVALID_FILE_TYPE"
	AccountHolderDocumentRequiredDocumentUploadsStatusReasonsUnknownError     AccountHolderDocumentRequiredDocumentUploadsStatusReasons = "UNKNOWN_ERROR"
)

type AccountHolderListDocumentsResponse

type AccountHolderListDocumentsResponse struct {
	Data []AccountHolderDocument `json:"data"`
	JSON accountHolderListDocumentsResponseJSON
}

func (*AccountHolderListDocumentsResponse) UnmarshalJSON

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

type AccountHolderNewParams

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

This interface is a union satisfied by one of the following: KYBParam, KYCParam, KYCExemptParam.

type AccountHolderNewWebhookParams

type AccountHolderNewWebhookParams struct {
	// URL to receive webhook requests. Must be a valid HTTPS address.
	URL param.Field[string] `json:"url,required"`
}

func (AccountHolderNewWebhookParams) MarshalJSON

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

type AccountHolderResubmitParams

type AccountHolderResubmitParams struct {
	Workflow param.Field[AccountHolderResubmitParamsWorkflow] `json:"workflow,required"`
	// An RFC 3339 timestamp indicating when the account holder accepted the applicable
	// legal agreements (e.g., cardholder terms) as agreed upon during API customer's
	// implementation with Lithic.
	TosTimestamp param.Field[string] `json:"tos_timestamp,required"`
	// Information on individual for whom the account is being opened and KYC is being
	// re-run.
	Individual param.Field[AccountHolderResubmitParamsIndividual] `json:"individual,required"`
}

func (AccountHolderResubmitParams) MarshalJSON

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

type AccountHolderResubmitParamsIndividual

type AccountHolderResubmitParamsIndividual struct {
	// Individual's current address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Individual's date of birth, as an RFC 3339 date.
	Dob param.Field[string] `json:"dob,required"`
	// Individual's email address. If utilizing Lithic for chargeback processing, this
	// customer email address may be used to communicate dispute status and resolution.
	Email param.Field[string] `json:"email,required"`
	// Individual's first name, as it appears on government-issued identity documents.
	FirstName param.Field[string] `json:"first_name,required"`
	// Government-issued identification number (required for identity verification and
	// compliance with banking regulations). Social Security Numbers (SSN) and
	// Individual Taxpayer Identification Numbers (ITIN) are currently supported,
	// entered as full nine-digits, with or without hyphens
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Individual's last name, as it appears on government-issued identity documents.
	LastName param.Field[string] `json:"last_name,required"`
	// Individual's phone number, entered in E.164 format.
	PhoneNumber param.Field[string] `json:"phone_number,required"`
}

Information on individual for whom the account is being opened and KYC is being re-run.

type AccountHolderResubmitParamsWorkflow

type AccountHolderResubmitParamsWorkflow string
const (
	AccountHolderResubmitParamsWorkflowKYCAdvanced AccountHolderResubmitParamsWorkflow = "KYC_ADVANCED"
)

type AccountHolderService

type AccountHolderService struct {
	Options []option.RequestOption
}

AccountHolderService contains methods and other services that help with interacting with the lithic 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 NewAccountHolderService method instead.

func NewAccountHolderService

func NewAccountHolderService(opts ...option.RequestOption) (r *AccountHolderService)

NewAccountHolderService 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 (*AccountHolderService) Get

func (r *AccountHolderService) Get(ctx context.Context, account_holder_token string, opts ...option.RequestOption) (res *AccountHolder, err error)

Get an Individual or Business Account Holder and/or their KYC or KYB evaluation status.

func (*AccountHolderService) GetDocument

func (r *AccountHolderService) GetDocument(ctx context.Context, account_holder_token string, document_token string, opts ...option.RequestOption) (res *AccountHolderDocument, err error)

Check the status of an account holder document upload, or retrieve the upload URLs to process your image uploads.

Note that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).

In the event your upload URLs have expired, calling this endpoint will refresh them. Similarly, in the event a document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.

When a new account holder document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` array in a `PENDING` state for the corresponding `image_type`.

func (*AccountHolderService) ListDocuments

func (r *AccountHolderService) ListDocuments(ctx context.Context, account_holder_token string, opts ...option.RequestOption) (res *AccountHolderListDocumentsResponse, err error)

Retrieve the status of account holder document uploads, or retrieve the upload URLs to process your image uploads.

Note that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).

In the event your upload URLs have expired, calling this endpoint will refresh them. Similarly, in the event a previous account holder document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.

When a new document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` list in a `PENDING` state for the corresponding `image_type`.

func (*AccountHolderService) New

Run an individual or business's information through the Customer Identification Program (CIP) and return an `account_token` if the status is accepted or pending (i.e., further action required). All calls to this endpoint will return an immediate response - though in some cases, the response may indicate the workflow is under review or further action will be needed to complete the account creation process. This endpoint can only be used on accounts that are part of the program the calling API key manages.

Note: If you choose to set a timeout for this request, we recommend 5 minutes.

func (*AccountHolderService) NewWebhook

Create a webhook to receive KYC or KYB evaluation events.

There are two types of account holder webhooks:

  • `verification`: Webhook sent when the status of a KYC or KYB evaluation changes from `PENDING_DOCUMENT` (KYC) or `PENDING` (KYB) to `ACCEPTED` or `REJECTED`.
  • `document_upload_front`/`document_upload_back`: Webhook sent when a document upload fails.

After a webhook has been created, this endpoint can be used to rotate a webhooks HMAC token or modify the registered URL. Only a single webhook is allowed per program. Since HMAC verification is available, the IP addresses from which KYC/KYB webhooks are sent are subject to change.

func (*AccountHolderService) Resubmit

func (r *AccountHolderService) Resubmit(ctx context.Context, account_holder_token string, body AccountHolderResubmitParams, opts ...option.RequestOption) (res *AccountHolder, err error)

Resubmit a KYC submission. This endpoint should be used in cases where a KYC submission returned a `PENDING_RESUBMIT` result, meaning one or more critical KYC fields may have been mis-entered and the individual's identity has not yet been successfully verified. This step must be completed in order to proceed with the KYC evaluation.

Two resubmission attempts are permitted via this endpoint before a `REJECTED` status is returned and the account creation process is ended.

func (*AccountHolderService) Update

func (r *AccountHolderService) Update(ctx context.Context, account_holder_token string, body AccountHolderUpdateParams, opts ...option.RequestOption) (res *AccountHolderUpdateResponse, err error)

Update the information associated with a particular account holder.

func (*AccountHolderService) UploadDocument

func (r *AccountHolderService) UploadDocument(ctx context.Context, account_holder_token string, body AccountHolderUploadDocumentParams, opts ...option.RequestOption) (res *AccountHolderDocument, err error)

Use this endpoint to identify which type of supported government-issued documentation you will upload for further verification. It will return two URLs to upload your document images to - one for the front image and one for the back image.

This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state.

Uploaded images must either be a `jpg` or `png` file, and each must be less than 15 MiB. Once both required uploads have been successfully completed, your document will be run through KYC verification.

If you have registered a webhook, you will receive evaluation updates for any document submission evaluations, as well as for any failed document uploads.

Two document submission attempts are permitted via this endpoint before a `REJECTED` status is returned and the account creation process is ended. Currently only one type of account holder document is supported per KYC verification.

type AccountHolderStatus

type AccountHolderStatus string
const (
	AccountHolderStatusAccepted        AccountHolderStatus = "ACCEPTED"
	AccountHolderStatusRejected        AccountHolderStatus = "REJECTED"
	AccountHolderStatusPendingResubmit AccountHolderStatus = "PENDING_RESUBMIT"
	AccountHolderStatusPendingDocument AccountHolderStatus = "PENDING_DOCUMENT"
)

type AccountHolderStatusReasons

type AccountHolderStatusReasons string
const (
	AccountHolderStatusReasonsAddressVerificationFailure  AccountHolderStatusReasons = "ADDRESS_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsAgeThresholdFailure         AccountHolderStatusReasons = "AGE_THRESHOLD_FAILURE"
	AccountHolderStatusReasonsCompleteVerificationFailure AccountHolderStatusReasons = "COMPLETE_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsDobVerificationFailure      AccountHolderStatusReasons = "DOB_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsIDVerificationFailure       AccountHolderStatusReasons = "ID_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsMaxDocumentAttempts         AccountHolderStatusReasons = "MAX_DOCUMENT_ATTEMPTS"
	AccountHolderStatusReasonsMaxResubmissionAttempts     AccountHolderStatusReasons = "MAX_RESUBMISSION_ATTEMPTS"
	AccountHolderStatusReasonsNameVerificationFailure     AccountHolderStatusReasons = "NAME_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsOtherVerificationFailure    AccountHolderStatusReasons = "OTHER_VERIFICATION_FAILURE"
	AccountHolderStatusReasonsRiskThresholdFailure        AccountHolderStatusReasons = "RISK_THRESHOLD_FAILURE"
	AccountHolderStatusReasonsWatchlistAlertFailure       AccountHolderStatusReasons = "WATCHLIST_ALERT_FAILURE"
)

type AccountHolderUpdateParams

type AccountHolderUpdateParams struct {
	// Account holder's email address. The primary purpose of this field is for
	// cardholder identification and verification during the digital wallet
	// tokenization process.
	Email param.Field[string] `json:"email"`
	// Account holder's phone number, entered in E.164 format. The primary purpose of
	// this field is for cardholder identification and verification during the digital
	// wallet tokenization process.
	PhoneNumber param.Field[string] `json:"phone_number"`
	// Only applicable for customers using the KYC-Exempt workflow to enroll authorized
	// users of businesses. Pass the account_token of the enrolled business associated
	// with the AUTHORIZED_USER in this field.
	BusinessAccountToken param.Field[string] `json:"business_account_token"`
}

func (AccountHolderUpdateParams) MarshalJSON

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

type AccountHolderUpdateResponse

type AccountHolderUpdateResponse struct {
	// The token for the account holder that was updated
	Token string `json:"token"`
	// The newly updated email for the account holder
	Email string `json:"email"`
	// The newly updated phone_number for the account holder
	PhoneNumber string `json:"phone_number"`
	// Only applicable for customers using the KYC-Exempt workflow to enroll businesses
	// with authorized users. Pass the account_token of the enrolled business
	// associated with the AUTHORIZED_USER in this field.
	BusinessAccountToken string `json:"business_account_token"`
	JSON                 accountHolderUpdateResponseJSON
}

func (*AccountHolderUpdateResponse) UnmarshalJSON

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

type AccountHolderUploadDocumentParams

type AccountHolderUploadDocumentParams struct {
	// Type of the document to upload.
	DocumentType param.Field[AccountHolderUploadDocumentParamsDocumentType] `json:"document_type,required"`
}

func (AccountHolderUploadDocumentParams) MarshalJSON

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

type AccountHolderUploadDocumentParamsDocumentType

type AccountHolderUploadDocumentParamsDocumentType string
const (
	AccountHolderUploadDocumentParamsDocumentTypeCommercialLicense AccountHolderUploadDocumentParamsDocumentType = "commercial_license"
	AccountHolderUploadDocumentParamsDocumentTypeDriversLicense    AccountHolderUploadDocumentParamsDocumentType = "drivers_license"
	AccountHolderUploadDocumentParamsDocumentTypePassport          AccountHolderUploadDocumentParamsDocumentType = "passport"
	AccountHolderUploadDocumentParamsDocumentTypePassportCard      AccountHolderUploadDocumentParamsDocumentType = "passport_card"
	AccountHolderUploadDocumentParamsDocumentTypeVisa              AccountHolderUploadDocumentParamsDocumentType = "visa"
)

type AccountListParams

type AccountListParams struct {
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// Page (for pagination).
	Page param.Field[int64] `query:"page"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
}

func (AccountListParams) URLQuery

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

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

type AccountListResponse

type AccountListResponse struct {
	Data []Account `json:"data,required"`
	// Page number.
	Page int64 `json:"page,required"`
	// Total number of entries.
	TotalEntries int64 `json:"total_entries,required"`
	// Total number of pages.
	TotalPages int64 `json:"total_pages,required"`
	JSON       accountListResponseJSON
}

func (*AccountListResponse) UnmarshalJSON

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

type AccountService

type AccountService struct {
	Options []option.RequestOption
}

AccountService contains methods and other services that help with interacting with the lithic API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.

func NewAccountService

func NewAccountService(opts ...option.RequestOption) (r *AccountService)

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

func (*AccountService) Get

func (r *AccountService) Get(ctx context.Context, account_token string, opts ...option.RequestOption) (res *Account, err error)

Get account configuration such as spend limits.

func (*AccountService) List

func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *shared.Page[Account], err error)

List account configurations.

func (*AccountService) ListAutoPaging

List account configurations.

func (*AccountService) Update

func (r *AccountService) Update(ctx context.Context, account_token string, body AccountUpdateParams, opts ...option.RequestOption) (res *Account, err error)

Update account configuration such as spend limits and verification address. Can only be run on accounts that are part of the program managed by this API key.

Accounts that are in the `PAUSED` state will not be able to transact or create new cards.

type AccountSpendLimit

type AccountSpendLimit struct {
	// Daily spend limit (in cents).
	Daily int64 `json:"daily,required"`
	// Monthly spend limit (in cents).
	Monthly int64 `json:"monthly,required"`
	// Total spend limit over account lifetime (in cents).
	Lifetime int64 `json:"lifetime,required"`
	JSON     accountSpendLimitJSON
}

Spend limit information for the user containing the daily, monthly, and lifetime spend limit of the account. Any charges to a card owned by this account will be declined once their transaction volume has surpassed the value in the applicable time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit feature is disabled.

func (*AccountSpendLimit) UnmarshalJSON

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

type AccountState

type AccountState string
const (
	AccountStateActive AccountState = "ACTIVE"
	AccountStatePaused AccountState = "PAUSED"
	AccountStateClosed AccountState = "CLOSED"
)

type AccountUpdateParams

type AccountUpdateParams struct {
	// Amount (in cents) for the account's new daily spend limit. Note that a spend
	// limit of 0 is effectively no limit, and should only be used to reset or remove a
	// prior limit. Only a limit of 1 or above will result in declined transactions due
	// to checks against the account limit.
	DailySpendLimit param.Field[int64] `json:"daily_spend_limit"`
	// Amount (in cents) for the account's new lifetime limit. Once this limit is
	// reached, no transactions will be accepted on any card created for this account
	// until the limit is updated. Note that a spend limit of 0 is effectively no
	// limit, and should only be used to reset or remove a prior limit. Only a limit of
	// 1 or above will result in declined transactions due to checks against the
	// account limit.
	LifetimeSpendLimit param.Field[int64] `json:"lifetime_spend_limit"`
	// Amount (in cents) for the account's new monthly spend limit. Note that a spend
	// limit of 0 is effectively no limit, and should only be used to reset or remove a
	// prior limit. Only a limit of 1 or above will result in declined transactions due
	// to checks against the account limit.
	MonthlySpendLimit param.Field[int64] `json:"monthly_spend_limit"`
	// Address used during Address Verification Service (AVS) checks during
	// transactions if enabled via Auth Rules.
	VerificationAddress param.Field[AccountUpdateParamsVerificationAddress] `json:"verification_address"`
	// Account states.
	State param.Field[AccountUpdateParamsState] `json:"state"`
}

func (AccountUpdateParams) MarshalJSON

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

type AccountUpdateParamsState

type AccountUpdateParamsState string
const (
	AccountUpdateParamsStateActive AccountUpdateParamsState = "ACTIVE"
	AccountUpdateParamsStatePaused AccountUpdateParamsState = "PAUSED"
)

type AccountUpdateParamsVerificationAddress

type AccountUpdateParamsVerificationAddress struct {
	Address1   param.Field[string] `json:"address1"`
	Address2   param.Field[string] `json:"address2"`
	City       param.Field[string] `json:"city"`
	State      param.Field[string] `json:"state"`
	PostalCode param.Field[string] `json:"postal_code"`
	Country    param.Field[string] `json:"country"`
}

Address used during Address Verification Service (AVS) checks during transactions if enabled via Auth Rules.

type AccountVerificationAddress

type AccountVerificationAddress struct {
	// Valid deliverable address (no PO boxes).
	Address1 string `json:"address1,required"`
	// Unit or apartment number (if applicable).
	Address2 string `json:"address2"`
	// City name.
	City string `json:"city,required"`
	// Valid state code. Only USA state codes are currently supported, entered in
	// uppercase ISO 3166-2 two-character format.
	State string `json:"state,required"`
	// Valid postal code. Only USA ZIP codes are currently supported, entered as a
	// five-digit ZIP or nine-digit ZIP+4.
	PostalCode string `json:"postal_code,required"`
	// Country name. Only USA is currently supported.
	Country string `json:"country,required"`
	JSON    accountVerificationAddressJSON
}

func (*AccountVerificationAddress) UnmarshalJSON

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

type AddressParam

type AddressParam = shared.AddressParam

type AggregateBalance

type AggregateBalance struct {
	// Type of financial account
	FinancialAccountType AggregateBalanceFinancialAccountType `json:"financial_account_type,required"`
	// 3-digit alphabetic ISO 4217 code for the local currency of the balance.
	Currency string `json:"currency,required"`
	// Funds available for spend in the currency's smallest unit (e.g., cents for USD)
	AvailableAmount int64 `json:"available_amount,required"`
	// Funds not available for spend due to card authorizations or pending ACH release.
	// Shown in the currency's smallest unit (e.g., cents for USD)
	PendingAmount int64 `json:"pending_amount,required"`
	// The sum of available and pending balance in the currency's smallest unit (e.g.,
	// cents for USD)
	TotalAmount int64 `json:"total_amount,required"`
	// Date and time for when the balance was first created.
	Created time.Time `json:"created,required" format:"date-time"`
	// Date and time for when the balance was last updated.
	Updated time.Time `json:"updated,required" format:"date-time"`
	// Globally unique identifier for the last transaction that impacted this balance
	LastTransactionToken string `json:"last_transaction_token,required" format:"uuid"`
	// Globally unique identifier for the last transaction event that impacted this
	// balance
	LastTransactionEventToken string `json:"last_transaction_event_token,required" format:"uuid"`
	// Globally unique identifier for the financial account that had its balance
	// updated most recently
	LastFinancialAccountToken string `json:"last_financial_account_token,required" format:"uuid"`
	JSON                      aggregateBalanceJSON
}

Aggregate Balance across all end-user accounts

func (*AggregateBalance) UnmarshalJSON

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

type AggregateBalanceFinancialAccountType

type AggregateBalanceFinancialAccountType string
const (
	AggregateBalanceFinancialAccountTypeIssuing AggregateBalanceFinancialAccountType = "ISSUING"
	AggregateBalanceFinancialAccountTypeReserve AggregateBalanceFinancialAccountType = "RESERVE"
)

type AggregateBalanceListParams

type AggregateBalanceListParams struct {
	// Get the aggregate balance for a given Financial Account type.
	FinancialAccountType param.Field[AggregateBalanceListParamsFinancialAccountType] `query:"financial_account_type"`
}

func (AggregateBalanceListParams) URLQuery

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

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

type AggregateBalanceListParamsFinancialAccountType

type AggregateBalanceListParamsFinancialAccountType string
const (
	AggregateBalanceListParamsFinancialAccountTypeIssuing AggregateBalanceListParamsFinancialAccountType = "ISSUING"
	AggregateBalanceListParamsFinancialAccountTypeReserve AggregateBalanceListParamsFinancialAccountType = "RESERVE"
)

type AggregateBalanceListResponse

type AggregateBalanceListResponse struct {
	Data []AggregateBalance `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    aggregateBalanceListResponseJSON
}

func (*AggregateBalanceListResponse) UnmarshalJSON

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

type AggregateBalanceService

type AggregateBalanceService struct {
	Options []option.RequestOption
}

AggregateBalanceService contains methods and other services that help with interacting with the lithic 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 NewAggregateBalanceService method instead.

func NewAggregateBalanceService

func NewAggregateBalanceService(opts ...option.RequestOption) (r *AggregateBalanceService)

NewAggregateBalanceService 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 (*AggregateBalanceService) List

Get the aggregated balance across all end-user accounts by financial account type

func (*AggregateBalanceService) ListAutoPaging

Get the aggregated balance across all end-user accounts by financial account type

type AuthRule

type AuthRule struct {
	// Globally unique identifier.
	Token string `json:"token" format:"uuid"`
	// Indicates whether the Auth Rule is ACTIVE or INACTIVE
	State AuthRuleState `json:"state"`
	// Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned
	// only if an Auth Rule is applied to entities that previously already had one
	// applied.
	PreviousAuthRuleTokens []string `json:"previous_auth_rule_tokens"`
	// Merchant category codes for which the Auth Rule permits transactions.
	AllowedMcc []string `json:"allowed_mcc"`
	// Merchant category codes for which the Auth Rule automatically declines
	// transactions.
	BlockedMcc []string `json:"blocked_mcc"`
	// Countries in which the Auth Rule permits transactions. Note that Lithic
	// maintains a list of countries in which all transactions are blocked; "allowing"
	// those countries in an Auth Rule does not override the Lithic-wide restrictions.
	AllowedCountries []string `json:"allowed_countries"`
	// Countries in which the Auth Rule automatically declines transactions.
	BlockedCountries []string `json:"blocked_countries"`
	// Address verification to confirm that postal code entered at point of transaction
	// (if applicable) matches the postal code on file for a given card. Since this
	// check is performed against the address submitted via the Enroll Consumer
	// endpoint, it should only be used in cases where card users are enrolled with
	// their own accounts. Available values:
	//
	//   - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of
	//     transaction (if applicable) matches address on file.
	AvsType AuthRuleAvsType `json:"avs_type"`
	// Array of account_token(s) identifying the accounts that the Auth Rule applies
	// to. Note that only this field or `card_tokens` can be provided for a given Auth
	// Rule.
	AccountTokens []string `json:"account_tokens"`
	// Array of card_token(s) identifying the cards that the Auth Rule applies to. Note
	// that only this field or `account_tokens` can be provided for a given Auth Rule.
	CardTokens []string `json:"card_tokens"`
	// Boolean indicating whether the Auth Rule is applied at the program level.
	ProgramLevel bool `json:"program_level"`
	JSON         authRuleJSON
}

func (*AuthRule) UnmarshalJSON

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

type AuthRuleApplyParams

type AuthRuleApplyParams struct {
	// Array of card_token(s) identifying the cards that the Auth Rule applies to. Note
	// that only this field or `account_tokens` can be provided for a given Auth Rule.
	CardTokens param.Field[[]string] `json:"card_tokens"`
	// Array of account_token(s) identifying the accounts that the Auth Rule applies
	// to. Note that only this field or `card_tokens` can be provided for a given Auth
	// Rule.
	AccountTokens param.Field[[]string] `json:"account_tokens"`
	// Boolean indicating whether the Auth Rule is applied at the program level.
	ProgramLevel param.Field[bool] `json:"program_level"`
}

func (AuthRuleApplyParams) MarshalJSON

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

type AuthRuleApplyResponse

type AuthRuleApplyResponse struct {
	Data AuthRule `json:"data"`
	JSON authRuleApplyResponseJSON
}

func (*AuthRuleApplyResponse) UnmarshalJSON

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

type AuthRuleAvsType

type AuthRuleAvsType string
const (
	AuthRuleAvsTypeZipOnly AuthRuleAvsType = "ZIP_ONLY"
)

type AuthRuleCreateResponse

type AuthRuleCreateResponse struct {
	Data AuthRule `json:"data"`
	JSON authRuleCreateResponseJSON
}

func (*AuthRuleCreateResponse) UnmarshalJSON

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

type AuthRuleListParams

type AuthRuleListParams struct {
	// Page (for pagination).
	Page param.Field[int64] `query:"page"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
}

func (AuthRuleListParams) URLQuery

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

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

type AuthRuleListResponse

type AuthRuleListResponse struct {
	Data []AuthRule `json:"data"`
	// Total number of entries.
	TotalEntries string `json:"total_entries"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// Page number.
	Page int64 `json:"page"`
	JSON authRuleListResponseJSON
}

func (*AuthRuleListResponse) UnmarshalJSON

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

type AuthRuleNewParams

type AuthRuleNewParams struct {
	// Merchant category codes for which the Auth Rule permits transactions.
	AllowedMcc param.Field[[]string] `json:"allowed_mcc"`
	// Merchant category codes for which the Auth Rule automatically declines
	// transactions.
	BlockedMcc param.Field[[]string] `json:"blocked_mcc"`
	// Countries in which the Auth Rule permits transactions. Note that Lithic
	// maintains a list of countries in which all transactions are blocked; "allowing"
	// those countries in an Auth Rule does not override the Lithic-wide restrictions.
	AllowedCountries param.Field[[]string] `json:"allowed_countries"`
	// Countries in which the Auth Rule automatically declines transactions.
	BlockedCountries param.Field[[]string] `json:"blocked_countries"`
	// Address verification to confirm that postal code entered at point of transaction
	// (if applicable) matches the postal code on file for a given card. Since this
	// check is performed against the address submitted via the Enroll Consumer
	// endpoint, it should only be used in cases where card users are enrolled with
	// their own accounts. Available values:
	//
	//   - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of
	//     transaction (if applicable) matches address on file.
	AvsType param.Field[AuthRuleNewParamsAvsType] `json:"avs_type"`
	// Array of account_token(s) identifying the accounts that the Auth Rule applies
	// to. Note that only this field or `card_tokens` can be provided for a given Auth
	// Rule.
	AccountTokens param.Field[[]string] `json:"account_tokens"`
	// Array of card_token(s) identifying the cards that the Auth Rule applies to. Note
	// that only this field or `account_tokens` can be provided for a given Auth Rule.
	CardTokens param.Field[[]string] `json:"card_tokens"`
	// Boolean indicating whether the Auth Rule is applied at the program level.
	ProgramLevel param.Field[bool] `json:"program_level"`
}

func (AuthRuleNewParams) MarshalJSON

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

type AuthRuleNewParamsAvsType

type AuthRuleNewParamsAvsType string
const (
	AuthRuleNewParamsAvsTypeZipOnly AuthRuleNewParamsAvsType = "ZIP_ONLY"
)

type AuthRuleRemoveParams

type AuthRuleRemoveParams struct {
	// Array of card_token(s) identifying the cards that the Auth Rule applies to. Note
	// that only this field or `account_tokens` can be provided for a given Auth Rule.
	CardTokens param.Field[[]string] `json:"card_tokens"`
	// Array of account_token(s) identifying the accounts that the Auth Rule applies
	// to. Note that only this field or `card_tokens` can be provided for a given Auth
	// Rule.
	AccountTokens param.Field[[]string] `json:"account_tokens"`
	// Boolean indicating whether the Auth Rule is applied at the program level.
	ProgramLevel param.Field[bool] `json:"program_level"`
}

func (AuthRuleRemoveParams) MarshalJSON

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

type AuthRuleRemoveResponse

type AuthRuleRemoveResponse struct {
	AccountTokens          []string `json:"account_tokens"`
	CardTokens             []string `json:"card_tokens"`
	PreviousAuthRuleTokens []string `json:"previous_auth_rule_tokens"`
	ProgramLevel           bool     `json:"program_level"`
	JSON                   authRuleRemoveResponseJSON
}

func (*AuthRuleRemoveResponse) UnmarshalJSON

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

type AuthRuleRetrieveResponse

type AuthRuleRetrieveResponse struct {
	Data []AuthRule `json:"data"`
	JSON authRuleRetrieveResponseJSON
}

func (*AuthRuleRetrieveResponse) UnmarshalJSON

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

type AuthRuleService

type AuthRuleService struct {
	Options []option.RequestOption
}

AuthRuleService contains methods and other services that help with interacting with the lithic 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 NewAuthRuleService method instead.

func NewAuthRuleService

func NewAuthRuleService(opts ...option.RequestOption) (r *AuthRuleService)

NewAuthRuleService 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 (*AuthRuleService) Apply

func (r *AuthRuleService) Apply(ctx context.Context, auth_rule_token string, body AuthRuleApplyParams, opts ...option.RequestOption) (res *AuthRuleApplyResponse, err error)

Applies an existing authorization rule (Auth Rule) to an program, account, or card level.

func (*AuthRuleService) Get

func (r *AuthRuleService) Get(ctx context.Context, auth_rule_token string, opts ...option.RequestOption) (res *AuthRuleRetrieveResponse, err error)

Detail the properties and entities (program, accounts, and cards) associated with an existing authorization rule (Auth Rule).

func (*AuthRuleService) List

func (r *AuthRuleService) List(ctx context.Context, query AuthRuleListParams, opts ...option.RequestOption) (res *shared.Page[AuthRule], err error)

Return all of the Auth Rules under the program.

func (*AuthRuleService) ListAutoPaging

Return all of the Auth Rules under the program.

func (*AuthRuleService) New

Creates an authorization rule (Auth Rule) and applies it at the program, account, or card level.

func (*AuthRuleService) Remove

Remove an existing authorization rule (Auth Rule) from an program, account, or card-level.

func (*AuthRuleService) Update

func (r *AuthRuleService) Update(ctx context.Context, auth_rule_token string, body AuthRuleUpdateParams, opts ...option.RequestOption) (res *AuthRuleUpdateResponse, err error)

Update the properties associated with an existing authorization rule (Auth Rule).

type AuthRuleState

type AuthRuleState string
const (
	AuthRuleStateActive   AuthRuleState = "ACTIVE"
	AuthRuleStateInactive AuthRuleState = "INACTIVE"
)

type AuthRuleUpdateParams

type AuthRuleUpdateParams struct {
	// Array of merchant category codes for which the Auth Rule will permit
	// transactions. Note that only this field or `blocked_mcc` can be used for a given
	// Auth Rule.
	AllowedMcc param.Field[[]string] `json:"allowed_mcc"`
	// Array of merchant category codes for which the Auth Rule will automatically
	// decline transactions. Note that only this field or `allowed_mcc` can be used for
	// a given Auth Rule.
	BlockedMcc param.Field[[]string] `json:"blocked_mcc"`
	// Array of country codes for which the Auth Rule will permit transactions. Note
	// that only this field or `blocked_countries` can be used for a given Auth Rule.
	AllowedCountries param.Field[[]string] `json:"allowed_countries"`
	// Array of country codes for which the Auth Rule will automatically decline
	// transactions. Note that only this field or `allowed_countries` can be used for a
	// given Auth Rule.
	BlockedCountries param.Field[[]string] `json:"blocked_countries"`
	// Address verification to confirm that postal code entered at point of transaction
	// (if applicable) matches the postal code on file for a given card.
	AvsType param.Field[AuthRuleUpdateParamsAvsType] `json:"avs_type"`
}

func (AuthRuleUpdateParams) MarshalJSON

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

type AuthRuleUpdateParamsAvsType

type AuthRuleUpdateParamsAvsType string
const (
	AuthRuleUpdateParamsAvsTypeZipOnly AuthRuleUpdateParamsAvsType = "ZIP_ONLY"
)

type AuthRuleUpdateResponse

type AuthRuleUpdateResponse struct {
	Data AuthRule `json:"data"`
	JSON authRuleUpdateResponseJSON
}

func (*AuthRuleUpdateResponse) UnmarshalJSON

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

type AuthStreamEnrollment

type AuthStreamEnrollment struct {
	// Whether ASA is enrolled.
	Enrolled bool `json:"enrolled"`
	JSON     authStreamEnrollmentJSON
}

func (*AuthStreamEnrollment) UnmarshalJSON

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

type AuthStreamEnrollmentEnrollParams

type AuthStreamEnrollmentEnrollParams struct {
	// A user-specified url to receive and respond to ASA request.
	WebhookURL param.Field[string] `json:"webhook_url" format:"uri"`
}

func (AuthStreamEnrollmentEnrollParams) MarshalJSON

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

type AuthStreamEnrollmentService

type AuthStreamEnrollmentService struct {
	Options []option.RequestOption
}

AuthStreamEnrollmentService contains methods and other services that help with interacting with the lithic 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 NewAuthStreamEnrollmentService method instead.

func NewAuthStreamEnrollmentService

func NewAuthStreamEnrollmentService(opts ...option.RequestOption) (r *AuthStreamEnrollmentService)

NewAuthStreamEnrollmentService 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 (*AuthStreamEnrollmentService) Disenroll

func (r *AuthStreamEnrollmentService) Disenroll(ctx context.Context, opts ...option.RequestOption) (err error)

Disenroll Authorization Stream Access (ASA) in Sandbox.

func (*AuthStreamEnrollmentService) Enroll

Authorization Stream Access (ASA) provides the ability to make custom transaction approval decisions through an HTTP interface to the ISO 8583 message stream.

ASA requests are delivered as an HTTP POST during authorization. The ASA request body adheres to the Lithic transaction schema, with some additional fields added for use in decisioning. A response should be sent with HTTP response code 200 and the approval decision in the response body. This response is converted by Lithic back into ISO 8583 format and forwarded to the network.

In Sandbox, users can self-enroll and disenroll in ASA. In production, onboarding requires manual approval and setup.

func (*AuthStreamEnrollmentService) Get

Check status for whether you have enrolled in Authorization Stream Access (ASA) for your program in Sandbox.

func (*AuthStreamEnrollmentService) GetSecret

func (r *AuthStreamEnrollmentService) GetSecret(ctx context.Context, opts ...option.RequestOption) (res *AuthStreamSecret, err error)

Retrieve the ASA HMAC secret key. If one does not exist for your program yet, calling this endpoint will create one for you. The headers (which you can use to verify webhooks) will begin appearing shortly after calling this endpoint for the first time. See [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) for more detail about verifying ASA webhooks.

func (*AuthStreamEnrollmentService) RotateSecret

func (r *AuthStreamEnrollmentService) RotateSecret(ctx context.Context, opts ...option.RequestOption) (err error)

Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be deactivated 24 hours after a successful request to this endpoint. Make a [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) request to retrieve the new secret key.

type AuthStreamSecret

type AuthStreamSecret struct {
	// The shared HMAC ASA secret
	Secret string `json:"secret"`
	JSON   authStreamSecretJSON
}

func (*AuthStreamSecret) UnmarshalJSON

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

type Balance

type Balance struct {
	// Funds available for spend in the currency's smallest unit (e.g., cents for USD)
	AvailableAmount int64 `json:"available_amount,required"`
	// Date and time for when the balance was first created.
	Created time.Time `json:"created,required" format:"date-time"`
	// 3-digit alphabetic ISO 4217 code for the local currency of the balance.
	Currency string `json:"currency,required"`
	// Globally unique identifier for the last financial transaction event that
	// impacted this balance.
	LastTransactionEventToken string `json:"last_transaction_event_token,required" format:"uuid"`
	// Globally unique identifier for the last financial transaction that impacted this
	// balance.
	LastTransactionToken string `json:"last_transaction_token,required" format:"uuid"`
	// Funds not available for spend due to card authorizations or pending ACH release.
	// Shown in the currency's smallest unit (e.g., cents for USD).
	PendingAmount int64 `json:"pending_amount,required"`
	// Globally unique identifier for the financial account that holds this balance.
	Token string `json:"token,required" format:"uuid"`
	// The sum of available and pending balance in the currency's smallest unit (e.g.,
	// cents for USD).
	TotalAmount int64 `json:"total_amount,required"`
	// Type of financial account.
	Type BalanceType `json:"type,required"`
	// Date and time for when the balance was last updated.
	Updated time.Time `json:"updated,required" format:"date-time"`
	JSON    balanceJSON
}

Balance of a Financial Account

func (*Balance) UnmarshalJSON

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

type BalanceListParams

type BalanceListParams struct {
	// List balances for all financial accounts of a given account_token.
	AccountToken param.Field[string] `query:"account_token" format:"uuid"`
	// UTC date and time of the balances to retrieve. Defaults to latest available
	// balances
	BalanceDate param.Field[time.Time] `query:"balance_date" format:"date-time"`
	// List balances for a given Financial Account type.
	FinancialAccountType param.Field[BalanceListParamsFinancialAccountType] `query:"financial_account_type"`
}

func (BalanceListParams) URLQuery

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

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

type BalanceListParamsFinancialAccountType

type BalanceListParamsFinancialAccountType string
const (
	BalanceListParamsFinancialAccountTypeIssuing BalanceListParamsFinancialAccountType = "ISSUING"
	BalanceListParamsFinancialAccountTypeReserve BalanceListParamsFinancialAccountType = "RESERVE"
)

type BalanceListResponse

type BalanceListResponse struct {
	Data []Balance `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    balanceListResponseJSON
}

func (*BalanceListResponse) UnmarshalJSON

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

type BalanceService

type BalanceService struct {
	Options []option.RequestOption
}

BalanceService contains methods and other services that help with interacting with the lithic 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) List

Get the balances for a program or a given end-user account

func (*BalanceService) ListAutoPaging

Get the balances for a program or a given end-user account

type BalanceType

type BalanceType string
const (
	BalanceTypeIssuing BalanceType = "ISSUING"
	BalanceTypeReserve BalanceType = "RESERVE"
)

type Card

type Card struct {
	// An RFC 3339 timestamp for when the card was created. UTC time zone.
	Created time.Time `json:"created,required" format:"date-time"`
	// Three digit cvv printed on the back of the card.
	Cvv     string      `json:"cvv"`
	Funding CardFunding `json:"funding,required"`
	// Two digit (MM) expiry month.
	ExpMonth string `json:"exp_month"`
	// Four digit (yyyy) expiry year.
	ExpYear string `json:"exp_year"`
	// Hostname of card’s locked merchant (will be empty if not applicable).
	Hostname string `json:"hostname"`
	// Last four digits of the card number.
	LastFour string `json:"last_four,required"`
	// Friendly name to identify the card. We recommend against using this field to
	// store JSON data as it can cause unexpected behavior.
	Memo string `json:"memo"`
	// Primary Account Number (PAN) (i.e. the card number). Customers must be PCI
	// compliant to have PAN returned as a field in production. Please contact
	// [support@lithic.com](mailto:support@lithic.com) for questions.
	Pan string `json:"pan"`
	// Amount (in cents) to limit approved authorizations. Transaction requests above
	// the spend limit will be declined.
	SpendLimit int64 `json:"spend_limit,required"`
	// Spend limit duration values:
	//
	//   - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
	//     year.
	//   - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
	//     of the card.
	//   - `MONTHLY` - Card will authorize transactions up to spend limit for the
	//     trailing month. Month is calculated as this calendar date one month prior.
	//   - `TRANSACTION` - Card will authorize multiple transactions if each individual
	//     transaction is under the spend limit.
	SpendLimitDuration SpendLimitDuration `json:"spend_limit_duration,required"`
	// Card state values:
	//
	//   - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
	//     be undone.
	//   - `OPEN` - Card will approve authorizations (if they match card and account
	//     parameters).
	//   - `PAUSED` - Card will decline authorizations, but can be resumed at a later
	//     time.
	//   - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The
	//     card is provisioned pending manufacturing and fulfillment. Cards in this state
	//     can accept authorizations for e-commerce purchases, but not for "Card Present"
	//     purchases where the physical card itself is present.
	//   - `PENDING_ACTIVATION` - Each business day at 2pm Eastern Time Zone (ET), cards
	//     of type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card
	//     production warehouse and updated to state `PENDING_ACTIVATION` . Similar to
	//     `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce
	//     transactions. API clients should update the card's state to `OPEN` only after
	//     the cardholder confirms receipt of the card.
	//
	// In sandbox, the same daily batch fulfillment occurs, but no cards are actually
	// manufactured.
	State CardState `json:"state,required"`
	// List of identifiers for the Auth Rule(s) that are applied on the card.
	AuthRuleTokens []string `json:"auth_rule_tokens"`
	// Globally unique identifier.
	Token string `json:"token,required" format:"uuid"`
	// Card types:
	//
	//   - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
	//     wallet like Apple Pay or Google Pay (if the card program is digital
	//     wallet-enabled).
	//   - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
	//     branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
	//     Reach out at [lithic.com/contact](https://lithic.com/contact) for more
	//     information.
	//   - `SINGLE_USE` - Card is closed upon first successful authorization.
	//   - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
	//     successfully authorizes the card.
	Type CardType `json:"type,required"`
	// Specifies the digital card art to be displayed in the user’s digital wallet
	// after tokenization. This artwork must be approved by Mastercard and configured
	// by Lithic to use. See
	// [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).
	DigitalCardArtToken string `json:"digital_card_art_token" format:"uuid"`
	JSON                cardJSON
}

func (*Card) UnmarshalJSON

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

type CardEmbedParams

type CardEmbedParams struct {
	// A base64 encoded JSON string of an EmbedRequest to specify which card to load.
	EmbedRequest param.Field[string] `query:"embed_request,required"`
	// SHA256 HMAC of the embed_request JSON string with base64 digest.
	Hmac param.Field[string] `query:"hmac,required"`
}

func (CardEmbedParams) URLQuery

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

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

type CardFunding

type CardFunding struct {
	// Account name identifying the funding source. This may be `null`.
	AccountName string `json:"account_name"`
	// An RFC 3339 string representing when this funding source was added to the Lithic
	// account. This may be `null`. UTC time zone.
	Created time.Time `json:"created,required" format:"date-time"`
	// The last 4 digits of the account (e.g. bank account, debit card) associated with
	// this FundingAccount. This may be null.
	LastFour string `json:"last_four,required"`
	// The nickname given to the `FundingAccount` or `null` if it has no nickname.
	Nickname string `json:"nickname"`
	// State of funding source.
	//
	// Funding source states:
	//
	//   - `ENABLED` - The funding account is available to use for card creation and
	//     transactions.
	//   - `PENDING` - The funding account is still being verified e.g. bank
	//     micro-deposits verification.
	//   - `DELETED` - The founding account has been deleted.
	State CardFundingState `json:"state,required"`
	// A globally unique identifier for this FundingAccount.
	Token string `json:"token,required" format:"uuid"`
	// Types of funding source:
	//
	// - `DEPOSITORY_CHECKING` - Bank checking account.
	// - `DEPOSITORY_SAVINGS` - Bank savings account.
	Type CardFundingType `json:"type,required"`
	JSON cardFundingJSON
}

func (*CardFunding) UnmarshalJSON

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

type CardFundingState

type CardFundingState string
const (
	CardFundingStateEnabled CardFundingState = "ENABLED"
	CardFundingStatePending CardFundingState = "PENDING"
	CardFundingStateDeleted CardFundingState = "DELETED"
)

type CardFundingType

type CardFundingType string
const (
	CardFundingTypeDepositoryChecking CardFundingType = "DEPOSITORY_CHECKING"
	CardFundingTypeDepositorySavings  CardFundingType = "DEPOSITORY_SAVINGS"
)

type CardListParams

type CardListParams struct {
	// Returns cards associated with the specified account.
	AccountToken param.Field[string] `query:"account_token" format:"uuid"`
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// Page (for pagination).
	Page param.Field[int64] `query:"page"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
}

func (CardListParams) URLQuery

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

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

type CardListResponse

type CardListResponse struct {
	Data []Card `json:"data,required"`
	// Page number.
	Page int64 `json:"page,required"`
	// Total number of entries.
	TotalEntries int64 `json:"total_entries,required"`
	// Total number of pages.
	TotalPages int64 `json:"total_pages,required"`
	JSON       cardListResponseJSON
}

func (*CardListResponse) UnmarshalJSON

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

type CardNewParams

type CardNewParams struct {
	// Globally unique identifier for the account that the card will be associated
	// with. Required for programs enrolling users using the
	// [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc).
	// See [Managing Your Program](doc:managing-your-program) for more information.
	AccountToken param.Field[string] `json:"account_token" format:"uuid"`
	// For card programs with more than one BIN range. This must be configured with
	// Lithic before use. Identifies the card program/BIN range under which to create
	// the card. If omitted, will utilize the program's default `card_program_token`.
	// In Sandbox, use 00000000-0000-0000-1000-000000000000 and
	// 00000000-0000-0000-2000-000000000000 to test creating cards on specific card
	// programs.
	CardProgramToken param.Field[string] `json:"card_program_token" format:"uuid"`
	// Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided,
	// an expiration date will be generated.
	ExpMonth param.Field[string] `json:"exp_month"`
	// Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is
	// provided, an expiration date will be generated.
	ExpYear param.Field[string] `json:"exp_year"`
	// Friendly name to identify the card. We recommend against using this field to
	// store JSON data as it can cause unexpected behavior.
	Memo param.Field[string] `json:"memo"`
	// Amount (in cents) to limit approved authorizations. Transaction requests above
	// the spend limit will be declined. Note that a spend limit of 0 is effectively no
	// limit, and should only be used to reset or remove a prior limit. Only a limit of
	// 1 or above will result in declined transactions due to checks against the card
	// limit.
	SpendLimit param.Field[int64] `json:"spend_limit"`
	// Spend limit duration values:
	//
	//   - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
	//     year.
	//   - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
	//     of the card.
	//   - `MONTHLY` - Card will authorize transactions up to spend limit for the
	//     trailing month. Month is calculated as this calendar date one month prior.
	//   - `TRANSACTION` - Card will authorize multiple transactions if each individual
	//     transaction is under the spend limit.
	SpendLimitDuration param.Field[SpendLimitDuration] `json:"spend_limit_duration"`
	// Card state values:
	//
	//   - `OPEN` - Card will approve authorizations (if they match card and account
	//     parameters).
	//   - `PAUSED` - Card will decline authorizations, but can be resumed at a later
	//     time.
	State param.Field[CardNewParamsState] `json:"state"`
	// Card types:
	//
	//   - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
	//     wallet like Apple Pay or Google Pay (if the card program is digital
	//     wallet-enabled).
	//   - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
	//     branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
	//     Reach out at [lithic.com/contact](https://lithic.com/contact) for more
	//     information.
	//   - `SINGLE_USE` - Card is closed upon first successful authorization.
	//   - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
	//     successfully authorizes the card.
	Type param.Field[CardNewParamsType] `json:"type,required"`
	// Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and
	// `VIRTUAL`. See
	// [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
	Pin param.Field[string] `json:"pin"`
	// Specifies the digital card art to be displayed in the user’s digital wallet
	// after tokenization. This artwork must be approved by Mastercard and configured
	// by Lithic to use. See
	// [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).
	DigitalCardArtToken param.Field[string] `json:"digital_card_art_token" format:"uuid"`
	// Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic
	// before use. Specifies the configuration (i.e., physical card art) that the card
	// should be manufactured with.
	ProductID       param.Field[string]                      `json:"product_id"`
	ShippingAddress param.Field[shared.ShippingAddressParam] `json:"shipping_address"`
	// Shipping method for the card. Only applies to cards of type PHYSICAL. Use of
	// options besides `STANDARD` require additional permissions.
	//
	//   - `STANDARD` - USPS regular mail or similar international option, with no
	//     tracking
	//   - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
	//     with tracking
	//   - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
	//     tracking
	ShippingMethod param.Field[CardNewParamsShippingMethod] `json:"shipping_method"`
}

func (CardNewParams) MarshalJSON

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

type CardNewParamsShippingMethod

type CardNewParamsShippingMethod string
const (
	CardNewParamsShippingMethodStandard             CardNewParamsShippingMethod = "STANDARD"
	CardNewParamsShippingMethodStandardWithTracking CardNewParamsShippingMethod = "STANDARD_WITH_TRACKING"
	CardNewParamsShippingMethodExpedited            CardNewParamsShippingMethod = "EXPEDITED"
)

type CardNewParamsState

type CardNewParamsState string
const (
	CardNewParamsStateOpen   CardNewParamsState = "OPEN"
	CardNewParamsStatePaused CardNewParamsState = "PAUSED"
)

type CardNewParamsType

type CardNewParamsType string
const (
	CardNewParamsTypeVirtual        CardNewParamsType = "VIRTUAL"
	CardNewParamsTypePhysical       CardNewParamsType = "PHYSICAL"
	CardNewParamsTypeMerchantLocked CardNewParamsType = "MERCHANT_LOCKED"
	CardNewParamsTypeSingleUse      CardNewParamsType = "SINGLE_USE"
)

type CardProvisionParams

type CardProvisionParams struct {
	// Name of digital wallet provider.
	DigitalWallet param.Field[CardProvisionParamsDigitalWallet] `json:"digital_wallet"`
	// Required for `APPLE_PAY`. Base64 cryptographic nonce provided by the device's
	// wallet.
	Nonce param.Field[string] `json:"nonce" format:"byte"`
	// Required for `APPLE_PAY`. Base64 cryptographic nonce provided by the device's
	// wallet.
	NonceSignature param.Field[string] `json:"nonce_signature" format:"byte"`
	// Required for `APPLE_PAY`. Apple's public leaf certificate. Base64 encoded in PEM
	// format with headers `(-----BEGIN CERTIFICATE-----)` and trailers omitted.
	// Provided by the device's wallet.
	Certificate param.Field[string] `json:"certificate" format:"byte"`
}

func (CardProvisionParams) MarshalJSON

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

type CardProvisionParamsDigitalWallet

type CardProvisionParamsDigitalWallet string
const (
	CardProvisionParamsDigitalWalletApplePay   CardProvisionParamsDigitalWallet = "APPLE_PAY"
	CardProvisionParamsDigitalWalletGooglePay  CardProvisionParamsDigitalWallet = "GOOGLE_PAY"
	CardProvisionParamsDigitalWalletSamsungPay CardProvisionParamsDigitalWallet = "SAMSUNG_PAY"
)

type CardProvisionResponse

type CardProvisionResponse struct {
	ProvisioningPayload string `json:"provisioning_payload"`
	JSON                cardProvisionResponseJSON
}

func (*CardProvisionResponse) UnmarshalJSON

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

type CardReissueParams

type CardReissueParams struct {
	// If omitted, the previous shipping address will be used.
	ShippingAddress param.Field[shared.ShippingAddressParam] `json:"shipping_address"`
	// Shipping method for the card. Use of options besides `STANDARD` require
	// additional permissions.
	//
	//   - `STANDARD` - USPS regular mail or similar international option, with no
	//     tracking
	//   - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
	//     with tracking
	//   - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
	//     tracking
	ShippingMethod param.Field[CardReissueParamsShippingMethod] `json:"shipping_method"`
	// Specifies the configuration (e.g. physical card art) that the card should be
	// manufactured with, and only applies to cards of type `PHYSICAL`. This must be
	// configured with Lithic before use.
	ProductID param.Field[string] `json:"product_id"`
}

func (CardReissueParams) MarshalJSON

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

type CardReissueParamsShippingMethod

type CardReissueParamsShippingMethod string
const (
	CardReissueParamsShippingMethodStandard             CardReissueParamsShippingMethod = "STANDARD"
	CardReissueParamsShippingMethodStandardWithTracking CardReissueParamsShippingMethod = "STANDARD_WITH_TRACKING"
	CardReissueParamsShippingMethodExpedited            CardReissueParamsShippingMethod = "EXPEDITED"
)

type CardService

type CardService struct {
	Options []option.RequestOption
}

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

func (r *CardService) Embed(ctx context.Context, query CardEmbedParams, opts ...option.RequestOption) (res *string, err error)

Handling full card PANs and CVV codes requires that you comply with the Payment Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce their compliance obligations by leveraging our embedded card UI solution documented below.

In this setup, PANs and CVV codes are presented to the end-user via a card UI that we provide, optionally styled in the customer's branding using a specified css stylesheet. A user's browser makes the request directly to api.lithic.com, so card PANs and CVVs never touch the API customer's servers while full card data is displayed to their end-users. The response contains an HTML document. This means that the url for the request can be inserted straight into the `src` attribute of an iframe.

```html <iframe

id="card-iframe"
src="https://sandbox.lithic.com/v1/embed/card?embed_request=eyJjc3MiO...;hmac=r8tx1..."
allow="clipboard-write"
class="content"

></iframe> ```

You should compute the request payload on the server side. You can render it (or the whole iframe) on the server or make an ajax call from your front end code, but **do not ever embed your API key into front end code, as doing so introduces a serious security vulnerability**.

func (*CardService) Get

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

Get card configuration such as spend limit and state.

func (*CardService) GetEmbedHTML

func (r *CardService) GetEmbedHTML(ctx context.Context, body EmbedRequestParams, opts ...option.RequestOption) (res []byte, err error)

func (*CardService) GetEmbedURL

func (r *CardService) GetEmbedURL(ctx context.Context, body EmbedRequestParams, opts ...option.RequestOption) (res *url.URL, err error)

Handling full card PANs and CVV codes requires that you comply with the Payment Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce their compliance obligations by leveraging our embedded card UI solution documented below.

In this setup, PANs and CVV codes are presented to the end-user via a card UI that we provide, optionally styled in the customer's branding using a specified css stylesheet. A user's browser makes the request directly to api.lithic.com, so card PANs and CVVs never touch the API customer's servers while full card data is displayed to their end-users. The response contains an HTML document. This means that the url for the request can be inserted straight into the `src` attribute of an iframe.

```html <iframe

id="card-iframe"
src="https://sandbox.lithic.com/v1/embed/card?embed_request=eyJjc3MiO...;hmac=r8tx1..."
allow="clipboard-write"
class="content"

></iframe> ```

You should compute the request payload on the server side. You can render it (or the whole iframe) on the server or make an ajax call from your front end code, but **do not ever embed your API key into front end code, as doing so introduces a serious security vulnerability**.

func (*CardService) List

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

List cards.

func (*CardService) ListAutoPaging

func (r *CardService) ListAutoPaging(ctx context.Context, query CardListParams, opts ...option.RequestOption) *shared.PageAutoPager[Card]

List cards.

func (*CardService) New

func (r *CardService) New(ctx context.Context, body CardNewParams, opts ...option.RequestOption) (res *Card, err error)

Create a new virtual or physical card. Parameters `pin`, `shipping_address`, and `product_id` only apply to physical cards.

func (*CardService) Provision

func (r *CardService) Provision(ctx context.Context, card_token string, body CardProvisionParams, opts ...option.RequestOption) (res *CardProvisionResponse, err error)

Allow your cardholders to directly add payment cards to the device's digital wallet (e.g. Apple Pay) with one touch from your app.

This requires some additional setup and configuration. Please [Contact Us](https://lithic.com/contact) or your Customer Success representative for more information.

func (*CardService) Reissue

func (r *CardService) Reissue(ctx context.Context, card_token string, body CardReissueParams, opts ...option.RequestOption) (res *Card, err error)

Initiate print and shipment of a duplicate physical card.

Only applies to cards of type `PHYSICAL`.

func (*CardService) Update

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

Update the specified properties of the card. Unsupplied properties will remain unchanged. `pin` parameter only applies to physical cards.

_Note: setting a card to a `CLOSED` state is a final action that cannot be undone._

type CardState

type CardState string
const (
	CardStateClosed             CardState = "CLOSED"
	CardStateOpen               CardState = "OPEN"
	CardStatePaused             CardState = "PAUSED"
	CardStatePendingActivation  CardState = "PENDING_ACTIVATION"
	CardStatePendingFulfillment CardState = "PENDING_FULFILLMENT"
)

type CardType

type CardType string
const (
	CardTypeVirtual        CardType = "VIRTUAL"
	CardTypePhysical       CardType = "PHYSICAL"
	CardTypeMerchantLocked CardType = "MERCHANT_LOCKED"
	CardTypeSingleUse      CardType = "SINGLE_USE"
)

type CardUpdateParams

type CardUpdateParams struct {
	// Friendly name to identify the card. We recommend against using this field to
	// store JSON data as it can cause unexpected behavior.
	Memo param.Field[string] `json:"memo"`
	// Amount (in cents) to limit approved authorizations. Transaction requests above
	// the spend limit will be declined. Note that a spend limit of 0 is effectively no
	// limit, and should only be used to reset or remove a prior limit. Only a limit of
	// 1 or above will result in declined transactions due to checks against the card
	// limit.
	SpendLimit param.Field[int64] `json:"spend_limit"`
	// Spend limit duration values:
	//
	//   - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
	//     year.
	//   - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
	//     of the card.
	//   - `MONTHLY` - Card will authorize transactions up to spend limit for the
	//     trailing month. Month is calculated as this calendar date one month prior.
	//   - `TRANSACTION` - Card will authorize multiple transactions if each individual
	//     transaction is under the spend limit.
	SpendLimitDuration param.Field[SpendLimitDuration] `json:"spend_limit_duration"`
	// Identifier for any Auth Rules that will be applied to transactions taking place
	// with the card.
	AuthRuleToken param.Field[string] `json:"auth_rule_token"`
	// Card state values:
	//
	//   - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
	//     be undone.
	//   - `OPEN` - Card will approve authorizations (if they match card and account
	//     parameters).
	//   - `PAUSED` - Card will decline authorizations, but can be resumed at a later
	//     time.
	State param.Field[CardUpdateParamsState] `json:"state"`
	// Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and
	// `VIRTUAL`. See
	// [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
	Pin param.Field[string] `json:"pin"`
	// Specifies the digital card art to be displayed in the user’s digital wallet
	// after tokenization. This artwork must be approved by Mastercard and configured
	// by Lithic to use. See
	// [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).
	DigitalCardArtToken param.Field[string] `json:"digital_card_art_token" format:"uuid"`
}

func (CardUpdateParams) MarshalJSON

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

type CardUpdateParamsState

type CardUpdateParamsState string
const (
	CardUpdateParamsStateClosed CardUpdateParamsState = "CLOSED"
	CardUpdateParamsStateOpen   CardUpdateParamsState = "OPEN"
	CardUpdateParamsStatePaused CardUpdateParamsState = "PAUSED"
)

type Client

type Client struct {
	Options                 []option.RequestOption
	Accounts                *AccountService
	AccountHolders          *AccountHolderService
	AuthRules               *AuthRuleService
	AuthStreamEnrollment    *AuthStreamEnrollmentService
	TokenizationDecisioning *TokenizationDecisioningService
	Cards                   *CardService
	Balances                *BalanceService
	AggregateBalances       *AggregateBalanceService
	Disputes                *DisputeService
	Events                  *EventService
	Transfers               *TransferService
	FinancialAccounts       *FinancialAccountService
	Transactions            *TransactionService
	ResponderEndpoints      *ResponderEndpointService
	Webhooks                *WebhookService
}

Client creates a struct with services and top level methods that help with interacting with the lithic 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 (`LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET`). 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) APIStatus

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

API status check

type Dispute

type Dispute struct {
	// Amount under dispute. May be different from the original transaction amount.
	Amount int64 `json:"amount,required"`
	// Date dispute entered arbitration.
	ArbitrationDate time.Time `json:"arbitration_date,required" format:"date-time"`
	// Timestamp of when first Dispute was reported.
	Created time.Time `json:"created,required" format:"date-time"`
	// Date that the dispute was filed by the customer making the dispute.
	CustomerFiledDate time.Time `json:"customer_filed_date,required" format:"date-time"`
	// End customer description of the reason for the dispute.
	CustomerNote string `json:"customer_note,required"`
	// Unique identifiers for the dispute from the network.
	NetworkClaimIDs []string `json:"network_claim_ids,required"`
	// Unique identifier for the dispute from the network. If there are multiple, this
	// will be the first claim id set by the network
	PrimaryClaimID string `json:"primary_claim_id,required"`
	// Date that the dispute was submitted to the network.
	NetworkFiledDate time.Time `json:"network_filed_date,required" format:"date-time"`
	// Network reason code used to file the dispute.
	NetworkReasonCode string `json:"network_reason_code,required"`
	// Date dispute entered pre-arbitration.
	PrearbitrationDate time.Time `json:"prearbitration_date,required" format:"date-time"`
	// Dispute reason:
	//
	//   - `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
	//   - `CANCELLED`: Transaction was cancelled by the customer.
	//   - `DUPLICATED`: The transaction was a duplicate.
	//   - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
	//   - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
	//   - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable
	//     merchant activity.
	//   - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as
	//     described.
	//   - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
	//   - `INCORRECT_AMOUNT`: The transaction amount was incorrect.
	//   - `MISSING_AUTH`: The transaction was missing authorization.
	//   - `OTHER`: Other reason.
	//   - `PROCESSING_ERROR`: Processing error.
	//   - `REFUND_NOT_PROCESSED`: The refund was not processed.
	//   - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not
	//     cancelled.
	Reason DisputeReason `json:"reason,required"`
	// Date the representment was received.
	RepresentmentDate time.Time `json:"representment_date,required" format:"date-time"`
	// Resolution amount net of network fees.
	ResolutionAmount int64 `json:"resolution_amount,required"`
	// Date that the dispute was resolved.
	ResolutionDate time.Time `json:"resolution_date,required" format:"date-time"`
	// Note by Dispute team on the case resolution.
	ResolutionNote string `json:"resolution_note,required"`
	// Reason for the dispute resolution:
	//
	// - `CASE_LOST`: This case was lost at final arbitration.
	// - `NETWORK_REJECTED`: Network rejected.
	// - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
	// - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
	// - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
	// - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
	// - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
	// - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
	// - `PAST_FILING_DATE`: Past filing date.
	// - `PREARBITRATION_REJECTED`: Prearbitration rejected.
	// - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
	// - `REFUNDED`: Refunded.
	// - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
	// - `WITHDRAWN`: Withdrawn.
	// - `WON_ARBITRATION`: Won arbitration.
	// - `WON_FIRST_CHARGEBACK`: Won first chargeback.
	// - `WON_PREARBITRATION`: Won prearbitration.
	ResolutionReason DisputeResolutionReason `json:"resolution_reason,required"`
	// Status types:
	//
	//   - `NEW` - New dispute case is opened.
	//   - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more
	//     information.
	//   - `SUBMITTED` - Dispute is submitted to the card network.
	//   - `REPRESENTMENT` - Case has entered second presentment.
	//   - `PREARBITRATION` - Case has entered prearbitration.
	//   - `ARBITRATION` - Case has entered arbitration.
	//   - `CASE_WON` - Case was won and credit will be issued.
	//   - `CASE_CLOSED` - Case was lost or withdrawn.
	Status DisputeStatus `json:"status,required"`
	// Globally unique identifier.
	Token string `json:"token,required" format:"uuid"`
	// The transaction that is being disputed. A transaction can only be disputed once
	// but may have multiple dispute cases.
	TransactionToken string `json:"transaction_token,required" format:"uuid"`
	JSON             disputeJSON
}

Dispute.

func (*Dispute) UnmarshalJSON

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

type DisputeEvidence

type DisputeEvidence struct {
	// Timestamp of when dispute evidence was created.
	Created time.Time `json:"created,required" format:"date-time"`
	// Dispute token evidence is attached to.
	DisputeToken string `json:"dispute_token,required" format:"uuid"`
	// URL to download evidence. Only shown when `upload_status` is `UPLOADED`.
	DownloadURL string `json:"download_url"`
	// Globally unique identifier.
	Token string `json:"token,required" format:"uuid"`
	// Upload status types:
	//
	// - `DELETED` - Evidence was deleted.
	// - `ERROR` - Evidence upload failed.
	// - `PENDING` - Evidence is pending upload.
	// - `REJECTED` - Evidence was rejected.
	// - `UPLOADED` - Evidence was uploaded.
	UploadStatus DisputeEvidenceUploadStatus `json:"upload_status,required"`
	// URL to upload evidence. Only shown when `upload_status` is `PENDING`.
	UploadURL string `json:"upload_url"`
	JSON      disputeEvidenceJSON
}

Dispute evidence.

func (*DisputeEvidence) UnmarshalJSON

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

type DisputeEvidenceUploadStatus

type DisputeEvidenceUploadStatus string
const (
	DisputeEvidenceUploadStatusDeleted  DisputeEvidenceUploadStatus = "DELETED"
	DisputeEvidenceUploadStatusError    DisputeEvidenceUploadStatus = "ERROR"
	DisputeEvidenceUploadStatusPending  DisputeEvidenceUploadStatus = "PENDING"
	DisputeEvidenceUploadStatusRejected DisputeEvidenceUploadStatus = "REJECTED"
	DisputeEvidenceUploadStatusUploaded DisputeEvidenceUploadStatus = "UPLOADED"
)

type DisputeListEvidencesParams

type DisputeListEvidencesParams struct {
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// A cursor representing an item's token after which a page of results should
	// begin. Used to retrieve the next page of results after this item.
	StartingAfter param.Field[string] `query:"starting_after"`
	// A cursor representing an item's token before which a page of results should end.
	// Used to retrieve the previous page of results before this item.
	EndingBefore param.Field[string] `query:"ending_before"`
}

func (DisputeListEvidencesParams) URLQuery

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

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

type DisputeListEvidencesResponse

type DisputeListEvidencesResponse struct {
	Data []DisputeEvidence `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    disputeListEvidencesResponseJSON
}

func (*DisputeListEvidencesResponse) UnmarshalJSON

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

type DisputeListParams

type DisputeListParams struct {
	// List disputes of a given transaction token.
	TransactionToken param.Field[string] `query:"transaction_token" format:"uuid"`
	// List disputes of a specific status.
	Status param.Field[DisputeListParamsStatus] `query:"status"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// A cursor representing an item's token after which a page of results should
	// begin. Used to retrieve the next page of results after this item.
	StartingAfter param.Field[string] `query:"starting_after"`
	// A cursor representing an item's token before which a page of results should end.
	// Used to retrieve the previous page of results before this item.
	EndingBefore param.Field[string] `query:"ending_before"`
}

func (DisputeListParams) URLQuery

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

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

type DisputeListParamsStatus

type DisputeListParamsStatus string
const (
	DisputeListParamsStatusNew             DisputeListParamsStatus = "NEW"
	DisputeListParamsStatusPendingCustomer DisputeListParamsStatus = "PENDING_CUSTOMER"
	DisputeListParamsStatusSubmitted       DisputeListParamsStatus = "SUBMITTED"
	DisputeListParamsStatusRepresentment   DisputeListParamsStatus = "REPRESENTMENT"
	DisputeListParamsStatusPrearbitration  DisputeListParamsStatus = "PREARBITRATION"
	DisputeListParamsStatusArbitration     DisputeListParamsStatus = "ARBITRATION"
	DisputeListParamsStatusCaseWon         DisputeListParamsStatus = "CASE_WON"
	DisputeListParamsStatusCaseClosed      DisputeListParamsStatus = "CASE_CLOSED"
)

type DisputeListResponse

type DisputeListResponse struct {
	Data []Dispute `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    disputeListResponseJSON
}

func (*DisputeListResponse) UnmarshalJSON

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

type DisputeNewParams

type DisputeNewParams struct {
	// Amount to dispute
	Amount param.Field[int64] `json:"amount,required"`
	// Date the customer filed the dispute
	CustomerFiledDate param.Field[time.Time] `json:"customer_filed_date" format:"date-time"`
	// Reason for dispute
	Reason param.Field[DisputeNewParamsReason] `json:"reason,required"`
	// Transaction to dispute
	TransactionToken param.Field[string] `json:"transaction_token,required" format:"uuid"`
	// Customer description of dispute
	CustomerNote param.Field[string] `json:"customer_note"`
}

func (DisputeNewParams) MarshalJSON

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

type DisputeNewParamsReason

type DisputeNewParamsReason string
const (
	DisputeNewParamsReasonAtmCashMisdispense               DisputeNewParamsReason = "ATM_CASH_MISDISPENSE"
	DisputeNewParamsReasonCancelled                        DisputeNewParamsReason = "CANCELLED"
	DisputeNewParamsReasonDuplicated                       DisputeNewParamsReason = "DUPLICATED"
	DisputeNewParamsReasonFraudCardNotPresent              DisputeNewParamsReason = "FRAUD_CARD_NOT_PRESENT"
	DisputeNewParamsReasonFraudCardPresent                 DisputeNewParamsReason = "FRAUD_CARD_PRESENT"
	DisputeNewParamsReasonFraudOther                       DisputeNewParamsReason = "FRAUD_OTHER"
	DisputeNewParamsReasonGoodsServicesNotAsDescribed      DisputeNewParamsReason = "GOODS_SERVICES_NOT_AS_DESCRIBED"
	DisputeNewParamsReasonGoodsServicesNotReceived         DisputeNewParamsReason = "GOODS_SERVICES_NOT_RECEIVED"
	DisputeNewParamsReasonIncorrectAmount                  DisputeNewParamsReason = "INCORRECT_AMOUNT"
	DisputeNewParamsReasonMissingAuth                      DisputeNewParamsReason = "MISSING_AUTH"
	DisputeNewParamsReasonOther                            DisputeNewParamsReason = "OTHER"
	DisputeNewParamsReasonProcessingError                  DisputeNewParamsReason = "PROCESSING_ERROR"
	DisputeNewParamsReasonRefundNotProcessed               DisputeNewParamsReason = "REFUND_NOT_PROCESSED"
	DisputeNewParamsReasonRecurringTransactionNotCancelled DisputeNewParamsReason = "RECURRING_TRANSACTION_NOT_CANCELLED"
)

type DisputeReason

type DisputeReason string
const (
	DisputeReasonAtmCashMisdispense               DisputeReason = "ATM_CASH_MISDISPENSE"
	DisputeReasonCancelled                        DisputeReason = "CANCELLED"
	DisputeReasonDuplicated                       DisputeReason = "DUPLICATED"
	DisputeReasonFraudCardNotPresent              DisputeReason = "FRAUD_CARD_NOT_PRESENT"
	DisputeReasonFraudCardPresent                 DisputeReason = "FRAUD_CARD_PRESENT"
	DisputeReasonFraudOther                       DisputeReason = "FRAUD_OTHER"
	DisputeReasonGoodsServicesNotAsDescribed      DisputeReason = "GOODS_SERVICES_NOT_AS_DESCRIBED"
	DisputeReasonGoodsServicesNotReceived         DisputeReason = "GOODS_SERVICES_NOT_RECEIVED"
	DisputeReasonIncorrectAmount                  DisputeReason = "INCORRECT_AMOUNT"
	DisputeReasonMissingAuth                      DisputeReason = "MISSING_AUTH"
	DisputeReasonOther                            DisputeReason = "OTHER"
	DisputeReasonProcessingError                  DisputeReason = "PROCESSING_ERROR"
	DisputeReasonRefundNotProcessed               DisputeReason = "REFUND_NOT_PROCESSED"
	DisputeReasonRecurringTransactionNotCancelled DisputeReason = "RECURRING_TRANSACTION_NOT_CANCELLED"
)

type DisputeResolutionReason

type DisputeResolutionReason string
const (
	DisputeResolutionReasonCaseLost                      DisputeResolutionReason = "CASE_LOST"
	DisputeResolutionReasonNetworkRejected               DisputeResolutionReason = "NETWORK_REJECTED"
	DisputeResolutionReasonNoDisputeRights3DS            DisputeResolutionReason = "NO_DISPUTE_RIGHTS_3DS"
	DisputeResolutionReasonNoDisputeRightsBelowThreshold DisputeResolutionReason = "NO_DISPUTE_RIGHTS_BELOW_THRESHOLD"
	DisputeResolutionReasonNoDisputeRightsContactless    DisputeResolutionReason = "NO_DISPUTE_RIGHTS_CONTACTLESS"
	DisputeResolutionReasonNoDisputeRightsHybrid         DisputeResolutionReason = "NO_DISPUTE_RIGHTS_HYBRID"
	DisputeResolutionReasonNoDisputeRightsMaxChargebacks DisputeResolutionReason = "NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS"
	DisputeResolutionReasonNoDisputeRightsOther          DisputeResolutionReason = "NO_DISPUTE_RIGHTS_OTHER"
	DisputeResolutionReasonPastFilingDate                DisputeResolutionReason = "PAST_FILING_DATE"
	DisputeResolutionReasonPrearbitrationRejected        DisputeResolutionReason = "PREARBITRATION_REJECTED"
	DisputeResolutionReasonProcessorRejectedOther        DisputeResolutionReason = "PROCESSOR_REJECTED_OTHER"
	DisputeResolutionReasonRefunded                      DisputeResolutionReason = "REFUNDED"
	DisputeResolutionReasonRefundedAfterChargeback       DisputeResolutionReason = "REFUNDED_AFTER_CHARGEBACK"
	DisputeResolutionReasonWithdrawn                     DisputeResolutionReason = "WITHDRAWN"
	DisputeResolutionReasonWonArbitration                DisputeResolutionReason = "WON_ARBITRATION"
	DisputeResolutionReasonWonFirstChargeback            DisputeResolutionReason = "WON_FIRST_CHARGEBACK"
	DisputeResolutionReasonWonPrearbitration             DisputeResolutionReason = "WON_PREARBITRATION"
)

type DisputeService

type DisputeService struct {
	Options []option.RequestOption
}

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

func (r *DisputeService) Delete(ctx context.Context, dispute_token string, opts ...option.RequestOption) (res *Dispute, err error)

Withdraw dispute.

func (*DisputeService) DeleteEvidence

func (r *DisputeService) DeleteEvidence(ctx context.Context, dispute_token string, evidence_token string, opts ...option.RequestOption) (res *DisputeEvidence, err error)

Soft delete evidence for a dispute. Evidence will not be reviewed or submitted by Lithic after it is withdrawn.

func (*DisputeService) Get

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

Get dispute.

func (*DisputeService) GetEvidence

func (r *DisputeService) GetEvidence(ctx context.Context, dispute_token string, evidence_token string, opts ...option.RequestOption) (res *DisputeEvidence, err error)

Get a dispute's evidence metadata.

func (*DisputeService) InitiateEvidenceUpload

func (r *DisputeService) InitiateEvidenceUpload(ctx context.Context, dispute_token string, opts ...option.RequestOption) (res *DisputeEvidence, err error)

Use this endpoint to upload evidences for the dispute. It will return a URL to upload your documents to. The URL will expire in 30 minutes.

Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be less than 5 GiB.

func (*DisputeService) List

List disputes.

func (*DisputeService) ListAutoPaging

List disputes.

func (*DisputeService) ListEvidences

func (r *DisputeService) ListEvidences(ctx context.Context, dispute_token string, query DisputeListEvidencesParams, opts ...option.RequestOption) (res *shared.CursorPage[DisputeEvidence], err error)

List evidence metadata for a dispute.

func (*DisputeService) ListEvidencesAutoPaging

func (r *DisputeService) ListEvidencesAutoPaging(ctx context.Context, dispute_token string, query DisputeListEvidencesParams, opts ...option.RequestOption) *shared.CursorPageAutoPager[DisputeEvidence]

List evidence metadata for a dispute.

func (*DisputeService) New

func (r *DisputeService) New(ctx context.Context, body DisputeNewParams, opts ...option.RequestOption) (res *Dispute, err error)

Initiate a dispute.

func (*DisputeService) Update

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

Update dispute. Can only be modified if status is `NEW`.

func (*DisputeService) UploadEvidence

func (r *DisputeService) UploadEvidence(ctx context.Context, disputeToken string, file io.Reader, opts ...option.RequestOption) (err error)

type DisputeStatus

type DisputeStatus string
const (
	DisputeStatusNew             DisputeStatus = "NEW"
	DisputeStatusPendingCustomer DisputeStatus = "PENDING_CUSTOMER"
	DisputeStatusSubmitted       DisputeStatus = "SUBMITTED"
	DisputeStatusRepresentment   DisputeStatus = "REPRESENTMENT"
	DisputeStatusPrearbitration  DisputeStatus = "PREARBITRATION"
	DisputeStatusArbitration     DisputeStatus = "ARBITRATION"
	DisputeStatusCaseWon         DisputeStatus = "CASE_WON"
	DisputeStatusCaseClosed      DisputeStatus = "CASE_CLOSED"
)

type DisputeUpdateParams

type DisputeUpdateParams struct {
	// Amount to dispute
	Amount param.Field[int64] `json:"amount"`
	// Date the customer filed the dispute
	CustomerFiledDate param.Field[time.Time] `json:"customer_filed_date" format:"date-time"`
	// Customer description of dispute
	CustomerNote param.Field[string] `json:"customer_note"`
	// Reason for dispute
	Reason param.Field[DisputeUpdateParamsReason] `json:"reason"`
}

func (DisputeUpdateParams) MarshalJSON

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

type DisputeUpdateParamsReason

type DisputeUpdateParamsReason string
const (
	DisputeUpdateParamsReasonAtmCashMisdispense               DisputeUpdateParamsReason = "ATM_CASH_MISDISPENSE"
	DisputeUpdateParamsReasonCancelled                        DisputeUpdateParamsReason = "CANCELLED"
	DisputeUpdateParamsReasonDuplicated                       DisputeUpdateParamsReason = "DUPLICATED"
	DisputeUpdateParamsReasonFraudCardNotPresent              DisputeUpdateParamsReason = "FRAUD_CARD_NOT_PRESENT"
	DisputeUpdateParamsReasonFraudCardPresent                 DisputeUpdateParamsReason = "FRAUD_CARD_PRESENT"
	DisputeUpdateParamsReasonFraudOther                       DisputeUpdateParamsReason = "FRAUD_OTHER"
	DisputeUpdateParamsReasonGoodsServicesNotAsDescribed      DisputeUpdateParamsReason = "GOODS_SERVICES_NOT_AS_DESCRIBED"
	DisputeUpdateParamsReasonGoodsServicesNotReceived         DisputeUpdateParamsReason = "GOODS_SERVICES_NOT_RECEIVED"
	DisputeUpdateParamsReasonIncorrectAmount                  DisputeUpdateParamsReason = "INCORRECT_AMOUNT"
	DisputeUpdateParamsReasonMissingAuth                      DisputeUpdateParamsReason = "MISSING_AUTH"
	DisputeUpdateParamsReasonOther                            DisputeUpdateParamsReason = "OTHER"
	DisputeUpdateParamsReasonProcessingError                  DisputeUpdateParamsReason = "PROCESSING_ERROR"
	DisputeUpdateParamsReasonRefundNotProcessed               DisputeUpdateParamsReason = "REFUND_NOT_PROCESSED"
	DisputeUpdateParamsReasonRecurringTransactionNotCancelled DisputeUpdateParamsReason = "RECURRING_TRANSACTION_NOT_CANCELLED"
)

type EmbedRequestParams

type EmbedRequestParams struct {
	// A publicly available URI, so the white-labeled card element can be styled with
	// the client's branding.
	Css param.Field[string] `json:"css"`
	// An RFC 3339 timestamp for when the request should expire. UTC time zone.
	//
	// If no timezone is specified, UTC will be used. If payload does not contain an
	// expiration, the request will never expire.
	//
	// Using an `expiration` reduces the risk of a
	// [replay attack](https://en.wikipedia.org/wiki/Replay_attack). Without supplying
	// the `expiration`, in the event that a malicious user gets a copy of your request
	// in transit, they will be able to obtain the response data indefinitely.
	Expiration param.Field[time.Time] `json:"expiration" format:"date-time"`
	// Globally unique identifier for the card to be displayed.
	Token param.Field[string] `json:"token,required" format:"uuid"`
	// Required if you want to post the element clicked to the parent iframe.
	//
	// If you supply this param, you can also capture click events in the parent iframe
	// by adding an event listener.
	TargetOrigin param.Field[string] `json:"target_origin"`
}

func (EmbedRequestParams) MarshalJSON

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

type Error

type Error = apierror.Error

type Event

type Event struct {
	// Globally unique identifier.
	Token string `json:"token,required"`
	// Event types:
	//
	//   - `dispute.updated` - A dispute has been updated.
	//   - `digital_wallet.tokenization_approval_request` - Card network's request to
	//     Lithic to activate a digital wallet token.
	EventType EventEventType         `json:"event_type,required"`
	Payload   map[string]interface{} `json:"payload,required"`
	// An RFC 3339 timestamp for when the event was created. UTC time zone.
	//
	// If no timezone is specified, UTC will be used.
	Created time.Time `json:"created,required" format:"date-time"`
	JSON    eventJSON
}

A single event that affects the transaction state and lifecycle.

func (*Event) UnmarshalJSON

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

type EventEventType

type EventEventType string
const (
	EventEventTypeDisputeUpdated                           EventEventType = "dispute.updated"
	EventEventTypeDigitalWalletTokenizationApprovalRequest EventEventType = "digital_wallet.tokenization_approval_request"
)

type EventListParams

type EventListParams struct {
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
	// A cursor representing an item's token after which a page of results should
	// begin. Used to retrieve the next page of results after this item.
	StartingAfter param.Field[string] `query:"starting_after"`
	// A cursor representing an item's token before which a page of results should end.
	// Used to retrieve the previous page of results before this item.
	EndingBefore param.Field[string]                      `query:"ending_before"`
	EventTypes   param.Field[[]EventListParamsEventTypes] `query:"event_types"`
}

func (EventListParams) URLQuery

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

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

type EventListParamsEventTypes

type EventListParamsEventTypes string
const (
	EventListParamsEventTypesDisputeUpdated                           EventListParamsEventTypes = "dispute.updated"
	EventListParamsEventTypesDigitalWalletTokenizationApprovalRequest EventListParamsEventTypes = "digital_wallet.tokenization_approval_request"
)

type EventListResponse

type EventListResponse struct {
	Data    []Event `json:"data,required"`
	HasMore bool    `json:"has_more,required"`
	JSON    eventListResponseJSON
}

func (*EventListResponse) UnmarshalJSON

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

type EventService

type EventService struct {
	Options       []option.RequestOption
	Subscriptions *EventSubscriptionService
}

EventService contains methods and other services that help with interacting with the lithic API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventService method instead.

func NewEventService

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

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

func (*EventService) Get

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

Get an event.

func (*EventService) List

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

List all events.

func (*EventService) ListAutoPaging

List all events.

type EventSubscription

type EventSubscription struct {
	// A description of the subscription.
	Description string `json:"description,required"`
	// Whether the subscription is disabled.
	Disabled   bool                          `json:"disabled,required"`
	EventTypes []EventSubscriptionEventTypes `json:"event_types,required,nullable"`
	URL        string                        `json:"url,required" format:"uri"`
	// Globally unique identifier.
	Token string `json:"token,required"`
	JSON  eventSubscriptionJSON
}

A subscription to specific event types.

func (*EventSubscription) UnmarshalJSON

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

type EventSubscriptionEventTypes

type EventSubscriptionEventTypes string
const (
	EventSubscriptionEventTypesDisputeUpdated                           EventSubscriptionEventTypes = "dispute.updated"
	EventSubscriptionEventTypesDigitalWalletTokenizationApprovalRequest EventSubscriptionEventTypes = "digital_wallet.tokenization_approval_request"
)

type EventSubscriptionListParams

type EventSubscriptionListParams struct {
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
	// A cursor representing an item's token after which a page of results should
	// begin. Used to retrieve the next page of results after this item.
	StartingAfter param.Field[string] `query:"starting_after"`
	// A cursor representing an item's token before which a page of results should end.
	// Used to retrieve the previous page of results before this item.
	EndingBefore param.Field[string] `query:"ending_before"`
}

func (EventSubscriptionListParams) URLQuery

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

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

type EventSubscriptionListResponse

type EventSubscriptionListResponse struct {
	Data    []EventSubscription `json:"data,required"`
	HasMore bool                `json:"has_more,required"`
	JSON    eventSubscriptionListResponseJSON
}

func (*EventSubscriptionListResponse) UnmarshalJSON

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

type EventSubscriptionNewParams

type EventSubscriptionNewParams struct {
	// Event subscription description.
	Description param.Field[string] `json:"description"`
	// Whether the event subscription is active (false) or inactive (true).
	Disabled param.Field[bool] `json:"disabled"`
	// Indicates types of events that will be sent to this subscription. If left blank,
	// all types will be sent.
	EventTypes param.Field[[]EventSubscriptionNewParamsEventTypes] `json:"event_types"`
	// URL to which event webhooks will be sent. URL must be a valid HTTPS address.
	URL param.Field[string] `json:"url,required" format:"uri"`
}

func (EventSubscriptionNewParams) MarshalJSON

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

type EventSubscriptionNewParamsEventTypes

type EventSubscriptionNewParamsEventTypes string
const (
	EventSubscriptionNewParamsEventTypesDisputeUpdated                           EventSubscriptionNewParamsEventTypes = "dispute.updated"
	EventSubscriptionNewParamsEventTypesDigitalWalletTokenizationApprovalRequest EventSubscriptionNewParamsEventTypes = "digital_wallet.tokenization_approval_request"
)

type EventSubscriptionRecoverParams

type EventSubscriptionRecoverParams struct {
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
}

func (EventSubscriptionRecoverParams) URLQuery

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

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

type EventSubscriptionReplayMissingParams

type EventSubscriptionReplayMissingParams struct {
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
}

func (EventSubscriptionReplayMissingParams) URLQuery

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

type EventSubscriptionService

type EventSubscriptionService struct {
	Options []option.RequestOption
}

EventSubscriptionService contains methods and other services that help with interacting with the lithic 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 NewEventSubscriptionService method instead.

func NewEventSubscriptionService

func NewEventSubscriptionService(opts ...option.RequestOption) (r *EventSubscriptionService)

NewEventSubscriptionService 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 (*EventSubscriptionService) Delete

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

Delete an event subscription.

func (*EventSubscriptionService) Get

func (r *EventSubscriptionService) Get(ctx context.Context, event_subscription_token string, opts ...option.RequestOption) (res *EventSubscription, err error)

Get an event subscription.

func (*EventSubscriptionService) GetSecret

func (r *EventSubscriptionService) GetSecret(ctx context.Context, event_subscription_token string, opts ...option.RequestOption) (res *SubscriptionRetrieveSecretResponse, err error)

Get the secret for an event subscription.

func (*EventSubscriptionService) List

List all the event subscriptions.

func (*EventSubscriptionService) ListAutoPaging

List all the event subscriptions.

func (*EventSubscriptionService) New

Create a new event subscription.

func (*EventSubscriptionService) Recover

func (r *EventSubscriptionService) Recover(ctx context.Context, event_subscription_token string, query EventSubscriptionRecoverParams, opts ...option.RequestOption) (err error)

Resend all failed messages since a given time.

func (*EventSubscriptionService) ReplayMissing

func (r *EventSubscriptionService) ReplayMissing(ctx context.Context, event_subscription_token string, query EventSubscriptionReplayMissingParams, opts ...option.RequestOption) (err error)

Replays messages to the endpoint. Only messages that were created after `begin` will be sent. Messages that were previously sent to the endpoint are not resent.

func (*EventSubscriptionService) RotateSecret

func (r *EventSubscriptionService) RotateSecret(ctx context.Context, event_subscription_token string, opts ...option.RequestOption) (err error)

Rotate the secret for an event subscription. The previous secret will be valid for the next 24 hours.

func (*EventSubscriptionService) Update

func (r *EventSubscriptionService) Update(ctx context.Context, event_subscription_token string, body EventSubscriptionUpdateParams, opts ...option.RequestOption) (res *EventSubscription, err error)

Update an event subscription.

type EventSubscriptionUpdateParams

type EventSubscriptionUpdateParams struct {
	// Event subscription description.
	Description param.Field[string] `json:"description"`
	// Whether the event subscription is active (false) or inactive (true).
	Disabled param.Field[bool] `json:"disabled"`
	// Indicates types of events that will be sent to this subscription. If left blank,
	// all types will be sent.
	EventTypes param.Field[[]EventSubscriptionUpdateParamsEventTypes] `json:"event_types"`
	// URL to which event webhooks will be sent. URL must be a valid HTTPS address.
	URL param.Field[string] `json:"url,required" format:"uri"`
}

func (EventSubscriptionUpdateParams) MarshalJSON

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

type EventSubscriptionUpdateParamsEventTypes

type EventSubscriptionUpdateParamsEventTypes string
const (
	EventSubscriptionUpdateParamsEventTypesDisputeUpdated                           EventSubscriptionUpdateParamsEventTypes = "dispute.updated"
	EventSubscriptionUpdateParamsEventTypesDigitalWalletTokenizationApprovalRequest EventSubscriptionUpdateParamsEventTypes = "digital_wallet.tokenization_approval_request"
)

type FinancialAccount

type FinancialAccount struct {
	// Account number for your Lithic-assigned bank account number, if applicable.
	AccountNumber string `json:"account_number"`
	// Date and time for when the financial account was first created.
	Created time.Time `json:"created,required" format:"date-time"`
	// Routing number for your Lithic-assigned bank account number, if applicable.
	RoutingNumber string `json:"routing_number"`
	// Globally unique identifier for the financial account.
	Token string `json:"token,required" format:"uuid"`
	// Type of financial account
	Type FinancialAccountType `json:"type,required"`
	// Date and time for when the financial account was last updated.
	Updated time.Time `json:"updated,required" format:"date-time"`
	JSON    financialAccountJSON
}

Financial Account

func (*FinancialAccount) UnmarshalJSON

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

type FinancialAccountBalanceListParams

type FinancialAccountBalanceListParams struct {
	// UTC date of the balance to retrieve. Defaults to latest available balance
	BalanceDate param.Field[time.Time] `query:"balance_date" format:"date-time"`
	// Balance after a given financial event occured. For example, passing the
	// event_token of a $5 CARD_CLEARING financial event will return a balance
	// decreased by $5
	LastTransactionEventToken param.Field[string] `query:"last_transaction_event_token" format:"uuid"`
}

func (FinancialAccountBalanceListParams) URLQuery

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

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

type FinancialAccountBalanceListResponse

type FinancialAccountBalanceListResponse struct {
	Data []Balance `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    financialAccountBalanceListResponseJSON
}

func (*FinancialAccountBalanceListResponse) UnmarshalJSON

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

type FinancialAccountBalanceService

type FinancialAccountBalanceService struct {
	Options []option.RequestOption
}

FinancialAccountBalanceService contains methods and other services that help with interacting with the lithic 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 NewFinancialAccountBalanceService method instead.

func NewFinancialAccountBalanceService

func NewFinancialAccountBalanceService(opts ...option.RequestOption) (r *FinancialAccountBalanceService)

NewFinancialAccountBalanceService 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 (*FinancialAccountBalanceService) List

Get the balances for a given financial account.

func (*FinancialAccountBalanceService) ListAutoPaging

Get the balances for a given financial account.

type FinancialAccountFinancialTransactionService

type FinancialAccountFinancialTransactionService struct {
	Options []option.RequestOption
}

FinancialAccountFinancialTransactionService contains methods and other services that help with interacting with the lithic 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 NewFinancialAccountFinancialTransactionService method instead.

func NewFinancialAccountFinancialTransactionService

func NewFinancialAccountFinancialTransactionService(opts ...option.RequestOption) (r *FinancialAccountFinancialTransactionService)

NewFinancialAccountFinancialTransactionService 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 (*FinancialAccountFinancialTransactionService) Get

func (r *FinancialAccountFinancialTransactionService) Get(ctx context.Context, financial_account_token string, financial_transaction_token string, opts ...option.RequestOption) (res *FinancialTransaction, err error)

Get the financial transaction for the provided token.

func (*FinancialAccountFinancialTransactionService) List

List the financial transactions for a given financial account.

func (*FinancialAccountFinancialTransactionService) ListAutoPaging

List the financial transactions for a given financial account.

type FinancialAccountListParams

type FinancialAccountListParams struct {
	// List financial accounts for a given account_token
	AccountToken param.Field[string] `query:"account_token" format:"uuid"`
	// List financial accounts of a given type
	Type param.Field[FinancialAccountListParamsType] `query:"type"`
}

func (FinancialAccountListParams) URLQuery

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

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

type FinancialAccountListParamsType

type FinancialAccountListParamsType string
const (
	FinancialAccountListParamsTypeIssuing FinancialAccountListParamsType = "ISSUING"
	FinancialAccountListParamsTypeReserve FinancialAccountListParamsType = "RESERVE"
)

type FinancialAccountListResponse

type FinancialAccountListResponse struct {
	Data []FinancialAccount `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    financialAccountListResponseJSON
}

func (*FinancialAccountListResponse) UnmarshalJSON

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

type FinancialAccountParam

type FinancialAccountParam struct {
	// Account number for your Lithic-assigned bank account number, if applicable.
	AccountNumber param.Field[string] `json:"account_number"`
	// Date and time for when the financial account was first created.
	Created param.Field[time.Time] `json:"created,required" format:"date-time"`
	// Routing number for your Lithic-assigned bank account number, if applicable.
	RoutingNumber param.Field[string] `json:"routing_number"`
	// Globally unique identifier for the financial account.
	Token param.Field[string] `json:"token,required" format:"uuid"`
	// Type of financial account
	Type param.Field[FinancialAccountType] `json:"type,required"`
	// Date and time for when the financial account was last updated.
	Updated param.Field[time.Time] `json:"updated,required" format:"date-time"`
}

Financial Account

func (FinancialAccountParam) MarshalJSON

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

type FinancialAccountService

type FinancialAccountService struct {
	Options               []option.RequestOption
	Balances              *FinancialAccountBalanceService
	FinancialTransactions *FinancialAccountFinancialTransactionService
}

FinancialAccountService contains methods and other services that help with interacting with the lithic 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 NewFinancialAccountService method instead.

func NewFinancialAccountService

func NewFinancialAccountService(opts ...option.RequestOption) (r *FinancialAccountService)

NewFinancialAccountService 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 (*FinancialAccountService) List

Retrieve information on your financial accounts including routing and account number.

func (*FinancialAccountService) ListAutoPaging

Retrieve information on your financial accounts including routing and account number.

type FinancialAccountType

type FinancialAccountType string
const (
	FinancialAccountTypeIssuing FinancialAccountType = "ISSUING"
	FinancialAccountTypeReserve FinancialAccountType = "RESERVE"
)

type FinancialTransaction

type FinancialTransaction struct {
	// Status types:
	//
	//   - `CARD` - Issuing card transaction.
	//   - `ACH` - Transaction over ACH.
	//   - `TRANSFER` - Internal transfer of funds between financial accounts in your
	//     program.
	Category FinancialTransactionCategory `json:"category"`
	// Date and time when the financial transaction first occurred. UTC time zone.
	Created time.Time `json:"created" format:"date-time"`
	// 3-digit alphabetic ISO 4217 code for the settling currency of the transaction.
	Currency string `json:"currency"`
	// A string that provides a description of the financial transaction; may be useful
	// to display to users.
	Descriptor string `json:"descriptor"`
	// A list of all financial events that have modified this financial transaction.
	Events []FinancialTransactionEvents `json:"events"`
	// Pending amount of the transaction in the currency's smallest unit (e.g., cents),
	// including any acquirer fees. The value of this field will go to zero over time
	// once the financial transaction is settled.
	PendingAmount int64 `json:"pending_amount"`
	// APPROVED transactions were successful while DECLINED transactions were declined
	// by user, Lithic, or the network.
	Result FinancialTransactionResult `json:"result"`
	// Amount of the transaction that has been settled in the currency's smallest unit
	// (e.g., cents), including any acquirer fees. This may change over time.
	SettledAmount int64 `json:"settled_amount"`
	// Status types:
	//
	//   - `DECLINED` - The card transaction was declined.
	//   - `EXPIRED` - Lithic reversed the card authorization as it has passed its
	//     expiration time.
	//   - `PENDING` - Authorization is pending completion from the merchant or pending
	//     release from ACH hold period
	//   - `SETTLED` - The financial transaction is completed.
	//   - `VOIDED` - The merchant has voided the previously pending card authorization.
	Status FinancialTransactionStatus `json:"status"`
	// Globally unique identifier.
	Token string `json:"token" format:"uuid"`
	// Date and time when the financial transaction was last updated. UTC time zone.
	Updated time.Time `json:"updated" format:"date-time"`
	JSON    financialTransactionJSON
}

func (*FinancialTransaction) UnmarshalJSON

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

type FinancialTransactionCategory

type FinancialTransactionCategory string
const (
	FinancialTransactionCategoryCard     FinancialTransactionCategory = "CARD"
	FinancialTransactionCategoryACH      FinancialTransactionCategory = "ACH"
	FinancialTransactionCategoryTransfer FinancialTransactionCategory = "TRANSFER"
)

type FinancialTransactionEvents

type FinancialTransactionEvents struct {
	// Amount of the financial event that has been settled in the currency's smallest
	// unit (e.g., cents).
	Amount int64 `json:"amount"`
	// Date and time when the financial event occurred. UTC time zone.
	Created time.Time `json:"created" format:"date-time"`
	// APPROVED financial events were successful while DECLINED financial events were
	// declined by user, Lithic, or the network.
	Result FinancialTransactionEventsResult `json:"result"`
	// Globally unique identifier.
	Token string `json:"token" format:"uuid"`
	// Event types:
	//
	//   - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to
	//     insufficient balance.
	//   - `ACH_ORIGINATION_PENDING` - ACH origination pending release from an ACH hold.
	//   - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to
	//     available balance.
	//   - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder.
	//   - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available
	//     balance.
	//   - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial
	//     Institution.
	//   - `AUTHORIZATION` - Authorize a card transaction.
	//   - `AUTHORIZATION_ADVICE` - Advice on a card transaction.
	//   - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by
	//     Lithic.
	//   - `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant.
	//   - `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
	//     occurred on a card.
	//   - `CLEARING` - Card Transaction is settled.
	//   - `CORRECTION_DEBIT` - Manual card transaction correction (Debit).
	//   - `CORRECTION_CREDIT` - Manual card transaction correction (Credit).
	//   - `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a
	//     merchant.
	//   - `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
	//     your behalf by the network.
	//   - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit card funds
	//     without additional clearing.
	//   - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or
	//     credit card funds without additional clearing.
	//   - `RETURN` - A card refund has been processed on the transaction.
	//   - `RETURN_REVERSAL` - A card refund has been reversed (e.g., when a merchant
	//     reverses an incorrect refund).
	//   - `TRANSFER` - Successful internal transfer of funds between financial accounts.
	//   - `TRANSFER_INSUFFICIENT_FUNDS` - Declined internl transfer of funds due to
	//     insufficient balance of the sender.
	Type FinancialTransactionEventsType `json:"type"`
	JSON financialTransactionEventsJSON
}

func (*FinancialTransactionEvents) UnmarshalJSON

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

type FinancialTransactionEventsResult

type FinancialTransactionEventsResult string
const (
	FinancialTransactionEventsResultApproved FinancialTransactionEventsResult = "APPROVED"
	FinancialTransactionEventsResultDeclined FinancialTransactionEventsResult = "DECLINED"
)

type FinancialTransactionEventsType

type FinancialTransactionEventsType string
const (
	FinancialTransactionEventsTypeACHInsufficientFunds         FinancialTransactionEventsType = "ACH_INSUFFICIENT_FUNDS"
	FinancialTransactionEventsTypeACHOriginationPending        FinancialTransactionEventsType = "ACH_ORIGINATION_PENDING"
	FinancialTransactionEventsTypeACHOriginationReleased       FinancialTransactionEventsType = "ACH_ORIGINATION_RELEASED"
	FinancialTransactionEventsTypeACHReceiptPending            FinancialTransactionEventsType = "ACH_RECEIPT_PENDING"
	FinancialTransactionEventsTypeACHReceiptReleased           FinancialTransactionEventsType = "ACH_RECEIPT_RELEASED"
	FinancialTransactionEventsTypeACHReturn                    FinancialTransactionEventsType = "ACH_RETURN"
	FinancialTransactionEventsTypeAuthorization                FinancialTransactionEventsType = "AUTHORIZATION"
	FinancialTransactionEventsTypeAuthorizationAdvice          FinancialTransactionEventsType = "AUTHORIZATION_ADVICE"
	FinancialTransactionEventsTypeAuthorizationExpiry          FinancialTransactionEventsType = "AUTHORIZATION_EXPIRY"
	FinancialTransactionEventsTypeAuthorizationReversal        FinancialTransactionEventsType = "AUTHORIZATION_REVERSAL"
	FinancialTransactionEventsTypeBalanceInquiry               FinancialTransactionEventsType = "BALANCE_INQUIRY"
	FinancialTransactionEventsTypeClearing                     FinancialTransactionEventsType = "CLEARING"
	FinancialTransactionEventsTypeCorrectionDebit              FinancialTransactionEventsType = "CORRECTION_DEBIT"
	FinancialTransactionEventsTypeCorrectionCredit             FinancialTransactionEventsType = "CORRECTION_CREDIT"
	FinancialTransactionEventsTypeCreditAuthorization          FinancialTransactionEventsType = "CREDIT_AUTHORIZATION"
	FinancialTransactionEventsTypeCreditAuthorizationAdvice    FinancialTransactionEventsType = "CREDIT_AUTHORIZATION_ADVICE"
	FinancialTransactionEventsTypeFinancialAuthorization       FinancialTransactionEventsType = "FINANCIAL_AUTHORIZATION"
	FinancialTransactionEventsTypeFinancialCreditAuthorization FinancialTransactionEventsType = "FINANCIAL_CREDIT_AUTHORIZATION"
	FinancialTransactionEventsTypeReturn                       FinancialTransactionEventsType = "RETURN"
	FinancialTransactionEventsTypeReturnReversal               FinancialTransactionEventsType = "RETURN_REVERSAL"
	FinancialTransactionEventsTypeTransfer                     FinancialTransactionEventsType = "TRANSFER"
	FinancialTransactionEventsTypeTransferInsufficientFunds    FinancialTransactionEventsType = "TRANSFER_INSUFFICIENT_FUNDS"
)

type FinancialTransactionListParams

type FinancialTransactionListParams struct {
	// Financial Transaction category to be returned.
	Category param.Field[FinancialTransactionListParamsCategory] `query:"category"`
	// Financial Transaction status to be returned.
	Status param.Field[FinancialTransactionListParamsStatus] `query:"status"`
	// Financial Transaction result to be returned.
	Result param.Field[FinancialTransactionListParamsResult] `query:"result"`
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// A cursor representing an item's token after which a page of results should
	// begin. Used to retrieve the next page of results after this item.
	StartingAfter param.Field[string] `query:"starting_after"`
	// A cursor representing an item's token before which a page of results should end.
	// Used to retrieve the previous page of results before this item.
	EndingBefore param.Field[string] `query:"ending_before"`
}

func (FinancialTransactionListParams) URLQuery

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

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

type FinancialTransactionListParamsCategory

type FinancialTransactionListParamsCategory string
const (
	FinancialTransactionListParamsCategoryACH      FinancialTransactionListParamsCategory = "ACH"
	FinancialTransactionListParamsCategoryCard     FinancialTransactionListParamsCategory = "CARD"
	FinancialTransactionListParamsCategoryTransfer FinancialTransactionListParamsCategory = "TRANSFER"
)

type FinancialTransactionListParamsResult

type FinancialTransactionListParamsResult string
const (
	FinancialTransactionListParamsResultApproved FinancialTransactionListParamsResult = "APPROVED"
	FinancialTransactionListParamsResultDeclined FinancialTransactionListParamsResult = "DECLINED"
)

type FinancialTransactionListParamsStatus

type FinancialTransactionListParamsStatus string
const (
	FinancialTransactionListParamsStatusDeclined FinancialTransactionListParamsStatus = "DECLINED"
	FinancialTransactionListParamsStatusExpired  FinancialTransactionListParamsStatus = "EXPIRED"
	FinancialTransactionListParamsStatusPending  FinancialTransactionListParamsStatus = "PENDING"
	FinancialTransactionListParamsStatusSettled  FinancialTransactionListParamsStatus = "SETTLED"
	FinancialTransactionListParamsStatusVoided   FinancialTransactionListParamsStatus = "VOIDED"
)

type FinancialTransactionListResponse

type FinancialTransactionListResponse struct {
	Data []FinancialTransaction `json:"data,required"`
	// More data exists.
	HasMore bool `json:"has_more,required"`
	JSON    financialTransactionListResponseJSON
}

func (*FinancialTransactionListResponse) UnmarshalJSON

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

type FinancialTransactionResult

type FinancialTransactionResult string
const (
	FinancialTransactionResultApproved FinancialTransactionResult = "APPROVED"
	FinancialTransactionResultDeclined FinancialTransactionResult = "DECLINED"
)

type FinancialTransactionStatus

type FinancialTransactionStatus string
const (
	FinancialTransactionStatusDeclined FinancialTransactionStatus = "DECLINED"
	FinancialTransactionStatusExpired  FinancialTransactionStatus = "EXPIRED"
	FinancialTransactionStatusPending  FinancialTransactionStatus = "PENDING"
	FinancialTransactionStatusSettled  FinancialTransactionStatus = "SETTLED"
	FinancialTransactionStatusVoided   FinancialTransactionStatus = "VOIDED"
)

type KYBBeneficialOwnerEntitiesParam

type KYBBeneficialOwnerEntitiesParam struct {
	// Business's physical address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Any name that the business operates under that is not its legal business name
	// (if applicable).
	DbaBusinessName param.Field[string] `json:"dba_business_name"`
	// Government-issued identification number. US Federal Employer Identification
	// Numbers (EIN) are currently supported, entered as full nine-digits, with or
	// without hyphens.
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Legal (formal) business name.
	LegalBusinessName param.Field[string] `json:"legal_business_name,required"`
	// Parent company name (if applicable).
	ParentCompany param.Field[string] `json:"parent_company"`
	// One or more of the business's phone number(s), entered as a list in E.164
	// format.
	PhoneNumbers param.Field[[]string] `json:"phone_numbers,required"`
}

func (KYBBeneficialOwnerEntitiesParam) MarshalJSON

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

type KYBBeneficialOwnerIndividualsParam

type KYBBeneficialOwnerIndividualsParam struct {
	// Individual's current address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Individual's date of birth, as an RFC 3339 date.
	Dob param.Field[string] `json:"dob,required"`
	// Individual's email address. If utilizing Lithic for chargeback processing, this
	// customer email address may be used to communicate dispute status and resolution.
	Email param.Field[string] `json:"email,required"`
	// Individual's first name, as it appears on government-issued identity documents.
	FirstName param.Field[string] `json:"first_name,required"`
	// Government-issued identification number (required for identity verification and
	// compliance with banking regulations). Social Security Numbers (SSN) and
	// Individual Taxpayer Identification Numbers (ITIN) are currently supported,
	// entered as full nine-digits, with or without hyphens
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Individual's last name, as it appears on government-issued identity documents.
	LastName param.Field[string] `json:"last_name,required"`
	// Individual's phone number, entered in E.164 format.
	PhoneNumber param.Field[string] `json:"phone_number,required"`
}

func (KYBBeneficialOwnerIndividualsParam) MarshalJSON

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

type KYBBusinessEntityParam

type KYBBusinessEntityParam struct {
	// Business's physical address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Any name that the business operates under that is not its legal business name
	// (if applicable).
	DbaBusinessName param.Field[string] `json:"dba_business_name"`
	// Government-issued identification number. US Federal Employer Identification
	// Numbers (EIN) are currently supported, entered as full nine-digits, with or
	// without hyphens.
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Legal (formal) business name.
	LegalBusinessName param.Field[string] `json:"legal_business_name,required"`
	// Parent company name (if applicable).
	ParentCompany param.Field[string] `json:"parent_company"`
	// One or more of the business's phone number(s), entered as a list in E.164
	// format.
	PhoneNumbers param.Field[[]string] `json:"phone_numbers,required"`
}

Information for business for which the account is being opened and KYB is being run.

func (KYBBusinessEntityParam) MarshalJSON

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

type KYBControlPersonParam

type KYBControlPersonParam struct {
	// Individual's current address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Individual's date of birth, as an RFC 3339 date.
	Dob param.Field[string] `json:"dob,required"`
	// Individual's email address. If utilizing Lithic for chargeback processing, this
	// customer email address may be used to communicate dispute status and resolution.
	Email param.Field[string] `json:"email,required"`
	// Individual's first name, as it appears on government-issued identity documents.
	FirstName param.Field[string] `json:"first_name,required"`
	// Government-issued identification number (required for identity verification and
	// compliance with banking regulations). Social Security Numbers (SSN) and
	// Individual Taxpayer Identification Numbers (ITIN) are currently supported,
	// entered as full nine-digits, with or without hyphens
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Individual's last name, as it appears on government-issued identity documents.
	LastName param.Field[string] `json:"last_name,required"`
	// Individual's phone number, entered in E.164 format.
	PhoneNumber param.Field[string] `json:"phone_number,required"`
}

An individual with significant responsibility for managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating Officer, Managing Member, General Partner, President, Vice President, or Treasurer). This can be an executive, or someone who will have program-wide access to the cards that Lithic will provide. In some cases, this individual could also be a beneficial owner listed above. See [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) (Section II) for more background.

func (KYBControlPersonParam) MarshalJSON

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

type KYBParam

type KYBParam struct {
	// Information for business for which the account is being opened and KYB is being
	// run.
	BusinessEntity param.Field[KYBBusinessEntityParam] `json:"business_entity,required"`
	// List of all entities with >25% ownership in the company. If no entity or
	// individual owns >25% of the company, and the largest shareholder is an entity,
	// please identify them in this field. See
	// [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)
	// (Section I) for more background. If no business owner is an entity, pass in an
	// empty list. However, either this parameter or `beneficial_owner_individuals`
	// must be populated. on entities that should be included.
	BeneficialOwnerEntities param.Field[[]KYBBeneficialOwnerEntitiesParam] `json:"beneficial_owner_entities,required"`
	// List of all individuals with >25% ownership in the company. If no entity or
	// individual owns >25% of the company, and the largest shareholder is an
	// individual, please identify them in this field. See
	// [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)
	// (Section I) for more background on individuals that should be included. If no
	// individual is an entity, pass in an empty list. However, either this parameter
	// or `beneficial_owner_entities` must be populated.
	BeneficialOwnerIndividuals param.Field[[]KYBBeneficialOwnerIndividualsParam] `json:"beneficial_owner_individuals,required"`
	// An individual with significant responsibility for managing the legal entity
	// (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating
	// Officer, Managing Member, General Partner, President, Vice President, or
	// Treasurer). This can be an executive, or someone who will have program-wide
	// access to the cards that Lithic will provide. In some cases, this individual
	// could also be a beneficial owner listed above. See
	// [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)
	// (Section II) for more background.
	ControlPerson param.Field[KYBControlPersonParam] `json:"control_person,required"`
	// An RFC 3339 timestamp indicating when precomputed KYC was completed on the
	// business with a pass result.
	//
	// This field is required only if workflow type is `KYB_BYO`.
	KYBPassedTimestamp param.Field[string] `json:"kyb_passed_timestamp"`
	// Short description of the company's line of business (i.e., what does the company
	// do?).
	NatureOfBusiness param.Field[string] `json:"nature_of_business,required"`
	// An RFC 3339 timestamp indicating when the account holder accepted the applicable
	// legal agreements (e.g., cardholder terms) as agreed upon during API customer's
	// implementation with Lithic.
	TosTimestamp param.Field[string] `json:"tos_timestamp,required"`
	// Company website URL.
	WebsiteURL param.Field[string] `json:"website_url,required"`
	// Specifies the type of KYB workflow to run.
	Workflow param.Field[KYBWorkflow] `json:"workflow,required"`
}

func (KYBParam) MarshalJSON

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

type KYBWorkflow

type KYBWorkflow string
const (
	KYBWorkflowKYBBasic KYBWorkflow = "KYB_BASIC"
	KYBWorkflowKYBByo   KYBWorkflow = "KYB_BYO"
)

type KYCExemptKYCExemptionType

type KYCExemptKYCExemptionType string
const (
	KYCExemptKYCExemptionTypeAuthorizedUser  KYCExemptKYCExemptionType = "AUTHORIZED_USER"
	KYCExemptKYCExemptionTypePrepaidCardUser KYCExemptKYCExemptionType = "PREPAID_CARD_USER"
)

type KYCExemptParam

type KYCExemptParam struct {
	// Specifies the workflow type. This must be 'KYC_EXEMPT'
	Workflow param.Field[KYCExemptWorkflow] `json:"workflow,required"`
	// Specifies the type of KYC Exempt user
	KYCExemptionType param.Field[KYCExemptKYCExemptionType] `json:"kyc_exemption_type,required"`
	// The KYC Exempt user's first name
	FirstName param.Field[string] `json:"first_name,required"`
	// The KYC Exempt user's last name
	LastName param.Field[string] `json:"last_name,required"`
	// The KYC Exempt user's email
	Email param.Field[string] `json:"email,required"`
	// The KYC Exempt user's phone number
	PhoneNumber param.Field[string] `json:"phone_number,required"`
	// Only applicable for customers using the KYC-Exempt workflow to enroll authorized
	// users of businesses. Pass the account_token of the enrolled business associated
	// with the AUTHORIZED_USER in this field.
	BusinessAccountToken param.Field[string] `json:"business_account_token"`
	// KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.
	Address param.Field[shared.AddressParam] `json:"address"`
}

func (KYCExemptParam) MarshalJSON

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

type KYCExemptWorkflow

type KYCExemptWorkflow string
const (
	KYCExemptWorkflowKYCExempt KYCExemptWorkflow = "KYC_EXEMPT"
)

type KYCIndividualParam

type KYCIndividualParam struct {
	// Individual's current address - PO boxes, UPS drops, and FedEx drops are not
	// acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.
	Address param.Field[shared.AddressParam] `json:"address,required"`
	// Individual's date of birth, as an RFC 3339 date.
	Dob param.Field[string] `json:"dob,required"`
	// Individual's email address. If utilizing Lithic for chargeback processing, this
	// customer email address may be used to communicate dispute status and resolution.
	Email param.Field[string] `json:"email,required"`
	// Individual's first name, as it appears on government-issued identity documents.
	FirstName param.Field[string] `json:"first_name,required"`
	// Government-issued identification number (required for identity verification and
	// compliance with banking regulations). Social Security Numbers (SSN) and
	// Individual Taxpayer Identification Numbers (ITIN) are currently supported,
	// entered as full nine-digits, with or without hyphens
	GovernmentID param.Field[string] `json:"government_id,required"`
	// Individual's last name, as it appears on government-issued identity documents.
	LastName param.Field[string] `json:"last_name,required"`
	// Individual's phone number, entered in E.164 format.
	PhoneNumber param.Field[string] `json:"phone_number,required"`
}

Information on individual for whom the account is being opened and KYC is being run.

func (KYCIndividualParam) MarshalJSON

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

type KYCParam

type KYCParam struct {
	// Information on individual for whom the account is being opened and KYC is being
	// run.
	Individual param.Field[KYCIndividualParam] `json:"individual,required"`
	// An RFC 3339 timestamp indicating when precomputed KYC was completed on the
	// individual with a pass result.
	//
	// This field is required only if workflow type is `KYC_BYO`.
	KYCPassedTimestamp param.Field[string] `json:"kyc_passed_timestamp"`
	// An RFC 3339 timestamp indicating when the account holder accepted the applicable
	// legal agreements (e.g., cardholder terms) as agreed upon during API customer's
	// implementation with Lithic.
	TosTimestamp param.Field[string] `json:"tos_timestamp,required"`
	// Specifies the type of KYC workflow to run.
	Workflow param.Field[KYCWorkflow] `json:"workflow,required"`
}

func (KYCParam) MarshalJSON

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

type KYCWorkflow

type KYCWorkflow string
const (
	KYCWorkflowKYCAdvanced KYCWorkflow = "KYC_ADVANCED"
	KYCWorkflowKYCBasic    KYCWorkflow = "KYC_BASIC"
	KYCWorkflowKYCByo      KYCWorkflow = "KYC_BYO"
)

type ResponderEndpointCheckStatusParams

type ResponderEndpointCheckStatusParams struct {
	// The type of the endpoint.
	Type param.Field[ResponderEndpointCheckStatusParamsType] `query:"type,required"`
}

func (ResponderEndpointCheckStatusParams) URLQuery

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

type ResponderEndpointCheckStatusParamsType

type ResponderEndpointCheckStatusParamsType string
const (
	ResponderEndpointCheckStatusParamsTypeTokenizationDecisioning ResponderEndpointCheckStatusParamsType = "TOKENIZATION_DECISIONING"
)

type ResponderEndpointCreateResponse

type ResponderEndpointCreateResponse struct {
	// True if the endpoint was enrolled successfully.
	Enrolled bool `json:"enrolled"`
	JSON     responderEndpointCreateResponseJSON
}

func (*ResponderEndpointCreateResponse) UnmarshalJSON

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

type ResponderEndpointDeleteParams

type ResponderEndpointDeleteParams struct {
	// The type of the endpoint.
	Type param.Field[ResponderEndpointDeleteParamsType] `query:"type,required"`
}

func (ResponderEndpointDeleteParams) URLQuery

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

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

type ResponderEndpointDeleteParamsType

type ResponderEndpointDeleteParamsType string
const (
	ResponderEndpointDeleteParamsTypeTokenizationDecisioning ResponderEndpointDeleteParamsType = "TOKENIZATION_DECISIONING"
)

type ResponderEndpointNewParams

type ResponderEndpointNewParams struct {
	// The URL for the responder endpoint (must be http(s)).
	URL param.Field[string] `json:"url" format:"uri"`
	// The type of the endpoint.
	Type param.Field[ResponderEndpointNewParamsType] `json:"type"`
}

func (ResponderEndpointNewParams) MarshalJSON

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

type ResponderEndpointNewParamsType

type ResponderEndpointNewParamsType string
const (
	ResponderEndpointNewParamsTypeTokenizationDecisioning ResponderEndpointNewParamsType = "TOKENIZATION_DECISIONING"
)

type ResponderEndpointService

type ResponderEndpointService struct {
	Options []option.RequestOption
}

ResponderEndpointService contains methods and other services that help with interacting with the lithic 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 NewResponderEndpointService method instead.

func NewResponderEndpointService

func NewResponderEndpointService(opts ...option.RequestOption) (r *ResponderEndpointService)

NewResponderEndpointService 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 (*ResponderEndpointService) CheckStatus

Check the status of a responder endpoint

func (*ResponderEndpointService) Delete

Disenroll a responder endpoint

func (*ResponderEndpointService) New

Enroll a responder endpoint

type ResponderEndpointStatus

type ResponderEndpointStatus struct {
	// True if the instance has an endpoint enrolled.
	Enrolled bool `json:"enrolled"`
	// The URL of the currently enrolled endpoint or null.
	URL  string `json:"url,nullable" format:"uri"`
	JSON responderEndpointStatusJSON
}

func (*ResponderEndpointStatus) UnmarshalJSON

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

type ShippingAddressParam

type ShippingAddressParam = shared.ShippingAddressParam

type SpendLimitDuration

type SpendLimitDuration string
const (
	SpendLimitDurationAnnually    SpendLimitDuration = "ANNUALLY"
	SpendLimitDurationForever     SpendLimitDuration = "FOREVER"
	SpendLimitDurationMonthly     SpendLimitDuration = "MONTHLY"
	SpendLimitDurationTransaction SpendLimitDuration = "TRANSACTION"
)

type SubscriptionRetrieveSecretResponse

type SubscriptionRetrieveSecretResponse struct {
	Key  string `json:"key"`
	JSON subscriptionRetrieveSecretResponseJSON
}

func (*SubscriptionRetrieveSecretResponse) UnmarshalJSON

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

type TokenizationDecisioningRotateSecretResponse

type TokenizationDecisioningRotateSecretResponse struct {
	// The new Tokenization Decisioning HMAC secret
	Secret string `json:"secret"`
	JSON   tokenizationDecisioningRotateSecretResponseJSON
}

func (*TokenizationDecisioningRotateSecretResponse) UnmarshalJSON

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

type TokenizationDecisioningService

type TokenizationDecisioningService struct {
	Options []option.RequestOption
}

TokenizationDecisioningService contains methods and other services that help with interacting with the lithic 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 NewTokenizationDecisioningService method instead.

func NewTokenizationDecisioningService

func NewTokenizationDecisioningService(opts ...option.RequestOption) (r *TokenizationDecisioningService)

NewTokenizationDecisioningService 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 (*TokenizationDecisioningService) GetSecret

Retrieve the Tokenization Decisioning secret key. If one does not exist your program yet, calling this endpoint will create one for you. The headers of the Tokenization Decisioning request will contain a hmac signature which you can use to verify requests originate from Lithic. See [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more detail about verifying Tokenization Decisioning requests.

func (*TokenizationDecisioningService) RotateSecret

Generate a new Tokenization Decisioning secret key. The old Tokenization Decisioning secret key will be deactivated 24 hours after a successful request to this endpoint.

type TokenizationSecret

type TokenizationSecret struct {
	// The Tokenization Decisioning HMAC secret
	Secret string `json:"secret"`
	JSON   tokenizationSecretJSON
}

func (*TokenizationSecret) UnmarshalJSON

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

type Transaction

type Transaction struct {
	// A fixed-width 23-digit numeric identifier for the Transaction that may be set if
	// the transaction originated from the Mastercard network. This number may be used
	// for dispute tracking.
	AcquirerReferenceNumber string `json:"acquirer_reference_number,required,nullable"`
	// Authorization amount of the transaction (in cents), including any acquirer fees.
	// This may change over time, and will represent the settled amount once the
	// transaction is settled.
	Amount int64 `json:"amount,required"`
	// Authorization amount (in cents) of the transaction, including any acquirer fees.
	// This amount always represents the amount authorized for the transaction,
	// unaffected by settlement.
	AuthorizationAmount int64 `json:"authorization_amount,required"`
	// A fixed-width 6-digit numeric identifier that can be used to identify a
	// transaction with networks.
	AuthorizationCode string `json:"authorization_code,required"`
	// Token for the card used in this transaction.
	CardToken                string                              `json:"card_token,required" format:"uuid"`
	CardholderAuthentication TransactionCardholderAuthentication `json:"cardholder_authentication,nullable"`
	// Date and time when the transaction first occurred. UTC time zone.
	Created time.Time `json:"created,required" format:"date-time"`
	// A list of all events that have modified this transaction.
	Events   []TransactionEvents `json:"events,required"`
	Merchant TransactionMerchant `json:"merchant,required"`
	// Analogous to the "amount" property, but will represent the amount in the
	// transaction's local currency (smallest unit), including any acquirer fees.
	MerchantAmount int64 `json:"merchant_amount,required"`
	// Analogous to the "authorization_amount" property, but will represent the amount
	// in the transaction's local currency (smallest unit), including any acquirer
	// fees.
	MerchantAuthorizationAmount int64 `json:"merchant_authorization_amount,required"`
	// 3-digit alphabetic ISO 4217 code for the local currency of the transaction.
	MerchantCurrency string `json:"merchant_currency,required"`
	// Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`,
	// `VISA`, or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the
	// network code from the upstream provider.
	Network TransactionNetwork `json:"network,required,nullable"`
	// `APPROVED` or decline reason. See Event result types
	Result TransactionResult `json:"result,required"`
	// Amount of the transaction that has been settled (in cents), including any
	// acquirer fees. This may change over time.
	SettledAmount int64 `json:"settled_amount,required"`
	// Status types:
	//
	//   - `DECLINED` - The transaction was declined.
	//   - `EXPIRED` - Lithic reversed the authorization as it has passed its expiration
	//     time.
	//   - `PENDING` - Authorization is pending completion from the merchant.
	//   - `SETTLED` - The transaction is complete.
	//   - `VOIDED` - The merchant has voided the previously pending authorization.
	Status TransactionStatus `json:"status,required"`
	// Globally unique identifier.
	Token string `json:"token,required" format:"uuid"`
	JSON  transactionJSON
}

func (*Transaction) UnmarshalJSON

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

type TransactionCardholderAuthentication

type TransactionCardholderAuthentication struct {
	// 3-D Secure Protocol version. Possible values:
	//
	// - `1`: 3-D Secure Protocol version 1.x applied to the transaction.
	// - `2`: 3-D Secure Protocol version 2.x applied to the transaction.
	// - `null`: 3-D Secure was not used for the transaction
	ThreeDSVersion string `json:"3ds_version,required,nullable"`
	// Exemption applied by the ACS to authenticate the transaction without requesting
	// a challenge. Possible values:
	//
	//   - `AUTHENTICATION_OUTAGE_EXCEPTION`: Authentication Outage Exception exemption.
	//   - `LOW_VALUE`: Low Value Payment exemption.
	//   - `MERCHANT_INITIATED_TRANSACTION`: Merchant Initiated Transaction (3RI).
	//   - `NONE`: No exemption applied.
	//   - `RECURRING_PAYMENT`: Recurring Payment exemption.
	//   - `SECURE_CORPORATE_PAYMENT`: Secure Corporate Payment exemption.
	//   - `STRONG_CUSTOMER_AUTHENTICATION_DELEGATION`: Strong Customer Authentication
	//     Delegation exemption.
	//   - `TRANSACTION_RISK_ANALYSIS`: Acquirer Low-Fraud and Transaction Risk Analysis
	//     exemption.
	//
	// Maps to the 3-D Secure `transChallengeExemption` field.
	AcquirerExemption TransactionCardholderAuthenticationAcquirerExemption `json:"acquirer_exemption,required"`
	// Indicates whether chargeback liability shift applies to the transaction.
	// Possible values:
	//
	//   - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D
	//     Secure flow, chargeback liability shift applies.
	//   - `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong
	//     Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability
	//     remains with the acquirer and in this case the `acquirer_exemption` field is
	//     expected to be not `NONE`.
	//   - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the
	//     merchant is liable.
	//   - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated
	//     cryptography, possibly recurring. Chargeback liability shift to the issuer
	//     applies.
	LiabilityShift TransactionCardholderAuthenticationLiabilityShift `json:"liability_shift,required"`
	// Verification attempted values:
	//
	//   - `APP_LOGIN`: Out-of-band login verification was attempted by the ACS.
	//   - `BIOMETRIC`: Out-of-band biometric verification was attempted by the ACS.
	//   - `NONE`: No cardholder verification was attempted by the Access Control Server
	//     (e.g. frictionless 3-D Secure flow, no 3-D Secure, or stand-in Risk Based
	//     Analysis).
	//   - `OTHER`: Other method was used by the ACS to verify the cardholder (e.g.
	//     Mastercard Identity Check Express, recurring transactions, etc.)
	//   - `OTP`: One-time password verification was attempted by the ACS.
	VerificationAttempted TransactionCardholderAuthenticationVerificationAttempted `json:"verification_attempted,required"`
	// This field partially maps to the `transStatus` field in the
	// [EMVCo 3-D Secure specification](https://www.emvco.com/emv-technologies/3d-secure/)
	// and Mastercard SPA2 AAV leading indicators.
	//
	// Verification result values:
	//
	//   - `CANCELLED`: Authentication/Account verification could not be performed,
	//     `transStatus = U`.
	//   - `FAILED`: Transaction was not authenticated. `transStatus = N`, note: the
	//     utilization of exemptions could also result in `transStatus = N`, inspect the
	//     `acquirer_exemption` field for more information.
	//   - `FRICTIONLESS`: Attempts processing performed, the transaction was not
	//     authenticated, but a proof of attempted authentication/verification is
	//     provided. `transStatus = A` and the leading AAV indicator was one of {`kE`,
	//     `kF`, `kQ`}.
	//   - `NOT_ATTEMPTED`: A 3-D Secure flow was not applied to this transaction.
	//     Leading AAV indicator was one of {`kN`, `kX`} or no AAV was provided for the
	//     transaction.
	//   - `REJECTED`: Authentication/Account Verification rejected; `transStatus = R`.
	//     Issuer is rejecting authentication/verification and requests that
	//     authorization not be attempted.
	//   - `SUCCESS`: Authentication verification successful. `transStatus = Y` and
	//     leading AAV indicator for the transaction was one of {`kA`, `kB`, `kC`, `kD`,
	//     `kO`, `kP`, `kR`, `kS`}.
	//
	// Note that the following `transStatus` values are not represented by this field:
	//
	// - `C`: Challenge Required
	// - `D`: Challenge Required; decoupled authentication confirmed
	// - `I`: Informational only
	// - `S`: Challenge using Secure Payment Confirmation (SPC)
	VerificationResult TransactionCardholderAuthenticationVerificationResult `json:"verification_result,required"`
	JSON               transactionCardholderAuthenticationJSON
}

func (*TransactionCardholderAuthentication) UnmarshalJSON

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

type TransactionCardholderAuthenticationAcquirerExemption

type TransactionCardholderAuthenticationAcquirerExemption string
const (
	TransactionCardholderAuthenticationAcquirerExemptionAuthenticationOutageException          TransactionCardholderAuthenticationAcquirerExemption = "AUTHENTICATION_OUTAGE_EXCEPTION"
	TransactionCardholderAuthenticationAcquirerExemptionLowValue                               TransactionCardholderAuthenticationAcquirerExemption = "LOW_VALUE"
	TransactionCardholderAuthenticationAcquirerExemptionMerchantInitiatedTransaction           TransactionCardholderAuthenticationAcquirerExemption = "MERCHANT_INITIATED_TRANSACTION"
	TransactionCardholderAuthenticationAcquirerExemptionNone                                   TransactionCardholderAuthenticationAcquirerExemption = "NONE"
	TransactionCardholderAuthenticationAcquirerExemptionRecurringPayment                       TransactionCardholderAuthenticationAcquirerExemption = "RECURRING_PAYMENT"
	TransactionCardholderAuthenticationAcquirerExemptionSecureCorporatePayment                 TransactionCardholderAuthenticationAcquirerExemption = "SECURE_CORPORATE_PAYMENT"
	TransactionCardholderAuthenticationAcquirerExemptionStrongCustomerAuthenticationDelegation TransactionCardholderAuthenticationAcquirerExemption = "STRONG_CUSTOMER_AUTHENTICATION_DELEGATION"
	TransactionCardholderAuthenticationAcquirerExemptionTransactionRiskAnalysis                TransactionCardholderAuthenticationAcquirerExemption = "TRANSACTION_RISK_ANALYSIS"
)

type TransactionCardholderAuthenticationLiabilityShift

type TransactionCardholderAuthenticationLiabilityShift string
const (
	TransactionCardholderAuthenticationLiabilityShift3DSAuthenticated   TransactionCardholderAuthenticationLiabilityShift = "3DS_AUTHENTICATED"
	TransactionCardholderAuthenticationLiabilityShiftAcquirerExemption  TransactionCardholderAuthenticationLiabilityShift = "ACQUIRER_EXEMPTION"
	TransactionCardholderAuthenticationLiabilityShiftNone               TransactionCardholderAuthenticationLiabilityShift = "NONE"
	TransactionCardholderAuthenticationLiabilityShiftTokenAuthenticated TransactionCardholderAuthenticationLiabilityShift = "TOKEN_AUTHENTICATED"
)

type TransactionCardholderAuthenticationVerificationAttempted

type TransactionCardholderAuthenticationVerificationAttempted string
const (
	TransactionCardholderAuthenticationVerificationAttemptedAppLogin  TransactionCardholderAuthenticationVerificationAttempted = "APP_LOGIN"
	TransactionCardholderAuthenticationVerificationAttemptedBiometric TransactionCardholderAuthenticationVerificationAttempted = "BIOMETRIC"
	TransactionCardholderAuthenticationVerificationAttemptedNone      TransactionCardholderAuthenticationVerificationAttempted = "NONE"
	TransactionCardholderAuthenticationVerificationAttemptedOther     TransactionCardholderAuthenticationVerificationAttempted = "OTHER"
	TransactionCardholderAuthenticationVerificationAttemptedOtp       TransactionCardholderAuthenticationVerificationAttempted = "OTP"
)

type TransactionCardholderAuthenticationVerificationResult

type TransactionCardholderAuthenticationVerificationResult string
const (
	TransactionCardholderAuthenticationVerificationResultCancelled    TransactionCardholderAuthenticationVerificationResult = "CANCELLED"
	TransactionCardholderAuthenticationVerificationResultFailed       TransactionCardholderAuthenticationVerificationResult = "FAILED"
	TransactionCardholderAuthenticationVerificationResultFrictionless TransactionCardholderAuthenticationVerificationResult = "FRICTIONLESS"
	TransactionCardholderAuthenticationVerificationResultNotAttempted TransactionCardholderAuthenticationVerificationResult = "NOT_ATTEMPTED"
	TransactionCardholderAuthenticationVerificationResultRejected     TransactionCardholderAuthenticationVerificationResult = "REJECTED"
	TransactionCardholderAuthenticationVerificationResultSuccess      TransactionCardholderAuthenticationVerificationResult = "SUCCESS"
)

type TransactionEvents

type TransactionEvents struct {
	// Amount of the transaction event (in cents), including any acquirer fees.
	Amount int64 `json:"amount,required"`
	// RFC 3339 date and time this event entered the system. UTC time zone.
	Created time.Time `json:"created,required" format:"date-time"`
	// `APPROVED` or decline reason.
	//
	// Result types:
	//
	//   - `ACCOUNT_STATE_TRANSACTION_FAIL` - Contact
	//     [support@lithic.com](mailto:support@lithic.com).
	//   - `APPROVED` - Transaction is approved.
	//   - `BANK_CONNECTION_ERROR` - Please reconnect a funding source.
	//   - `BANK_NOT_VERIFIED` - Please confirm the funding source.
	//   - `CARD_CLOSED` - Card state was closed at the time of authorization.
	//   - `CARD_PAUSED` - Card state was paused at the time of authorization.
	//   - `FRAUD_ADVICE` - Transaction declined due to risk.
	//   - `GLOBAL_TRANSACTION_LIMIT` - Platform spend limit exceeded, contact
	//     [support@lithic.com](mailto:support@lithic.com).
	//   - `GLOBAL_WEEKLY_LIMIT` - Platform spend limit exceeded, contact
	//     [support@lithic.com](mailto:support@lithic.com).
	//   - `GLOBAL_MONTHLY_LIMIT` - Platform spend limit exceeded, contact
	//     [support@lithic.com](mailto:support@lithic.com).
	//   - `INACTIVE_ACCOUNT` - Account is inactive. Contact
	//     [support@lithic.com](mailto:support@lithic.com).
	//   - `INCORRECT_PIN` - PIN verification failed.
	//   - `INVALID_CARD_DETAILS` - Incorrect CVV or expiry date.
	//   - `INSUFFICIENT_FUNDS` - Please ensure the funding source is connected and up to
	//     date.
	//   - `MERCHANT_BLACKLIST` - This merchant is disallowed on the platform.
	//   - `SINGLE_USE_RECHARGED` - Single use card attempted multiple times.
	//   - `SWITCH_INOPERATIVE_ADVICE` - Network error, re-attempt the transaction.
	//   - `UNAUTHORIZED_MERCHANT` - Merchant locked card attempted at different
	//     merchant.
	//   - `UNKNOWN_HOST_TIMEOUT` - Network error, re-attempt the transaction.
	//   - `USER_TRANSACTION_LIMIT` - User-set spend limit exceeded.
	Result TransactionEventsResult `json:"result,required"`
	// Globally unique identifier.
	Token string `json:"token,required" format:"uuid"`
	// Event types:
	//
	//   - `AUTHORIZATION` - Authorize a transaction.
	//   - `AUTHORIZATION_ADVICE` - Advice on a transaction.
	//   - `AUTHORIZATION_EXPIRY` - Authorization has expired and reversed by Lithic.
	//   - `AUTHORIZATION_REVERSAL` - Authorization was reversed by the merchant.
	//   - `BALANCE_INQUIRY` - A balance inquiry (typically a $0 authorization) has
	//     occurred on a card.
	//   - `CLEARING` - Transaction is settled.
	//   - `CORRECTION_DEBIT` - Manual transaction correction (Debit).
	//   - `CORRECTION_CREDIT` - Manual transaction correction (Credit).
	//   - `CREDIT_AUTHORIZATION` - A refund or credit authorization from a merchant.
	//   - `CREDIT_AUTHORIZATION_ADVICE` - A credit authorization was approved on your
	//     behalf by the network.
	//   - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit funds without
	//     additional clearing.
	//   - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or
	//     credit funds without additional clearing.
	//   - `RETURN` - A refund has been processed on the transaction.
	//   - `RETURN_REVERSAL` - A refund has been reversed (e.g., when a merchant reverses
	//     an incorrect refund).
	Type TransactionEventsType `json:"type,required"`
	JSON transactionEventsJSON
}

A single card transaction may include multiple events that affect the transaction state and lifecycle.

func (*TransactionEvents) UnmarshalJSON

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

type TransactionEventsResult

type TransactionEventsResult string
const (
	TransactionEventsResultAccountStateTransaction TransactionEventsResult = "ACCOUNT_STATE_TRANSACTION"
	TransactionEventsResultApproved                TransactionEventsResult = "APPROVED"
	TransactionEventsResultBankConnectionError     TransactionEventsResult = "BANK_CONNECTION_ERROR"
	TransactionEventsResultBankNotVerified         TransactionEventsResult = "BANK_NOT_VERIFIED"
	TransactionEventsResultCardClosed              TransactionEventsResult = "CARD_CLOSED"
	TransactionEventsResultCardPaused              TransactionEventsResult = "CARD_PAUSED"
	TransactionEventsResultFraudAdvice             TransactionEventsResult = "FRAUD_ADVICE"
	TransactionEventsResultGlobalTransactionLimit  TransactionEventsResult = "GLOBAL_TRANSACTION_LIMIT"
	TransactionEventsResultGlobalWeeklyLimit       TransactionEventsResult = "GLOBAL_WEEKLY_LIMIT"
	TransactionEventsResultGlobalMonthlyLimit      TransactionEventsResult = "GLOBAL_MONTHLY_LIMIT"
	TransactionEventsResultInactiveAccount         TransactionEventsResult = "INACTIVE_ACCOUNT"
	TransactionEventsResultIncorrectPin            TransactionEventsResult = "INCORRECT_PIN"
	TransactionEventsResultInvalidCardDetails      TransactionEventsResult = "INVALID_CARD_DETAILS"
	TransactionEventsResultInsufficientFunds       TransactionEventsResult = "INSUFFICIENT_FUNDS"
	TransactionEventsResultMerchantBlacklist       TransactionEventsResult = "MERCHANT_BLACKLIST"
	TransactionEventsResultSingleUseRecharged      TransactionEventsResult = "SINGLE_USE_RECHARGED"
	TransactionEventsResultSwitchInoperativeAdvice TransactionEventsResult = "SWITCH_INOPERATIVE_ADVICE"
	TransactionEventsResultUnauthorizedMerchant    TransactionEventsResult = "UNAUTHORIZED_MERCHANT"
	TransactionEventsResultUnknownHostTimeout      TransactionEventsResult = "UNKNOWN_HOST_TIMEOUT"
	TransactionEventsResultUserTransactionLimit    TransactionEventsResult = "USER_TRANSACTION_LIMIT"
)

type TransactionEventsType

type TransactionEventsType string
const (
	TransactionEventsTypeAuthorization                TransactionEventsType = "AUTHORIZATION"
	TransactionEventsTypeAuthorizationAdvice          TransactionEventsType = "AUTHORIZATION_ADVICE"
	TransactionEventsTypeAuthorizationExpiry          TransactionEventsType = "AUTHORIZATION_EXPIRY"
	TransactionEventsTypeAuthorizationReversal        TransactionEventsType = "AUTHORIZATION_REVERSAL"
	TransactionEventsTypeBalanceInquiry               TransactionEventsType = "BALANCE_INQUIRY"
	TransactionEventsTypeClearing                     TransactionEventsType = "CLEARING"
	TransactionEventsTypeCorrectionDebit              TransactionEventsType = "CORRECTION_DEBIT"
	TransactionEventsTypeCorrectionCredit             TransactionEventsType = "CORRECTION_CREDIT"
	TransactionEventsTypeCreditAuthorization          TransactionEventsType = "CREDIT_AUTHORIZATION"
	TransactionEventsTypeCreditAuthorizationAdvice    TransactionEventsType = "CREDIT_AUTHORIZATION_ADVICE"
	TransactionEventsTypeFinancialAuthorization       TransactionEventsType = "FINANCIAL_AUTHORIZATION"
	TransactionEventsTypeFinancialCreditAuthorization TransactionEventsType = "FINANCIAL_CREDIT_AUTHORIZATION"
	TransactionEventsTypeReturn                       TransactionEventsType = "RETURN"
	TransactionEventsTypeReturnReversal               TransactionEventsType = "RETURN_REVERSAL"
	TransactionEventsTypeVoid                         TransactionEventsType = "VOID"
)

type TransactionListParams

type TransactionListParams struct {
	// Filters for transactions associated with a specific account.
	AccountToken param.Field[string] `query:"account_token" format:"uuid"`
	// Filters for transactions associated with a specific card.
	CardToken param.Field[string] `query:"card_token" format:"uuid"`
	// Filters for transactions using transaction result field. Can filter by
	// `APPROVED`, and `DECLINED`.
	Result param.Field[TransactionListParamsResult] `query:"result"`
	// Date string in RFC 3339 format. Only entries created after the specified date
	// will be included. UTC time zone.
	Begin param.Field[time.Time] `query:"begin" format:"date-time"`
	// Date string in RFC 3339 format. Only entries created before the specified date
	// will be included. UTC time zone.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// Page (for pagination).
	Page param.Field[int64] `query:"page"`
	// Page size (for pagination).
	PageSize param.Field[int64] `query:"page_size"`
}

func (TransactionListParams) URLQuery

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

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

type TransactionListParamsResult

type TransactionListParamsResult string
const (
	TransactionListParamsResultApproved TransactionListParamsResult = "APPROVED"
	TransactionListParamsResultDeclined TransactionListParamsResult = "DECLINED"
)

type TransactionListResponse

type TransactionListResponse struct {
	Data []Transaction `json:"data,required"`
	// Page of the result.
	Page int64 `json:"page,required"`
	// Number of matched rows.
	TotalEntries int64 `json:"total_entries,required"`
	// Total pages of result.
	TotalPages int64 `json:"total_pages,required"`
	JSON       transactionListResponseJSON
}

func (*TransactionListResponse) UnmarshalJSON

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

type TransactionMerchant

type TransactionMerchant struct {
	// Unique identifier to identify the payment card acceptor.
	AcceptorID string `json:"acceptor_id"`
	// City of card acceptor.
	City string `json:"city"`
	// Uppercase country of card acceptor (see ISO 8583 specs).
	Country string `json:"country"`
	// Short description of card acceptor.
	Descriptor string `json:"descriptor"`
	// Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is
	// used to classify a business by the types of goods or services it provides.
	Mcc string `json:"mcc"`
	// Geographic state of card acceptor (see ISO 8583 specs).
	State string `json:"state"`
	JSON  transactionMerchantJSON
}

func (*TransactionMerchant) UnmarshalJSON

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

type TransactionNetwork

type TransactionNetwork string
const (
	TransactionNetworkInterlink  TransactionNetwork = "INTERLINK"
	TransactionNetworkMaestro    TransactionNetwork = "MAESTRO"
	TransactionNetworkMastercard TransactionNetwork = "MASTERCARD"
	TransactionNetworkVisa       TransactionNetwork = "VISA"
	TransactionNetworkUnknown    TransactionNetwork = "UNKNOWN"
)

type TransactionResult

type TransactionResult string
const (
	TransactionResultAccountStateTransaction TransactionResult = "ACCOUNT_STATE_TRANSACTION"
	TransactionResultApproved                TransactionResult = "APPROVED"
	TransactionResultBankConnectionError     TransactionResult = "BANK_CONNECTION_ERROR"
	TransactionResultBankNotVerified         TransactionResult = "BANK_NOT_VERIFIED"
	TransactionResultCardClosed              TransactionResult = "CARD_CLOSED"
	TransactionResultCardPaused              TransactionResult = "CARD_PAUSED"
	TransactionResultFraudAdvice             TransactionResult = "FRAUD_ADVICE"
	TransactionResultGlobalTransactionLimit  TransactionResult = "GLOBAL_TRANSACTION_LIMIT"
	TransactionResultGlobalWeeklyLimit       TransactionResult = "GLOBAL_WEEKLY_LIMIT"
	TransactionResultGlobalMonthlyLimit      TransactionResult = "GLOBAL_MONTHLY_LIMIT"
	TransactionResultInactiveAccount         TransactionResult = "INACTIVE_ACCOUNT"
	TransactionResultIncorrectPin            TransactionResult = "INCORRECT_PIN"
	TransactionResultInvalidCardDetails      TransactionResult = "INVALID_CARD_DETAILS"
	TransactionResultInsufficientFunds       TransactionResult = "INSUFFICIENT_FUNDS"
	TransactionResultMerchantBlacklist       TransactionResult = "MERCHANT_BLACKLIST"
	TransactionResultSingleUseRecharged      TransactionResult = "SINGLE_USE_RECHARGED"
	TransactionResultSwitchInoperativeAdvice TransactionResult = "SWITCH_INOPERATIVE_ADVICE"
	TransactionResultUnauthorizedMerchant    TransactionResult = "UNAUTHORIZED_MERCHANT"
	TransactionResultUnknownHostTimeout      TransactionResult = "UNKNOWN_HOST_TIMEOUT"
	TransactionResultUserTransactionLimit    TransactionResult = "USER_TRANSACTION_LIMIT"
)

type TransactionService

type TransactionService struct {
	Options []option.RequestOption
}

TransactionService contains methods and other services that help with interacting with the lithic 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, transaction_token string, opts ...option.RequestOption) (res *Transaction, err error)

Get specific transaction.

func (*TransactionService) List

List transactions.

func (*TransactionService) ListAutoPaging

List transactions.

func (*TransactionService) SimulateAuthorization

Simulates an authorization request from the payment network as if it came from a merchant acquirer. If you're configured for ASA, simulating auths requires your ASA client to be set up properly (respond with a valid JSON to the ASA request). For users that are not configured for ASA, a daily transaction limit of $5000 USD is applied by default. This limit can be modified via the [update account](https://docs.lithic.com/reference/patchaccountbytoken) endpoint.

func (*TransactionService) SimulateAuthorizationAdvice

Simulates an authorization advice request from the payment network as if it came from a merchant acquirer. An authorization advice request changes the amount of the transaction.

func (*TransactionService) SimulateClearing

Clears an existing authorization. After this event, the transaction is no longer pending.

If no `amount` is supplied to this endpoint, the amount of the transaction will be captured. Any transaction that has any amount completed at all do not have access to this behavior.

func (*TransactionService) SimulateCreditAuthorization

Simulates a credit authorization advice message from the payment network. This message indicates that a credit authorization was approved on your behalf by the network.

func (*TransactionService) SimulateReturn

Returns (aka refunds) an amount back to a card. Returns are cleared immediately and do not spend time in a `PENDING` state.

func (*TransactionService) SimulateReturnReversal

Voids a settled credit transaction – i.e., a transaction with a negative amount and `SETTLED` status. These can be credit authorizations that have already cleared or financial credit authorizations.

func (*TransactionService) SimulateVoid

Voids an existing, uncleared (aka pending) authorization. If amount is not sent the full amount will be voided. Cannot be used on partially completed transactions, but can be used on partially voided transactions. _Note that simulating an authorization expiry on credit authorizations or credit authorization advice is not currently supported but will be added soon._

type TransactionSimulateAuthorizationAdviceParams

type TransactionSimulateAuthorizationAdviceParams struct {
	// Amount (in cents) to authorize. This amount will override the transaction's
	// amount that was originally set by /v1/simulate/authorize.
	Amount param.Field[int64] `json:"amount,required"`
	// The transaction token returned from the /v1/simulate/authorize response.
	Token param.Field[string] `json:"token,required" format:"uuid"`
}

func (TransactionSimulateAuthorizationAdviceParams) MarshalJSON

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

type TransactionSimulateAuthorizationAdviceResponse

type TransactionSimulateAuthorizationAdviceResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	// A unique token to reference this transaction.
	Token string `json:"token" format:"uuid"`
	JSON  transactionSimulateAuthorizationAdviceResponseJSON
}

func (*TransactionSimulateAuthorizationAdviceResponse) UnmarshalJSON

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

type TransactionSimulateAuthorizationParams

type TransactionSimulateAuthorizationParams struct {
	// Amount (in cents) to authorize. For credit authorizations and financial credit
	// authorizations, any value entered will be converted into a negative amount in
	// the simulated transaction. For example, entering 100 in this field will appear
	// as a -100 amount in the transaction. For balance inquiries, this field must be
	// set to 0.
	Amount param.Field[int64] `json:"amount,required"`
	// Merchant descriptor.
	Descriptor param.Field[string] `json:"descriptor,required"`
	// Sixteen digit card number.
	Pan param.Field[string] `json:"pan,required"`
	// Type of event to simulate.
	//
	//   - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent
	//     clearing step is required to settle the transaction.
	//   - `BALANCE_INQUIRY` is a $0 authorization that includes a request for the
	//     balance held on the card, and is most typically seen when a cardholder
	//     requests to view a card's balance at an ATM.
	//   - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize
	//     a refund or credit, meaning a subsequent clearing step is required to settle
	//     the transaction.
	//   - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit
	//     funds immediately (such as an ATM withdrawal), and no subsequent clearing is
	//     required to settle the transaction.
	//   - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant
	//     to credit funds immediately, and no subsequent clearing is required to settle
	//     the transaction.
	Status param.Field[TransactionSimulateAuthorizationParamsStatus] `json:"status"`
	// Unique identifier to identify the payment card acceptor.
	MerchantAcceptorID param.Field[string] `json:"merchant_acceptor_id"`
	// 3-digit alphabetic ISO 4217 currency code.
	MerchantCurrency param.Field[string] `json:"merchant_currency"`
	// Amount of the transaction to be simulated in currency specified in
	// merchant_currency, including any acquirer fees.
	MerchantAmount param.Field[int64] `json:"merchant_amount"`
	// Merchant category code for the transaction to be simulated. A four-digit number
	// listed in ISO 18245. Supported merchant category codes can be found
	// [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
	Mcc param.Field[string] `json:"mcc"`
	// Set to true if the terminal is capable of partial approval otherwise false.
	// Partial approval is when part of a transaction is approved and another payment
	// must be used for the remainder.
	PartialApprovalCapable param.Field[bool] `json:"partial_approval_capable"`
}

func (TransactionSimulateAuthorizationParams) MarshalJSON

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

type TransactionSimulateAuthorizationParamsStatus

type TransactionSimulateAuthorizationParamsStatus string
const (
	TransactionSimulateAuthorizationParamsStatusAuthorization                TransactionSimulateAuthorizationParamsStatus = "AUTHORIZATION"
	TransactionSimulateAuthorizationParamsStatusBalanceInquiry               TransactionSimulateAuthorizationParamsStatus = "BALANCE_INQUIRY"
	TransactionSimulateAuthorizationParamsStatusCreditAuthorization          TransactionSimulateAuthorizationParamsStatus = "CREDIT_AUTHORIZATION"
	TransactionSimulateAuthorizationParamsStatusFinancialAuthorization       TransactionSimulateAuthorizationParamsStatus = "FINANCIAL_AUTHORIZATION"
	TransactionSimulateAuthorizationParamsStatusFinancialCreditAuthorization TransactionSimulateAuthorizationParamsStatus = "FINANCIAL_CREDIT_AUTHORIZATION"
)

type TransactionSimulateAuthorizationResponse

type TransactionSimulateAuthorizationResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	// A unique token to reference this transaction with later calls to void or clear
	// the authorization.
	Token string `json:"token" format:"uuid"`
	JSON  transactionSimulateAuthorizationResponseJSON
}

func (*TransactionSimulateAuthorizationResponse) UnmarshalJSON

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

type TransactionSimulateClearingParams

type TransactionSimulateClearingParams struct {
	// Amount (in cents) to complete. Typically this will match the original
	// authorization, but may be more or less.
	//
	// If no amount is supplied to this endpoint, the amount of the transaction will be
	// captured. Any transaction that has any amount completed at all do not have
	// access to this behavior.
	Amount param.Field[int64] `json:"amount"`
	// The transaction token returned from the /v1/simulate/authorize response.
	Token param.Field[string] `json:"token,required" format:"uuid"`
}

func (TransactionSimulateClearingParams) MarshalJSON

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

type TransactionSimulateClearingResponse

type TransactionSimulateClearingResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	JSON               transactionSimulateClearingResponseJSON
}

func (*TransactionSimulateClearingResponse) UnmarshalJSON

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

type TransactionSimulateCreditAuthorizationParams

type TransactionSimulateCreditAuthorizationParams struct {
	// Amount (in cents). Any value entered will be converted into a negative amount in
	// the simulated transaction. For example, entering 100 in this field will appear
	// as a -100 amount in the transaction.
	Amount param.Field[int64] `json:"amount,required"`
	// Merchant descriptor.
	Descriptor param.Field[string] `json:"descriptor,required"`
	// Sixteen digit card number.
	Pan param.Field[string] `json:"pan,required"`
	// Unique identifier to identify the payment card acceptor.
	MerchantAcceptorID param.Field[string] `json:"merchant_acceptor_id"`
	// Merchant category code for the transaction to be simulated. A four-digit number
	// listed in ISO 18245. Supported merchant category codes can be found
	// [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
	Mcc param.Field[string] `json:"mcc"`
}

func (TransactionSimulateCreditAuthorizationParams) MarshalJSON

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

type TransactionSimulateCreditAuthorizationResponse

type TransactionSimulateCreditAuthorizationResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	// A unique token to reference this transaction.
	Token string `json:"token" format:"uuid"`
	JSON  transactionSimulateCreditAuthorizationResponseJSON
}

func (*TransactionSimulateCreditAuthorizationResponse) UnmarshalJSON

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

type TransactionSimulateReturnParams

type TransactionSimulateReturnParams struct {
	// Amount (in cents) to authorize.
	Amount param.Field[int64] `json:"amount,required"`
	// Merchant descriptor.
	Descriptor param.Field[string] `json:"descriptor,required"`
	// Sixteen digit card number.
	Pan param.Field[string] `json:"pan,required"`
}

func (TransactionSimulateReturnParams) MarshalJSON

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

type TransactionSimulateReturnResponse

type TransactionSimulateReturnResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	// A unique token to reference this transaction.
	Token string `json:"token" format:"uuid"`
	JSON  transactionSimulateReturnResponseJSON
}

func (*TransactionSimulateReturnResponse) UnmarshalJSON

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

type TransactionSimulateReturnReversalParams

type TransactionSimulateReturnReversalParams struct {
	// The transaction token returned from the /v1/simulate/authorize response.
	Token param.Field[string] `json:"token,required" format:"uuid"`
}

func (TransactionSimulateReturnReversalParams) MarshalJSON

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

type TransactionSimulateReturnReversalResponse

type TransactionSimulateReturnReversalResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	JSON               transactionSimulateReturnReversalResponseJSON
}

func (*TransactionSimulateReturnReversalResponse) UnmarshalJSON

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

type TransactionSimulateVoidParams

type TransactionSimulateVoidParams struct {
	// Amount (in cents) to void. Typically this will match the original authorization,
	// but may be less.
	Amount param.Field[int64] `json:"amount"`
	// The transaction token returned from the /v1/simulate/authorize response.
	Token param.Field[string] `json:"token,required" format:"uuid"`
	// Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`.
	//
	//   - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed
	//     by Lithic.
	//   - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant.
	Type param.Field[TransactionSimulateVoidParamsType] `json:"type"`
}

func (TransactionSimulateVoidParams) MarshalJSON

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

type TransactionSimulateVoidParamsType

type TransactionSimulateVoidParamsType string
const (
	TransactionSimulateVoidParamsTypeAuthorizationExpiry   TransactionSimulateVoidParamsType = "AUTHORIZATION_EXPIRY"
	TransactionSimulateVoidParamsTypeAuthorizationReversal TransactionSimulateVoidParamsType = "AUTHORIZATION_REVERSAL"
)

type TransactionSimulateVoidResponse

type TransactionSimulateVoidResponse struct {
	// Debugging request ID to share with Lithic Support team.
	DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
	JSON               transactionSimulateVoidResponseJSON
}

func (*TransactionSimulateVoidResponse) UnmarshalJSON

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

type TransactionStatus

type TransactionStatus string
const (
	TransactionStatusBounced  TransactionStatus = "BOUNCED"
	TransactionStatusDeclined TransactionStatus = "DECLINED"
	TransactionStatusExpired  TransactionStatus = "EXPIRED"
	TransactionStatusPending  TransactionStatus = "PENDING"
	TransactionStatusSettled  TransactionStatus = "SETTLED"
	TransactionStatusSettling TransactionStatus = "SETTLING"
	TransactionStatusVoided   TransactionStatus = "VOIDED"
)

type Transfer

type Transfer struct {
	// Status types:
	//
	//   - `TRANSFER` - Internal transfer of funds between financial accounts in your
	//     program.
	Category TransferCategory `json:"category"`
	// Date and time when the transfer occurred. UTC time zone.
	Created time.Time `json:"created" format:"date-time"`
	// 3-digit alphabetic ISO 4217 code for the settling currency of the transaction.
	Currency string `json:"currency"`
	// A string that provides a description of the transfer; may be useful to display
	// to users.
	Descriptor string `json:"descriptor"`
	// A list of all financial events that have modified this trasnfer.
	Events []TransferEvents `json:"events"`
	// Pending amount of the transaction in the currency's smallest unit (e.g., cents),
	// including any acquirer fees. The value of this field will go to zero over time
	// once the financial transaction is settled.
	PendingAmount int64 `json:"pending_amount"`
	// APPROVED transactions were successful while DECLINED transactions were declined
	// by user, Lithic, or the network.
	Result TransferResult `json:"result"`
	// Amount of the transaction that has been settled in the currency's smallest unit
	// (e.g., cents).
	SettledAmount int64 `json:"settled_amount"`
	// Status types:
	//
	// - `DECLINED` - The transfer was declined.
	// - `EXPIRED` - The transfer was held in pending for too long and expired.
	// - `PENDING` - The transfer is pending release from a hold.
	// - `SETTLED` - The transfer is completed.
	// - `VOIDED` - The transfer was reversed before it settled.
	Status TransferStatus `json:"status"`
	// Globally unique identifier for the transfer event.
	Token string `json:"token" format:"uuid"`
	// Date and time when the financial transaction was last updated. UTC time zone.
	Updated time.Time `json:"updated" format:"date-time"`
	// The updated balance of the sending financial account.
	FromBalance []Balance `json:"from_balance"`
	// The updated balance of the receiving financial account.
	ToBalance []Balance `json:"to_balance"`
	JSON      transferJSON
}

func (*Transfer) UnmarshalJSON

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

type TransferCategory

type TransferCategory string
const (
	TransferCategoryTransfer TransferCategory = "TRANSFER"
)

type TransferCreateResponse

type TransferCreateResponse struct {
	Data Transfer `json:"data"`
	JSON transferCreateResponseJSON
}

func (*TransferCreateResponse) UnmarshalJSON

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

type TransferEvents

type TransferEvents struct {
	// Amount of the financial event that has been settled in the currency's smallest
	// unit (e.g., cents).
	Amount int64 `json:"amount"`
	// Date and time when the financial event occurred. UTC time zone.
	Created time.Time `json:"created" format:"date-time"`
	// APPROVED financial events were successful while DECLINED financial events were
	// declined by user, Lithic, or the network.
	Result TransferEventsResult `json:"result"`
	// Globally unique identifier.
	Token string `json:"token" format:"uuid"`
	// Event types:
	//
	//   - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to
	//     insufficient balance.
	//   - `ACH_ORIGINATION_PENDING` - ACH origination pending release from an ACH hold.
	//   - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to
	//     available balance.
	//   - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder.
	//   - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available
	//     balance.
	//   - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial
	//     Institution.
	//   - `AUTHORIZATION` - Authorize a card transaction.
	//   - `AUTHORIZATION_ADVICE` - Advice on a card transaction.
	//   - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by
	//     Lithic.
	//   - `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant.
	//   - `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
	//     occurred on a card.
	//   - `CLEARING` - Card Transaction is settled.
	//   - `CORRECTION_DEBIT` - Manual card transaction correction (Debit).
	//   - `CORRECTION_CREDIT` - Manual card transaction correction (Credit).
	//   - `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a
	//     merchant.
	//   - `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
	//     your behalf by the network.
	//   - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit card funds
	//     without additional clearing.
	//   - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or
	//     credit card funds without additional clearing.
	//   - `RETURN` - A card refund has been processed on the transaction.
	//   - `RETURN_REVERSAL` - A card refund has been reversed (e.g., when a merchant
	//     reverses an incorrect refund).
	//   - `TRANSFER` - Successful internal transfer of funds between financial accounts.
	//   - `TRANSFER_INSUFFICIENT_FUNDS` - Declined internl transfer of funds due to
	//     insufficient balance of the sender.
	Type TransferEventsType `json:"type"`
	JSON transferEventsJSON
}

func (*TransferEvents) UnmarshalJSON

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

type TransferEventsResult

type TransferEventsResult string
const (
	TransferEventsResultApproved TransferEventsResult = "APPROVED"
	TransferEventsResultDeclined TransferEventsResult = "DECLINED"
)

type TransferEventsType

type TransferEventsType string
const (
	TransferEventsTypeACHInsufficientFunds         TransferEventsType = "ACH_INSUFFICIENT_FUNDS"
	TransferEventsTypeACHOriginationPending        TransferEventsType = "ACH_ORIGINATION_PENDING"
	TransferEventsTypeACHOriginationReleased       TransferEventsType = "ACH_ORIGINATION_RELEASED"
	TransferEventsTypeACHReceiptPending            TransferEventsType = "ACH_RECEIPT_PENDING"
	TransferEventsTypeACHReceiptReleased           TransferEventsType = "ACH_RECEIPT_RELEASED"
	TransferEventsTypeACHReturn                    TransferEventsType = "ACH_RETURN"
	TransferEventsTypeAuthorization                TransferEventsType = "AUTHORIZATION"
	TransferEventsTypeAuthorizationAdvice          TransferEventsType = "AUTHORIZATION_ADVICE"
	TransferEventsTypeAuthorizationExpiry          TransferEventsType = "AUTHORIZATION_EXPIRY"
	TransferEventsTypeAuthorizationReversal        TransferEventsType = "AUTHORIZATION_REVERSAL"
	TransferEventsTypeBalanceInquiry               TransferEventsType = "BALANCE_INQUIRY"
	TransferEventsTypeClearing                     TransferEventsType = "CLEARING"
	TransferEventsTypeCorrectionDebit              TransferEventsType = "CORRECTION_DEBIT"
	TransferEventsTypeCorrectionCredit             TransferEventsType = "CORRECTION_CREDIT"
	TransferEventsTypeCreditAuthorization          TransferEventsType = "CREDIT_AUTHORIZATION"
	TransferEventsTypeCreditAuthorizationAdvice    TransferEventsType = "CREDIT_AUTHORIZATION_ADVICE"
	TransferEventsTypeFinancialAuthorization       TransferEventsType = "FINANCIAL_AUTHORIZATION"
	TransferEventsTypeFinancialCreditAuthorization TransferEventsType = "FINANCIAL_CREDIT_AUTHORIZATION"
	TransferEventsTypeReturn                       TransferEventsType = "RETURN"
	TransferEventsTypeReturnReversal               TransferEventsType = "RETURN_REVERSAL"
	TransferEventsTypeTransfer                     TransferEventsType = "TRANSFER"
	TransferEventsTypeTransferInsufficientFunds    TransferEventsType = "TRANSFER_INSUFFICIENT_FUNDS"
)

type TransferNewParams

type TransferNewParams struct {
	// Financial Account
	From param.Field[FinancialAccountParam] `json:"from,required"`
	// Financial Account
	To param.Field[FinancialAccountParam] `json:"to,required"`
	// Amount to be transferred in the currency’s smallest unit (e.g., cents for USD).
	// This should always be a positive value.
	Amount param.Field[int64] `json:"amount,required"`
	// Optional descriptor for the transfer.
	Memo param.Field[string] `json:"memo"`
	// Customer-provided transaction_token that will serve as an idempotency token.
	TransactionToken param.Field[string] `json:"transaction_token" format:"uuid"`
}

func (TransferNewParams) MarshalJSON

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

type TransferResult

type TransferResult string
const (
	TransferResultApproved TransferResult = "APPROVED"
	TransferResultDeclined TransferResult = "DECLINED"
)

type TransferService

type TransferService struct {
	Options []option.RequestOption
}

TransferService contains methods and other services that help with interacting with the lithic 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 NewTransferService method instead.

func NewTransferService

func NewTransferService(opts ...option.RequestOption) (r *TransferService)

NewTransferService 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 (*TransferService) New

Transfer funds between two financial accounts

type TransferStatus

type TransferStatus string
const (
	TransferStatusDeclined TransferStatus = "DECLINED"
	TransferStatusExpired  TransferStatus = "EXPIRED"
	TransferStatusPending  TransferStatus = "PENDING"
	TransferStatusSettled  TransferStatus = "SETTLED"
	TransferStatusVoided   TransferStatus = "VOIDED"
)

type WebhookService

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the lithic API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.

func NewWebhookService

func NewWebhookService(opts ...option.RequestOption) (r *WebhookService)

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

func (*WebhookService) VerifySignature

func (r *WebhookService) VerifySignature(payload []byte, headers http.Header, secret string, now time.Time) (err error)

Validates whether or not the webhook payload was sent by Lithic.

An error will be raised if the webhook payload was not sent by Lithic.

Directories

Path Synopsis
examples
card_embed_html command
dispute_upload command
union command

Jump to

Keyboard shortcuts

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