Java SDK for Italy
corp-merch-java on Maven Central — JDK 17+, async via CompletableFuture, Spring Boot starter for Italy.
Architecture — Install and initialise for Italy
Maven: <dependency><groupId>com.corpmerch</groupId><artifactId>corp-merch-java</artifactId><version>2.x</version></dependency>. Init: CorpMerch cm = CorpMerch.builder().apiKey(System.getenv("CM_KEY")).country("Italy").build();. Routes through the Milano hub; IVA 22% computed server-side. JDK 17+, no Kotlin or Scala dependency.
How to wire it up — Quickstart with CompletableFuture
Sync: Order o = cm.orders().create(OrderCreateParams.builder().idempotencyKey(UUID.randomUUID().toString())...build());. Async: cm.orders().createAsync(params).thenAccept(o -> log.info("id={}", o.id()));. All POJOs immutable; Jackson @JsonInclude(NON_NULL). Errors as typed exceptions extending CorpMerchException.
Operations and edge cases — Spring Boot starter
corp-merch-spring-boot-starter registers CorpMerch as a bean configured from application.yml: corp-merch.api-key, corp-merch.country: Italy. Webhook controller auto-registered at /webhooks/corpmerch with HMAC verification. Actuator health indicator exposes SdI channel status. Sistema di Interscambio (SdI) acknowledgement ids surfaced on invoice events.
FAQ
JDK versions?
JDK 17 and 21 in CI. JDK 11 works in offline mode but is not officially supported.
Kotlin / Scala?
Pure Java — usable from Kotlin and Scala. Idiomatic Kotlin extension functions ship in a companion module.
Reactor / RxJava?
Adapter modules ship for Project Reactor (Mono/Flux) and RxJava 3 (Single/Observable).
Spring Boot 3?
Yes — the starter supports Spring Boot 3.x. Spring Boot 2.7 supported on the legacy 1.x SDK.
IVA 22% and SdI?
country: 'Italy' applies IVA 22% and routes invoicing via SdI. Actuator health indicator exposes SdI channel availability.