Skip to content

Latest commit

 

History

History
3505 lines (2582 loc) · 108 KB

README.md

File metadata and controls

3505 lines (2582 loc) · 108 KB

Getting started

Mundipagg API

How to Build

The generated code uses a few Maven dependencies e.g., Jackson, UniRest, and Apache HttpClient. The reference to these dependencies is already added in the pom.xml file will be installed automatically. Therefore, you will need internet access for a successful build.

  • In order to open the client library in Eclipse click on File -> Import.

Importing SDK into Eclipse - Step 1

  • In the import dialog, select Existing Java Project and click Next.

Importing SDK into Eclipse - Step 2

  • Browse to locate the folder containing the source code. Select the detected location of the project and click Finish.

Importing SDK into Eclipse - Step 3

  • Upon successful import, the project will be automatically built by Eclipse after automatically resolving the dependencies.

Importing SDK into Eclipse - Step 4

How to Use

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

1. Starting a new project

For starting a new project, click the menu command File > New > Project.

Add a new project in Eclipse

Next, choose Maven > Maven Projectand click Next.

Create a new Maven Project - Step 1

Here, make sure to use the current workspace by choosing Use default Workspace location, as shown in the picture below and click Next.

Create a new Maven Project - Step 2

Following this, select the quick start project type to create a simple project with an existing class and a main method. To do this, choose maven-archetype-quickstart item from the list and click Next.

Create a new Maven Project - Step 3

In the last step, provide a Group Id and Artifact Id as shown in the picture below and click Finish.

Create a new Maven Project - Step 4

2. Add reference of the library project

The created Maven project manages its dependencies using its pom.xml file. In order to add a dependency on the MundiAPILib client library, double click on the pom.xml file in the Package Explorer. Opening the pom.xml file will render a graphical view on the cavas. Here, switch to the Dependencies tab and click the Add button as shown in the picture below.

Adding dependency to the client library - Step 1

Clicking the Add button will open a dialog where you need to specify MundiAPI in Group Id and MundiAPILib in the Artifact Id fields. Once added click OK. Save the pom.xml file.

Adding dependency to the client library - Step 2

3. Write sample code

Once the SimpleConsoleApp is created, a file named App.java will be visible in the Package Explorer with a main method. This is the entry point for the execution of the created project. Here, you can add code to initialize the client library and instantiate a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.

Adding dependency to the client library - Step 2

How to Test

The generated code and the server can be tested using automatically generated test cases. JUnit is used as the testing framework and test runner.

In Eclipse, for running the tests do the following:

  1. Select the project MundiAPILib from the package explorer.
  2. Select "Run -> Run as -> JUnit Test" or use "Alt + Shift + X" followed by "T" to run the Tests.

Initialization

Authentication

In order to setup authentication and initialization of 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.

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

MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);

Class Reference

List of Controllers

Class: ChargesController

Get singleton instance

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

ChargesController charges = client.getCharges();

Method: getChargeAsync

Get a charge from its id

