Skip to main content

Inventories

The Inventory API enables retrieval of inventory items, combos, and categories.

Note: All requests require an X-API-Key header with your API key.


1. Get Categories

Service Call: InventoryService.GetCategories

Retrieve all active categories for a store. Each category includes items and combos.

Examples

import com.kodypay.grpc.ordering.v1.*;
import io.grpc.ManagedChannelBuilder;
import io.grpc.Metadata;
import static io.grpc.stub.MetadataUtils.newAttachHeadersInterceptor;
public class GetCategoriesExample {
public static void main(String[] args) {
Metadata metadata = new Metadata();
metadata.put(Metadata.Key.of("X-API-Key", Metadata.ASCII_STRING_MARSHALLER), "API_KEY");

var channel = ManagedChannelBuilder.forAddress("grpc-staging.kodypay.com", 443)
.useTransportSecurity().build();
var client = InventoryServiceGrpc.newBlockingStub(channel)
.withInterceptors(newAttachHeadersInterceptor(metadata));

GetCategoriesRequest request = GetCategoriesRequest.newBuilder()
.setStoreId("STORE_123")
.build();

var response = client.getCategories(request);
response.getCategoriesList().forEach(category -> {
System.out.println("Category: " + category.getName());
category.getItemsList().forEach(itemOrCombo -> {
if (itemOrCombo.hasItem()) {
InventoryItem item = itemOrCombo.getItem();
System.out.println(" Item: " + item.getName() + " - " + item.getGrossPrice());
} else if (itemOrCombo.hasCombo()) {
Combo combo = itemOrCombo.getCombo();
System.out.println(" Combo: " + combo.getName() + " - " + combo.getGrossPrice());
}
});
});
}
}

2. Get Inventory

Service Call: InventoryService.GetInventory

Retrieve full inventory or filter items by category.

Examples

GetInventoryRequest request = GetInventoryRequest.newBuilder()
.setStoreId("STORE_123")
.setCategoryId("CATEGORY_456") // Optional filter
.build();

var response = client.getInventory(request);
response.getItemsList().forEach(itemOrCombo -> {
if (itemOrCombo.hasItem()) {
InventoryItem item = itemOrCombo.getItem();
System.out.println("Item: " + item.getName());
} else {
Combo combo = itemOrCombo.getCombo();
System.out.println("Combo: " + combo.getName());
}
});

Field Notes:

  • gross_price: String formatted as "0.00" (e.g., "9.99"). A value of "0.00" indicates a free item.
  • integration_id: Custom identifier for third-party system integration.
  • tags: User-defined labels (e.g., "Vegetarian") with no enforced structure.
  • Categories only include active items and combos in responses.