This is the official Java SDK for making calls to Poynt API in the cloud.
Maven dependency
<dependency>
<groupId>co.poynt.api</groupId>
<artifactId>java-cloud-sdk</artifactId>
<version>X.X.X</version>
</dependency>
Maven repository
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>Nexus snapshot repository</name>
<url>https://nexus.poynt.com/content/repositories/snapshots</url>
</snapshotRepository>
- Signup at https://poynt.net.
- Login and go to Development > Cloud apps
- Create a new cloud app.
- Copy the app id and download the key file.
- Put the
.pem
key file on your application's classpath. - Create a new config file on your application's classpath with the following contents:
appId=urn:aid:...YOUR_APP_ID...
appKeyFile=classpath:YOUR_APP_KEY_FILE.pem
# optional apiHost. If not specified defaults to https://services.poynt.net
# apiHost can also be set as a VM option: -DapiHost=
# apiHost=https://services-eu.poynt.net
# Adjust to your liking
httpSocketTimeout=2000
httpConnectTimeout=5000
httpRequestTimeout=30000
httpMaxConnection=10
httpMaxConnectionPerRoute=2
NOTE: appKeyFile
value can be an absolute path on disk or a path on the classpath. Include classpath:
if it is on the classpath.
public class Main {
public static void main(String[] args) {
final String businessId = "24eb9f63-cb3e-4f5c-a0f9-5cf70dc53f62";
// Use as a singleton
PoyntSdk sdk = PoyntSdk.builder().configure("config.properties").build();
Business business = sdk.business().get(businessId);
System.out.println(business);
List<BusinessUser> users = sdk.businessUser().getAll(businessId);
System.out.println(users);
CatalogWithProduct catalog = sdk.catalog().get(businessId, "675f0c80-6db8-4584-a444-6b213d0f4f66");
System.out.println(catalog);
Product product = sdk.product().get(businessId, "675f0c80-6db8-4584-a444-6b213d0f4f66");
System.out.println(product);
}
}