{"openapi":"3.1.0","info":{"title":"Vatlayer","description":"Vatlayer is a simple JSON-based REST API enabling you to validate VAT numbers, retrieve all or single EU VAT rates based on IP address or country code, convert prices in compliance with EU VAT rates and types, and more.","version":"1.0.0"},"servers":[{"url":"https://apilayer.net/api"}],"paths":{"/validate":{"get":{"tags":["Endpoints"],"summary":"Vatlayer :- /validate","description":"Validate a VAT number and retrieve the associated company name and address.","operationId":"vatlayerValidate","parameters":[{"name":"access_key","in":"query","description":"After signing up, every user is assigned a personal API Access Key - a unique password provided to access any of the API's data endpoints.","required":true,"schema":{"type":"string"}},{"name":"vat_number","in":"query","description":"Simply specify the vat_number you would like to validate and append it to the API request URL.","required":true,"schema":{"type":"string","example":"LU26375245"}},{"name":"callback","in":"query","description":"The vatlayer API also supports JSONP Callbacks. To use this feature, simply attach callback=CALLBACK_FUNCTION to any API Endpoint, and the result set will be returned as the callback function you specified.","required":false,"schema":{"type":"string","example":"CALLBACK_FUNCTION"}},{"name":"format","in":"query","description":"In order to enhance readability the vatlayer API features a built-in JSON format function, which displays the API's Response in typically JSON-structured format. To enable this function, simply attach format=1 to any valid API Endpoint URL.","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}}],"responses":{"200":{"description":"VAT number validation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"},"examples":{"example":{"summary":"Typical validate response (company found)","value":{"valid":true,"database":"ok","format_valid":true,"source":"vies","checked_at":1792389033,"query":"LU26375245","country_code":"LU","vat_number":"26375245","company_name":"AMAZON EUROPE CORE S.A R.L.","company_address":"38, AVENUE JOHN F. KENNEDY L-1855  LUXEMBOURG"}},"not_found":{"summary":"Valid format, not registered (no company found)","value":{"valid":false,"database":"ok","format_valid":true,"source":"vies","checked_at":1792481044,"query":"LU00000000","country_code":"LU","vat_number":"00000000","company_name":"","company_address":""}},"invalid_format":{"summary":"Invalid format (malformed number)","value":{"valid":false,"database":"ok","format_valid":false,"source":null,"checked_at":null,"query":"XYZ123","country_code":"","vat_number":"","company_name":"","company_address":""}}}}}},"400":{"description":"Bad Request - validation error (e.g. no_vat_number_supplied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}},"/rate_list":{"get":{"tags":["Endpoints"],"summary":"Vatlayer :- /rate_list","description":"Using the vatlayer API's rate_list endpoint, you may also request VAT rates for all EU member states at once.","operationId":"vatlayerRateList","parameters":[{"name":"access_key","in":"query","description":"After signing up, every user is assigned a personal API Access Key - a unique password provided to access any of the API's data endpoints.","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Set to 1 to enable pretty JSON formatting for easier reading (increases payload size).","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}},{"name":"callback","in":"query","description":"JSONP callback function name. If present the JSON response will be wrapped in this function (per documentation).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"VAT rates for all EU member states.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateListResponse"},"examples":{"example":{"summary":"rate_list sample (abridged)","value":{"success":true,"rates":{"DE":{"country_name":"Germany","standard_rate":19,"reduced_rates":{"some foodstuffs":7,"books (excluding books whose content is harmful to minors)":7}},"FR":{"country_name":"France","standard_rate":20,"reduced_rates":{"foodstuffs":10,"books (excluding those with pornographic or violent content)":5.5}}}}}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}},"/price":{"get":{"tags":["Endpoints"],"summary":"Vatlayer :- /price","description":"Using the vatlayer API's price endpoint, you may request the API to calculate VAT compliant prices on your behalf.","operationId":"vatlayerPrice","parameters":[{"name":"access_key","in":"query","description":"After signing up, every user is assigned a personal API Access Key - a unique password provided to access any of the API's data endpoints.","required":true,"schema":{"type":"string"}},{"name":"amount","in":"query","description":"The amount/price you would like to calculate in compliance with EU VAT rates.","required":true,"schema":{"type":"number","format":"float","example":125}},{"name":"country_code","in":"query","description":"Define country by appending a 2-letter country code of your choice.","required":false,"schema":{"type":"string","example":"GB"}},{"name":"ip_address","in":"query","description":"Define country by appending a custom IP address to be located by the API.","required":false,"schema":{"type":"string"}},{"name":"use_client_ip","in":"query","description":"Define country by having the API locate the IP address of the client making the API call.","required":false,"schema":{"type":"integer","enum":[0,1]}},{"name":"type","in":"query","description":"The type of goods according to the API's types endpoint.","required":false,"schema":{"type":"string","example":"medical"}},{"name":"incl","in":"query","description":"In case you are supplying an amount which already includes the respective VAT percentage and would like to request the API to perform a reverse calculation, simply set the API's incl parameter to 1.","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}},{"name":"format","in":"query","description":"Set to 1 to enable pretty JSON formatting for easier reading (increases payload size).","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}},{"name":"callback","in":"query","description":"JSONP callback function name. If present the JSON response will be wrapped in this function (per documentation).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"VAT-compliant price calculation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"},"examples":{"example":{"summary":"Price calculation example (GB, amount excl VAT)","value":{"success":true,"country_code":"GB","country_name":"United Kingdom","price_excl_vat":125,"price_incl_vat":150,"vat_rate":20}},"with_type":{"summary":"DE, amount 100 with type=medical","value":{"success":true,"country_code":"DE","country_name":"Germany","price_excl_vat":100,"price_incl_vat":100,"type":"medical","vat_rate":0}}}}}},"400":{"description":"Bad Request - validation / business-rule error (e.g. invalid_amount, no_country_code_or_ip_supplied, both_country_code_and_ip_supplied, invalid_ip_address, could_not_resolve_ip, invalid_country_code).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}},"/rate":{"get":{"tags":["Endpoints"],"summary":"Vatlayer :- /rate","description":"Using the vatlayer API's rate endpoint, you may request VAT rates for a country of your choice.","operationId":"vatlayerRate","parameters":[{"name":"access_key","in":"query","description":"After signing up, every user is assigned a personal API Access Key - a unique password provided to access any of the API's data endpoints.","required":true,"schema":{"type":"string"}},{"name":"country_code","in":"query","description":"Define country by appending a 2-letter country code of your choice.","required":false,"schema":{"type":"string","example":"DE"}},{"name":"ip_address","in":"query","description":"Define country by appending a custom IP address to be located by the API.","required":false,"schema":{"type":"string"}},{"name":"use_client_ip","in":"query","description":"Define country by having the API locate the IP address of the client making the API call.","required":false,"schema":{"type":"integer","enum":[0,1]}},{"name":"format","in":"query","description":"Set to 1 to enable pretty JSON formatting for easier reading (increases payload size).","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}},{"name":"callback","in":"query","description":"JSONP callback function name. If present the JSON response will be wrapped in this function (per documentation).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"VAT rate for the requested country.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateResponse"},"examples":{"example":{"summary":"Example rate response (Germany, abridged - 5 of 23 reduced-rate keys)","value":{"success":true,"country_code":"DE","country_name":"Germany","standard_rate":19,"reduced_rates":{"some foodstuffs":7,"books (excluding books whose content is harmful to minors)":7,"newspapers and periodicals (except those containing content harmful to minors and/or more than 50% advertising)":7,"intra-community and international passenger transport for certain road, rail and inland waterway transportation":7,"hotel accommodation (only short-term accommodation)":7}}}}}}},"400":{"description":"Bad Request - validation / business-rule error (e.g. no_country_code_or_ip_supplied, both_country_code_and_ip_supplied, invalid_ip_address, could_not_resolve_ip, invalid_country_code).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}},"/types":{"get":{"tags":["Endpoints"],"summary":"Vatlayer :- /types","description":"Access a full list containing all available reduced VAT rate types via the API's types endpoint.","operationId":"vatlayerTypes","parameters":[{"name":"access_key","in":"query","description":"After signing up, every user is assigned a personal API Access Key - a unique password provided to access any of the API's data endpoints.","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Set to 1 to enable pretty JSON formatting for easier reading (increases payload size).","required":false,"schema":{"type":"integer","enum":[0,1],"example":1}},{"name":"callback","in":"query","description":"JSONP callback function name. If present the JSON response will be wrapped in this function (per documentation).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Available reduced VAT rate types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesResponse"},"examples":{"example":{"value":{"success":true,"types":["foodstuffs","books","medical","hotels"]}}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}}},"components":{"schemas":{"ValidateResponse":{"description":"VAT number validation result.","properties":{"valid":{"type":"boolean","example":true},"database":{"type":"string","example":"ok"},"format_valid":{"type":"boolean","example":true},"query":{"type":"string","example":"LU26375245"},"country_code":{"type":"string","description":"2-letter country code of the VAT number. Empty string when the format is invalid.","example":"LU"},"vat_number":{"type":"string","description":"The VAT number without the country prefix. Empty string when the format is invalid.","example":"26375245"},"company_name":{"type":"string","description":"Registered company name. Empty string when no company is found (never null).","example":"AMAZON EUROPE CORE S.A R.L."},"company_address":{"type":"string","description":"Registered company address. Empty string when no company is found (never null).","example":"38, AVENUE JOHN F. KENNEDY L-1855  LUXEMBOURG"},"source":{"type":["string","null"],"description":"Source of the lookup, for example vies (the EU VIES database). null when the format is invalid.","example":"vies"},"checked_at":{"type":["integer","null"],"description":"Unix timestamp of the lookup. null when the format is invalid.","example":1792389033}},"type":"object"},"RateResponse":{"description":"Single-country VAT rate.","properties":{"success":{"type":"boolean","example":true},"country_code":{"type":"string","example":"DE"},"country_name":{"type":"string","example":"Germany"},"standard_rate":{"type":"number","example":19},"reduced_rates":{"description":"Map of reduced-rate category to VAT percentage. Keys are free-text category names from the same list as /types (the values accepted by the type parameter of /price). They differ per country and are not a fixed list. null for a country outside the EU.","type":["object","null"],"additionalProperties":{"type":"number"}}},"type":"object","example":{"success":true,"country_code":"DE","country_name":"Germany","standard_rate":19,"reduced_rates":{"some foodstuffs":7,"books (excluding books whose content is harmful to minors)":7,"newspapers and periodicals (except those containing content harmful to minors and/or more than 50% advertising)":7,"intra-community and international passenger transport for certain road, rail and inland waterway transportation":7,"hotel accommodation (only short-term accommodation)":7}}},"RateInfo":{"description":"Per-country rate details used in rate_list.","properties":{"country_name":{"type":"string"},"standard_rate":{"type":"number"},"reduced_rates":{"type":"object","additionalProperties":{"type":"number"}}},"type":"object"},"RateListResponse":{"description":"VAT rates for all EU member states.","properties":{"success":{"type":"boolean","example":true},"rates":{"description":"Map of 2-letter country code -> rate info.","type":"object","additionalProperties":{"$ref":"#/components/schemas/RateInfo"}}},"type":"object","example":{"success":true,"rates":{"DE":{"country_name":"Germany","standard_rate":19,"reduced_rates":{"some foodstuffs":7,"books (excluding books whose content is harmful to minors)":7}},"FR":{"country_name":"France","standard_rate":20,"reduced_rates":{"foodstuffs":10,"books (excluding those with pornographic or violent content)":5.5}}}}},"PriceResponse":{"description":"VAT-compliant price calculation result.","properties":{"success":{"type":"boolean","example":true},"country_code":{"type":"string","example":"GB"},"country_name":{"type":"string","example":"United Kingdom"},"price_excl_vat":{"type":"number","example":125},"price_incl_vat":{"type":"number","example":150},"vat_rate":{"type":"number","example":20},"type":{"type":"string","description":"Only returned when the type parameter is sent (it echoes that type). Left out of the response otherwise.","example":"medical"}},"type":"object"},"TypesResponse":{"description":"Available reduced VAT rate types.","properties":{"success":{"type":"boolean","example":true},"types":{"type":"array","items":{"type":"string"}}},"type":"object"},"Error":{"title":"Error","type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"integer","example":101},"type":{"type":"string","example":"invalid_access_key"},"info":{"type":"string","example":"You have not supplied a valid API Access Key. [Technical Support: support@apilayer.com]"}}}}}},"responses":{"401":{"description":"Unauthorized","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"account_on_hold":{"summary":"account_on_hold","value":{"success":false,"error":{"code":107,"type":"account_on_hold","info":"Your account currently has open invoices and API has been automatically disabled. Please settle your open balance or downgrade to the Free Plan to restore API access. [Support: support@apilayer.com]"}}},"invalid_access_key":{"summary":"invalid_access_key","value":{"success":false,"error":{"code":101,"type":"invalid_access_key","info":"You have not supplied a valid API Access Key. [Technical Support: support@apilayer.com]"}}},"missing_access_key":{"summary":"missing_access_key","value":{"success":false,"error":{"code":101,"type":"missing_access_key","info":"You have not supplied an API Access Key. [Required format: access_key=YOUR_ACCESS_KEY]"}}},"inactive_user":{"summary":"inactive_user","value":{"success":false,"error":{"code":102,"type":"inactive_user","info":"Permission denied - User not active."}}}}}}},"403":{"description":"Forbidden","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"https_access_restricted":{"summary":"https_access_restricted","value":{"success":false,"error":{"code":105,"type":"https_access_restricted","info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."}}},"function_access_restricted":{"summary":"function_access_restricted","value":{"success":false,"error":{"code":105,"type":"function_access_restricted","info":"Access Restricted - Your current Subscription Plan does not support this API Function."}}},"spread_access_restricted":{"summary":"spread_access_restricted","value":{"success":false,"error":{"code":403,"type":"spread_access_restricted","info":"Access Restricted - Your current Subscription Plan does not support Bid/Ask Data."}}},"source_currency_access_restricted":{"summary":"source_currency_access_restricted","value":{"success":false,"error":{"code":403,"type":"source_currency_access_restricted","info":"Access Restricted - Your current Subscription Plan does not support Source Currency Switching."}}},"api_access_blocked":{"summary":"api_access_blocked","value":{"success":false,"error":{"code":104,"type":"api_access_blocked","info":"Your API access has been temporarily disabled. Please upgrade your Subscription Plan or contact support."}}}}}}},"404":{"description":"Not Found","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_api_function":{"summary":"invalid_api_function","value":{"success":false,"error":{"code":103,"type":"invalid_api_function","info":"This API Function does not exist."}}},"404_not_found":{"summary":"404_not_found","value":{"success":false,"error":{"code":404,"type":"404_not_found","info":"404 - The requested resource could not be found. Please try again or contact support."}}}}}}},"429":{"description":"Too Many Requests","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"usage_limit_reached":{"summary":"usage_limit_reached","value":{"success":false,"error":{"code":104,"type":"usage_limit_reached","info":"Your monthly usage limit has been reached. Please upgrade your Subscription Plan."}}},"daily_usage_limit_reached":{"summary":"daily_usage_limit_reached","value":{"success":false,"error":{"code":104,"type":"daily_usage_limit_reached","info":"Your daily usage limit has been reached. Please try again tomorrow or upgrade your subscription plan."}}},"fair_use_limit_reached":{"summary":"fair_use_limit_reached","value":{"success":false,"error":{"code":104,"type":"fair_use_limit_reached","info":"Your fair use limit has been reached. [Please contact support: support@apilayer.com]"}}},"rate_limit_reached":{"summary":"rate_limit_reached","value":{"success":false,"error":{"code":106,"type":"rate_limit_reached","info":"You have exceeded the maximum rate limitation allowed on your subscription plan. Please refer to the \"Rate Limits\" section of the API Documentation for details. "}}}}}}},"500":{"description":"Internal Server Error","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"internal_error":{"summary":"internal_error","value":{"success":false,"error":{"code":0,"type":"internal_error","info":"An error has occured. [Technical Support: support@apilayer.com]"}}}}}}},"503":{"description":"Service Unavailable","content":{"application/json; Charset=UTF-8":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"maintenance_mode":{"summary":"maintenance_mode","value":{"success":false,"error":{"code":503,"type":"maintenance_mode","info":""}}}}}}}}},"externalDocs":{"description":"Official vatlayer documentation (reference)","url":"https://vatlayer.com/documentation"}}