transferzero-sdk

1.34.3 • Public • Published

transferzero-sdk

TransferzeroSdk - JavaScript client for transferzero-sdk Reference documentation for the TransferZero API V1

For more information, please visit:

Automatically generated by the OpenAPI Generator

Installation

For Node.js

npm

Install the API client library as a dependency in your Node project via:

npm install transferzero-sdk --save

Getting Started

Please follow the installation instruction.

You can find examples in the examples directory on the features required by the Onboarding documentation

Webhooks

To parse webhooks you can use the following snippet:

const webhookHeader = {}; // The webhook headers in json object format received through the webhook callback url
const webhookContent = '{ (...) }'; // The webhook body in json string received through the webhook callback url
const webhookUrl = 'http://webhook.url';

const validateRequest = apiClient.validateRequest(webhookUrl, webhookContent, webhookHeader)

if (!validateRequest) {
   return "Could not validate webhook request headers";
};

const webhook = apiClient.parseResponseString(webhookContent, Webhook);
if (webhook.event.startsWith('transaction')) {
  const transactionWebhook = apiClient.parseResponseString(
    webhookContent,
    TransactionWebhook
  );
  console.log(transactionWebhook);
} else if (webhook.event.startsWith('recipient')) {
  const recipientWebhook = apiClient.parseResponseString(
    webhookContent,
    RecipientWebhook
  );
  console.log(recipientWebhook);
} else if (webhook.event.startsWith('payout_method')) {
  const payoutMethodWebhook = apiClient.parseResponseString(
    webhookContent,
    PayoutMethodWebhook
  );
  console.log(payoutMethodWebhook);
} else if (webhook.event.startsWith('sender')) {
  const senderWebhook = apiClient.parseResponseString(
    webhookContent,
    SenderWebhook
  );
  console.log(senderWebhook);
} else if (webhook.event.startsWith('document')) {
  const documentWebhook = apiClient.parseResponseString(
    webhookContent,
    DocumentWebhook
  );
  console.log(documentWebhook);
} else {
  console.log("Could not verify webhook signature");
}

Documentation for API Endpoints

All URIs are relative to https://api-sandbox.transferzero.com/v1

