npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@classapp-tech/mundiapilib

v2.4.0

Published

Mundipagg API

Downloads

1,226

Readme

Disclaimer

This lib was created from a fork of the original Mundipagg NodeJS repo.

Getting started

Mundipagg API

How to Build

The generated SDK relies on Node Package Manager (NPM) being available to resolve dependencies. If you don't already have NPM installed, please go ahead and follow instructions to install NPM from here. The SDK also requires Node to be installed. If Node isn't already installed, please install it from here

NPM is installed by default when Node is installed

To check if node and npm have been successfully installed, write the following commands in command prompt:

  • node --version
  • npm -version

Version Check

Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):

npm install

Resolve Dependencies

Resolve Dependencies

This will install all dependencies in the node_modules folder.

Once dependencies are resolved, you will need to move the folder MundiAPILib in to your node_modules folder.

How to Use

The following section explains how to use the library in a new project.

1. Open Project Folder

Open an IDE/Text Editor for JavaScript like Sublime Text. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

Click on File and select Open Folder.

Open Folder

Select the folder of your SDK and click on Select Folder to open it up in Sublime Text. The folder will become visible in the bar on the left.

Open Project

2. Creating a Test File

Now right click on the folder name and select the New File option to create a new test file. Save it as index.js Now import the generated NodeJS library using the following lines of code:

var lib = require('lib');

Save changes.

Create new file

Save new file

3. Running The Test File

To run the index.js file, open up the command prompt and navigate to the Path where the SDK folder resides. Type the following command to run the file:

node index.js

Run file

How to Test

These tests use Mocha framework for testing, coupled with Chai for assertions. These dependencies need to be installed for tests to run. Tests can be run in a number of ways:

Method 1 (Run all tests)

  1. Navigate to the root directory of the SDK folder from command prompt.
  2. Type mocha --recursive to run all the tests.

Method 2 (Run all tests)

  1. Navigate to the ../test/Controllers/ directory from command prompt.
  2. Type mocha * to run all the tests.

