Documentation
¶
Overview ¶
Package moov is the root package of the moov-go SDK.
Create a client, then either use the Moov facade (which holds every service) or construct individual domain services directly:
// Using the facade
client := moov.NewClientWithBasicAuth(pubKey, privKey,
moov.WithAPIVersion("v2026.04.00"),
)
m := moov.New(client)
account, err := m.Accounts.Create(ctx, accounts.CreateRequest{...})
transfer, err := m.Transfers.Create(ctx, accountID, transfers.CreateRequest{...})
// Using domain services directly
acctSvc := accounts.NewService(client)
xferSvc := transfers.NewService(client)
Error handling ¶
Every method returns (*T, error). On API errors the error wraps an *errors.APIError accessible via errors.As:
import mooverr "github.com/fintech-sdk/moov-go/errors"
acct, err := m.Accounts.Get(ctx, accountID)
if mooverr.IsNotFound(err) { return nil }
var e *mooverr.APIError
if stdErrors.As(err, &e) {
log.Printf("status=%d requestID=%s", e.StatusCode, e.RequestID)
}
Idempotency ¶
[Transfers.Create] automatically generates a UUID v4 idempotency key and reuses it across every retry attempt. Pin your own key to stay deduplicated across process restarts:
m.Transfers.Create(ctx, accountID, req,
moov.WithIdempotencyKey("order-"+order.ID),
)
Webhook verification ¶
Use the [webhook] sub-package:
import "github.com/fintech-sdk/moov-go/webhook" event, err := webhook.ParseEvent(r.Header, body, secret)
Domain packages ¶
Each Moov API resource group is a distinct package:
github.com/fintech-sdk/moov-go/accounts github.com/fintech-sdk/moov-go/capabilities github.com/fintech-sdk/moov-go/representatives github.com/fintech-sdk/moov-go/underwriting github.com/fintech-sdk/moov-go/billing github.com/fintech-sdk/moov-go/files github.com/fintech-sdk/moov-go/onboarding github.com/fintech-sdk/moov-go/resolution github.com/fintech-sdk/moov-go/partner github.com/fintech-sdk/moov-go/bankaccounts github.com/fintech-sdk/moov-go/cards github.com/fintech-sdk/moov-go/applepay github.com/fintech-sdk/moov-go/googlepay github.com/fintech-sdk/moov-go/paymentmethods github.com/fintech-sdk/moov-go/terminal github.com/fintech-sdk/moov-go/wallets github.com/fintech-sdk/moov-go/transfers github.com/fintech-sdk/moov-go/sweeps github.com/fintech-sdk/moov-go/refunds github.com/fintech-sdk/moov-go/disputes github.com/fintech-sdk/moov-go/issuing github.com/fintech-sdk/moov-go/invoices github.com/fintech-sdk/moov-go/paymentlinks github.com/fintech-sdk/moov-go/receipts github.com/fintech-sdk/moov-go/schedules github.com/fintech-sdk/moov-go/images github.com/fintech-sdk/moov-go/products github.com/fintech-sdk/moov-go/support github.com/fintech-sdk/moov-go/branding github.com/fintech-sdk/moov-go/enrichment github.com/fintech-sdk/moov-go/institutions github.com/fintech-sdk/moov-go/auth github.com/fintech-sdk/moov-go/e2ee github.com/fintech-sdk/moov-go/ping
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client = httpclient.Client
Client is the Moov API HTTP client. Create one with NewClientWithBasicAuth or NewClientWithToken, then pass it to domain service constructors or New.
func NewClientWithBasicAuth ¶
NewClientWithBasicAuth creates a Client authenticated with a public/private key pair (server-side integrations). Always set WithAPIVersion explicitly.
func NewClientWithToken ¶
NewClientWithToken creates a Client authenticated with a short-lived bearer access token (client-side / Moov.js integrations). Obtain a token via auth.Service.Create.
type Moov ¶
type Moov struct {
// Core
Ping *ping.Service
// Moov accounts bounded context
Accounts *accounts.Service
Capabilities *capabilities.Service
Representatives *representatives.Service
Underwriting *underwriting.Service
Billing *billing.Service
Files *files.Service
Onboarding *onboarding.Service
Resolution *resolution.Service
Partner *partner.Service
// Sources bounded context
BankAccounts *bankaccounts.Service
Cards *cards.Service
ApplePay *applepay.Service
GooglePay *googlepay.Service
PaymentMethods *paymentmethods.Service
Terminal *terminal.Service
Wallets *wallets.Service
// Money movement bounded context
Transfers *transfers.Service
Sweeps *sweeps.Service
Refunds *refunds.Service
Disputes *disputes.Service
Issuing *issuing.Service
Invoices *invoices.Service
PaymentLinks *paymentlinks.Service
Receipts *receipts.Service
Schedules *schedules.Service
// Account tools bounded context
Images *images.Service
Products *products.Service
Support *support.Service
// Enrichment bounded context
Branding *branding.Service
Enrichment *enrichment.Service
Institutions *institutions.Service
// Authentication bounded context
Auth *auth.Service
E2EE *e2ee.Service
}
Moov holds every domain service backed by the same Client. Construct one with New.
Each field is a pointer to a domain-specific service whose methods map 1-to-1 with the Moov API endpoints for that resource group.
type Option ¶
type Option = httpclient.Option
Option configures a Client at construction time.
func WithAPIVersion ¶
WithAPIVersion sets the X-Moov-Version header. Always set this explicitly — Moov silently falls back to v2024.01.00 otherwise.
func WithBaseURL ¶
WithBaseURL overrides the API base URL (e.g. for a test server).
func WithHTTPClient ¶
WithHTTPClient replaces the underlying *http.Client.
func WithLogger ¶
WithLogger attaches a *slog.Logger for request/retry telemetry.
func WithMaxRetries ¶
WithMaxRetries sets how many additional attempts to make on transient failures.
type RequestOption ¶
type RequestOption = httpclient.RequestOption
RequestOption customizes a single API call.
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) RequestOption
WithIdempotencyKey pins an explicit idempotency key for a single call.
func WithRequestAPIVersion ¶
func WithRequestAPIVersion(v string) RequestOption
WithRequestAPIVersion overrides the API version for a single call.
func WithRequestMaxRetries ¶
func WithRequestMaxRetries(n int) RequestOption
WithRequestMaxRetries overrides the retry count for a single call.
func WithWaitFor ¶
func WithWaitFor(value string) RequestOption
WithWaitFor sets X-Wait-For (e.g. "rail-response" for synchronous transfer creation).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package accounts provides types and a service for the Moov accounts API.
|
Package accounts provides types and a service for the Moov accounts API. |
|
Package applepay provides types and a service for the Moov Apple Pay API.
|
Package applepay provides types and a service for the Moov Apple Pay API. |
|
Package bankaccounts provides types and a service for the Moov bank accounts API.
|
Package bankaccounts provides types and a service for the Moov bank accounts API. |
|
Package billing provides types and a service for the Moov billing API.
|
Package billing provides types and a service for the Moov billing API. |
|
Package capabilities provides types and a service for the Moov capabilities API.
|
Package capabilities provides types and a service for the Moov capabilities API. |
|
Package cards provides types and a service for the Moov cards API.
|
Package cards provides types and a service for the Moov cards API. |
|
Package errors provides the public error type and helpers for the moov-go SDK.
|
Package errors provides the public error type and helpers for the moov-go SDK. |
|
Package files provides types and a service for the Moov files API.
|
Package files provides types and a service for the Moov files API. |
|
Package googlepay provides types and a service for the Moov Google Pay API.
|
Package googlepay provides types and a service for the Moov Google Pay API. |
|
internal
|
|
|
httpclient
Package httpclient is the internal HTTP engine for the moov-go SDK.
|
Package httpclient is the internal HTTP engine for the moov-go SDK. |
|
Package onboarding provides types and a service for the Moov onboarding links API.
|
Package onboarding provides types and a service for the Moov onboarding links API. |
|
Package partner provides types and a service for the Moov partner billing API.
|
Package partner provides types and a service for the Moov partner billing API. |
|
Package paymentmethods provides types and a service for the Moov payment methods API.
|
Package paymentmethods provides types and a service for the Moov payment methods API. |
|
Package representatives provides types and a service for the Moov representatives API.
|
Package representatives provides types and a service for the Moov representatives API. |
|
Package resolution provides types and a service for the Moov resolution links API.
|
Package resolution provides types and a service for the Moov resolution links API. |
|
Package terminal provides types and a service for the Moov terminal applications API.
|
Package terminal provides types and a service for the Moov terminal applications API. |
|
Package transfers provides types and a service for the Moov transfers API.
|
Package transfers provides types and a service for the Moov transfers API. |
|
Package types contains primitive value types shared across multiple moov-go domain packages (Amount, Address, Phone, etc.).
|
Package types contains primitive value types shared across multiple moov-go domain packages (Amount, Address, Phone, etc.). |
|
Package underwriting provides types and a service for the Moov underwriting API.
|
Package underwriting provides types and a service for the Moov underwriting API. |
|
Package wallets provides types and a service for the Moov wallets API.
|
Package wallets provides types and a service for the Moov wallets API. |
|
Package webhook provides Moov webhook signature verification and event parsing.
|
Package webhook provides Moov webhook signature verification and event parsing. |