Java SDK for Spain
corp-merch-java on Maven Central — JDK 17+, async via CompletableFuture, Spring Boot starter for Spain.
Architecture — Install and initialise for Spain
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("Spain").build();. Routes through the Madrid hub; IVA 21% 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: Spain. Webhook controller auto-registered at /webhooks/corpmerch with HMAC verification. Actuator health indicator exposes FACe/SII channel status. FACe / Suministro Inmediato de Información (SII) 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 21% and FACe/SII?
country: 'Spain' applies IVA 21% and routes invoicing via FACe/SII. Actuator health indicator exposes FACe/SII channel availability.