Hi there,
We do have an aidl service to work with the catalog but at the moment it only exposes read operations (IPoyntProductService). Hopefully we will add write operations soon.
For now, consider using our cloud API interface to create catalog from your server.
Step 1 would be to create products. Here’s an example:
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ean\":\"EAN-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"upc\":\"UPC-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"isbn\":\"ISBN-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"plu\":\"PLU-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"asin\":\"ASIN-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"name\":\"Cheetos Crunch 843\",\n \"description\":\"A bag of Cheetos\",\n \"specification\":\"Total Fat: 16%DV, Sodium:10%DV,, Carb: 4%DV\",\n \"releaseDate\":\"2014-01-01T00:00:00Z\",\n \"brand\":\"Cheetos\",\n \"manufacturer\":\"FritoLay\",\n \"publisher\":\"FritoLay\",\n \"studio\":\"www.cheetos.com\",\n \"designer\":\"John Doe\",\n \"author\":\"John Doe\",\n \"artist\":\"\",\n \"msrp\":{\"amount\":142, \"currency\":\"USD\"},\n \"tags\":\"chips cheetas\",\n \"sku\":\"SK-a42929fc-56a4-be05-6a60-e0b9f9f41974\",\n \"mpn\":\"FRTLY1\",\n \"styleNumber\":\"Flaming\",\n \"modelNumber\":\"BAG-O-CHIP\",\n \"type\":\"SIMPLE\",\n \"imageUrl\":[\"http://i.onionstatic.com/avclub/4425/01/16x9/1200.jpg\"],\n \"price\":{\"amount\":142, \"currency\":\"USD\"},\n \"unitOfMeasure\":\"EACH\",\n \"status\":\"ACTIVE\",\n \"shortCode\":\"BOC\"\n}\n");
Request request = new Request.Builder()
.url("https://services.poynt.net/businesses/<business id>/products")
.post(body)
.addHeader("content-type", "application/json")
.addHeader("authorization", "Bearer <token>")
.addHeader("poynt-request-id", "<unique id>")
.addHeader("api-version", "1.2")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Step 2: Create catalog with array of CatalogItems which would have the ids of products you created in Step 1. Or create catalog with array of categories with corresponding arrays of CatalogItems.