vatcheckapi 0.1.0

Rust client for vatcheckapi.com (status, validate)
Documentation

vatcheckapi-rs

Rust client for the vatcheckapi.com API.

[dependencies]
vatcheckapi = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
use vatcheckapi::{Client, AuthMethod};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::builder("YOUR_API_KEY")
        .with_auth_method(AuthMethod::Header)
        .build();

    let status = client.status().await?;
    println!("{:?}", status);

    let resp = client.validate(&serde_json::json!({"vat_number": "DE123456789"})).await?;
    println!("{:?}", resp);
    Ok(())
}