Documentation
¶
Overview ¶
Package tipalti is a production-grade Go client for the full Tipalti API surface: the modern OAuth2 REST API, the legacy HMAC-signed SOAP Payee/Payer API, and the Procurement REST API.
Architecture ¶
Internally this module is organized by Domain-Driven Design layers under internal/: domain (entities, value objects, and Port interfaces — no HTTP/XML/JSON knowledge), application (use-case services that orchestrate a domain Port, e.g. adding pagination streaming), infrastructure (adapters implementing each domain Port against Tipalti's actual REST/SOAP/Procurement wire formats). This file is the only .go file at the module root: it wires the layers together behind a single public Client and re-exports the types external callers need, since Go's internal/ convention means none of the packages above are importable outside this module.
Quick start ¶
client, err := tipalti.New(
tipalti.WithMode(tipalti.ModeSandbox),
tipalti.WithREST("client-id", "client-secret"),
tipalti.WithSOAP("payer-name", "api-key"),
tipalti.WithProcurement("procurement-api-key"),
)
if err != nil {
log.Fatal(err)
}
page, err := client.Payees.List(ctx, tipalti.PayeeListParams{})
result, err := client.SOAP.Payer.ProcessPayments(ctx, []map[string]any{
{"idap": "vendor-123", "amount": 100.00, "currency": "USD", "refCode": "pay-1"},
}, tipalti.ProcessPaymentsOptions{PaymentGroupTitle: "Weekly payout"})
pos, err := client.Procurement.PurchaseOrders.List(ctx, tipalti.PurchaseOrderListParams{})
Only populate the credential options for the API families you actually use — a Client built with just WithSOAP is fine as long as you only call client.SOAP.* methods.
Index ¶
- Constants
- Variables
- func Collect[T any](s *Stream[T]) ([]T, error)
- type APIError
- type AuthenticationError
- type Client
- type InvoiceListParams
- type Mode
- type NetworkError
- type Option
- type Page
- type PayeeListParams
- type PayeeStatus
- type PaymentListParams
- type ProcessPaymentsOptions
- type PurchaseOrderListParams
- type RateLimitError
- type RateLimiter
- type Resource
- type SOAPFaultError
- type SOAPResult
- type Stream
- type TelemetryEvent
- type TelemetryFunc
- type TelemetryHook
- type UploadURL
- type ValidationError
- type WebhookEvent
Constants ¶
const ( ModeSandbox = config.ModeSandbox ModeProduction = config.ModeProduction )
const ( PayeeStatusActive = soappayeeapp.PayeeStatusActive PayeeStatusSuspended = soappayeeapp.PayeeStatusSuspended PayeeStatusBlocked = soappayeeapp.PayeeStatusBlocked )
Variables ¶
var ( WithMode = config.WithMode WithREST = config.WithREST WithSOAP = config.WithSOAP WithProcurement = config.WithProcurement WithRESTBaseURL = config.WithRESTBaseURL WithSOAPBaseURL = config.WithSOAPBaseURL WithProcurementBaseURL = config.WithProcurementBaseURL WithSOAPVersion = config.WithSOAPVersion WithReceiveTimeout = config.WithReceiveTimeout WithMaxRetries = config.WithMaxRetries WithTelemetryHook = config.WithTelemetryHook )
Functions ¶
Types ¶
type AuthenticationError ¶
type AuthenticationError = apperrors.AuthenticationError
type Client ¶
type Client struct {
// Payees, Invoices, Payments cover the modern OAuth2 REST API.
Payees *payeeapp.Service
Invoices *invoiceapp.Service
Payments *paymentapp.Service
// SOAP covers the legacy HMAC-signed SOAP API.
SOAP struct {
Payee *soappayeeapp.Service
Payer *soappayerapp.Service
}
// Procurement covers the Procurement REST API.
Procurement struct {
PurchaseOrders *procurementapp.PurchaseOrderService
Employees *procurementapp.EmployeeService
}
}
Client is the entry point for every Tipalti API family this module covers. Build one with New.
func (*Client) InvoiceStream ¶
InvoiceStream returns every invoice across all pages, fetching pages on demand as the returned Stream's channel is consumed.
func (*Client) PayeeStream ¶
PayeeStream returns every payee across all pages, fetching pages on demand as the returned Stream's channel is consumed.
func (*Client) PaymentStream ¶
PaymentStream returns every payment across all pages, fetching pages on demand as the returned Stream's channel is consumed.
type InvoiceListParams ¶
type InvoiceListParams = invoice.ListParams
type NetworkError ¶
type NetworkError = apperrors.NetworkError
type PayeeListParams ¶
type PayeeListParams = payee.ListParams
type PayeeStatus ¶
type PayeeStatus = soappayeeapp.PayeeStatus
type PaymentListParams ¶
type PaymentListParams = payment.ListParams
type ProcessPaymentsOptions ¶
type ProcessPaymentsOptions = soappayerapp.ProcessPaymentsOptions
type PurchaseOrderListParams ¶
type PurchaseOrderListParams = purchaseorder.ListParams
type RateLimitError ¶
type RateLimitError = apperrors.RateLimitError
type RateLimiter ¶
RateLimiter is an optional, self-contained token-bucket rate limiter, useful for staying under the Procurement API's documented request limits client-side rather than relying solely on 429 retries.
func NewRateLimiter ¶
func NewRateLimiter(rate int, per time.Duration) *RateLimiter
NewRateLimiter builds a RateLimiter allowing rate operations per the given duration (e.g. NewRateLimiter(5, time.Minute)).
type SOAPFaultError ¶
type SOAPFaultError = apperrors.SOAPFaultError
type SOAPResult ¶
SOAPResult is the parsed, flattened set of child elements from a SOAP operation's response element.
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
Stream is a lazily-fetched sequence of paginated results. See PayeeStream et al.
type TelemetryEvent ¶
type TelemetryEvent = telemetry.RequestEvent
TelemetryEvent describes one completed (or failed) HTTP request attempt.
type TelemetryFunc ¶
TelemetryFunc adapts a plain function to the TelemetryHook interface.
type TelemetryHook ¶
TelemetryHook receives a callback for every HTTP request attempt this module makes, across all three API families. See WithTelemetryHook.
type ValidationError ¶
type ValidationError = apperrors.ValidationError
type WebhookEvent ¶
WebhookEvent is a parsed Tipalti IPN notification. See ParseWebhook.
func ParseWebhook ¶
func ParseWebhook(rawBody string) (WebhookEvent, error)
ParseWebhook parses a raw application/x-www-form-urlencoded IPN request body. See the webhook package doc comment (internal/webhook/webhook.go) for Tipalti's IPN delivery model and verification guidance.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
apperrors
Package apperrors defines the typed error hierarchy returned by every package in this module.
|
Package apperrors defines the typed error hierarchy returned by every package in this module. |
|
application/invoiceapp
Package invoiceapp orchestrates invoice use cases over invoice.Port.
|
Package invoiceapp orchestrates invoice use cases over invoice.Port. |
|
application/payeeapp
Package payeeapp orchestrates payee use cases over the payee.Port, adding cross-cutting behavior (pagination streaming) the domain port itself doesn't need to know about.
|
Package payeeapp orchestrates payee use cases over the payee.Port, adding cross-cutting behavior (pagination streaming) the domain port itself doesn't need to know about. |
|
application/paymentapp
Package paymentapp orchestrates payment use cases over payment.Port.
|
Package paymentapp orchestrates payment use cases over payment.Port. |
|
application/procurementapp
Package procurementapp orchestrates Procurement API use cases: purchase order sync and the employee CSV import flow.
|
Package procurementapp orchestrates Procurement API use cases: purchase order sync and the employee CSV import flow. |
|
application/soappayeeapp
Package soappayeeapp provides typed wrappers over soap.Caller for every legacy SOAP Payee Functions operation.
|
Package soappayeeapp provides typed wrappers over soap.Caller for every legacy SOAP Payee Functions operation. |
|
application/soappayerapp
Package soappayerapp provides typed wrappers over soap.Caller for every legacy SOAP Payer Functions operation.
|
Package soappayerapp provides typed wrappers over soap.Caller for every legacy SOAP Payer Functions operation. |
|
config
Package config holds credentials and connection settings for all three Tipalti API families, built via functional options.
|
Package config holds credentials and connection settings for all three Tipalti API families, built via functional options. |
|
domain/employee
Package employee defines the domain contract for the Procurement REST API's bulk employee CSV import flow (get a signed upload URL, upload the CSV, trigger the import).
|
Package employee defines the domain contract for the Procurement REST API's bulk employee CSV import flow (get a signed upload URL, upload the CSV, trigger the import). |
|
domain/invoice
Package invoice defines the domain contract for the modern REST API's invoice/bill management operations.
|
Package invoice defines the domain contract for the modern REST API's invoice/bill management operations. |
|
domain/payee
Package payee defines the domain contract for the modern REST API's payee management operations.
|
Package payee defines the domain contract for the modern REST API's payee management operations. |
|
domain/payment
Package payment defines the domain contract for the modern REST API's mass-payout initiation and tracking operations.
|
Package payment defines the domain contract for the modern REST API's mass-payout initiation and tracking operations. |
|
domain/purchaseorder
Package purchaseorder defines the domain contract for the Procurement REST API's purchase-order sync operations.
|
Package purchaseorder defines the domain contract for the Procurement REST API's purchase-order sync operations. |
|
domain/shared
Package shared holds value objects and types used across every domain package (payee, invoice, payment, purchaseorder, employee).
|
Package shared holds value objects and types used across every domain package (payee, invoice, payment, purchaseorder, employee). |
|
domain/soap
Package soap defines the domain contract for the legacy, HMAC-signed SOAP API shared by both the Payee and Payer Functions services.
|
Package soap defines the domain contract for the legacy, HMAC-signed SOAP API shared by both the Payee and Payer Functions services. |
|
infrastructure/httptransport
Package httptransport is the shared HTTP transport used by every Tipalti API adapter (REST, SOAP, Procurement).
|
Package httptransport is the shared HTTP transport used by every Tipalti API adapter (REST, SOAP, Procurement). |
|
infrastructure/oauth2
Package oauth2 caches and refreshes OAuth 2.0 client-credentials access tokens for the modern Tipalti REST API.
|
Package oauth2 caches and refreshes OAuth 2.0 client-credentials access tokens for the modern Tipalti REST API. |
|
infrastructure/procurementadapter
Package procurementadapter implements the purchaseorder/employee domain ports against Tipalti's Procurement REST API (static x-api-key auth).
|
Package procurementadapter implements the purchaseorder/employee domain ports against Tipalti's Procurement REST API (static x-api-key auth). |
|
infrastructure/restadapter
Package restadapter implements the payee/invoice/payment domain ports against Tipalti's modern OAuth2 REST API.
|
Package restadapter implements the payee/invoice/payment domain ports against Tipalti's modern OAuth2 REST API. |
|
infrastructure/soapadapter
Package soapadapter implements soap.Caller against Tipalti's legacy HMAC-signed SOAP API (PayeeFunctions.asmx / PayerFunctions.asmx).
|
Package soapadapter implements soap.Caller against Tipalti's legacy HMAC-signed SOAP API (PayeeFunctions.asmx / PayerFunctions.asmx). |
|
pagination
Package pagination provides generic, channel-based auto-pagination over cursor-paginated list endpoints.
|
Package pagination provides generic, channel-based auto-pagination over cursor-paginated list endpoints. |
|
ratelimit
Package ratelimit provides an optional, self-contained token-bucket rate limiter.
|
Package ratelimit provides an optional, self-contained token-bucket rate limiter. |
|
telemetry
Package telemetry defines a minimal, dependency-free observability hook that every HTTP request in this module reports through.
|
Package telemetry defines a minimal, dependency-free observability hook that every HTTP request in this module reports through. |
|
webhook
Package webhook parses Tipalti IPN (Instant Payment Notification) callbacks.
|
Package webhook parses Tipalti IPN (Instant Payment Notification) callbacks. |