A financial service SDK for Java for innovative accounting solutions providers.
Lockstep automates accounting workflows to improve your operational efficiency and cash flow. Accelerate payments through automated customer communications, enhanced collections activity management, and innovative forecasting and reporting.
Here's how to add the Lockstep Java SDK to your project.
-
Download the JAR file from the Lockstep documentation and import it into your Java Project;
-
Obtain an API key for the Lockstep Platform API by visiting: API Key
-
Create a LockstepAPI Client in your .java file
Map<String, String> environment = System.getenv();
String key = environment.getOrDefault("PASS_ENVIRONMENT_HERE", null);
//You can use either "sbx" or "dev"
LockstepApi client = LockstepApi.withEnvironment("sbx");
client.withApiKey(INSERT_API_KEY);
- Make a ping call to make sure you're connected https://developer.lockstep.io/reference/v1_status_retrievestatus
LockstepResponse<StatusModel> response = client.getStatusClient().ping();
System.out.println("Ping result: " + response.isSuccess());
You now have your API credentials and have successfully created your client.
This example will show you how to call the Lockstep API, using the Query Invoices API to retrieve a collection of invoices.
# Connect to Client
# Lockstep provides sandbox and production environments
LockstepApi client = LockstepApi.withEnvironment("sbx");
client.withApiKey(INSERT_API_KEY);
InvoicesClient invoiceClient = client.getInvoicesClient();
LockstepResponse<FetchResult<InvoiceModel>> invoices = invoiceClient.queryInvoices("invoiceDate", "Company", "invoiceDate asc", 10, 0);
InvoiceModel[] invoiceModelList = invoices.getValue().getRecords();
for (InvoiceModel currentInvoice : InvoiceModel) {
System.out.println("Invoice " + count + ":" + currentInvoice.getInvoiceId());
}