https://github.com/vapor-community/vatifier
Vapor wrapper for verifying VAT-numbers via the VIES service.
https://github.com/vapor-community/vatifier
server-side-swift swift vapor vat vies
Last synced: 6 months ago
JSON representation
Vapor wrapper for verifying VAT-numbers via the VIES service.
- Host: GitHub
- URL: https://github.com/vapor-community/vatifier
- Owner: vapor-community
- License: mit
- Created: 2020-05-16T16:20:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-26T14:14:27.000Z (over 3 years ago)
- Last Synced: 2025-04-29T09:55:33.579Z (6 months ago)
- Topics: server-side-swift, swift, vapor, vat, vies
- Language: Swift
- Size: 9.77 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vatifier

### Vatifier is a Vapor helper for verifying VAT numbers via the [VIES service](https://ec.europa.eu/taxation_customs/vies/)
## Usage
Add the following line to your `Package.swift`
~~~~swift
.package(url: "https://github.com/vapor-community/vatifier.git", from: "1.0.0").product(name: "Vatifier", package: "vatifier")
~~~~Add this line to your `configure.swift` file:
~~~~swift
import Vatifierapp.vatifier.use(.VIES)
~~~~You can now verify VAT numbers from `Application` or `Request`
~~~~swift
app.vatifier.verify("47458714", country: "DK")
req.vatifier.verify("47458714", country: "DK")
~~~~If the API request was successfull you will have a `VATVerificationResponse` which contains an `isValid` boolean and optional `name` and `address` properties. If the API request failed, the future will be in an error state and a `VIESError` will be returned.