{"id":20012599,"url":"https://github.com/bloombox/java","last_synced_at":"2025-07-28T21:09:06.911Z","repository":{"id":48859914,"uuid":"113338835","full_name":"Bloombox/Java","owner":"Bloombox","description":"Bloombox for Java - Retail cannabis software SDK for Java and Kotlin","archived":false,"fork":false,"pushed_at":"2021-07-08T09:14:17.000Z","size":14178,"stargazers_count":4,"open_issues_count":14,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-05T00:51:38.254Z","etag":null,"topics":["api-client","bloombox","cannabis","grpc","java","opencannabis","protobuf"],"latest_commit_sha":null,"homepage":"https://bloombox.github.io/Java","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bloombox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2017-12-06T16:13:57.000Z","updated_at":"2019-08-11T17:29:38.000Z","dependencies_parsed_at":"2022-09-07T18:00:26.907Z","dependency_job_id":null,"html_url":"https://github.com/Bloombox/Java","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/Bloombox/Java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloombox%2FJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloombox%2FJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloombox%2FJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloombox%2FJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bloombox","download_url":"https://codeload.github.com/Bloombox/Java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloombox%2FJava/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267585826,"owners_count":24111577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","bloombox","cannabis","grpc","java","opencannabis","protobuf"],"created_at":"2024-11-13T07:31:44.062Z","updated_at":"2025-07-28T21:09:06.893Z","avatar_url":"https://github.com/Bloombox.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bloombox for Java\n\n[![Build Status](https://travis-ci.org/Bloombox/Java.svg?branch=master)](https://travis-ci.org/Bloombox/Java) [![Maven Central](https://img.shields.io/maven-central/v/io.bloombox/java-client.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.bloombox%22%20AND%20a%3A%22java-client%22) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/e76289cfda1c44deb7fed137f504e164)](https://www.codacy.com/app/bloombox/Java?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Bloombox/Java\u0026amp;utm_campaign=Badge_Grade) [![Test Coverage](https://api.codeclimate.com/v1/badges/97f47bd5c867f368414a/test_coverage)](https://codeclimate.com/github/Bloombox/Java/test_coverage)\n\nThis Java project and resulting JAR provide Java clients API access to the [Bloombox](https://bloombox.io) platform.\nBloombox APIs are built and served using [gRPC](https://grpc.io) and exposed in client libraries like this one with a\nmore fluid interface to work with.\n\nThat being said, you can always opt to use the lower level gRPC APIs, either via gRPC (docs coming soon) or via JSON\nREST, using transcoding (docs coming soon on this too).\n\nIn terms of Javaland, this client is built on Kotlin/Java and tested on JDK8. There isn't any particular reason it\nwouldn't work in earlier versions of the JDK or JRE, but YMMV as it's tested for now on Open JDK and Oracle JDK 8.\n\n\n### Using the code\n\nLibrary JARs, source JARs, and documentation JARs are available via [Maven Central](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.bloombox%22%20AND%20a%3A%22java-client%22) and, if you want snapshots or a faster release track, Nexus.\n\nVia Maven:\n```xml\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.bloombox\u003c/groupId\u003e\n      \u003cartifactId\u003ejava-client\u003c/artifactId\u003e\n      \u003cversion\u003e1.5\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n```\n\nVia Gradle:\n```gradle\n  compile 'io.bloombox:java-client:1.5'\n```\n\nThen, in your app, simply create a client (with your desired settings), and begin using services:\n\nJava:\n\n```java\n  final Bloombox client = new Bloombox(\n    Bloombox.Settings.defaults(\"[your-api-key]\", \"[your-partner-id]\", \"[your-location-id]\"))\n```\n\nKotlin:\n```kotlin\n  val client = Bloombox(\n        settings = Bloombox.Settings(\n              apiKey = \"[your-api-key]\",\n              partner = \"[your-partner-id]\",\n              location = \"[your-location-id]\"))\n```\n\n\n### Building the code\n\nBuilding the code is easy and follows standard Maven conventions, i.e. `mvn clean package install`.\nIf you're developing on the code, you'll use `make`.\n\n#### Required tools:\n\n- `java` (JDK 8, 9 and 10 supported, both Oracle and Open)\n- `maven` or `gradle` (Gradle 4.8 or greater is required for JDK 10 and above)\n\n\n## Services\n\nAfter you've setup the SDK and client object, you can access a given service via a top-level function named after the\nservice. For instance, the Shop API is available at `client.shop()`.\n\nThe object handed back by this method call is structured with callable methods for each API call available for the given\nservice. Below you'll find some samples.\n\n\n### Shop API\n\nThe Shop API is what powers online ordering services with Bloombox. It enables features for **managing and operating an\nintegrated digital storefront**, with user signup, login, support for hours, zipcode verification, and full on pickup or\ndelivery ordering orchestration.\n\n#### Getting hours info\n\nEach Bloombox digital storefront maintains a set of hours that the user can control. Using the *info()* method, an\nintegrating system can check to see the current status of the storefront, according to those hours:\n\n###### Java\n```java\n  // with our client object, obtain shop info synchronously\n  final ShopInfo.Response infoResponse = client.shop().info();\n  if (infoResponse.getStatus() == ShopStatus.OPEN) System.out.println(\"The shop is OPEN.\");\n```\n\n###### Kotlin\n```kotlin\n  // with our client object, obtain shop info synchronously\n  val info = client.shop().info()\n  if (info.getStatus() == ShopStatus.OPEN) print(\"The shop is OPEN.\")\n```\n\n#### Enumerated shop statuses\n\nAccording to the current set of _regular hours_ (recurring hours rules that apply everyday, on weekdays, weekends, or\nspecific days of the week), and _special hours_ (hours for specific dates, like _New Year's Day_ or _Thanksgiving_), a\ndigital storefront may take on the following statuses:\n\n##### Shop statuses\n- `OPEN`: The storefront is open for any and all configured order types.\n- `DELIVERY_ONLY`: The storefront is currently open only for delivery orders.\n- `PICKUP_ONLY`: The storefront is currently open only for pickup orders.\n- `CLOSED`: The storefront is currently closed and not accepting orders of any type.\n\nWhen an order is submitted to a shop that is `CLOSED` (or a `PICKUP` order is submitted during `DELIVERY_ONLY`, or a\n`DELIVERY` order is submitted during `PICKUP_ONLY`), Bloombox will reject the order with an error.\n\n\n### Telemetry API\n\nUsing the Telemetry system, developers can send telemetry event data to Bloombox. This allows events from in-house\nsystems to be considered during event analysis. Developers can also send their own events for later ad-hoc querying\nusing the *Generic Events* service:\n\n###### Java\n```java\n// make an event payload map...\nfinal HashMap\u003cString, Value\u003e eventMap = new HashMap\u003c\u003e();\neventMap.put(\"some-key\", Value.newBuilder().setStringValue(\"string-value\").build());\n\nclient.telemetry().event(\"[event-collection-name]\", eventMap);\n```\n\n###### Kotlin\n```kotlin\nclient.telemetry().event(\n   collection = \"[event-collection-name]\",\n   context = TelemetryClient.EventContext(\n         partner = \"[partner-code]\",\n         location = \"[location-key]\"),\n   payload = hashMapOf(\n         Pair(\"some-key\", Value.newBuilder().setStringValue(\"string-value\").build()),\n         Pair(\"subobject-key\", Value.newBuilder().setStructValue(Struct.newBuilder()\n               .putFields(\"number-key\", Value.newBuilder().setNumberValue(id).build())).build())))\n```\n\n\n### Menu API\n\nUsing the Menu API, you can download product catalog content, geared for showcase/presentation (i.e. items that are out of stock are hidden by default, featured items are presented above the fold, etc). Menus are cached for only a short amount of time and are instantly purged when updates occur:\n\n###### Java\n```java\nclient.menu().retrieve(MenuClient.MenuContext(\"[partner-id]\", \"[location-id]\"));\n```\n\n###### Kotlin\n```kotlin\nclient.menu().retrieve(\n    MenuClient.MenuContext(\n        partner = \"[partner-id]\",\n        location = \"[location-id]\"), false /* 'full' flag */, { response -\u003e\n  // do something with your menu at response.catalog\n}\n```\n\n### Tooling\n\n#### Debug mode\n\nSetting the `enableLogging` property to `true` in your `Bloombox.Settings` object will enable a bunch of logging to\nstdout (by default), via the standard Java logging interface. If you install a default adapter via Log4j2 or another\nmechanism, it should work fine and begin receiving logs from the `Bloombox` object and it's child service objects.\n\n\n### Development tools:\n\nThis is an open source codebase. If you'd like to file a PR or just get it building, here's how you do that:\n\n- `git clone [...] \u0026\u0026 cd [project root]`\n- `git submodule update --init --remote`\n- `make`\n\n\n## Licensing\n\nCopyright © 2018 Bloombox, LLC.\n\nA copy of the Apache 2.0 license is enclosed at `LICENSE.txt`, along with\nadditional notices in `NOTICE.txt`.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloombox%2Fjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloombox%2Fjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloombox%2Fjava/lists"}