The SaaS interface is available through AWS Marketplace under the offer OpenTIN API (SaaS) — Verify the validity of Tax Identification Numbers. After subscribing you are redirected to a landing page where your JWT bearer token is generated. Store this token securely — you will include it in every API request.
{region}.opentin-api.open-automation.io/tin_validate/{country}/{type}/{tin} with your token in the Authorization: Bearer header.eu-central-1.opentin-api.open-automation.ioeu-west-2.opentin-api.open-automation.ioap-south-1.opentin-api.open-automation.ious-east-1.opentin-api.open-automation.ioFor the full API specification, path parameters and response codes, see the OpenTIN Technical Documentation.
# Replace with your JWT bearer token received after subscribing on AWS Marketplace TOKEN="" # Choose the region closest to you: # eu-central-1.opentin-api.open-automation.io (EU Frankfurt) # eu-west-2.opentin-api.open-automation.io (EU London) # ap-south-1.opentin-api.open-automation.io (Asia Pacific Mumbai) # us-east-1.opentin-api.open-automation.io (US East N. Virginia) REGION="eu-central-1" # Validate a TIN number # country: ISO 3166-1 Alpha-2 or Alpha-3 (e.g. US, FRA) # entity_type: I for Individuals, E for Entities # tin: the TIN number to validate curl \ -H "Authorization: Bearer $TOKEN" \ https://$REGION.opentin-api.open-automation.io/tin_validate/US/I/123456789
import requests # Replace with your JWT bearer token received after subscribing on AWS Marketplace token = "" # Choose the region closest to you: # eu-central-1.opentin-api.open-automation.io (EU Frankfurt) # eu-west-2.opentin-api.open-automation.io (EU London) # ap-south-1.opentin-api.open-automation.io (Asia Pacific Mumbai) # us-east-1.opentin-api.open-automation.io (US East N. Virginia) region = "eu-central-1" base_url = f"https://{region}.opentin-api.open-automation.io" headers = { "Authorization": f"Bearer {token}" } # Validate a TIN number # country: ISO 3166-1 Alpha-2 or Alpha-3 (e.g. US, FRA) # entity_type: I for Individuals, E for Entities # tin: the TIN number to validate country = "US" entity_type = "I" tin = "123456789" response = requests.get( f"{base_url}/tin_validate/{country}/{entity_type}/{tin}", headers=headers ) print(response.status_code) print(response.json()) # Expected: {"tin_valid": 1, "message": "The TIN is valid", ...}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// Replace with your JWT bearer token received after subscribing on AWS Marketplace
var token = "";
// Choose the region closest to you:
// eu-central-1.opentin-api.open-automation.io (EU Frankfurt)
// eu-west-2.opentin-api.open-automation.io (EU London)
// ap-south-1.opentin-api.open-automation.io (Asia Pacific Mumbai)
// us-east-1.opentin-api.open-automation.io (US East N. Virginia)
var region = "eu-central-1";
var baseUrl = $"https://{region}.opentin-api.open-automation.io";
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);
// Validate a TIN number
// country: ISO 3166-1 Alpha-2 or Alpha-3 (e.g. US, FRA)
// entityType: I for Individuals, E for Entities
// tin: the TIN number to validate
var country = "US";
var entityType = "I";
var tin = "123456789";
var response = await client.GetAsync(
$"{baseUrl}/tin_validate/{country}/{entityType}/{tin}"
);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Status: {(int)response.StatusCode}");
Console.WriteLine(body);
// Expected: {"tin_valid": 1, "message": "The TIN is valid", ...}
}
}
package com.openautomation;
/**
* Sample code to call the OpenTIN AWS SaaS API.
* Requires Java 11+. No external dependencies.
*/
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class OpenTIN_SaaS_API {
// Replace with your JWT bearer token received after subscribing on AWS Marketplace
private static final String JWT_TOKEN = "<your-jwt-bearer-token>";
// Choose the region closest to your application:
// eu-central-1.opentin-api.open-automation.io (EU Frankfurt)
// eu-west-2.opentin-api.open-automation.io (EU London)
// ap-south-1.opentin-api.open-automation.io (Asia Pacific Mumbai)
// us-east-1.opentin-api.open-automation.io (US East N. Virginia)
static String BASE_URL = "https://eu-central-1.opentin-api.open-automation.io";
private static final HttpClient HTTP_CLIENT = HttpClient.newHttpClient();
public static String validateTIN(String country, String entityType, String tin) throws Exception {
String url = String.format("%s/tin_validate/%s/%s/%s", BASE_URL, country, entityType, tin);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer " + JWT_TOKEN)
.GET()
.build();
HttpResponse<String> response = HTTP_CLIENT.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) {
return response.body();
} else {
throw new RuntimeException("API error HTTP " + response.statusCode() + ": " + response.body());
}
}
public static void main(String[] args) throws Exception {
// Validate a TIN number
// country: ISO 3166-1 Alpha-2 or Alpha-3 (e.g. US, FRA)
// entityType: I for Individuals, E for Entities
// tin: the TIN number to validate
System.out.println(validateTIN("US", "I", "123456789"));
// Expected: {"tin_valid": 1, "message": "The TIN is valid", ...}
}
}