Method 3 (Run specific controller's tests)

  1. Navigate to the ../test/Controllers/ directory from command prompt.
  2. Type mocha MundiAPIController to run all the tests in that controller file.

To increase mocha's default timeout, you can change the TEST_TIMEOUT parameter's value in TestBootstrap.js.

Run Tests

Initialization

Authentication

In order to setup authentication in the API client, you need the following information.

| Parameter | Description | |-----------|-------------| | basicAuthUserName | The username to use with basic authentication | | basicAuthPassword | The password to use with basic authentication |

API client can be initialized as following:

const lib = require('lib');

// Configuration parameters and credentials
lib.Configuration.basicAuthUserName = "basicAuthUserName"; // The username to use with basic authentication
lib.Configuration.basicAuthPassword = "basicAuthPassword"; // The password to use with basic authentication

Class Reference

List of Controllers

Class: CustomersController

Get singleton instance

The singleton instance of the CustomersController class can be accessed from the API Client.

var controller = lib.CustomersController;

Method: createAccessToken

Creates a access token for a customer

function createAccessToken(customerId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | request | Required | Request for creating a access token | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var request = new CreateAccessTokenRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createAccessToken(customerId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateCustomer

Updates a customer

function updateCustomer(customerId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | request | Required | Request for updating a customer | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var request = new UpdateCustomerRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateCustomer(customerId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: deleteAccessTokens

Delete a Customer's access tokens

function deleteAccessTokens(customerId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id |

Example Usage


    var customerId = customer_id;

    controller.deleteAccessTokens(customerId, function(error, response, context) {

    
    });

Method: getCustomer

Get a customer

function getCustomer(customerId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id |

Example Usage


    var customerId = customer_id;

    controller.getCustomer(customerId, function(error, response, context) {

    
    });

Method: getAddresses

Gets all adressess from a customer

function getAddresses(customerId, page, size, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | page | Optional | Page number | | size | Optional | Page size |

Example Usage


    var customerId = customer_id;
    var page = 177;
    var size = 177;

    controller.getAddresses(customerId, page, size, function(error, response, context) {

    
    });

Method: getAccessToken

Get a Customer's access token

function getAccessToken(customerId, tokenId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | tokenId | Required | Token Id |

Example Usage


    var customerId = customer_id;
    var tokenId = token_id;

    controller.getAccessToken(customerId, tokenId, function(error, response, context) {

    
    });

Method: getAddress

Get a customer's address

function getAddress(customerId, addressId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | addressId | Required | Address Id |

Example Usage


    var customerId = customer_id;
    var addressId = address_id;

    controller.getAddress(customerId, addressId, function(error, response, context) {

    
    });

Method: createCard

Creates a new card for a customer

function createCard(customerId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | request | Required | Request for creating a card | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var request = new CreateCardRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createCard(customerId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: renewCard

Renew a card

function renewCard(customerId, cardId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | cardId | Required | Card Id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var cardId = card_id;
    var idempotencyKey = 'idempotency-key';

    controller.renewCard(customerId, cardId, idempotencyKey, function(error, response, context) {

    
    });

Method: createCustomer

Creates a new customer

function createCustomer(request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | request | Required | Request for creating a customer | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var request = new CreateCustomerRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createCustomer(request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateAddress

Updates an address

function updateAddress(customerId, addressId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | addressId | Required | Address Id | | request | Required | Request for updating an address | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var addressId = address_id;
    var request = new UpdateAddressRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateAddress(customerId, addressId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getAccessTokens

Get all access tokens from a customer

function getAccessTokens(customerId, page, size, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | page | Optional | Page number | | size | Optional | Page size |

Example Usage


    var customerId = customer_id;
    var page = 177;
    var size = 177;

    controller.getAccessTokens(customerId, page, size, function(error, response, context) {

    
    });

Method: updateCustomerMetadata

Updates the metadata a customer

function updateCustomerMetadata(customerId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | The customer id | | request | Required | Request for updating the customer metadata | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var request = new UpdateMetadataRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateCustomerMetadata(customerId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: deleteAddress

Delete a Customer's address

function deleteAddress(customerId, addressId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | addressId | Required | Address Id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var addressId = address_id;
    var idempotencyKey = 'idempotency-key';

    controller.deleteAddress(customerId, addressId, idempotencyKey, function(error, response, context) {

    
    });

Method: updateCard

Updates a card

function updateCard(customerId, cardId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | cardId | Required | Card id | | request | Required | Request for updating a card | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var cardId = card_id;
    var request = new UpdateCardRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateCard(customerId, cardId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: deleteAccessToken

Delete a customer's access token

function deleteAccessToken(customerId, tokenId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | tokenId | Required | Token Id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var tokenId = token_id;
    var idempotencyKey = 'idempotency-key';

    controller.deleteAccessToken(customerId, tokenId, idempotencyKey, function(error, response, context) {

    
    });

Method: createAddress

Creates a new address for a customer

function createAddress(customerId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | request | Required | Request for creating an address | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var request = new CreateAddressRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createAddress(customerId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getCard

Get a customer's card

function getCard(customerId, cardId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer id | | cardId | Required | Card id |

Example Usage


    var customerId = customer_id;
    var cardId = card_id;

    controller.getCard(customerId, cardId, function(error, response, context) {

    
    });

Method: getCards

Get all cards from a customer

function getCards(customerId, page, size, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | page | Optional | Page number | | size | Optional | Page size |

Example Usage


    var customerId = customer_id;
    var page = 177;
    var size = 177;

    controller.getCards(customerId, page, size, function(error, response, context) {

    
    });

Method: deleteCard

Delete a customer's card

function deleteCard(customerId, cardId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | customerId | Required | Customer Id | | cardId | Required | Card Id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var customerId = customer_id;
    var cardId = card_id;
    var idempotencyKey = 'idempotency-key';

    controller.deleteCard(customerId, cardId, idempotencyKey, function(error, response, context) {

    
    });

Method: getCustomers

Get all Customers

function getCustomers(name, document, page, size, email, code, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | name | Optional | Name of the Customer | | document | Optional | Document of the Customer | | page | Optional DefaultValue | Current page the the search | | size | Optional DefaultValue | Quantity pages of the search | | email | Optional | Customer's email | | code | Optional | Customer's code |

Example Usage


    var name = 'name';
    var document = 'document';
    var page = 177;
    var size = 177;
    var email = 'email';
    var code = 'Code';

    controller.getCustomers(name, document, page, size, email, code, function(error, response, context) {

    
    });

Back to List of Controllers

Class: ChargesController

Get singleton instance

The singleton instance of the ChargesController class can be accessed from the API Client.

var controller = lib.ChargesController;

Method: getCharge

Get a charge from its id

function getCharge(chargeId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id |

Example Usage


    var chargeId = charge_id;

    controller.getCharge(chargeId, function(error, response, context) {

    
    });

Method: confirmPayment

TODO: Add a method description

function confirmPayment(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | TODO: Add a parameter description | | request | Optional | Request for confirm payment | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new CreateConfirmPaymentRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.confirmPayment(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateChargeCard

Updates the card from a charge

function updateChargeCard(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id | | request | Required | Request for updating a charge's card | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new UpdateChargeCardRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateChargeCard(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getCharges

Lists all charges

function getCharges(page, size, code, status, paymentMethod, customerId, orderId, createdSince, createdUntil, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | page | Optional | Page number | | size | Optional | Page size | | code | Optional | Filter for charge's code | | status | Optional | Filter for charge's status | | paymentMethod | Optional | Filter for charge's payment method | | customerId | Optional | Filter for charge's customer id | | orderId | Optional | Filter for charge's order id | | createdSince | Optional | Filter for the beginning of the range for charge's creation | | createdUntil | Optional | Filter for the end of the range for charge's creation |

Example Usage


    var page = 177;
    var size = 177;
    var code = 'code';
    var status = 'status';
    var paymentMethod = payment_method;
    var customerId = customer_id;
    var orderId = order_id;
    var createdSince = date("D M d, Y G:i");
    var createdUntil = date("D M d, Y G:i");

    controller.getCharges(page, size, code, status, paymentMethod, customerId, orderId, createdSince, createdUntil, function(error, response, context) {

    
    });

Method: cancelCharge

Cancel a charge

function cancelCharge(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id | | request | Optional | Request for cancelling a charge | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new CreateCancelChargeRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.cancelCharge(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: retryCharge

Retries a charge

function retryCharge(chargeId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var idempotencyKey = 'idempotency-key';

    controller.retryCharge(chargeId, idempotencyKey, function(error, response, context) {

    
    });

Method: updateChargePaymentMethod

Updates a charge's payment method

function updateChargePaymentMethod(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id | | request | Required | Request for updating the payment method from a charge | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new UpdateChargePaymentMethodRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateChargePaymentMethod(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateChargeMetadata

Updates the metadata from a charge

function updateChargeMetadata(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | The charge id | | request | Required | Request for updating the charge metadata | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new UpdateMetadataRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateChargeMetadata(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: captureCharge

Captures a charge

function captureCharge(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge id | | request | Optional | Request for capturing a charge | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new CreateCaptureChargeRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.captureCharge(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateChargeDueDate

Updates the due date from a charge

function updateChargeDueDate(chargeId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge Id | | request | Required | Request for updating the due date | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var chargeId = charge_id;
    var request = new UpdateChargeDueDateRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateChargeDueDate(chargeId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: createCharge

Creates a new charge

function createCharge(request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | request | Required | Request for creating a charge | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var request = new CreateChargeRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createCharge(request, idempotencyKey, function(error, response, context) {

    
    });

Method: getChargeTransactions

TODO: Add a method description

function getChargeTransactions(chargeId, page, size, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | chargeId | Required | Charge Id | | page | Optional | Page number | | size | Optional | Page size |

Example Usage


    var chargeId = charge_id;
    var page = 177;
    var size = 177;

    controller.getChargeTransactions(chargeId, page, size, function(error, response, context) {

    
    });

Method: getChargesSummary

TODO: Add a method description

function getChargesSummary(status, createdSince, createdUntil, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | status | Required | TODO: Add a parameter description | | createdSince | Optional | TODO: Add a parameter description | | createdUntil | Optional | TODO: Add a parameter description |

Example Usage


    var status = 'status';
    var createdSince = date("D M d, Y G:i");
    var createdUntil = date("D M d, Y G:i");

    controller.getChargesSummary(status, createdSince, createdUntil, function(error, response, context) {

    
    });

Back to List of Controllers

Class: RecipientsController

Get singleton instance

The singleton instance of the RecipientsController class can be accessed from the API Client.

var controller = lib.RecipientsController;

Method: updateRecipientMetadata

Updates recipient metadata

function updateRecipientMetadata(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | request | Required | Metadata | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new UpdateMetadataRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateRecipientMetadata(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateRecipientTransferSettings

TODO: Add a method description

function updateRecipientTransferSettings(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient Identificator | | request | Required | TODO: Add a parameter description | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new UpdateTransferSettingsRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateRecipientTransferSettings(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getAnticipation

Gets an anticipation

function getAnticipation(recipientId, anticipationId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | anticipationId | Required | Anticipation id |

Example Usage


    var recipientId = recipient_id;
    var anticipationId = anticipation_id;

    controller.getAnticipation(recipientId, anticipationId, function(error, response, context) {

    
    });

Method: getRecipients

Retrieves paginated recipients information

function getRecipients(page, size, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | page | Optional | Page number | | size | Optional | Page size |

Example Usage


    var page = 177;
    var size = 177;

    controller.getRecipients(page, size, function(error, response, context) {

    
    });

Method: getBalance

Get balance information for a recipient

function getBalance(recipientId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id |

Example Usage


    var recipientId = recipient_id;

    controller.getBalance(recipientId, function(error, response, context) {

    
    });

Method: getAnticipations

Retrieves a paginated list of anticipations from a recipient

function getAnticipations(recipientId, page, size, status, timeframe, paymentDateSince, paymentDateUntil, createdSince, createdUntil, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | page | Optional | Page number | | size | Optional | Page size | | status | Optional | Filter for anticipation status | | timeframe | Optional | Filter for anticipation timeframe | | paymentDateSince | Optional | Filter for start range for anticipation payment date | | paymentDateUntil | Optional | Filter for end range for anticipation payment date | | createdSince | Optional | Filter for start range for anticipation creation date | | createdUntil | Optional | Filter for end range for anticipation creation date |

Example Usage


    var recipientId = recipient_id;
    var page = 177;
    var size = 177;
    var status = 'status';
    var timeframe = 'timeframe';
    var paymentDateSince = date("D M d, Y G:i");
    var paymentDateUntil = date("D M d, Y G:i");
    var createdSince = date("D M d, Y G:i");
    var createdUntil = date("D M d, Y G:i");

    controller.getAnticipations(recipientId, page, size, status, timeframe, paymentDateSince, paymentDateUntil, createdSince, createdUntil, function(error, response, context) {

    
    });

Method: createAnticipation

Creates an anticipation

function createAnticipation(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | request | Required | Anticipation data | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new CreateAnticipationRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createAnticipation(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateRecipientDefaultBankAccount

Updates the default bank account from a recipient

function updateRecipientDefaultBankAccount(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | request | Required | Bank account data | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new UpdateRecipientBankAccountRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateRecipientDefaultBankAccount(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getRecipient

Retrieves recipient information

function getRecipient(recipientId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipiend id |

Example Usage


    var recipientId = recipient_id;

    controller.getRecipient(recipientId, function(error, response, context) {

    
    });

Method: getAnticipationLimits

Gets the anticipation limits for a recipient

function getAnticipationLimits(recipientId, timeframe, paymentDate, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | timeframe | Required | Timeframe | | paymentDate | Required | Anticipation payment date |

Example Usage


    var recipientId = recipient_id;
    var timeframe = 'timeframe';
    var paymentDate = date("D M d, Y G:i");

    controller.getAnticipationLimits(recipientId, timeframe, paymentDate, function(error, response, context) {

    
    });

Method: getTransfer

Gets a transfer

function getTransfer(recipientId, transferId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | transferId | Required | Transfer id |

Example Usage


    var recipientId = recipient_id;
    var transferId = transfer_id;

    controller.getTransfer(recipientId, transferId, function(error, response, context) {

    
    });

Method: getTransfers

Gets a paginated list of transfers for the recipient

function getTransfers(recipientId, page, size, status, createdSince, createdUntil, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | page | Optional | Page number | | size | Optional | Page size | | status | Optional | Filter for transfer status | | createdSince | Optional | Filter for start range of transfer creation date | | createdUntil | Optional | Filter for end range of transfer creation date |

Example Usage


    var recipientId = recipient_id;
    var page = 85;
    var size = 85;
    var status = 'status';
    var createdSince = date("D M d, Y G:i");
    var createdUntil = date("D M d, Y G:i");

    controller.getTransfers(recipientId, page, size, status, createdSince, createdUntil, function(error, response, context) {

    
    });

Method: updateRecipient

Updates a recipient

function updateRecipient(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | request | Required | Recipient data | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new UpdateRecipientRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateRecipient(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: createRecipient

Creates a new recipient

function createRecipient(request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | request | Required | Recipient data | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var request = new CreateRecipientRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createRecipient(request, idempotencyKey, function(error, response, context) {

    
    });

Method: createTransfer

Creates a transfer for a recipient

function createTransfer(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient Id | | request | Required | Transfer data | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new CreateTransferRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createTransfer(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: createWithdraw

TODO: Add a method description

function createWithdraw(recipientId, request, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | TODO: Add a parameter description | | request | Required | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new CreateWithdrawRequest({"key":"value"});

    controller.createWithdraw(recipientId, request, function(error, response, context) {

    
    });

Method: getWithdrawById

TODO: Add a method description

function getWithdrawById(recipientId, withdrawalId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | TODO: Add a parameter description | | withdrawalId | Required | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var withdrawalId = withdrawal_id;

    controller.getWithdrawById(recipientId, withdrawalId, function(error, response, context) {

    
    });

Method: getWithdrawals

Gets a paginated list of transfers for the recipient

function getWithdrawals(recipientId, page, size, status, createdSince, createdUntil, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | TODO: Add a parameter description | | page | Optional | TODO: Add a parameter description | | size | Optional | TODO: Add a parameter description | | status | Optional | TODO: Add a parameter description | | createdSince | Optional | TODO: Add a parameter description | | createdUntil | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var page = 85;
    var size = 85;
    var status = 'status';
    var createdSince = date("D M d, Y G:i");
    var createdUntil = date("D M d, Y G:i");

    controller.getWithdrawals(recipientId, page, size, status, createdSince, createdUntil, function(error, response, context) {

    
    });

Method: updateAutomaticAnticipationSettings

Updates recipient metadata

function updateAutomaticAnticipationSettings(recipientId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | recipientId | Required | Recipient id | | request | Required | Metadata | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var recipientId = recipient_id;
    var request = new UpdateAutomaticAnticipationSettingsRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateAutomaticAnticipationSettings(recipientId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getRecipientByCode

Retrieves recipient information

function getRecipientByCode(code, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | code | Required | Recipient code |

Example Usage


    var code = 'code';

    controller.getRecipientByCode(code, function(error, response, context) {

    
    });

Back to List of Controllers

Class: SubscriptionsController

Get singleton instance

The singleton instance of the SubscriptionsController class can be accessed from the API Client.

var controller = lib.SubscriptionsController;

Method: createDiscount

Creates a discount

function createDiscount(subscriptionId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription id | | request | Required | Request for creating a discount | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var request = new CreateDiscountRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createDiscount(subscriptionId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: getSubscriptionItem

Get Subscription Item

function getSubscriptionItem(subscriptionId, itemId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription Id | | itemId | Required | Item id |

Example Usage


    var subscriptionId = subscription_id;
    var itemId = item_id;

    controller.getSubscriptionItem(subscriptionId, itemId, function(error, response, context) {

    
    });

Method: deleteUsage

Deletes a usage

function deleteUsage(subscriptionId, itemId, usageId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | The subscription id | | itemId | Required | The subscription item id | | usageId | Required | The usage id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var itemId = item_id;
    var usageId = usage_id;
    var idempotencyKey = 'idempotency-key';

    controller.deleteUsage(subscriptionId, itemId, usageId, idempotencyKey, function(error, response, context) {

    
    });

Method: cancelSubscription

Cancels a subscription

function cancelSubscription(subscriptionId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription id | | request | Optional | Request for cancelling a subscription | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var request = new CreateCancelSubscriptionRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.cancelSubscription(subscriptionId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: deleteIncrement

Deletes a increment

function deleteIncrement(subscriptionId, incrementId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription id | | incrementId | Required | Increment id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var incrementId = increment_id;
    var idempotencyKey = 'idempotency-key';

    controller.deleteIncrement(subscriptionId, incrementId, idempotencyKey, function(error, response, context) {

    
    });

Method: getSubscriptionCycleById

TODO: Add a method description

function getSubscriptionCycleById(subscriptionId, cycleId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | The subscription id | | cycleId | Required | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var cycleId = 'cycleId';

    controller.getSubscriptionCycleById(subscriptionId, cycleId, function(error, response, context) {

    
    });

Method: updateSubscriptionStartAt

Updates the start at date from a subscription

function updateSubscriptionStartAt(subscriptionId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | The subscription id | | request | Required | Request for updating the subscription start date | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var request = new UpdateSubscriptionStartAtRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateSubscriptionStartAt(subscriptionId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateSubscriptionPaymentMethod

Updates the payment method from a subscription

function updateSubscriptionPaymentMethod(subscriptionId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription id | | request | Required | Request for updating the paymentmethod from a subscription | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var request = new UpdateSubscriptionPaymentMethodRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateSubscriptionPaymentMethod(subscriptionId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: updateCurrentCycleStatus

TODO: Add a method description

function updateCurrentCycleStatus(subscriptionId, request, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription Id | | request | Required | Request for updating the end date of the subscription current status | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var request = new UpdateCurrentCycleStatusRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateCurrentCycleStatus(subscriptionId, request, idempotencyKey, function(error, response, context) {

    
    });

Method: createSubscription

Creates a new subscription

function createSubscription(body, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | body | Required | Request for creating a subscription | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var body = new CreateSubscriptionRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.createSubscription(body, idempotencyKey, function(error, response, context) {

    
    });

Method: getUsagesDetails

TODO: Add a method description

function getUsagesDetails(subscriptionId, cycleId, size, page, itemId, group, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription Identifier | | cycleId | Optional | Cycle id | | size | Optional | Page size | | page | Optional | Page number | | itemId | Optional | Identificador do item | | group | Optional | identificador da loja (account) de cada item |

Example Usage


    var subscriptionId = subscription_id;
    var cycleId = cycle_id;
    var size = 85;
    var page = 85;
    var itemId = item_id;
    var group = 'group';

    controller.getUsagesDetails(subscriptionId, cycleId, size, page, itemId, group, function(error, response, context) {

    
    });

Method: renewSubscription

TODO: Add a method description

function renewSubscription(subscriptionId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | TODO: Add a parameter description | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var idempotencyKey = 'idempotency-key';

    controller.renewSubscription(subscriptionId, idempotencyKey, function(error, response, context) {

    
    });

Method: updateSubscriptionItem

Updates a subscription item

function updateSubscriptionItem(subscriptionId, itemId, body, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription Id | | itemId | Required | Item id | | body | Required | Request for updating a subscription item | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var itemId = item_id;
    var body = new UpdateSubscriptionItemRequest({"key":"value"});
    var idempotencyKey = 'idempotency-key';

    controller.updateSubscriptionItem(subscriptionId, itemId, body, idempotencyKey, function(error, response, context) {

    
    });

Method: createAnUsage

Create Usage

function createAnUsage(subscriptionId, itemId, idempotencyKey, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | Subscription id | | itemId | Required | Item id | | idempotencyKey | Optional | TODO: Add a parameter description |

Example Usage


    var subscriptionId = subscription_id;
    var itemId = item_id;
    var idempotencyKey = 'idempotency-key';

    controller.createAnUsage(subscriptionId, itemId, idempotencyKey, function(error, response, context) {

    
    });

Method: getIncrementById

TODO: Add a method description

function getIncrementById(subscriptionId, incrementId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subscriptionId | Required | The subscription Id | | incrementId | Required | The increment Id |

Example Usage


    var subscriptionId = subscription_id;
    var incrementId = increment_id;

    controller.getIncrementById(subscriptionId, incrementId, function(error, response, context) {

    
    });

![Method: ](https://apidocs.io/img/method.png ".SubscriptionsController.delete