Documentation ¶
Index ¶
- type AccountDetailResp
- type AccountResp
- type AccountSchema
- type AccountService
- type AccountState
- type AccountUnit
- type Amount
- type AuthorizationCodeResp
- type BeneficiaryAddress
- type Client
- func (b *Client) Account() *AccountService
- func (b *Client) Counterparty() *CounterpartyService
- func (b *Client) Exchange() *ExchangeService
- func (b *Client) Payment() *PaymentService
- func (b *Client) PaymentDraft() *PaymentDraftService
- func (b *Client) Transfer() *TransferService
- func (b *Client) Webhook() *WebhookService
- type CounterpartyProfileType
- type CounterpartyRecipientCharges
- type CounterpartyResp
- type CounterpartyRespAccount
- type CounterpartyService
- func (c *CounterpartyService) AddNonRevolut(nonRevolutCounterparty *NonRevolutCounterpartyReq) (*CounterpartyResp, error)
- func (c *CounterpartyService) AddRevolut(revolutCounterparty *RevolutCounterpartyReq) (*CounterpartyResp, error)
- func (c *CounterpartyService) Delete(id string) error
- func (c *CounterpartyService) List() ([]*CounterpartyResp, error)
- func (c *CounterpartyService) WithId(id string) (*CounterpartyResp, error)
- type CounterpartyState
- type CounterpartyType
- type EstimatedTime
- type ExchangeAmount
- type ExchangeRateReq
- type ExchangeRateResp
- type ExchangeReq
- type ExchangeResp
- type ExchangeService
- type LegCounterparty
- type NonRevolutCounterpartyReq
- type NonRevolutCounterpartyReqAddress
- type NonRevolutCounterpartyReqInvidualName
- type OAuthResp
- type OAuthService
- type PaymentDraftDetail
- type PaymentDraftDetailPayment
- type PaymentDraftPayment
- type PaymentDraftPaymentReceiver
- type PaymentDraftReq
- type PaymentDraftResp
- type PaymentDraftService
- type PaymentDraftState
- type PaymentDrafts
- type PaymentOrder
- type PaymentReceiver
- type PaymentReq
- type PaymentService
- func (p *PaymentService) Cancel(id string) error
- func (p *PaymentService) Create(paymentReq *PaymentReq) (*TransactionResp, error)
- func (p *PaymentService) List(transactionReq *TransactionReq) ([]*TransactionResp, error)
- func (p *PaymentService) WithId(id string) (*TransactionResp, error)
- func (p *PaymentService) WithRequestId(requestId string) (*TransactionResp, error)
- type PaymentState
- type PaymentType
- type RevolutCounterpartyReq
- type TransactionCard
- type TransactionCreatedEvent
- type TransactionCreatedEventData
- type TransactionLeg
- type TransactionMerchant
- type TransactionReq
- type TransactionResp
- type TransactionStateChangedEvent
- type TransactionStateChangedEventData
- type TransferReq
- type TransferResp
- type TransferService
- type TransferState
- type WebhookService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDetailResp ¶
type AccountDetailResp struct { // IBAN Iban string `json:"iban"` // BIC Bic string `json:"bic"` // the account number AccountNo string `json:"account_no"` // the sort code SortCode string `json:"sort_code"` // the routing number RoutingNumber string `json:"routing_number"` // the beneficiary name Beneficiary string `json:"beneficiary"` BeneficiaryAddress BeneficiaryAddress `json:"beneficiary_address"` // the country of the bank BankCountry string `json:"bank_country"` // determines if this account address is pooled or unique Pooled bool `json:"pooled"` // the reference of the pooled account UniqueReference string `json:"unique_reference"` // the list of supported schemes, possible values: chaps, bacs, faster_payments, sepa, swift, ach Schemes []AccountSchema `json:"schemes"` EstimatedTime EstimatedTime `json:"estimated_time"` }
type AccountResp ¶
type AccountResp struct { // the account ID Id string `json:"id"` // the account name Name string `json:"name"` // the available balance Balance float64 `json:"balance"` // the account currency Currency string `json:"currency"` // the account state, one of active, inactive State AccountState `json:"state"` // determines if the account is visible to other businesses on Revolut Public bool `json:"public"` // the instant when the account was created UpdatedAt time.Time `json:"updated_at"` // the instant when the account was last updated CreatedAt time.Time `json:"created_at"` }
type AccountSchema ¶
type AccountSchema string
const ( AccountSchema_CHAPS AccountSchema = "chaps" AccountSchema_BACS AccountSchema = "bacs" AccountSchema_FASTER_PAYMENTS AccountSchema = "faster_payments" AccountSchema_SEPA AccountSchema = "sepa" AccountSchema_SWIFT AccountSchema = "swift" AccountSchema_ACH AccountSchema = "ach" )
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
func (*AccountService) DetailWithId ¶
func (a *AccountService) DetailWithId(id string) ([]*AccountDetailResp, error)
DetailWithId: This endpoint retrieves individual account details. doc: https://revolut-engineering.github.io/api-docs/business-api/#accounts-get-account-details
func (*AccountService) List ¶
func (a *AccountService) List() ([]*AccountResp, error)
List: This endpoint retrieves your accounts. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-accounts-get-accounts
func (*AccountService) WithId ¶
func (a *AccountService) WithId(id string) (*AccountResp, error)
WithId: This endpoint retrieves one of your accounts by ID. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-accounts-get-account
type AccountState ¶
type AccountState string
const ( AccountState_ACTIVE AccountState = "active" AccountState_INACTIVE AccountState = "inactive" )
type AccountUnit ¶
type AccountUnit string
const ( AccountUnit_DAYS AccountUnit = "days" AccountUnit_HOURS AccountUnit = "hours" )
type AuthorizationCodeResp ¶
type BeneficiaryAddress ¶
type BeneficiaryAddress struct { // the address line 1 of the beneficiary StreetLine1 string `json:"street_line1"` // the address line 2 of the beneficiary StreetLine2 string `json:"street_line2"` // the region of the beneficiary Region string `json:"region"` // the city of the beneficiary City string `json:"city"` // the country of the beneficiary Country string `json:"country"` // the postal code of the beneficiary Postcode string `json:"postcode"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Account ¶
func (b *Client) Account() *AccountService
func (*Client) Counterparty ¶
func (b *Client) Counterparty() *CounterpartyService
func (*Client) Exchange ¶
func (b *Client) Exchange() *ExchangeService
func (*Client) Payment ¶
func (b *Client) Payment() *PaymentService
func (*Client) PaymentDraft ¶
func (b *Client) PaymentDraft() *PaymentDraftService
func (*Client) Transfer ¶
func (b *Client) Transfer() *TransferService
func (*Client) Webhook ¶
func (b *Client) Webhook() *WebhookService
type CounterpartyProfileType ¶
type CounterpartyProfileType string
const ( CounterpartyProfileType_BUSINESS CounterpartyProfileType = "business" CounterpartyProfileType_PERSONAL CounterpartyProfileType = "personal" )
type CounterpartyRecipientCharges ¶
type CounterpartyRecipientCharges string
const ( CounterpartyRecipientCharges_NO CounterpartyRecipientCharges = "no" CounterpartyRecipientCharges_EXPECTED CounterpartyRecipientCharges = "expected" )
type CounterpartyResp ¶
type CounterpartyResp struct { // the ID of the counterparty Id string `json:"id"` // the name of the counterparty Name string `json:"name"` // the phone number of the counterparty Phone string `json:"phone"` // the type of the Revolut profile, business or personal ProfileType CounterpartyProfileType `json:"profile_type"` // the country of the bank Country string `json:"country"` // the state of the counterparty, one of created, deleted State CounterpartyState `json:"state"` // the instant when the counterparty was created CreatedAt time.Time `json:"created_at"` // the instant when the counterparty was last updated UpdatedAt time.Time `json:"updated_at"` // the list of public accounts of this counterparty Accounts []CounterpartyRespAccount `json:"accounts"` }
type CounterpartyRespAccount ¶
type CounterpartyRespAccount struct { // the ID of a counterparty's account Id string `json:"id"` // the currency of a counterparty's account Currency string `json:"currency"` // the type of account, revolut or external Type string `json:"type"` // bank account number AccountNo string `json:"account_no"` // IBAN Iban string `json:"iban"` // sort code SortCode string `json:"sort_code"` Email string `json:"email"` Name string `json:"name"` BankCountry string `json:"bank_country"` // routing transit number RoutingNumber string `json:"routing_number"` // BIC Bic string `json:"bic"` // indicates the possibility of the recipient charges: no or expected RecipientCharges CounterpartyRecipientCharges `json:"recipient_charges"` }
type CounterpartyService ¶
type CounterpartyService struct {
// contains filtered or unexported fields
}
func (*CounterpartyService) AddNonRevolut ¶
func (c *CounterpartyService) AddNonRevolut(nonRevolutCounterparty *NonRevolutCounterpartyReq) (*CounterpartyResp, error)
AddNonRevolut: You can create a counterparty for an non-Revolut bank account. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-counterparties-add-non-revolut-counterparty
func (*CounterpartyService) AddRevolut ¶
func (c *CounterpartyService) AddRevolut(revolutCounterparty *RevolutCounterpartyReq) (*CounterpartyResp, error)
AddRevolut: You can create a counterparty for an existing Revolut user. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-counterparties-add-revolut-counterparty
func (*CounterpartyService) Delete ¶
func (c *CounterpartyService) Delete(id string) error
Delete: This endpoint deletes a counterparty with the given ID. Once a counterparty is deleted no payments can be made to it. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-counterparties-delete-counterparty
func (*CounterpartyService) List ¶
func (c *CounterpartyService) List() ([]*CounterpartyResp, error)
List: This endpoint retrieves all your counterparties. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-counterparties-get-counterparties
func (*CounterpartyService) WithId ¶
func (c *CounterpartyService) WithId(id string) (*CounterpartyResp, error)
WithId: This endpoint retrieves a counterparty by ID. doc https://revolut-engineering.github.io/api-docs/#business-api-business-api-counterparties-get-counterparty
type CounterpartyState ¶
type CounterpartyState string
const ( CounterpartyState_ACTIVE CounterpartyState = "created" CounterpartyState_INACTIVE CounterpartyState = "deleted" )
type CounterpartyType ¶
type CounterpartyType string
const ( CounterpartyType_SELF CounterpartyType = "self" CounterpartyType_REVOLUT CounterpartyType = "revolut" CounterpartyType_EXTERNAL CounterpartyType = "external" )
type EstimatedTime ¶
type EstimatedTime struct { // the unit of the inbound transfer time estimate, possible values: days, hours Unit AccountUnit `json:"unit"` // the maximum estimate Min int `json:"min"` // the minimum estimate Max int `json:"max"` }
type ExchangeAmount ¶
type ExchangeRateReq ¶
type ExchangeRateResp ¶
type ExchangeRateResp struct { // information about the currency to exchange from From Amount `json:"from"` // information about the currency to exchange to To Amount `json:"to"` // exchange rate Rate float64 `json:"rate"` // fee for the operation Fee Amount `json:"fee"` // date of proposed exchange rate RateDate time.Time `json:"rate_date"` }
type ExchangeReq ¶
type ExchangeReq struct { // information about the account you want to exchange from From ExchangeAmount `json:"from"` // information about the account you want to exchange to To ExchangeAmount `json:"to"` // a user-provided exchange reference Reference string `json:"reference"` // a unique value used to handle duplicates submitted as a result of lost connection or another client error (40 characters max) RequestId string `json:"request_id"` }
type ExchangeResp ¶
type ExchangeResp struct { // the ID of transaction Id string `json:"id"` // is always exchange State string `json:"state"` // reason code for declined or failed transaction state ReasonCode string `json:"reason_code"` // the instant when the transaction was created CreatedAt time.Time `json:"created_at"` // the instant when the transaction was completed CompletedAt time.Time `json:"completed_at"` }
type ExchangeService ¶
type ExchangeService struct {
// contains filtered or unexported fields
}
func (*ExchangeService) Exchange ¶
func (e *ExchangeService) Exchange(exchangeReq *ExchangeReq) (*ExchangeResp, error)
Exchange: To check the exchange rate and fees for the operation, please use the /rate endpoint. doc: https://revolut-engineering.github.io/api-docs/business-api/#exchanges-exchange-currency
func (*ExchangeService) Rate ¶
func (e *ExchangeService) Rate(exchangeRateReq *ExchangeRateReq) (*ExchangeRateResp, error)
Rate: doc: https://revolut-engineering.github.io/api-docs/business-api/#exchanges-get-exchange-rates
type LegCounterparty ¶
type LegCounterparty struct { // the counterparty ID Id string `json:"id"` // the type of account: self, revolut, external Type CounterpartyType `json:"type"` // the counterparty account ID AccountId string `json:"account_id"` }
type NonRevolutCounterpartyReq ¶
type NonRevolutCounterpartyReq struct { // an optional name of the external company counterparty, this field must exist when individual_name does not CompanyName string `json:"company_name,omitempty"` InvidualName NonRevolutCounterpartyReqInvidualName `json:"invidual_name,omitempty"` // the country of the bank BankCountry string `json:"bank_country"` // the currency of a counterparty's account Currency string `json:"currency"` // bank account number AccountNo string `json:"account_no"` // sort code SortCode string `json:"sort_code"` // routing transit number RoutingNumber string `json:"routing_number"` // an optional email address of the beneficiary Email string `json:"email,omitempty"` // an optional phone number of the beneficiary Phone string `json:"phone,omitempty"` Address NonRevolutCounterpartyReqAddress `json:"address"` }
type NonRevolutCounterpartyReqAddress ¶
type NonRevolutCounterpartyReqAddress struct { // an optional address line 1 of the counterparty StreetLine1 string `json:"street_line1,omitempty"` // an optional address line 2 of the counterparty StreetLine2 string `json:"street_line2,omitempty"` // an optional region of the counterparty Region string `json:"region,omitempty"` // an optional postal code of the counterparty Postcode string `json:"postcode,omitempty"` // an optional city of the counterparty City string `json:"city,omitempty"` // an optional the bankCountry of the counterparty Country string `json:"country,omitempty"` }
type NonRevolutCounterpartyReqInvidualName ¶
type NonRevolutCounterpartyReqInvidualName struct { // an optional first name of the external individual counterparty, this field must exist when company_name does not FirstName string `json:"first_name,omitempty"` // an optional last name of the external individual counterparty, this field must exist when company_name does not LastName string `json:"last_name,omitempty"` }
type OAuthResp ¶
type OAuthResp struct { // the access token AccessToken string `json:"access_token"` // "bearer" means that this token is valid to access the API TokenType string `json:"token_type"` // token expiration time in seconds ExpiresIn int32 `json:"expires_in"` // A token to be used to request a new access token RefreshToken string `json:"refresh_token"` }
type OAuthService ¶
type OAuthService struct {
// contains filtered or unexported fields
}
func NewOAuth ¶
func NewOAuth(clientId string, privateKey *rsa.PrivateKey, issuer string, sandbox bool) *OAuthService
func (*OAuthService) ExchangeAuthorisationCode ¶
func (oa *OAuthService) ExchangeAuthorisationCode(code string) (*OAuthResp, error)
ExchangeAuthorisationCode: This endpoint is used to exchange an authorisation code with an access token. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-oauth-get-authorisation-code
func (*OAuthService) GetAuthorisationCode ¶
func (oa *OAuthService) GetAuthorisationCode(clientId, redirectUri string) ([]*AuthorizationCodeResp, error)
GetAuthorisationCode: Navigate the user to this address to request an authorisation code doc: https://revolut-engineering.github.io/api-docs/business-api/#oauth-get-authorisation-code
func (*OAuthService) RefreshAccessToken ¶
func (oa *OAuthService) RefreshAccessToken(refreshToken string) (*OAuthResp, error)
RefreshAccessToken: This endpoint is used to request a new user access token after the expiration date. doc: https://revolut-engineering.github.io/api-docs/#business-api-business-api-oauth-refresh-access-token
type PaymentDraftDetail ¶
type PaymentDraftDetail struct { // an optional future date/time ScheduledFor string `json:"scheduled_for"` // an optional title of payment Title string `json:"title"` // a list of payments Payments []PaymentDraftDetailPayment `json:"payments"` }
type PaymentDraftDetailPayment ¶
type PaymentDraftDetailPayment struct { Id string `json:"id"` Amount ExchangeRateResp `json:"amount"` // the ID of the account to pay from AccountId string `json:"account_id"` // an optional textual reference shown on the transaction Reference string `json:"reference,omitempty"` Receiver PaymentDraftPaymentReceiver `json:"receiver"` // the state of the transaction, one of CREATED, PENDING, COMPLETED, REVERTED, DECLINED, CANCELLED, FAILED, DELETED State PaymentDraftState `json:"state"` // an optional textual description of state reason Reason string `json:"reason,omitempty"` // an optional textual description of error ErrorMessage string `json:"error_message,omitempty"` // explanation of conversation process CurrentChargeOptions ExchangeRateResp `json:"current_charge_options"` }
type PaymentDraftPayment ¶
type PaymentDraftPayment struct { // the transaction currency Currency string `json:"currency"` // the transaction amount Amount int `json:"amount"` // the ID of the account to pay from (must be the same for all payments json) AccountId string `json:"account_id"` Receiver PaymentDraftPaymentReceiver `json:"receiver,omitempty"` // a mandatory textual reference shown on the transaction Reference string `json:"reference"` }
type PaymentDraftReq ¶
type PaymentDraftReq struct { // an optional title of payment Title string `json:"title"` // an optional future date/time ScheduleFor string `json:"schedule_for"` // a list of planned transactions Payments []PaymentDraftPayment `json:"payments"` }
type PaymentDraftResp ¶
type PaymentDraftResp struct { // the ID of the created draft payment Id string `json:"id"` }
type PaymentDraftService ¶
type PaymentDraftService struct {
// contains filtered or unexported fields
}
func (*PaymentDraftService) Create ¶
func (e *PaymentDraftService) Create(paymentDraftReq *PaymentDraftReq) (*PaymentDraftResp, error)
Create: doc: https://revolut-engineering.github.io/api-docs/business-api/#payment-drafts-create-a-payment-draft
func (*PaymentDraftService) Delete ¶
func (e *PaymentDraftService) Delete(id string) error
Delete: doc: https://revolut-engineering.github.io/api-docs/business-api/#get-payment-drafts-delete-payment-draft
func (*PaymentDraftService) List ¶
func (e *PaymentDraftService) List() (*PaymentDrafts, error)
List: doc: https://revolut-engineering.github.io/api-docs/business-api/#get-payment-drafts
func (*PaymentDraftService) WithId ¶
func (e *PaymentDraftService) WithId(id string) (*PaymentDraftDetailPayment, error)
WithId: doc: https://revolut-engineering.github.io/api-docs/business-api/#get-payment-drafts-get-payment-draft-by-id
type PaymentDraftState ¶
type PaymentDraftState string
const ( PaymentDraftState_PENDING PaymentDraftState = "PENDING" PaymentDraftState_COMPLETE PaymentDraftState = "COMPLETED" PaymentDraftState_DECLINE PaymentDraftState = "DECLINED" PaymentDraftState_FAILED PaymentDraftState = "FAILED" PaymentDraftState_CREATED PaymentDraftState = "CREATED" PaymentDraftState_REVERTED PaymentDraftState = "REVERTED" PaymentDraftState_CANCELLED PaymentDraftState = "CANCELLED" PaymentDraftState_DELETED PaymentDraftState = "DELETED" )
type PaymentDrafts ¶
type PaymentDrafts struct { // a list of payments PaymentOrders []PaymentOrder `json:"payment_orders"` }
type PaymentOrder ¶
type PaymentOrder struct { // the ID of the draft payment Id string `json:"id"` // an optional future date/time ScheduledFor string `json:"scheduled_for,optional"` // an optional title of payment Title string `json:"title,optional"` // count of payments in current draft PaymentsCount int `json:"payments_count"` }
type PaymentReceiver ¶
type PaymentReceiver struct { // the ID of the receiving counterparty CounterpartyId string `json:"counterparty_id"` // the ID of the receiving counterparty's account, provide only for payments to business counterparties, //can be own account (only for internal counterparties) AccountId string `json:"account_id"` }
type PaymentReq ¶
type PaymentReq struct { // the client provided ID of the transaction (40 characters max) RequestId string `json:"request_id"` // the ID of the account to pay from AccountId string `json:"account_id"` Receiver PaymentReceiver `json:"receiver"` // the transaction amount Amount float64 `json:"amount"` // the transaction currency Currency string `json:"currency"` // an optional textual reference shown on the transaction Reference string `json:"reference,omitempty"` // a future date/time // doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-schedule-payment ScheduleFor string `json:"schedule_for,omitempty"` }
type PaymentService ¶
type PaymentService struct {
// contains filtered or unexported fields
}
func (*PaymentService) Cancel ¶
func (p *PaymentService) Cancel(id string) error
Cancel: This endpoint allows to cancel a scheduled transaction that was initiated by you, via API. doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-get-transaction
func (*PaymentService) Create ¶
func (p *PaymentService) Create(paymentReq *PaymentReq) (*TransactionResp, error)
Create: This endpoint creates a new payment. If the payment is for another Revolut account, business or personal, the transaction may be processed synchronously. doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-create-payment
func (*PaymentService) List ¶
func (p *PaymentService) List(transactionReq *TransactionReq) ([]*TransactionResp, error)
List: This endpoint retrieves historical transactions based on the provided query criteria. doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-get-transaction
func (*PaymentService) WithId ¶
func (p *PaymentService) WithId(id string) (*TransactionResp, error)
WithId: To retrieve a transaction by ID doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-get-transaction
func (*PaymentService) WithRequestId ¶
func (p *PaymentService) WithRequestId(requestId string) (*TransactionResp, error)
WithRequestId: To retrieve a transaction by request ID doc: https://revolut-engineering.github.io/api-docs/business-api/#payments-get-transaction
type PaymentState ¶
type PaymentState string
const ( PaymentState_PENDING PaymentState = "pending" PaymentState_COMPLETE PaymentState = "completed" PaymentState_DECLINE PaymentState = "declined" PaymentState_FAILED PaymentState = "failed" )
type PaymentType ¶
type PaymentType string
const ( PaymentType_ATM PaymentType = "atm" PaymentType_CARD_PAYMENT PaymentType = "card_payment" PaymentType_CARD_REFUND PaymentType = "card_refund" PaymentType_CARD_CHARGEBACK PaymentType = "card_chargeback" PaymentType_CARD_CREDIT PaymentType = "card_credit" PaymentType_EXCHANGE PaymentType = "exchange" PaymentType_TRANSFER PaymentType = "transfer" PaymentType_LOAN PaymentType = "loan" PaymentType_FEE PaymentType = "fee" PaymentType_REFUND PaymentType = "refund" PaymentType_TOPUP PaymentType = "topup" PaymentType_TOPUP_RETURN PaymentType = "topup_return" PaymentType_TAX PaymentType = "tax" PaymentType_TAX_REFUND PaymentType = "tax_refund" )
type RevolutCounterpartyReq ¶
type RevolutCounterpartyReq struct { // the type of the Revolut profile, business or personal ProfileType CounterpartyProfileType `json:"profile_type"` // an optional name. Provide only with personal profile_type Name string `json:"name,omitempty"` // an optional phone number of the counterparty. Provide only with personal profile_type. Phone string `json:"phone,omitempty"` // an optional email address of an admin of a public Revolut Business account. Provide only with business profile_type. Email string `json:"email,omitempty"` }
type TransactionCard ¶
type TransactionCreatedEvent ¶
type TransactionCreatedEvent struct { // the event name Event string `json:"event"` // the event time Timestamp time.Time `json:"timestamp"` Data TransactionCreatedEventData `json:"data"` }
type TransactionCreatedEventData ¶
type TransactionCreatedEventData struct { // the ID of transaction Id string `json:"id"` Type string `json:"type"` // the client provided request ID RequestId string `json:"request_id"` // the transction state: pending, completed, declined or failed State PaymentState `json:"state"` // an optional reason code for declined or failed transaction state ReasonCode string `json:"reason_code"` // the instant when the transaction was created CreatedAt time.Time `json:"created_at"` // the instant when the transaction was last updated UpdatedAt time.Time `json:"updated_at"` // the instant when the transaction was completed, mandatory for completed state only CompletedAt time.Time `json:"completed_at"` // an optional date when the transaction was scheduled for ScheduledFor string `json:"scheduled_for"` // a user provided payment reference Reference string `json:"reference"` // the legs of transaction, there'll be 2 legs between your Revolut accounts and 1 leg in other cases Legs []TransactionLeg `json:"legs"` }
type TransactionLeg ¶
type TransactionLeg struct { // the ID of the leg LegId string `json:"leg_id"` // the ID of the account the transaction is associated with AccountId string `json:"account_id"` Counterparty LegCounterparty `json:"counterparty"` // the transaction amount Amount float64 `json:"amount"` // the transaction currency Currency string `json:"currency"` // the billing amount for cross-currency payments BillAmount float64 `json:"bill_amount"` // the billing currency for cross-currency payments BillCurrency string `json:"bill_currency"` // the transaction leg purpose Description string `json:"description"` // a total balance of the account the transaction is associated with (optional) Balance float64 `json:"balance,omitempty"` }
type TransactionMerchant ¶
type TransactionReq ¶
type TransactionReq struct { // an optional timestamp to query from, filtering on the created_at field From string // an optional timestamp to query to, filtering on the created_at field. Default is now To string // an optional counterparty id Counterparty string // an optional number of records to return (1000 max, default is 100) Count int32 // the transaction type, one of atm, card_payment, card_refund, card_chargeback, card_credit, //exchange, transfer, loan, fee, refund, topup, topup_return, tax, tax_refund Type PaymentType }
type TransactionResp ¶
type TransactionResp struct { // the ID of transaction Id string `json:"id"` // he transaction type, one of atm, card_payment, card_refund, card_chargeback, //card_credit, exchange, transfer, loan, fee, refund, topup, topup_return, tax, tax_refund Type PaymentType `json:"type"` // the client provided request ID RequestId string `json:"request_id,omitempty"` // the transction state: pending, completed, declined or failed State PaymentState `json:"state"` // the instant when the transaction was created CreatedAt time.Time `json:"created_at"` // the instant when the transaction was last updated UpdatedAt time.Time `json:"updated_at"` // the instant when the transaction was completed, mandatory for completed state only CompletedAt time.Time `json:"completed_at,omitempty"` // an optional date when the transaction was scheduled for ScheduledFor string `json:"scheduled_for"` // a user provided payment reference Reference string `json:"reference,omitempty"` // the legs of transaction, there'll be 2 legs between your Revolut accounts and 1 leg in other cases Legs []TransactionLeg `json:"legs"` // reason code for declined or failed transaction state ReasonCode string `json:"reason_code,omitempty"` // the merchant info (only for card payments) Merchant TransactionMerchant `json:"merchant,omitempty"` // the card information (only for card payments) Card TransactionCard `json:"card,omitempty"` // the ID of the original transaction which has been refunded (only for refunds) RelatedTransactionId string `json:"related_transaction_id,omitempty"` }
type TransactionStateChangedEvent ¶
type TransactionStateChangedEvent struct { // the event name Event string `json:"event"` // the event time Timestamp time.Time `json:"timestamp"` Data TransactionStateChangedEventData `json:"data"` }
type TransferReq ¶
type TransferReq struct { // a unique value used to handle duplicates submitted as a // result of lost connection or another client error (40 characters max) RequestId string `json:"request_id"` // the ID of a source account SourceAccountId string `json:"source_account_id"` // the ID of a target account TargetAccountId string `json:"target_account_id"` // the transaction amount Amount float64 `json:"amount"` // the transaction currency, both source and target accounts should be in this currency Currency string `json:"currency"` // an optional textual reference shown on the transaction Reference string `json:"reference,omitempty"` }
type TransferResp ¶
type TransferResp struct { // the ID of the created transaction Id string `json:"id"` // the transction state: pending, completed, declined or failed State string `json:"state"` // the instant when the transaction was created CreatedAt time.Time `json:"created_at"` // the instant when the transaction was completed CompletedAt time.Time `json:"completed_at"` }
type TransferService ¶
type TransferService struct {
// contains filtered or unexported fields
}
func (*TransferService) Create ¶
func (t *TransferService) Create(transferReq *TransferReq) (*TransferResp, error)
Create: This endpoint processes transfers between accounts of the business with the same currency. doc: https://revolut-engineering.github.io/api-docs/business-api/#transfers-create-transfer
type TransferState ¶
type TransferState string
const ( TransferState_PENDING TransferState = "pending" TransferState_COMPLETE TransferState = "completed" TransferState_DECLINE TransferState = "declined" TransferState_FAILED TransferState = "failed" )
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
func (*WebhookService) Delete ¶
func (p *WebhookService) Delete() error
Delete: Use this API request to delete a web-hook doc: https://revolut-engineering.github.io/api-docs/business-api/#web-hooks-setting-up-a-web-hook
func (*WebhookService) Set ¶
func (p *WebhookService) Set(url string) error
Set: doc: https://revolut-engineering.github.io/api-docs/business-api/#web-hooks-setting-up-a-web-hook