void getChargeAsync(
        final String chargeId,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id

Example Usage

String chargeId = "charge_id";
// Invoking the API call with sample inputs
charges.getChargeAsync(chargeId, new APICallBack<GetChargeResponse>() {
    public void onSuccess(HttpContext context, GetChargeResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: retryChargeAsync

Retries a charge

void retryChargeAsync(
        final String chargeId,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id

Example Usage

String chargeId = "charge_id";
// Invoking the API call with sample inputs
charges.retryChargeAsync(chargeId, new APICallBack<GetChargeResponse>() {
    public void onSuccess(HttpContext context, GetChargeResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createChargeAsync

Creates a new charge

void createChargeAsync(
        final CreateChargeRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
request Required Request for creating a charge

Example Usage

try {
    CreateChargeRequest request = new CreateChargeRequest();
    // Invoking the API call with sample inputs
    charges.createChargeAsync(request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateChargeCardAsync

Updates the card from a charge

void updateChargeCardAsync(
        final String chargeId,
        final UpdateChargeCardRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id
request Required Request for updating a charge's card

Example Usage

try {
    String chargeId = "charge_id";
    UpdateChargeCardRequest request = new UpdateChargeCardRequest();
    // Invoking the API call with sample inputs
    charges.updateChargeCardAsync(chargeId, request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateChargePaymentMethodAsync

Updates a charge's payment method

void updateChargePaymentMethodAsync(
        final String chargeId,
        final UpdateChargePaymentMethodRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id
request Required Request for updating the payment method from a charge

Example Usage

try {
    String chargeId = "charge_id";
    UpdateChargePaymentMethodRequest request = new UpdateChargePaymentMethodRequest();
    // Invoking the API call with sample inputs
    charges.updateChargePaymentMethodAsync(chargeId, request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: cancelChargeAsync

Cancel a charge

void cancelChargeAsync(
        final String chargeId,
        final CreateCancelChargeRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id
request Optional Request for cancelling a charge

Example Usage

try {
    String chargeId = "charge_id";
    CreateCancelChargeRequest request = new CreateCancelChargeRequest();
    // Invoking the API call with sample inputs
    charges.cancelChargeAsync(chargeId, request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: captureChargeAsync

Captures a charge

void captureChargeAsync(
        final String chargeId,
        final CreateCaptureChargeRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required Charge id
request Optional Request for capturing a charge

Example Usage

try {
    String chargeId = "charge_id";
    CreateCaptureChargeRequest request = new CreateCaptureChargeRequest();
    // Invoking the API call with sample inputs
    charges.captureChargeAsync(chargeId, request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateChargeMetadataAsync

Updates the metadata from a charge

void updateChargeMetadataAsync(
        final String chargeId,
        final UpdateMetadataRequest request,
        final APICallBack<GetChargeResponse> callBack)

Parameters

Parameter Tags Description
chargeId Required The charge id
request Required Request for updating the charge metadata

Example Usage

try {
    String chargeId = "charge_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    charges.updateChargeMetadataAsync(chargeId, request, new APICallBack<GetChargeResponse>() {
        public void onSuccess(HttpContext context, GetChargeResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getChargesAsync

Lists all charges

void getChargesAsync(
        final Integer page,
        final Integer size,
        final String code,
        final String status,
        final String paymentMethod,
        final String customerId,
        final String orderId,
        final DateTime createdSince,
        final DateTime createdUntil,
        final APICallBack<ListChargesResponse> 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

Integer page = 144;
Integer size = 144;
String code = "code";
String status = "status";
String paymentMethod = "payment_method";
String customerId = "customer_id";
String orderId = "order_id";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
// Invoking the API call with sample inputs
charges.getChargesAsync(page, size, code, status, paymentMethod, customerId, orderId, createdSince, createdUntil, new APICallBack<ListChargesResponse>() {
    public void onSuccess(HttpContext context, ListChargesResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: CustomersController

Get singleton instance

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

CustomersController customers = client.getCustomers();

Method: createCustomerAsync

Creates a new customer

void createCustomerAsync(
        final CreateCustomerRequest request,
        final APICallBack<GetCustomerResponse> callBack)

Parameters

Parameter Tags Description
request Required Request for creating a customer

Example Usage

try {
    CreateCustomerRequest request = new CreateCustomerRequest();
    // Invoking the API call with sample inputs
    customers.createCustomerAsync(request, new APICallBack<GetCustomerResponse>() {
        public void onSuccess(HttpContext context, GetCustomerResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getCustomerAsync

Get a customer

void getCustomerAsync(
        final String customerId,
        final APICallBack<GetCustomerResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id

Example Usage

String customerId = "customer_id";
// Invoking the API call with sample inputs
customers.getCustomerAsync(customerId, new APICallBack<GetCustomerResponse>() {
    public void onSuccess(HttpContext context, GetCustomerResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateCardAsync

Updates a card

void updateCardAsync(
        final String customerId,
        final String cardId,
        final UpdateCardRequest request,
        final APICallBack<GetCardResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
cardId Required Card id
request Required Request for updating a card

Example Usage

try {
    String customerId = "customer_id";
    String cardId = "card_id";
    UpdateCardRequest request = new UpdateCardRequest();
    // Invoking the API call with sample inputs
    customers.updateCardAsync(customerId, cardId, request, new APICallBack<GetCardResponse>() {
        public void onSuccess(HttpContext context, GetCardResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateAddressAsync

Updates an address

void updateAddressAsync(
        final String customerId,
        final String addressId,
        final UpdateAddressRequest request,
        final APICallBack<GetAddressResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
addressId Required Address Id
request Required Request for updating an address

Example Usage

try {
    String customerId = "customer_id";
    String addressId = "address_id";
    UpdateAddressRequest request = new UpdateAddressRequest();
    // Invoking the API call with sample inputs
    customers.updateAddressAsync(customerId, addressId, request, new APICallBack<GetAddressResponse>() {
        public void onSuccess(HttpContext context, GetAddressResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getAddressAsync

Get a customer's address

void getAddressAsync(
        final String customerId,
        final String addressId,
        final APICallBack<GetAddressResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer id
addressId Required Address Id

Example Usage

String customerId = "customer_id";
String addressId = "address_id";
// Invoking the API call with sample inputs
customers.getAddressAsync(customerId, addressId, new APICallBack<GetAddressResponse>() {
    public void onSuccess(HttpContext context, GetAddressResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteAddressAsync

Delete a Customer's address

void deleteAddressAsync(
        final String customerId,
        final String addressId,
        final APICallBack<GetAddressResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
addressId Required Address Id

Example Usage

String customerId = "customer_id";
String addressId = "address_id";
// Invoking the API call with sample inputs
customers.deleteAddressAsync(customerId, addressId, new APICallBack<GetAddressResponse>() {
    public void onSuccess(HttpContext context, GetAddressResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteCardAsync

Delete a customer's card

void deleteCardAsync(
        final String customerId,
        final String cardId,
        final APICallBack<GetCardResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
cardId Required Card Id

Example Usage

String customerId = "customer_id";
String cardId = "card_id";
// Invoking the API call with sample inputs
customers.deleteCardAsync(customerId, cardId, new APICallBack<GetCardResponse>() {
    public void onSuccess(HttpContext context, GetCardResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createAddressAsync

Creates a new address for a customer

void createAddressAsync(
        final String customerId,
        final CreateAddressRequest request,
        final APICallBack<GetAddressResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
request Required Request for creating an address

Example Usage

try {
    String customerId = "customer_id";
    CreateAddressRequest request = new CreateAddressRequest();
    // Invoking the API call with sample inputs
    customers.createAddressAsync(customerId, request, new APICallBack<GetAddressResponse>() {
        public void onSuccess(HttpContext context, GetAddressResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getCardAsync

Get a customer's card

void getCardAsync(
        final String customerId,
        final String cardId,
        final APICallBack<GetCardResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer id
cardId Required Card id

Example Usage

String customerId = "customer_id";
String cardId = "card_id";
// Invoking the API call with sample inputs
customers.getCardAsync(customerId, cardId, new APICallBack<GetCardResponse>() {
    public void onSuccess(HttpContext context, GetCardResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createCardAsync

Creates a new card for a customer

void createCardAsync(
        final String customerId,
        final CreateCardRequest request,
        final APICallBack<GetCardResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer id
request Required Request for creating a card

Example Usage

try {
    String customerId = "customer_id";
    CreateCardRequest request = new CreateCardRequest();
    // Invoking the API call with sample inputs
    customers.createCardAsync(customerId, request, new APICallBack<GetCardResponse>() {
        public void onSuccess(HttpContext context, GetCardResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateCustomerAsync

Updates a customer

void updateCustomerAsync(
        final String customerId,
        final UpdateCustomerRequest request,
        final APICallBack<GetCustomerResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer id
request Required Request for updating a customer

Example Usage

try {
    String customerId = "customer_id";
    UpdateCustomerRequest request = new UpdateCustomerRequest();
    // Invoking the API call with sample inputs
    customers.updateCustomerAsync(customerId, request, new APICallBack<GetCustomerResponse>() {
        public void onSuccess(HttpContext context, GetCustomerResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: deleteAccessTokensAsync

Delete a Customer's access tokens

void deleteAccessTokensAsync(
        final String customerId,
        final APICallBack<ListAccessTokensResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id

Example Usage

String customerId = "customer_id";
// Invoking the API call with sample inputs
customers.deleteAccessTokensAsync(customerId, new APICallBack<ListAccessTokensResponse>() {
    public void onSuccess(HttpContext context, ListAccessTokensResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getCustomersAsync

Get all Customers

void getCustomersAsync(
        final String name,
        final String document,
        final Integer page,
        final Integer size,
        final String email,
        final APICallBack<ListCustomersResponse> 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

Example Usage

String name = "name";
String document = "document";
Integer page = 1;
Integer size = 10;
String email = "email";
// Invoking the API call with sample inputs
customers.getCustomersAsync(name, document, page, size, email, new APICallBack<ListCustomersResponse>() {
    public void onSuccess(HttpContext context, ListCustomersResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAccessTokenAsync

Get a Customer's access token

void getAccessTokenAsync(
        final String customerId,
        final String tokenId,
        final APICallBack<GetAccessTokenResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
tokenId Required Token Id

Example Usage

String customerId = "customer_id";
String tokenId = "token_id";
// Invoking the API call with sample inputs
customers.getAccessTokenAsync(customerId, tokenId, new APICallBack<GetAccessTokenResponse>() {
    public void onSuccess(HttpContext context, GetAccessTokenResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createAccessTokenAsync

Creates a access token for a customer

void createAccessTokenAsync(
        final String customerId,
        final CreateAccessTokenRequest request,
        final APICallBack<GetAccessTokenResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
request Required Request for creating a access token

Example Usage

try {
    String customerId = "customer_id";
    CreateAccessTokenRequest request = new CreateAccessTokenRequest();
    // Invoking the API call with sample inputs
    customers.createAccessTokenAsync(customerId, request, new APICallBack<GetAccessTokenResponse>() {
        public void onSuccess(HttpContext context, GetAccessTokenResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: deleteAccessTokenAsync

Delete a customer's access token

void deleteAccessTokenAsync(
        final String customerId,
        final String tokenId,
        final APICallBack<GetAccessTokenResponse> callBack)

Parameters

Parameter Tags Description
customerId Required Customer Id
tokenId Required Token Id

Example Usage

String customerId = "customer_id";
String tokenId = "token_id";
// Invoking the API call with sample inputs
customers.deleteAccessTokenAsync(customerId, tokenId, new APICallBack<GetAccessTokenResponse>() {
    public void onSuccess(HttpContext context, GetAccessTokenResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateCustomerMetadataAsync

Updates the metadata a customer

void updateCustomerMetadataAsync(
        final String customerId,
        final UpdateMetadataRequest request,
        final APICallBack<GetCustomerResponse> callBack)

Parameters

Parameter Tags Description
customerId Required The customer id
request Required Request for updating the customer metadata

Example Usage

try {
    String customerId = "customer_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    customers.updateCustomerMetadataAsync(customerId, request, new APICallBack<GetCustomerResponse>() {
        public void onSuccess(HttpContext context, GetCustomerResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getAccessTokensAsync

Get all access tokens from a customer

void getAccessTokensAsync(
        final String customerId,
        final Integer page,
        final Integer size,
        final APICallBack<ListAccessTokensResponse> callBack)

Parameters

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

Example Usage

String customerId = "customer_id";
Integer page = 144;
Integer size = 144;
// Invoking the API call with sample inputs
customers.getAccessTokensAsync(customerId, page, size, new APICallBack<ListAccessTokensResponse>() {
    public void onSuccess(HttpContext context, ListAccessTokensResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAddressesAsync

Gets all adressess from a customer

void getAddressesAsync(
        final String customerId,
        final Integer page,
        final Integer size,
        final APICallBack<ListAddressesResponse> callBack)

Parameters

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

Example Usage

String customerId = "customer_id";
Integer page = 144;
Integer size = 144;
// Invoking the API call with sample inputs
customers.getAddressesAsync(customerId, page, size, new APICallBack<ListAddressesResponse>() {
    public void onSuccess(HttpContext context, ListAddressesResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getCardsAsync

Get all cards from a customer

void getCardsAsync(
        final String customerId,
        final Integer page,
        final Integer size,
        final APICallBack<ListCardsResponse> callBack)

Parameters

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

Example Usage

String customerId = "customer_id";
Integer page = 144;
Integer size = 144;
// Invoking the API call with sample inputs
customers.getCardsAsync(customerId, page, size, new APICallBack<ListCardsResponse>() {
    public void onSuccess(HttpContext context, ListCardsResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: InvoicesController

Get singleton instance

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

InvoicesController invoices = client.getInvoices();

Method: getInvoiceAsync

Gets an invoice

void getInvoiceAsync(
        final String invoiceId,
        final APICallBack<GetInvoiceResponse> callBack)

Parameters

Parameter Tags Description
invoiceId Required Invoice Id

Example Usage

String invoiceId = "invoice_id";
// Invoking the API call with sample inputs
invoices.getInvoiceAsync(invoiceId, new APICallBack<GetInvoiceResponse>() {
    public void onSuccess(HttpContext context, GetInvoiceResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: cancelInvoiceAsync

Cancels an invoice

void cancelInvoiceAsync(
        final String invoiceId,
        final APICallBack<GetInvoiceResponse> callBack)

Parameters

Parameter Tags Description
invoiceId Required Invoice id

Example Usage

String invoiceId = "invoice_id";
// Invoking the API call with sample inputs
invoices.cancelInvoiceAsync(invoiceId, new APICallBack<GetInvoiceResponse>() {
    public void onSuccess(HttpContext context, GetInvoiceResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateInvoiceMetadataAsync

Updates the metadata from an invoice

void updateInvoiceMetadataAsync(
        final String invoiceId,
        final UpdateMetadataRequest request,
        final APICallBack<GetInvoiceResponse> callBack)

Parameters

Parameter Tags Description
invoiceId Required The invoice id
request Required Request for updating the invoice metadata

Example Usage

try {
    String invoiceId = "invoice_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    invoices.updateInvoiceMetadataAsync(invoiceId, request, new APICallBack<GetInvoiceResponse>() {
        public void onSuccess(HttpContext context, GetInvoiceResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getInvoicesAsync

Gets all invoices

void getInvoicesAsync(
        final Integer page,
        final Integer size,
        final String code,
        final String customerId,
        final String subscriptionId,
        final DateTime createdSince,
        final DateTime createdUntil,
        final String status,
        final DateTime dueSince,
        final DateTime dueUntil,
        final APICallBack<ListInvoicesResponse> callBack)

Parameters

Parameter Tags Description
page Optional Page number
size Optional Page size
code Optional Filter for Invoice's code
customerId Optional Filter for Invoice's customer id
subscriptionId Optional Filter for Invoice's subscription id
createdSince Optional Filter for Invoice's creation date start range
createdUntil Optional Filter for Invoices creation date end range
status Optional Filter for Invoice's status
dueSince Optional Filter for Invoice's due date start range
dueUntil Optional Filter for Invoice's due date end range

Example Usage

Integer page = 144;
Integer size = 144;
String code = "code";
String customerId = "customer_id";
String subscriptionId = "subscription_id";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
String status = "status";
DateTime dueSince = new Date();
DateTime dueUntil = new Date();
// Invoking the API call with sample inputs
invoices.getInvoicesAsync(page, size, code, customerId, subscriptionId, createdSince, createdUntil, status, dueSince, dueUntil, new APICallBack<ListInvoicesResponse>() {
    public void onSuccess(HttpContext context, ListInvoicesResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: PlansController

Get singleton instance

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

PlansController plans = client.getPlans();

Method: updatePlanItemAsync

Updates a plan item

void updatePlanItemAsync(
        final String planId,
        final String planItemId,
        final UpdatePlanItemRequest body,
        final APICallBack<GetPlanItemResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id
planItemId Required Plan item id
body Required Request for updating the plan item

Example Usage

try {
    String planId = "plan_id";
    String planItemId = "plan_item_id";
    UpdatePlanItemRequest body = new UpdatePlanItemRequest();
    // Invoking the API call with sample inputs
    plans.updatePlanItemAsync(planId, planItemId, body, new APICallBack<GetPlanItemResponse>() {
        public void onSuccess(HttpContext context, GetPlanItemResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getPlanAsync

Gets a plan

void getPlanAsync(
        final String planId,
        final APICallBack<GetPlanResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id

Example Usage

String planId = "plan_id";
// Invoking the API call with sample inputs
plans.getPlanAsync(planId, new APICallBack<GetPlanResponse>() {
    public void onSuccess(HttpContext context, GetPlanResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createPlanItemAsync

Adds a new item to a plan

void createPlanItemAsync(
        final String planId,
        final CreatePlanItemRequest request,
        final APICallBack<GetPlanItemResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id
request Required Request for creating a plan item

Example Usage

try {
    String planId = "plan_id";
    CreatePlanItemRequest request = new CreatePlanItemRequest();
    // Invoking the API call with sample inputs
    plans.createPlanItemAsync(planId, request, new APICallBack<GetPlanItemResponse>() {
        public void onSuccess(HttpContext context, GetPlanItemResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updatePlanAsync

Updates a plan

void updatePlanAsync(
        final String planId,
        final UpdatePlanRequest request,
        final APICallBack<GetPlanResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id
request Required Request for updating a plan

Example Usage

try {
    String planId = "plan_id";
    UpdatePlanRequest request = new UpdatePlanRequest();
    // Invoking the API call with sample inputs
    plans.updatePlanAsync(planId, request, new APICallBack<GetPlanResponse>() {
        public void onSuccess(HttpContext context, GetPlanResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: createPlanAsync

Creates a new plan

void createPlanAsync(
        final CreatePlanRequest body,
        final APICallBack<GetPlanResponse> callBack)

Parameters

Parameter Tags Description
body Required Request for creating a plan

Example Usage

try {
    CreatePlanRequest body = new CreatePlanRequest();
    // Invoking the API call with sample inputs
    plans.createPlanAsync(body, new APICallBack<GetPlanResponse>() {
        public void onSuccess(HttpContext context, GetPlanResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: deletePlanAsync

Deletes a plan

void deletePlanAsync(
        final String planId,
        final APICallBack<GetPlanResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id

Example Usage

String planId = "plan_id";
// Invoking the API call with sample inputs
plans.deletePlanAsync(planId, new APICallBack<GetPlanResponse>() {
    public void onSuccess(HttpContext context, GetPlanResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getPlanItemAsync

Gets a plan item

void getPlanItemAsync(
        final String planId,
        final String planItemId,
        final APICallBack<GetPlanItemResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id
planItemId Required Plan item id

Example Usage

String planId = "plan_id";
String planItemId = "plan_item_id";
// Invoking the API call with sample inputs
plans.getPlanItemAsync(planId, planItemId, new APICallBack<GetPlanItemResponse>() {
    public void onSuccess(HttpContext context, GetPlanItemResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deletePlanItemAsync

Removes an item from a plan

void deletePlanItemAsync(
        final String planId,
        final String planItemId,
        final APICallBack<GetPlanItemResponse> callBack)

Parameters

Parameter Tags Description
planId Required Plan id
planItemId Required Plan item id

Example Usage

String planId = "plan_id";
String planItemId = "plan_item_id";
// Invoking the API call with sample inputs
plans.deletePlanItemAsync(planId, planItemId, new APICallBack<GetPlanItemResponse>() {
    public void onSuccess(HttpContext context, GetPlanItemResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updatePlanMetadataAsync

Updates the metadata from a plan

void updatePlanMetadataAsync(
        final String planId,
        final UpdateMetadataRequest request,
        final APICallBack<GetPlanResponse> callBack)

Parameters

Parameter Tags Description
planId Required The plan id
request Required Request for updating the plan metadata

Example Usage

try {
    String planId = "plan_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    plans.updatePlanMetadataAsync(planId, request, new APICallBack<GetPlanResponse>() {
        public void onSuccess(HttpContext context, GetPlanResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getPlansAsync

Gets all plans

void getPlansAsync(
        final Integer page,
        final Integer size,
        final String name,
        final String status,
        final String billingType,
        final DateTime createdSince,
        final DateTime createdUntil,
        final APICallBack<ListPlansResponse> callBack)

Parameters

Parameter Tags Description
page Optional Page number
size Optional Page size
name Optional Filter for Plan's name
status Optional Filter for Plan's status
billingType Optional Filter for plan's billing type
createdSince Optional Filter for plan's creation date start range
createdUntil Optional Filter for plan's creation date end range

Example Usage

Integer page = 144;
Integer size = 144;
String name = "name";
String status = "status";
String billingType = "billing_type";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
// Invoking the API call with sample inputs
plans.getPlansAsync(page, size, name, status, billingType, createdSince, createdUntil, new APICallBack<ListPlansResponse>() {
    public void onSuccess(HttpContext context, ListPlansResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: SubscriptionsController

Get singleton instance

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

SubscriptionsController subscriptions = client.getSubscriptions();

Method: updateSubscriptionItemAsync

Updates a subscription item

void updateSubscriptionItemAsync(
        final String subscriptionId,
        final String itemId,
        final UpdateSubscriptionItemRequest body,
        final APICallBack<GetSubscriptionItemResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription Id
itemId Required Item id
body Required Request for updating a subscription item

Example Usage

try {
    String subscriptionId = "subscription_id";
    String itemId = "item_id";
    UpdateSubscriptionItemRequest body = new UpdateSubscriptionItemRequest();
    // Invoking the API call with sample inputs
    subscriptions.updateSubscriptionItemAsync(subscriptionId, itemId, body, new APICallBack<GetSubscriptionItemResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionItemResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: createUsageAsync

Creates a usage

void createUsageAsync(
        final String subscriptionId,
        final String itemId,
        final CreateUsageRequest body,
        final APICallBack<GetUsageResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription Id
itemId Required Item id
body Required Request for creating a usage

Example Usage

try {
    String subscriptionId = "subscription_id";
    String itemId = "item_id";
    CreateUsageRequest body = new CreateUsageRequest();
    // Invoking the API call with sample inputs
    subscriptions.createUsageAsync(subscriptionId, itemId, body, new APICallBack<GetUsageResponse>() {
        public void onSuccess(HttpContext context, GetUsageResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateSubscriptionBillingDateAsync

Updates the billing date from a subscription

void updateSubscriptionBillingDateAsync(
        final String subscriptionId,
        final UpdateSubscriptionBillingDateRequest request,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required The subscription id
request Required Request for updating the subscription billing date

Example Usage

try {
    String subscriptionId = "subscription_id";
    UpdateSubscriptionBillingDateRequest request = new UpdateSubscriptionBillingDateRequest();
    // Invoking the API call with sample inputs
    subscriptions.updateSubscriptionBillingDateAsync(subscriptionId, request, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateSubscriptionCardAsync

Updates the credit card from a subscription

void updateSubscriptionCardAsync(
        final String subscriptionId,
        final UpdateSubscriptionCardRequest request,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
request Required Request for updating a card

Example Usage

try {
    String subscriptionId = "subscription_id";
    UpdateSubscriptionCardRequest request = new UpdateSubscriptionCardRequest();
    // Invoking the API call with sample inputs
    subscriptions.updateSubscriptionCardAsync(subscriptionId, request, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: createSubscriptionAsync

Creates a new subscription

void createSubscriptionAsync(
        final CreateSubscriptionRequest body,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
body Required Request for creating a subscription

Example Usage

try {
    CreateSubscriptionRequest body = new CreateSubscriptionRequest();
    // Invoking the API call with sample inputs
    subscriptions.createSubscriptionAsync(body, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: createSubscriptionItemAsync

Creates a new Subscription item

void createSubscriptionItemAsync(
        final String subscriptionId,
        final CreateSubscriptionItemRequest request,
        final APICallBack<GetSubscriptionItemResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
request Required Request for creating a subscription item

Example Usage

try {
    String subscriptionId = "subscription_id";
    CreateSubscriptionItemRequest request = new CreateSubscriptionItemRequest();
    // Invoking the API call with sample inputs
    subscriptions.createSubscriptionItemAsync(subscriptionId, request, new APICallBack<GetSubscriptionItemResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionItemResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: createDiscountAsync

Creates a discount

void createDiscountAsync(
        final String subscriptionId,
        final CreateDiscountRequest request,
        final APICallBack<GetDiscountResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
request Required Request for creating a discount

Example Usage

try {
    String subscriptionId = "subscription_id";
    CreateDiscountRequest request = new CreateDiscountRequest();
    // Invoking the API call with sample inputs
    subscriptions.createDiscountAsync(subscriptionId, request, new APICallBack<GetDiscountResponse>() {
        public void onSuccess(HttpContext context, GetDiscountResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getSubscriptionAsync

Gets a subscription

void getSubscriptionAsync(
        final String subscriptionId,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id

Example Usage

String subscriptionId = "subscription_id";
// Invoking the API call with sample inputs
subscriptions.getSubscriptionAsync(subscriptionId, new APICallBack<GetSubscriptionResponse>() {
    public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateSubscriptionPaymentMethodAsync

Updates the payment method from a subscription

void updateSubscriptionPaymentMethodAsync(
        final String subscriptionId,
        final UpdateSubscriptionPaymentMethodRequest request,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
request Required Request for updating the paymentmethod from a subscription

Example Usage

try {
    String subscriptionId = "subscription_id";
    UpdateSubscriptionPaymentMethodRequest request = new UpdateSubscriptionPaymentMethodRequest();
    // Invoking the API call with sample inputs
    subscriptions.updateSubscriptionPaymentMethodAsync(subscriptionId, request, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: deleteDiscountAsync

Deletes a discount

void deleteDiscountAsync(
        final String subscriptionId,
        final String discountId,
        final APICallBack<GetDiscountResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
discountId Required Discount Id

Example Usage

String subscriptionId = "subscription_id";
String discountId = "discount_id";
// Invoking the API call with sample inputs
subscriptions.deleteDiscountAsync(subscriptionId, discountId, new APICallBack<GetDiscountResponse>() {
    public void onSuccess(HttpContext context, GetDiscountResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: cancelSubscriptionAsync

Cancels a subscription

void cancelSubscriptionAsync(
        final String subscriptionId,
        final CreateCancelSubscriptionRequest request,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
request Optional Request for cancelling a subscription

Example Usage

try {
    String subscriptionId = "subscription_id";
    CreateCancelSubscriptionRequest request = new CreateCancelSubscriptionRequest();
    // Invoking the API call with sample inputs
    subscriptions.cancelSubscriptionAsync(subscriptionId, request, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: deleteSubscriptionItemAsync

Deletes a subscription item

void deleteSubscriptionItemAsync(
        final String subscriptionId,
        final String subscriptionItemId,
        final APICallBack<GetSubscriptionItemResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required Subscription id
subscriptionItemId Required Subscription item id

Example Usage

String subscriptionId = "subscription_id";
String subscriptionItemId = "subscription_item_id";
// Invoking the API call with sample inputs
subscriptions.deleteSubscriptionItemAsync(subscriptionId, subscriptionItemId, new APICallBack<GetSubscriptionItemResponse>() {
    public void onSuccess(HttpContext context, GetSubscriptionItemResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteUsageAsync

Deletes a usage

void deleteUsageAsync(
        final String subscriptionId,
        final String itemId,
        final String usageId,
        final APICallBack<GetUsageResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required The subscription id
itemId Required The subscription item id
usageId Required The usage id

Example Usage

String subscriptionId = "subscription_id";
String itemId = "item_id";
String usageId = "usage_id";
// Invoking the API call with sample inputs
subscriptions.deleteUsageAsync(subscriptionId, itemId, usageId, new APICallBack<GetUsageResponse>() {
    public void onSuccess(HttpContext context, GetUsageResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getUsagesAsync

Lists all usages from a subscription item

void getUsagesAsync(
        final String subscriptionId,
        final String itemId,
        final Integer page,
        final Integer size,
        final APICallBack<ListUsagesResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required The subscription id
itemId Required The subscription item id
page Optional Page number
size Optional Page size

Example Usage

String subscriptionId = "subscription_id";
String itemId = "item_id";
Integer page = 236;
Integer size = 236;
// Invoking the API call with sample inputs
subscriptions.getUsagesAsync(subscriptionId, itemId, page, size, new APICallBack<ListUsagesResponse>() {
    public void onSuccess(HttpContext context, ListUsagesResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateSubscriptionMetadataAsync

Updates the metadata from a subscription

void updateSubscriptionMetadataAsync(
        final String subscriptionId,
        final UpdateMetadataRequest request,
        final APICallBack<GetSubscriptionResponse> callBack)

Parameters

Parameter Tags Description
subscriptionId Required The subscription id
request Required Request for updating the subscrption metadata

Example Usage

try {
    String subscriptionId = "subscription_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    subscriptions.updateSubscriptionMetadataAsync(subscriptionId, request, new APICallBack<GetSubscriptionResponse>() {
        public void onSuccess(HttpContext context, GetSubscriptionResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getSubscriptionsAsync

Gets all subscriptions

void getSubscriptionsAsync(
        final Integer page,
        final Integer size,
        final String code,
        final String billingType,
        final String customerId,
        final String planId,
        final String cardId,
        final String status,
        final DateTime nextBillingSince,
        final DateTime nextBillingUntil,
        final DateTime createdSince,
        final DateTime createdUntil,
        final APICallBack<ListSubscriptionsResponse> callBack)

Parameters

Parameter Tags Description
page Optional Page number
size Optional Page size
code Optional Filter for subscription's code
billingType Optional Filter for subscription's billing type
customerId Optional Filter for subscription's customer id
planId Optional Filter for subscription's plan id
cardId Optional Filter for subscription's card id
status Optional Filter for subscription's status
nextBillingSince Optional Filter for subscription's next billing date start range
nextBillingUntil Optional Filter for subscription's next billing date end range
createdSince Optional Filter for subscription's creation date start range
createdUntil Optional Filter for subscriptions creation date end range

Example Usage

Integer page = 236;
Integer size = 236;
String code = "code";
String billingType = "billing_type";
String customerId = "customer_id";
String planId = "plan_id";
String cardId = "card_id";
String status = "status";
DateTime nextBillingSince = new Date();
DateTime nextBillingUntil = new Date();
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
// Invoking the API call with sample inputs
subscriptions.getSubscriptionsAsync(page, size, code, billingType, customerId, planId, cardId, status, nextBillingSince, nextBillingUntil, createdSince, createdUntil, new APICallBack<ListSubscriptionsResponse>() {
    public void onSuccess(HttpContext context, ListSubscriptionsResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: OrdersController

Get singleton instance

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

OrdersController orders = client.getOrders();

Method: getOrderAsync

Gets an order

void getOrderAsync(
        final String orderId,
        final APICallBack<GetOrderResponse> callBack)

Parameters

Parameter Tags Description
orderId Required Order id

Example Usage

String orderId = "order_id";
// Invoking the API call with sample inputs
orders.getOrderAsync(orderId, new APICallBack<GetOrderResponse>() {
    public void onSuccess(HttpContext context, GetOrderResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createOrderAsync

Creates a new Order

void createOrderAsync(
        final CreateOrderRequest body,
        final APICallBack<GetOrderResponse> callBack)

Parameters

Parameter Tags Description
body Required Request for creating an order

Example Usage

try {
    CreateOrderRequest body = new CreateOrderRequest();
    // Invoking the API call with sample inputs
    orders.createOrderAsync(body, new APICallBack<GetOrderResponse>() {
        public void onSuccess(HttpContext context, GetOrderResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateOrderMetadataAsync

Updates the metadata from an order

void updateOrderMetadataAsync(
        final String orderId,
        final UpdateMetadataRequest request,
        final APICallBack<GetOrderResponse> callBack)

Parameters

Parameter Tags Description
orderId Required The order id
request Required Request for updating the order metadata

Example Usage

try {
    String orderId = "order_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    orders.updateOrderMetadataAsync(orderId, request, new APICallBack<GetOrderResponse>() {
        public void onSuccess(HttpContext context, GetOrderResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getOrdersAsync

Gets all orders

void getOrdersAsync(
        final Integer page,
        final Integer size,
        final String code,
        final String status,
        final DateTime createdSince,
        final DateTime createdUntil,
        final String customerId,
        final APICallBack<ListOrderResponse> callBack)

Parameters

Parameter Tags Description
page Optional Page number
size Optional Page size
code Optional Filter for order's code
status Optional Filter for order's status
createdSince Optional Filter for order's creation date start range
createdUntil Optional Filter for order's creation date end range
customerId Optional Filter for order's customer id

Example Usage

Integer page = 236;
Integer size = 236;
String code = "code";
String status = "status";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
String customerId = "customer_id";
// Invoking the API call with sample inputs
orders.getOrdersAsync(page, size, code, status, createdSince, createdUntil, customerId, new APICallBack<ListOrderResponse>() {
    public void onSuccess(HttpContext context, ListOrderResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: TokensController

Get singleton instance

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

TokensController tokens = client.getTokens();

Method: getTokenAsync

Tags: Skips Authentication

Gets a token from its id

void getTokenAsync(
        final String id,
        final String publicKey,
        final APICallBack<GetTokenResponse> callBack)

Parameters

Parameter Tags Description
id Required Token id
publicKey Required Public key

Example Usage

String id = "id";
String publicKey = "public_key";
// Invoking the API call with sample inputs
tokens.getTokenAsync(id, publicKey, new APICallBack<GetTokenResponse>() {
    public void onSuccess(HttpContext context, GetTokenResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createTokenAsync

Tags: Skips Authentication

TODO: Add a method description

void createTokenAsync(
        final String publicKey,
        final CreateTokenRequest request,
        final APICallBack<GetTokenResponse> callBack)

Parameters

Parameter Tags Description
publicKey Required Public key
request Required Request for creating a token

Example Usage

try {
    String publicKey = "public_key";
    CreateTokenRequest request = new CreateTokenRequest();
    // Invoking the API call with sample inputs
    tokens.createTokenAsync(publicKey, request, new APICallBack<GetTokenResponse>() {
        public void onSuccess(HttpContext context, GetTokenResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Back to List of Controllers

Class: RecipientsController

Get singleton instance

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

RecipientsController recipients = client.getRecipients();

Method: createRecipientAsync

Creates a new recipient

void createRecipientAsync(
        final CreateRecipientRequest request,
        final APICallBack<GetRecipientResponse> callBack)

Parameters

Parameter Tags Description
request Required Recipient data

Example Usage

try {
    CreateRecipientRequest request = new CreateRecipientRequest();
    // Invoking the API call with sample inputs
    recipients.createRecipientAsync(request, new APICallBack<GetRecipientResponse>() {
        public void onSuccess(HttpContext context, GetRecipientResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateRecipientAsync

Updates a recipient

void updateRecipientAsync(
        final String recipientId,
        final UpdateRecipientRequest request,
        final APICallBack<GetRecipientResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
request Required Recipient data

Example Usage

try {
    String recipientId = "recipient_id";
    UpdateRecipientRequest request = new UpdateRecipientRequest();
    // Invoking the API call with sample inputs
    recipients.updateRecipientAsync(recipientId, request, new APICallBack<GetRecipientResponse>() {
        public void onSuccess(HttpContext context, GetRecipientResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: updateRecipientDefaultBankAccountAsync

Updates the default bank account from a recipient

void updateRecipientDefaultBankAccountAsync(
        final String recipientId,
        final UpdateRecipientBankAccountRequest request,
        final APICallBack<GetRecipientResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
request Required Bank account data

Example Usage

try {
    String recipientId = "recipient_id";
    UpdateRecipientBankAccountRequest request = new UpdateRecipientBankAccountRequest();
    // Invoking the API call with sample inputs
    recipients.updateRecipientDefaultBankAccountAsync(recipientId, request, new APICallBack<GetRecipientResponse>() {
        public void onSuccess(HttpContext context, GetRecipientResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getRecipientAsync

Retrieves recipient information

void getRecipientAsync(
        final String recipientId,
        final APICallBack<GetRecipientResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipiend id

Example Usage

String recipientId = "recipient_id";
// Invoking the API call with sample inputs
recipients.getRecipientAsync(recipientId, new APICallBack<GetRecipientResponse>() {
    public void onSuccess(HttpContext context, GetRecipientResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getRecipientsAsync

Retrieves paginated recipients information

void getRecipientsAsync(
        final Integer page,
        final Integer size,
        final APICallBack<ListRecipientResponse> callBack)

Parameters

Parameter Tags Description
page Optional Page number
size Optional Page size

Example Usage

Integer page = 236;
Integer size = 236;
// Invoking the API call with sample inputs
recipients.getRecipientsAsync(page, size, new APICallBack<ListRecipientResponse>() {
    public void onSuccess(HttpContext context, ListRecipientResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBalanceAsync

Get balance information for a recipient

void getBalanceAsync(
        final String recipientId,
        final APICallBack<GetBalanceResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id

Example Usage

String recipientId = "recipient_id";
// Invoking the API call with sample inputs
recipients.getBalanceAsync(recipientId, new APICallBack<GetBalanceResponse>() {
    public void onSuccess(HttpContext context, GetBalanceResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createTransferAsync

Creates a transfer for a recipient

void createTransferAsync(
        final String recipientId,
        final CreateTransferRequest request,
        final APICallBack<GetTransferResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient Id
request Required Transfer data

Example Usage

try {
    String recipientId = "recipient_id";
    CreateTransferRequest request = new CreateTransferRequest();
    // Invoking the API call with sample inputs
    recipients.createTransferAsync(recipientId, request, new APICallBack<GetTransferResponse>() {
        public void onSuccess(HttpContext context, GetTransferResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getTransferAsync

Gets a transfer

void getTransferAsync(
        final String recipientId,
        final String transferId,
        final APICallBack<GetTransferResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
transferId Required Transfer id

Example Usage

String recipientId = "recipient_id";
String transferId = "transfer_id";
// Invoking the API call with sample inputs
recipients.getTransferAsync(recipientId, transferId, new APICallBack<GetTransferResponse>() {
    public void onSuccess(HttpContext context, GetTransferResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getTransfersAsync

Gets a paginated list of transfers for the recipient

void getTransfersAsync(
        final String recipientId,
        final Integer page,
        final Integer size,
        final String status,
        final DateTime createdSince,
        final DateTime createdUntil,
        final APICallBack<ListTransferResponse> 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

String recipientId = "recipient_id";
Integer page = 236;
Integer size = 236;
String status = "status";
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
// Invoking the API call with sample inputs
recipients.getTransfersAsync(recipientId, page, size, status, createdSince, createdUntil, new APICallBack<ListTransferResponse>() {
    public void onSuccess(HttpContext context, ListTransferResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: createAnticipationAsync

Creates an anticipation

void createAnticipationAsync(
        final String recipientId,
        final CreateAnticipationRequest request,
        final APICallBack<GetAnticipationResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
request Required Anticipation data

Example Usage

try {
    String recipientId = "recipient_id";
    CreateAnticipationRequest request = new CreateAnticipationRequest();
    // Invoking the API call with sample inputs
    recipients.createAnticipationAsync(recipientId, request, new APICallBack<GetAnticipationResponse>() {
        public void onSuccess(HttpContext context, GetAnticipationResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getAnticipationAsync

Gets an anticipation

void getAnticipationAsync(
        final String recipientId,
        final String anticipationId,
        final APICallBack<GetAnticipationResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
anticipationId Required Anticipation id

Example Usage

String recipientId = "recipient_id";
String anticipationId = "anticipation_id";
// Invoking the API call with sample inputs
recipients.getAnticipationAsync(recipientId, anticipationId, new APICallBack<GetAnticipationResponse>() {
    public void onSuccess(HttpContext context, GetAnticipationResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAnticipationLimitsAsync

Gets the anticipation limits for a recipient

void getAnticipationLimitsAsync(
        final String recipientId,
        final String timeframe,
        final DateTime paymentDate,
        final APICallBack<GetAnticipationLimitResponse> callBack)

Parameters

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

Example Usage

String recipientId = "recipient_id";
String timeframe = "timeframe";
DateTime paymentDate = new Date();
// Invoking the API call with sample inputs
recipients.getAnticipationLimitsAsync(recipientId, timeframe, paymentDate, new APICallBack<GetAnticipationLimitResponse>() {
    public void onSuccess(HttpContext context, GetAnticipationLimitResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAnticipationsAsync

Retrieves a paginated list of anticipations from a recipient

void getAnticipationsAsync(
        final String recipientId,
        final Integer page,
        final Integer size,
        final String status,
        final String timeframe,
        final DateTime paymentDateSince,
        final DateTime paymentDateUntil,
        final DateTime createdSince,
        final DateTime createdUntil,
        final APICallBack<ListAnticipationResponse> 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

String recipientId = "recipient_id";
Integer page = 236;
Integer size = 236;
String status = "status";
String timeframe = "timeframe";
DateTime paymentDateSince = new Date();
DateTime paymentDateUntil = new Date();
DateTime createdSince = new Date();
DateTime createdUntil = new Date();
// Invoking the API call with sample inputs
recipients.getAnticipationsAsync(recipientId, page, size, status, timeframe, paymentDateSince, paymentDateUntil, createdSince, createdUntil, new APICallBack<ListAnticipationResponse>() {
    public void onSuccess(HttpContext context, ListAnticipationResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: updateRecipientMetadataAsync

Updates recipient metadata

void updateRecipientMetadataAsync(
        final String recipientId,
        final UpdateMetadataRequest request,
        final APICallBack<GetRecipientResponse> callBack)

Parameters

Parameter Tags Description
recipientId Required Recipient id
request Required Metadata

Example Usage

try {
    String recipientId = "recipient_id";
    UpdateMetadataRequest request = new UpdateMetadataRequest();
    // Invoking the API call with sample inputs
    recipients.updateRecipientMetadataAsync(recipientId, request, new APICallBack<GetRecipientResponse>() {
        public void onSuccess(HttpContext context, GetRecipientResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Back to List of Controllers