Class Method HTTP request Description
TransferzeroSdk.APILogsApi getApiLog GET /api_logs/{API Log ID} Fetch an individual API log
TransferzeroSdk.APILogsApi getApiLogs GET /api_logs Fetch a list of API logs
TransferzeroSdk.AccountDebitsApi postAccountsDebits POST /accounts/debits Creating an account debit
TransferzeroSdk.AccountValidationApi postAccountValidations POST /account_validations Validates the existence of a bank account or a mobile phone number
TransferzeroSdk.AccountsApi getAccount GET /accounts/{Currency} Fetches account balance for specified currrency
TransferzeroSdk.AccountsApi getAccounts GET /accounts Fetches account balances for all currencies
TransferzeroSdk.CurrencyInfoApi infoCurrencies GET /info/currencies Getting a list of possible requested currencies
TransferzeroSdk.CurrencyInfoApi infoCurrenciesIn GET /info/currencies/in Getting a list of possible input currencies
TransferzeroSdk.CurrencyInfoApi infoCurrenciesOut GET /info/currencies/out Getting a list of possible output currencies
TransferzeroSdk.DocumentsApi getDocument GET /documents/{Document ID} Fetching a document
TransferzeroSdk.DocumentsApi getDocuments GET /documents Getting a list of documents
TransferzeroSdk.DocumentsApi postDocuments POST /documents Creating a document
TransferzeroSdk.LogsApi getWebhookLog GET /logs/{Webhook Log ID} Fetch an individual webhook log
TransferzeroSdk.LogsApi getWebhookLogs GET /logs/webhooks Fetch a list of webhook logs
TransferzeroSdk.PayinMethodsApi deletePayinMethod DELETE /payin_methods/{PayinMethod ID} Deleting a payin method
TransferzeroSdk.PayinMethodsApi getPayinMethod GET /payin_methods/{PayinMethod ID} Fetching a payin method
TransferzeroSdk.PayinMethodsApi patchPayinMethod PATCH /payin_methods/{PayinMethod ID} Updating a payin method
TransferzeroSdk.PayinMethodsApi retryPayinMethod POST /payin_methods/{PayinMethod ID}/retry Retries PayinMethod
TransferzeroSdk.PaymentMethodsApi paymentMethodsIn GET /info/payment_methods/in This method returns possible payin methods.
TransferzeroSdk.PaymentMethodsApi paymentMethodsOut GET /info/payment_methods/out This method returns possible payout methods.
TransferzeroSdk.PayoutMethodsApi deletePayoutMethod DELETE /payout_methods/{Payout Method ID} Deleting a payout method
TransferzeroSdk.PayoutMethodsApi getPayoutMethod GET /payout_methods/{Payout Method ID} Fetching a payout method
TransferzeroSdk.PayoutMethodsApi getPayoutMethods GET /payout_methods Listing payout methods
TransferzeroSdk.PayoutMethodsApi patchPayoutMethod PATCH /payout_methods/{Payout Method ID} Updating a payout method
TransferzeroSdk.PayoutMethodsApi postPayoutMethods POST /payout_methods Creating a payout method
TransferzeroSdk.RecipientsApi deleteRecipient DELETE /recipients/{Recipient ID} Cancelling a recipient
TransferzeroSdk.RecipientsApi getRecipients GET /recipients Getting a list of recipients with filtering
TransferzeroSdk.RecipientsApi patchRecipient PATCH /recipients/{Recipient ID} Updating a recipient
TransferzeroSdk.RecipientsApi proofOfPayments GET /recipients/{Recipient ID}/proof_of_payments Returns list of proof of payments
TransferzeroSdk.SendersApi deleteSender DELETE /senders/{Sender ID} Deleting a sender
TransferzeroSdk.SendersApi getSender GET /senders/{Sender ID} Fetching a sender
TransferzeroSdk.SendersApi getSenders GET /senders Listing senders
TransferzeroSdk.SendersApi patchSender PATCH /senders/{Sender ID} Updating a sender
TransferzeroSdk.SendersApi postSenders POST /senders Creating a sender
TransferzeroSdk.TransactionsApi calculateTransactions POST /transactions/calculate Calculates transaction amounts for a transaction payload
TransferzeroSdk.TransactionsApi createAndFundTransaction POST /transactions/create_and_fund Creates a new transaction and funds it from account balance
TransferzeroSdk.TransactionsApi getTransaction GET /transactions/{Transaction ID} Fetch a single transaction
TransferzeroSdk.TransactionsApi getTransactions GET /transactions Get a list of transactions
TransferzeroSdk.TransactionsApi payinTransaction POST /transactions/{Transaction ID}/payin Creates a fake payin for transaction
TransferzeroSdk.TransactionsApi payoutTransaction POST /transactions/{Transaction ID}/payout Creates a fake payout for transaction
TransferzeroSdk.TransactionsApi postTransactions POST /transactions Creates a new transaction
TransferzeroSdk.TransactionsApi validateTransactions POST /transactions/validate Validates a transaction payload
TransferzeroSdk.WebhooksApi deleteWebhook DELETE /webhooks/{Webhook ID} Unsubscribing from a webhook
TransferzeroSdk.WebhooksApi getWebhook GET /webhooks/{Webhook ID} Find a webhook's details
TransferzeroSdk.WebhooksApi getWebhookEvents GET /webhooks/events Find possible webhook events
TransferzeroSdk.WebhooksApi getWebhooks GET /webhooks Listing webhooks
TransferzeroSdk.WebhooksApi postWebhooks POST /webhooks Creating a webhook

Documentation for Models

Documentation for Authorization

You can set the API Key and Secret by passing a config object when creating an ApiClient:

const apiClient = new ApiClient({
  apiKey: '<key>',
  apiSecret: '<secret>',
  basePath: 'https://api-sandbox.transferzero.com/v1'
});

Or by setting the properties on an ApiClient instance:

const apiClient = new ApiClient();
apiClient.apiKey = '<key>';
apiClient.apiSecret = '<secret>';
apiClient.basePath = 'https://api-sandbox.transferzero.com/v1';

Author

  • API version: 1.0
  • Package version: 1.34.3
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Readme

Keywords

Package Sidebar

Install

npm i transferzero-sdk

Weekly Downloads

66

Version

1.34.3

License

MIT

Unpacked Size

3.98 MB

Total Files

311

Last publish

Collaborators

  • bitpesa