Documentation
¶
Overview ¶
Package raw contains Wise API wire-format types used for JSON deserialization. These types mirror Wise's JSON exactly and are not part of the public API.
Index ¶
- type AccountRequirement
- type Balance
- type BalanceAmount
- type BankAccountCurrency
- type BankAccountDetails
- type BankOptionCTA
- type BankOptionDescription
- type BankReceiveOption
- type CurrencyInfo
- type DeliveryEstimate
- type ErrorDetail
- type ErrorResponse
- type ExchangeDetails
- type ExchangeRate
- type FundingResponse
- type MultiCurrencyAccount
- type Profile
- type Quote
- type QuoteFee
- type QuoteNotice
- type QuotePaymentOption
- type Recipient
- type StatementResponse
- type StatementTransaction
- type TotalFunds
- type TransactionDetails
- type Transfer
- type TransferDetails
- type TransferRequirement
- type TransferRequirementField
- type TransferRequirementForm
- type TransferRequirementValue
- type User
- type UserAddress
- type UserDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRequirement ¶ added in v0.9.0
type AccountRequirement struct {
Type string `json:"type"`
Title string `json:"title"`
UsageInfo string `json:"usageInfo"`
Fields []TransferRequirementForm `json:"fields"`
}
AccountRequirement from the account-requirements endpoint (GET /v1/quotes/{quoteId}/account-requirements). One dynamic form per available payout route; Fields reuses the transfer-requirements form shape.
type Balance ¶
type Balance struct {
ID int64 `json:"id"`
Currency string `json:"currency"`
Type string `json:"type"` // "STANDARD" or "SAVINGS"
Name string `json:"name"`
InvestmentState string `json:"investmentState"`
Amount BalanceAmount `json:"amount"`
ReservedAmount BalanceAmount `json:"reservedAmount"`
CreationTime string `json:"creationTime"`
ModificationTime string `json:"modificationTime"`
Visible bool `json:"visible"`
}
Balance from Wise API (/v4/profiles/{id}/balances).
type BalanceAmount ¶
BalanceAmount represents a monetary amount from the Wise API. Value is a float64 in major units (e.g., 1234.56 means 1234.56). Always convert to int64 cents via Cents() for precision-safe arithmetic.
func (BalanceAmount) Cents ¶
func (a BalanceAmount) Cents() int64
Cents converts a BalanceAmount to int64 minor units (cents). Uses math.Round to handle IEEE 754 floating-point representation errors.
type BankAccountCurrency ¶ added in v0.9.0
BankAccountCurrency names the currency of a bank-account-details set.
type BankAccountDetails ¶ added in v0.9.0
type BankAccountDetails struct {
ID *int64 `json:"id"` // nil for preview details
Currency BankAccountCurrency `json:"currency"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
Status string `json:"status"` // "AVAILABLE" or "ACTIVE"
Deprecated bool `json:"deprecated"`
ReceiveOptions []BankReceiveOption `json:"receiveOptions"`
}
BankAccountDetails from Wise API (GET /v1/profiles/{profileId}/account-details).
type BankOptionCTA ¶ added in v0.9.0
BankOptionCTA labels the key value of a receive option (e.g. "IBAN").
type BankOptionDescription ¶ added in v0.9.0
type BankOptionDescription struct {
Title string `json:"title"`
Body string `json:"body"`
CTA *BankOptionCTA `json:"cta"`
}
BankOptionDescription carries the display text of a receive option.
type BankReceiveOption ¶ added in v0.9.0
type BankReceiveOption struct {
Type string `json:"type"` // "LOCAL" or "INTERNATIONAL"
Title string `json:"title"`
Description *BankOptionDescription `json:"description"`
}
BankReceiveOption is one receive route (local or SWIFT) of a details set.
type CurrencyInfo ¶ added in v0.9.0
type CurrencyInfo struct {
Code string `json:"code"`
Symbol string `json:"symbol"`
Name string `json:"name"`
CountryKeywords []string `json:"countryKeywords"`
SupportsDecimals bool `json:"supportsDecimals"`
}
CurrencyInfo from Wise API (GET /v1/currencies).
type DeliveryEstimate ¶ added in v0.8.0
type DeliveryEstimate struct {
EstimatedDeliveryDate string `json:"estimatedDeliveryDate"`
FormattedEstimatedDeliveryDate string `json:"formattedEstimatedDeliveryDate"`
}
DeliveryEstimate from Wise API (/v1/delivery-estimates/{transferId}). EstimatedDeliveryDate uses Wise's zone-suffixed ISO-8601 layout ("2018-01-10T12:15:00.000+0000"), which differs from RFC3339.
type ErrorDetail ¶
ErrorDetail contains error information from the Wise API.
type ErrorResponse ¶
type ErrorResponse struct {
Errors []ErrorDetail `json:"errors"`
}
ErrorResponse from Wise API.
type ExchangeDetails ¶
type ExchangeDetails struct {
FromAmount BalanceAmount `json:"fromAmount"`
ToAmount BalanceAmount `json:"toAmount"`
Rate float64 `json:"rate"`
FromCurrency string `json:"fromCurrency"`
ToCurrency string `json:"toCurrency"`
}
ExchangeDetails for currency conversion transactions.
type ExchangeRate ¶ added in v0.8.0
type ExchangeRate struct {
Source string `json:"source"`
Target string `json:"target"`
Rate float64 `json:"rate"`
Time string `json:"time"`
}
ExchangeRate from Wise API (/v1/rates).
type FundingResponse ¶ added in v0.9.0
type FundingResponse struct {
Type string `json:"type"`
Status string `json:"status"`
ErrorCode string `json:"errorCode,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
BalanceTransactionID *int64 `json:"balanceTransactionId,omitempty"`
PartnerReference string `json:"partnerReference,omitempty"`
}
FundingResponse from the fund-transfer endpoint (POST /v1/profiles/{profileId}/transfers/{transferId}/payments). The payload is discriminated by "type": the BALANCE variant carries balanceTransactionId, the trusted-pre-fund variants carry partnerReference.
type MultiCurrencyAccount ¶ added in v0.9.0
type MultiCurrencyAccount struct {
ID int64 `json:"id"`
ProfileID int64 `json:"profileId"`
RecipientID int64 `json:"recipientId"`
CreationTime string `json:"creationTime"`
ModificationTime string `json:"modificationTime"`
Active bool `json:"active"`
Eligible bool `json:"eligible"`
}
MultiCurrencyAccount from Wise API (GET /v1/profiles/{profileId}/multi-currency-account).
type Profile ¶
type Profile struct {
ID int64 `json:"id"`
PublicID string `json:"publicId"`
UserID int64 `json:"userId"`
Type string `json:"type"` // "PERSONAL" or "BUSINESS"
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
BusinessName string `json:"businessName,omitempty"`
Email string `json:"email"`
CreatedAt string `json:"createdAt"`
}
Profile from Wise API (/v2/profiles).
type Quote ¶ added in v0.8.0
type Quote struct {
ID string `json:"id,omitempty"`
SourceCurrency string `json:"sourceCurrency"`
TargetCurrency string `json:"targetCurrency"`
SourceAmount float64 `json:"sourceAmount"`
TargetAmount float64 `json:"targetAmount"`
PayIn string `json:"payIn"`
PayOut string `json:"payOut"`
Rate float64 `json:"rate"`
CreatedTime string `json:"createdTime"`
ExpirationTime string `json:"expirationTime"`
Status string `json:"status"`
Profile int64 `json:"profile"`
RateType string `json:"rateType"`
ProvidedAmountType string `json:"providedAmountType"`
GuaranteedTargetAmountAllowed bool `json:"guaranteedTargetAmountAllowed"`
GuaranteedTargetAmount bool `json:"guaranteedTargetAmount"`
PaymentOptions []QuotePaymentOption `json:"paymentOptions"`
Notices []QuoteNotice `json:"notices"`
}
Quote from Wise API (/v3/quotes). ID is a UUID string; it is omitted for unauthenticated quotes.
type QuoteFee ¶ added in v0.8.0
type QuoteFee struct {
TransferWise float64 `json:"transferwise"`
PayIn float64 `json:"payIn"`
Discount float64 `json:"discount"`
Partner float64 `json:"partner"`
Total float64 `json:"total"`
}
QuoteFee is the fee breakdown for a quote payment option. All values are in major source-currency units, matching Wise's wire format; convert with Money conversions at the consumer boundary.
type QuoteNotice ¶ added in v0.8.0
type QuoteNotice struct {
Text string `json:"text"`
Link *string `json:"link"`
Type string `json:"type"`
}
QuoteNotice is a message Wise wants shown to the user about a quote.
type QuotePaymentOption ¶ added in v0.8.0
type QuotePaymentOption struct {
Disabled bool `json:"disabled"`
EstimatedDelivery string `json:"estimatedDelivery"`
FormattedEstimatedDelivery string `json:"formattedEstimatedDelivery"`
Fee QuoteFee `json:"fee"`
SourceAmount float64 `json:"sourceAmount"`
TargetAmount float64 `json:"targetAmount"`
SourceCurrency string `json:"sourceCurrency"`
TargetCurrency string `json:"targetCurrency"`
PayIn string `json:"payIn"`
PayOut string `json:"payOut"`
PayInProduct string `json:"payInProduct"`
FeePercentage float64 `json:"feePercentage"`
}
QuotePaymentOption is one payment method combination available for a quote.
type Recipient ¶ added in v0.8.0
type Recipient struct {
ID int64 `json:"id"`
AccountHolderName string `json:"accountHolderName"`
Currency string `json:"currency"`
Country string `json:"country"`
Type string `json:"type"`
Details map[string]any `json:"details"`
Active bool `json:"active"`
}
Recipient from Wise API (/v1/accounts, /v2/accounts).
type StatementResponse ¶
type StatementResponse struct {
Transactions []StatementTransaction `json:"transactions"`
EndOfStatementBalance BalanceAmount `json:"endOfStatementBalance"`
}
StatementResponse from balance-statements endpoint.
type StatementTransaction ¶
type StatementTransaction struct {
TransactionID string `json:"transactionId"`
Date string `json:"date"`
Amount BalanceAmount `json:"amount"`
TotalFees BalanceAmount `json:"totalFees"`
Details TransactionDetails `json:"details"`
ExchangeDetails *ExchangeDetails `json:"exchangeDetails,omitempty"`
RunningBalance BalanceAmount `json:"runningBalance"`
ReferenceNumber string `json:"referenceNumber"`
}
StatementTransaction from Wise balance statements.
type TotalFunds ¶ added in v0.9.0
type TotalFunds struct {
TotalWorth BalanceAmount `json:"totalWorth"`
TotalAvailable BalanceAmount `json:"totalAvailable"`
}
TotalFunds from Wise API (GET /v4/profiles/{id}/total-funds/{currency}).
type TransactionDetails ¶
type TransactionDetails struct {
Type string `json:"type"`
Description string `json:"description"`
Category string `json:"category,omitempty"`
MerchantName string `json:"merchantName,omitempty"`
MerchantCategoryCode int `json:"merchantCategoryCode,omitempty"`
PaymentReference string `json:"paymentReference,omitempty"`
TransferReference string `json:"transferReference,omitempty"`
}
TransactionDetails contains transaction metadata.
type Transfer ¶ added in v0.7.0
type Transfer struct {
ID int64 `json:"id"`
User int64 `json:"user"`
TargetAccount int64 `json:"targetAccount"`
SourceAccount *int64 `json:"sourceAccount"`
Quote *int64 `json:"quote"`
QuoteUUID string `json:"quoteUuid"`
Status string `json:"status"`
Rate float64 `json:"rate"`
Created string `json:"created"`
Business *int64 `json:"business"`
Details TransferDetails `json:"details"`
HasActiveIssues bool `json:"hasActiveIssues"`
SourceCurrency string `json:"sourceCurrency"`
SourceValue float64 `json:"sourceValue"`
TargetCurrency string `json:"targetCurrency"`
TargetValue float64 `json:"targetValue"`
CustomerTransactionID string `json:"customerTransactionId"`
Reference string `json:"reference"` // Deprecated by Wise: prefer Details.Reference.
}
Transfer from Wise API (/v1/transfers, /v1/transfers/{id}).
The list and get endpoints return the same object shape. Field set mirrors the documented Standard Transfer response; unknown fields are ignored by the JSON decoder so Wise can add fields without breaking the SDK.
type TransferDetails ¶ added in v0.7.0
type TransferDetails struct {
Reference string `json:"reference"`
}
TransferDetails is the details block of a Transfer.
type TransferRequirement ¶ added in v0.8.0
type TransferRequirement struct {
Type string `json:"type"`
Fields []TransferRequirementForm `json:"fields"`
}
TransferRequirement from Wise API (POST /v1/transfer-requirements). Fields is a dynamic form description: each entry groups one or more form controls (keyed by the JSON field name they map to) with validation metadata and, for selects, the list of allowed values.
type TransferRequirementField ¶ added in v0.8.0
type TransferRequirementField struct {
Key string `json:"key"`
Name string `json:"name"`
Type string `json:"type"`
RefreshRequirementsOnChange bool `json:"refreshRequirementsOnChange"`
Required bool `json:"required"`
DisplayFormat *string `json:"displayFormat"`
Example *string `json:"example"`
MinLength *int32 `json:"minLength"`
MaxLength *int32 `json:"maxLength"`
ValidationRegexp *string `json:"validationRegexp"`
ValuesAllowed []TransferRequirementValue `json:"valuesAllowed"`
}
TransferRequirementField describes a single dynamic form control.
type TransferRequirementForm ¶ added in v0.8.0
type TransferRequirementForm struct {
Name string `json:"name"`
Group []TransferRequirementField `json:"group"`
}
TransferRequirementForm is a labelled group of related form fields.
type TransferRequirementValue ¶ added in v0.8.0
TransferRequirementValue is one allowed value of a select field.
type User ¶ added in v0.9.0
type User struct {
ID int64 `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Active bool `json:"active"`
Detail *UserDetail `json:"details"`
}
User from Wise API (/v1/me, /v1/users/{userId}).
type UserAddress ¶ added in v0.9.0
type UserAddress struct {
CountryCode string `json:"countryCode"`
FirstLine string `json:"firstLine"`
PostCode string `json:"postCode"`
City string `json:"city"`
State string `json:"state"`
Occupation string `json:"occupation"`
}
UserAddress is the address on file for a user.
type UserDetail ¶ added in v0.9.0
type UserDetail struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
PhoneNumber string `json:"phoneNumber"`
DateOfBirth string `json:"dateOfBirth"` // "1977-01-01" or empty
Occupation string `json:"occupation"`
Avatar string `json:"avatar"`
PrimaryAddress int64 `json:"primaryAddress"`
Address *UserAddress `json:"address"`
}
UserDetail is the personal-details block of a User; null on the wire when Wise has none on file.