Liking cljdoc? Tell your friends :D
Clojure only.

stdnum.vies

Online EU VAT validation against the official VIES service (https://ec.europa.eu/taxation_customs/vies/). This is the one capability in the library that performs network I/O - it is kept in its own namespace so stdnum.core stays pure and dependency-light. check confirms a VAT number actually exists in the member-state registry (and returns the trader name / address where the state discloses them), which a checksum cannot do.

(require '[stdnum.vies :as vies])
(vies/check "DE136695976")
;=> {:valid? true, :country "DE", :vat-number "136695976", :name "...", ...}

Requires JDK 11+ (uses java.net.http). On any network/service failure check returns {:error <message>} rather than throwing.

Online EU VAT validation against the official VIES service
(https://ec.europa.eu/taxation_customs/vies/). This is the one capability in
the library that performs network I/O - it is kept in its own namespace so
`stdnum.core` stays pure and dependency-light. `check` confirms a VAT number
actually *exists* in the member-state registry (and returns the trader name /
address where the state discloses them), which a checksum cannot do.

    (require '[stdnum.vies :as vies])
    (vies/check "DE136695976")
    ;=> {:valid? true, :country "DE", :vat-number "136695976", :name "...", ...}

Requires JDK 11+ (uses java.net.http). On any network/service failure `check`
returns `{:error <message>}` rather than throwing.
raw docstring

checkclj

(check vat)
(check country number)

Look up a VAT number against the live EU VIES service. Accepts a full VAT id with country prefix ("DE136695976") or an explicit country + number. Returns {:valid? :country :vat-number :name :address :request-date :raw} on a reply, or {:error <message>} on a network/service failure. Performs a network request; requires JDK 11+.

Look up a VAT number against the live EU VIES service. Accepts a full VAT id
with country prefix ("DE136695976") or an explicit `country` + `number`.
Returns `{:valid? :country :vat-number :name :address :request-date :raw}` on a
reply, or `{:error <message>}` on a network/service failure. Performs a network
request; requires JDK 11+.
sourceraw docstring

parse-responseclj

(parse-response body)

Pure: turn a VIES REST JSON response body into a result map. A successful reply yields {:valid? :country :vat-number :name :address :request-date :raw}; a member-state error (e.g. MS_UNAVAILABLE, MS_MAX_CONCURRENT_REQ) yields {:error <code> :raw} - the validity is genuinely unknown, not false. Exposed so the parsing can be tested without a network call.

Pure: turn a VIES REST JSON response body into a result map. A successful reply
yields `{:valid? :country :vat-number :name :address :request-date :raw}`; a
member-state error (e.g. `MS_UNAVAILABLE`, `MS_MAX_CONCURRENT_REQ`) yields
`{:error <code> :raw}` - the validity is genuinely unknown, not false. Exposed
so the parsing can be tested without a network call.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close