Skip to content

velopaymentsapi/velo-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript client for Velo

License npm version
This library provides a JavaScript client that simplifies interactions with the Velo Payments API. For full details covering the API visit our docs at Velo Payments APIs. Note: some of the Velo API calls which require authorization via an access token, see the full docs on how to configure.

Throughout this document and the Velo platform the following terms are used:

  • Payor. An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout.
  • Payee. The recipient of funds paid out by a payor.
  • Payment. A single transfer of funds from a payor to a payee.
  • Payout. A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee.
  • Sandbox. An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking.
  • Maintain a collection of payees
  • Query the payor’s current balance of funds within the platform and perform additional funding
  • Issue payments to payees
  • Query the platform for a history of those payments

This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference.

## API access following authentication
Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated.

This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below:

-H "Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f "


If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.30.53
- Package version: 2.30.53
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install velo-payments --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your velo-payments from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var VeloPayments = require('velo-payments');

var defaultClient = VeloPayments.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = "YOUR ACCESS TOKEN"

var api = new VeloPayments.CountriesApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listPaymentChannelRulesV1(callback);

Documentation for API Endpoints

All URIs are relative to https://api.sandbox.velopayments.com

Class Method HTTP request Description
VeloPayments.CountriesApi listPaymentChannelRulesV1 GET /v1/paymentChannelRules List Payment Channel Country Rules
VeloPayments.CountriesApi listSupportedCountriesV1 GET /v1/supportedCountries List Supported Countries
VeloPayments.CountriesApi listSupportedCountriesV2 GET /v2/supportedCountries List Supported Countries
VeloPayments.CurrenciesApi listSupportedCurrenciesV2 GET /v2/currencies List Supported Currencies
VeloPayments.FundingManagerApi createAchFundingRequest POST /v1/sourceAccounts/{sourceAccountId}/achFundingRequest Create Funding Request
VeloPayments.FundingManagerApi createFundingRequest POST /v2/sourceAccounts/{sourceAccountId}/fundingRequest Create Funding Request
VeloPayments.FundingManagerApi createFundingRequestV3 POST /v3/sourceAccounts/{sourceAccountId}/fundingRequest Create Funding Request
VeloPayments.FundingManagerApi getFundingAccount GET /v1/fundingAccounts/{fundingAccountId} Get Funding Account
VeloPayments.FundingManagerApi getFundingAccountV2 GET /v2/fundingAccounts/{fundingAccountId} Get Funding Account
VeloPayments.FundingManagerApi getFundingAccounts GET /v1/fundingAccounts Get Funding Accounts
VeloPayments.FundingManagerApi getFundingAccountsV2 GET /v2/fundingAccounts Get Funding Accounts
VeloPayments.FundingManagerApi getSourceAccount GET /v1/sourceAccounts/{sourceAccountId} Get details about given source account.
VeloPayments.FundingManagerApi getSourceAccountV2 GET /v2/sourceAccounts/{sourceAccountId} Get details about given source account.
VeloPayments.FundingManagerApi getSourceAccountV3 GET /v3/sourceAccounts/{sourceAccountId} Get details about given source account.
VeloPayments.FundingManagerApi getSourceAccounts GET /v1/sourceAccounts Get list of source accounts
VeloPayments.FundingManagerApi getSourceAccountsV2 GET /v2/sourceAccounts Get list of source accounts
VeloPayments.FundingManagerApi getSourceAccountsV3 GET /v3/sourceAccounts Get list of source accounts
VeloPayments.FundingManagerApi listFundingAuditDeltas GET /v1/deltas/fundings Get Funding Audit Delta
VeloPayments.FundingManagerApi setNotificationsRequest POST /v1/sourceAccounts/{sourceAccountId}/notifications Set notifications
VeloPayments.FundingManagerApi transferFunds POST /v2/sourceAccounts/{sourceAccountId}/transfers Transfer Funds between source accounts
VeloPayments.FundingManagerApi transferFundsV3 POST /v3/sourceAccounts/{sourceAccountId}/transfers Transfer Funds between source accounts
VeloPayments.FundingManagerPrivateApi createFundingAccountV2 POST /v2/fundingAccounts Create Funding Account
VeloPayments.FundingManagerPrivateApi deleteSourceAccountV3 DELETE /v3/sourceAccounts/{sourceAccountId} Delete a source account by ID
VeloPayments.LoginApi logout POST /v1/logout Logout
VeloPayments.LoginApi resetPassword POST /v1/password/reset Reset password
VeloPayments.LoginApi validateAccessToken POST /v1/validate validate
VeloPayments.LoginApi veloAuth POST /v1/authenticate Authentication endpoint
VeloPayments.PayeeInvitationApi createPayeeV3 POST /v3/payees Initiate Payee Creation
VeloPayments.PayeeInvitationApi getPayeesInvitationStatusV3 GET /v3/payees/payors/{payorId}/invitationStatus Get Payee Invitation Status
VeloPayments.PayeeInvitationApi getPayeesInvitationStatusV4 GET /v4/payees/payors/{payorId}/invitationStatus Get Payee Invitation Status
VeloPayments.PayeeInvitationApi queryBatchStatusV3 GET /v3/payees/batch/{batchId} Query Batch Status
VeloPayments.PayeeInvitationApi queryBatchStatusV4 GET /v4/payees/batch/{batchId} Query Batch Status
VeloPayments.PayeeInvitationApi resendPayeeInviteV3 POST /v3/payees/{payeeId}/invite Resend Payee Invite
VeloPayments.PayeeInvitationApi resendPayeeInviteV4 POST /v4/payees/{payeeId}/invite Resend Payee Invite
VeloPayments.PayeeInvitationApi v4CreatePayee POST /v4/payees Initiate Payee Creation
VeloPayments.PayeesApi deletePayeeByIdV3 DELETE /v3/payees/{payeeId} Delete Payee by Id
VeloPayments.PayeesApi deletePayeeByIdV4 DELETE /v4/payees/{payeeId} Delete Payee by Id
VeloPayments.PayeesApi getPayeeByIdV3 GET /v3/payees/{payeeId} Get Payee by Id
VeloPayments.PayeesApi getPayeeByIdV4 GET /v4/payees/{payeeId} Get Payee by Id
VeloPayments.PayeesApi listPayeeChangesV3 GET /v3/payees/deltas List Payee Changes
VeloPayments.PayeesApi listPayeeChangesV4 GET /v4/payees/deltas List Payee Changes
VeloPayments.PayeesApi listPayeesV3 GET /v3/payees List Payees
VeloPayments.PayeesApi listPayeesV4 GET /v4/payees List Payees
VeloPayments.PayeesApi payeeDetailsUpdateV3 POST /v3/payees/{payeeId}/payeeDetailsUpdate Update Payee Details
VeloPayments.PayeesApi payeeDetailsUpdateV4 POST /v4/payees/{payeeId}/payeeDetailsUpdate Update Payee Details
VeloPayments.PayeesApi v3PayeesPayeeIdRemoteIdUpdatePost POST /v3/payees/{payeeId}/remoteIdUpdate Update Payee Remote Id
VeloPayments.PayeesApi v4PayeesPayeeIdRemoteIdUpdatePost POST /v4/payees/{payeeId}/remoteIdUpdate Update Payee Remote Id
VeloPayments.PaymentAuditServiceApi exportTransactionsCSVV4 GET /v4/paymentaudit/transactions Export Transactions
VeloPayments.PaymentAuditServiceApi getFundingsV4 GET /v4/paymentaudit/fundings Get Fundings for Payor
VeloPayments.PaymentAuditServiceApi getPaymentDetailsV4 GET /v4/paymentaudit/payments/{paymentId} Get Payment
VeloPayments.PaymentAuditServiceApi getPaymentsForPayoutV4 GET /v4/paymentaudit/payouts/{payoutId} Get Payments for Payout
VeloPayments.PaymentAuditServiceApi getPayoutStatsV4 GET /v4/paymentaudit/payoutStatistics Get Payout Statistics
VeloPayments.PaymentAuditServiceApi getPayoutsForPayorV4 GET /v4/paymentaudit/payouts Get Payouts for Payor
VeloPayments.PaymentAuditServiceApi listPaymentChangesV4 GET /v4/payments/deltas List Payment Changes
VeloPayments.PaymentAuditServiceApi listPaymentsAuditV4 GET /v4/paymentaudit/payments Get List of Payments
VeloPayments.PaymentAuditServiceDeprecatedApi exportTransactionsCSVV3 GET /v3/paymentaudit/transactions V3 Export Transactions
VeloPayments.PaymentAuditServiceDeprecatedApi getFundingsV1 GET /v1/paymentaudit/fundings V1 Get Fundings for Payor
VeloPayments.PaymentAuditServiceDeprecatedApi getPaymentDetailsV3 GET /v3/paymentaudit/payments/{paymentId} V3 Get Payment
VeloPayments.PaymentAuditServiceDeprecatedApi getPaymentsForPayoutPAV3 GET /v3/paymentaudit/payouts/{payoutId} V3 Get Payments for Payout
VeloPayments.PaymentAuditServiceDeprecatedApi getPayoutStatsV1 GET /v1/paymentaudit/payoutStatistics V1 Get Payout Statistics
VeloPayments.PaymentAuditServiceDeprecatedApi getPayoutsForPayorV3 GET /v3/paymentaudit/payouts V3 Get Payouts for Payor
VeloPayments.PaymentAuditServiceDeprecatedApi listPaymentChanges GET /v1/deltas/payments V1 List Payment Changes
VeloPayments.PaymentAuditServiceDeprecatedApi listPaymentsAuditV3 GET /v3/paymentaudit/payments V3 Get List of Payments
VeloPayments.PayorsApi getPayorById GET /v1/payors/{payorId} Get Payor
VeloPayments.PayorsApi getPayorByIdV2 GET /v2/payors/{payorId} Get Payor
VeloPayments.PayorsApi payorAddPayorLogo POST /v1/payors/{payorId}/branding/logos Add Logo
VeloPayments.PayorsApi payorCreateApiKeyRequest POST /v1/payors/{payorId}/applications/{applicationId}/keys Create API Key
VeloPayments.PayorsApi payorCreateApplicationRequest POST /v1/payors/{payorId}/applications Create Application
VeloPayments.PayorsApi payorEmailOptOut POST /v1/payors/{payorId}/reminderEmailsUpdate Reminder Email Opt-Out
VeloPayments.PayorsApi payorGetBranding GET /v1/payors/{payorId}/branding Get Branding
VeloPayments.PayorsApi payorLinks GET /v1/payorLinks List Payor Links
VeloPayments.PayorsPrivateApi createPayorLinks POST /v1/payorLinks Create a Payor Link
VeloPayments.PayoutServiceApi createQuoteForPayoutV3 POST /v3/payouts/{payoutId}/quote Create a quote for the payout
VeloPayments.PayoutServiceApi deschedulePayout DELETE /v3/payouts/{payoutId}/schedule Deschedule a payout
VeloPayments.PayoutServiceApi getPaymentsForPayoutV3 GET /v3/payouts/{payoutId}/payments Retrieve payments for a payout
VeloPayments.PayoutServiceApi getPayoutSummaryV3 GET /v3/payouts/{payoutId} Get Payout Summary
VeloPayments.PayoutServiceApi instructPayoutV3 POST /v3/payouts/{payoutId} Instruct Payout
VeloPayments.PayoutServiceApi scheduleForPayout POST /v3/payouts/{payoutId}/schedule Schedule a payout
VeloPayments.PayoutServiceApi submitPayoutV3 POST /v3/payouts Submit Payout
VeloPayments.PayoutServiceApi withdrawPayment POST /v1/payments/{paymentId}/withdraw Withdraw a Payment
VeloPayments.PayoutServiceApi withdrawPayoutV3 DELETE /v3/payouts/{payoutId} Withdraw Payout
VeloPayments.TokensApi resendToken POST /v2/users/{userId}/tokens Resend a token
VeloPayments.UsersApi deleteUserByIdV2 DELETE /v2/users/{userId} Delete a User
VeloPayments.UsersApi disableUserV2 POST /v2/users/{userId}/disable Disable a User
VeloPayments.UsersApi enableUserV2 POST /v2/users/{userId}/enable Enable a User
VeloPayments.UsersApi getSelf GET /v2/users/self Get Self
VeloPayments.UsersApi getUserByIdV2 GET /v2/users/{userId} Get User
VeloPayments.UsersApi inviteUser POST /v2/users/invite Invite a User
VeloPayments.UsersApi listUsers GET /v2/users List Users
VeloPayments.UsersApi registerSms POST /v2/users/registration/sms Register SMS Number
VeloPayments.UsersApi resendToken POST /v2/users/{userId}/tokens Resend a token
VeloPayments.UsersApi roleUpdate POST /v2/users/{userId}/roleUpdate Update User Role
VeloPayments.UsersApi unlockUserV2 POST /v2/users/{userId}/unlock Unlock a User
VeloPayments.UsersApi unregisterMFA POST /v2/users/{userId}/mfa/unregister Unregister MFA for the user
VeloPayments.UsersApi unregisterMFAForSelf POST /v2/users/self/mfa/unregister Unregister MFA for Self
VeloPayments.UsersApi updatePasswordSelf POST /v2/users/self/password Update Password for self
VeloPayments.UsersApi userDetailsUpdate POST /v2/users/{userId}/userDetailsUpdate Update User Details
VeloPayments.UsersApi userDetailsUpdateForSelf POST /v2/users/self/userDetailsUpdate Update User Details for self
VeloPayments.UsersApi validatePasswordSelf POST /v2/users/self/password/validate Validate the proposed password
VeloPayments.WebhooksApi createWebhookV1 POST /v1/webhooks Create Webhook
VeloPayments.WebhooksApi getWebhookV1 GET /v1/webhooks/{webhookId} Get details about the given webhook.
VeloPayments.WebhooksApi listWebhooksV1 GET /v1/webhooks List the details about the webhooks for the given payor.
VeloPayments.WebhooksApi pingWebhookV1 POST /v1/webhooks/{webhookId}/ping
VeloPayments.WebhooksApi updateWebhookV1 POST /v1/webhooks/{webhookId} Update Webhook

Documentation for Models

Documentation for Authorization

OAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • : Scopes not required

basicAuth

  • Type: HTTP basic authentication

oAuthVeloBackOffice

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • : Scopes not required