### Example Quote Response Object Source: https://vatstack.com/docs/quotes This is an example of a successfully created quote object. It includes details such as the quote ID, amount, country code, IP address, and nested validation and VAT information. The response structure provides comprehensive data about the quote. ```json { "id": "5dc490ea73c1ce2f69628900", "abbreviation": "VAT ID no.", "amount": 10000, "amount_total": 10000, "category": null, "country_code": "IE", "country_name": "Ireland", "integrations": [ { "provider": "stripe", "tax_rate_id": "txr_1ITsZmE4GGQvLhGdNCYVfm7M" } ], "ip_address": "92.251.255.11", "local_name": "Value added tax identification number", "member_state": true, "validation": { "id": "5dc490ea73c1ce2f69628901", "active": true, "company_address": "3RD FLOOR, GORDON HOUSE, BARROW STREET, DUBLIN 4", "company_name": "GOOGLE IRELAND LIMITED", "company_type": null, "consultation_number": "WAPIAAAAW5H1hUQb", "country_code": "IE", "query": "IE6388047V", "type": "eu_vat", "valid": true, "valid_format": true, "vat_number": "6388047V", "requested": "2019-11-07T00:00:00.000Z", "created": "2019-11-07T21:47:22.952Z", "updated": "2019-11-07T21:47:22.952Z" }, "vat": { "abbreviation": "VAT", "amount": 0, "inclusive": false, "local_name": "Value Added Tax", "rate": 0, "rate_type": "reverse_charge" }, "created": "2019-11-07T21:47:22.955Z", "updated": "2019-11-07T21:47:22.955Z" } ``` -------------------------------- ### Retrieve a Supply - cURL Request Example Source: https://vatstack.com/docs/supplies This cURL command demonstrates how to retrieve a specific supply object using its unique ID. It requires authorization via a secret API key and specifies the GET HTTP method to fetch data from the /v1/supplies/:id endpoint. ```curl curl -X GET https://api.vatstack.com/v1/supplies/:id \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" \ ``` -------------------------------- ### Create Quote Request with Node.js (Axios) Source: https://vatstack.com/docs/getting-started Send a POST request to the Vatstack API to create a quote request using Node.js and the Axios library. Ensure Axios is installed. The function takes an amount and an API key, returning quote data or an error. ```javascript const axios = require('axios') ​ var api_key = 'pk_live_6c46e7d65bc2caccdbf48f4a9c2fcba7' var amount = 10000 ​ // Create a quote request via HTTP POST.axios.post('https://api.vatstack.com/v1/quotes', { amount: amount }, { headers: { 'X-API-KEY': api_key } }) .then(function(result) { // Do something with result.data. console.log(result.data) }) .catch(function(err) { // Handle the error. console.error(err.response.data) }) ``` -------------------------------- ### List Supplies - JSON Response Example Source: https://vatstack.com/docs/supplies This JSON object represents a successful response when listing supplies. It includes pagination information and an array of supply objects, each detailing transaction specifics like amount, currency, and VAT information. ```json { "has_more": false, "supplies_count": 1, "supplies": [ { "amount": 9900, "amount_refunded": 0, "amount_total": 9900, "country_code": "IE", "created": "2020-06-04T21:53:37.326Z", "currency": "USD", "description": null, "evidence": { "bank_address": { "name": "VISA", "country_code": "IE" }, "billing_address": { "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "ip_address": { "label": "92.251.255.11", "provider": "MaxMind GeoIP2", "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "required_count": 1, "created": "2020-06-04T21:53:21.698Z", "updated": "2020-06-04T21:53:21.698Z", "id": "5ed96d51336f006f30a50462" }, "evidence_status": "sufficient", "id": "5ed96d61336f006f30a50463", "invoice_number": "310B7863-0007", "issued": "2020-06-04T20:43:17.582Z", "name": "John Casper", "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "updated": "2020-06-04T21:53:37.326Z", "validation": null, "vat": { "inclusive": true, "rate_type": "standard", "rate": 23, "amount": 1851 } }, ... ] } ``` -------------------------------- ### Event Authorization Header Source: https://vatstack.com/docs/webhooks This example shows the authorization header format used for webhook requests. It includes the 'X-API-KEY' with your secret key for authenticating requests to your endpoint. ```http "X-API-KEY": "sk_live_c283fd6d793076603646b197c7cb0424" ``` -------------------------------- ### Retrieve a Supply - JSON Response Example Source: https://vatstack.com/docs/supplies This JSON object details a single supply record as returned by the API. It includes comprehensive information about the transaction, such as the amount, currency, issuing country, and evidence details related to the transaction's validation. ```json { "amount": 9900, "amount_refunded": 0, "amount_total": 9900, "country_code": "IE", "created": "2020-06-04T21:53:37.326Z", "currency": "USD", "description": null, "evidence": { "bank_address": { "name": "VISA", "country_code": "IE" }, "billing_address": { "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "ip_address": { "label": "92.251.255.11", "provider": "MaxMind GeoIP2", "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "required_count": 1, "created": "2020-06-04T21:53:21.698Z", "updated": "2020-06-04T21:53:21.698Z", "id": "5ed96d51336f006f30a50462" }, "evidence_status": "sufficient", "id": "5ed96d61336f006f30a50463", "invoice_number": "310B7863-0007", "issued": "2020-06-04T20:43:17.582Z", "name": "John Casper", "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "updated": "2020-06-04T21:53:37.326Z", "validation": null, "vat": { "inclusive": true, "rate_type": "standard", "rate": 23, "amount": 1851 } } ``` -------------------------------- ### List All Supplies using cURL Source: https://vatstack.com/docs/supplies This code snippet shows how to retrieve a list of all supply objects using a cURL command. It demonstrates the necessary GET request to the '/v1/supplies' endpoint and includes authorization via an 'X-API-KEY' header. This method allows for filtering results using query parameters such as 'country_code', 'issued_since', 'limit', and 'name'. ```curl curl -X GET https://api.vatstack.com/v1/supplies \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" ``` -------------------------------- ### Update a Supply - cURL Request Example Source: https://vatstack.com/docs/supplies This cURL command illustrates how to update an existing supply object via the API. It uses the PUT HTTP method and requires the supply's ID in the URL, along with authentication through a secret API key. ```curl curl -X PUT https://api.vatstack.com/v1/supplies/:id \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" \ ``` -------------------------------- ### POST /v1/quotes Source: https://vatstack.com/docs/getting-started Create a quote request by sending a POST request to the API endpoint. This endpoint requires an API key in the headers and the amount in the request body. ```APIDOC ## POST /v1/quotes ### Description Create a quote request by sending a POST request to the API endpoint. This endpoint requires an API key in the headers and the amount in the request body. ### Method POST ### Endpoint https://api.vatstack.com/v1/quotes ### Parameters #### Query Parameters None #### Request Body - **amount** (integer) - Required - The amount for which to request a quote. #### Headers - **X-API-KEY** (string) - Required - Your unique public API key. ### Request Example ```json { "amount": 10000 } ``` ### Response #### Success Response (200) - **data** (object) - Contains the quote details. - **data.id** (string) - The unique identifier for the quote. - **data.amount** (integer) - The requested amount. - **data.tax_rate** (float) - The applicable tax rate. - **data.tax_amount** (integer) - The calculated tax amount. - **data.total_amount** (integer) - The total amount including tax. #### Response Example ```json { "data": { "id": "quote_12345", "amount": 10000, "tax_rate": 0.20, "tax_amount": 2000, "total_amount": 12000 } } ``` #### Error Response (4xx or 5xx) - **error** (object) - Contains error details. - **error.message** (string) - A message describing the error. #### Error Response Example ```json { "error": { "message": "Invalid API Key" } } ``` ``` -------------------------------- ### List All Quotes Request with Query Parameters Source: https://vatstack.com/docs/quotes This code demonstrates how to retrieve a list of all quote objects using a GET request. It includes authorization with a Secret Key and optional query parameters 'limit' and 'page' for pagination. The response contains quote objects and pagination information. ```curl curl -X GET https://api.vatstack.com/v1/quotes \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" \ -G \ -d "limit=50" \ -d "page=1" ``` -------------------------------- ### GET /v1/evidences Source: https://vatstack.com/docs/evidences Retrieves a paginated list of all evidence objects, ordered by creation date with the most recent appearing first. ```APIDOC ## GET /v1/evidences ### Description Retrieves all evidence objects in order of creation, with the most recent appearing highest. ### Method GET ### Endpoint https://api.vatstack.com/v1/evidences ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit on the number of objects to be returned (1-100, default 20). - **page** (integer) - Optional - Integer for the current page. ### Response #### Success Response (200) - **has_more** (boolean) - Indicates if more pages are available. - **evidences_count** (integer) - Total number of evidence objects. - **evidences** (array) - List of evidence objects. ### Response Example { "has_more": false, "evidences_count": 9, "evidences": [] } ``` -------------------------------- ### Example Event Payload for validation.succeeded Source: https://vatstack.com/docs/webhooks This JSON object represents the structure of an event payload for a 'validation.succeeded' event. It includes the event name and detailed payload information about the VAT validation. ```json { "name": "validation.succeeded", "payload": { "id": "5d1ded3128ca7a842aaf5ed4", "active": true, "company_address": "3RD FLOOR, GORDON HOUSE, BARROW STREET, DUBLIN 4", "company_name": "GOOGLE IRELAND LIMITED", "company_type": null, "consultation_number": "WAPIAAAAW21qsOHW", "country_code": "IE", "query": "IE6388047V", "type": "eu_vat", "valid": true, "valid_format": true, "vat_number": "6388047V", "requested": "2019-07-04T00:00:00.000Z", "created": "2019-07-04T12:12:33.322Z", "updated": "2019-07-04T12:12:33.322Z" }, "created": "2019-07-04T12:12:33.322Z", "updated": "2019-07-04T12:12:33.322Z" } ``` -------------------------------- ### Example Response for Listing Quotes Source: https://vatstack.com/docs/quotes This JSON structure represents the response when listing multiple quote objects. It includes a boolean 'has_more' to indicate if further results are available, the total 'quotes_count', and an array named 'quotes' containing the quote objects. ```json { "has_more": true, "quotes_count": 23, "quotes": [ { "id": "5dc490ea73c1ce2f69628900", "abbreviation": "VAT ID no.", "amount": 10000, "amount_total": 10000, "category": null, "country_code": "IE", "country_name": "Ireland", "integrations": [ { "provider": "stripe", "tax_rate_id": "txr_1ITsZmE4GGQvLhGdNCYVfm7M" } ], "ip_address": "92.251.255.11", "local_name": "Value added tax identification number", "member_state": true, "validation": { "id": "5dc490ea73c1ce2f69628901", "active": true, "company_address": "3RD FLOOR, GORDON HOUSE, BARROW STREET, DUBLIN 4", "company_name": "GOOGLE IRELAND LIMITED", "company_type": null, "consultation_number": "WAPIAAAAW5H1hUQb", "country_code": "IE", "query": "IE6388047V", "type": "eu_vat", "valid": true, "valid_format": true, "vat_number": "6388047V", "requested": "2019-11-07T00:00:00.000Z", "created": "2019-11-07T21:47:22.952Z", "updated": "2019-11-07T21:47:22.952Z" }, "vat": { "abbreviation": "VAT", "amount": 0, "inclusive": false, "local_name": "Value Added Tax", "rate": 0, "rate_type": "reverse_charge" }, "created": "2019-11-07T21:47:22.955Z", "updated": "2019-11-07T21:47:22.955Z" }, ... ] } ``` -------------------------------- ### Retrieve a Batch Response Example Source: https://vatstack.com/docs/batches This JSON object represents a successful response when retrieving a batch by its ID. It contains detailed information about the batch, such as its ID, name, queries processed, ignored queries, and the status of the validation process. It also includes validation results for each query. ```json { "id": "5dae0611273f2a47db1acd27", "name": "Validations for November", "queries": [ "DE811128135", "INVALIDNUMBER" ], "queries_count": 2, "queries_ignored": [ "INVALIDNUMBER" ], "queries_ignored_count": 1, "scheduled": null, "status": "pending", "succeeded_count": 1, "validations": { "has_more": false, "validations": [ { "query": "DE811128135", "valid": null, "valid_format": true }, ... ], "validations_count": 2 }, "created": "2019-10-21T19:25:05.501Z", "updated": "2019-10-21T19:43:12.348Z" } ``` -------------------------------- ### Create Quote Request with PHP (cURL) Source: https://vatstack.com/docs/getting-started Utilize PHP's built-in cURL extension to send a POST request to the Vatstack API for quote creation. This method handles request setup, execution, and response decoding, including error handling. ```php $api_key = 'pk_live_6c46e7d65bc2caccdbf48f4a9c2fcba7'; $amount = 10000; ​ // Initialize CURL. $ch = curl_init('https://api.vatstack.com/v1/quotes'); ​ curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); ​ // Add VAT number to body. curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'amount=' . $amount); ​ // Add key to header array. curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-KEY: ' . $api_key]); ​ $json = curl_exec($ch); ​ if ($json === false) { // Handle the error. echo 'Curl Error: ' . curl_error($ch); } else { // Decode JSON response. $data = json_decode($json, true); ​ // Do something with $data. var_dump($data); } ​ // Close connection. curl_close($ch); ``` -------------------------------- ### Test Mode Configuration Source: https://vatstack.com/docs/testing Instructions for configuring your environment to use test mode and handling webhooks. ```APIDOC ## Configuration Details ### Test API Keys Requests made using test keys are automatically identified as test mode. Toggle the "production" switch in your dashboard to access your test keys. ### Webhooks Configure a dedicated webhook endpoint in your dashboard for test events. - Events are sent immediately upon request. - Failed webhook attempts in test mode are not retried. ``` -------------------------------- ### Create a Supply Object via API Source: https://vatstack.com/docs/supplies Demonstrates how to create a new supply object by sending a POST request to the Vatstack API. Requires authentication using a secret API key provided in the header. ```bash curl -X POST https://api.vatstack.com/v1/supplies \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" ``` -------------------------------- ### Create Evidence Object using cURL Source: https://vatstack.com/docs/evidences This snippet demonstrates how to create an evidence object using a cURL command. It includes the necessary endpoint and authorization header. The body parameters for bank address, billing address, and IP address are optional and should be sent as nested objects. ```bash curl -X POST https://api.vatstack.com/v1/evidences \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" \ -d '{ "bank_address": { "name": "Example Bank", "country_code": "US" }, "billing_address": { "city": "New York", "country_code": "US", "line_1": "123 Main St", "postal_code": "10001" }, "ip_address": { "label": "192.168.1.1" } }' ``` -------------------------------- ### GET /v1/quotes Source: https://vatstack.com/docs/getting-started Retrieve historical quotes you have performed in the past by sending a GET request to the API endpoint. This endpoint requires an API key in the headers. ```APIDOC ## GET /v1/quotes ### Description Retrieve historical quotes you have performed in the past by sending a GET request to the API endpoint. This endpoint requires an API key in the headers. ### Method GET ### Endpoint https://api.vatstack.com/v1/quotes ### Parameters #### Query Parameters None #### Request Body None #### Headers - **X-API-KEY** (string) - Required - Your unique public API key. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **data** (array) - An array of historical quote objects. - Each object contains details of a past quote, similar to the POST response. #### Response Example ```json { "data": [ { "id": "quote_12345", "amount": 10000, "tax_rate": 0.20, "tax_amount": 2000, "total_amount": 12000 }, { "id": "quote_67890", "amount": 5000, "tax_rate": 0.15, "tax_amount": 750, "total_amount": 5750 } ] } ``` #### Error Response (4xx or 5xx) - **error** (object) - Contains error details. - **error.message** (string) - A message describing the error. #### Error Response Example ```json { "error": { "message": "Invalid API Key" } } ``` ``` -------------------------------- ### POST /v1/supplies Source: https://vatstack.com/docs/supplies Creates a new supply object to record a transaction, calculate VAT, and verify evidence sufficiency. ```APIDOC ## POST /v1/supplies ### Description Creates a new supply object. This endpoint allows you to record TBE service transactions, attach evidence for place-of-supply verification, and trigger automated VAT calculations. ### Method POST ### Endpoint https://api.vatstack.com/v1/supplies ### Parameters #### Request Body - **amount** (integer) - Required - The transaction amount in cents. - **country_code** (string) - Required - 2-letter ISO country code of the place of supply. - **currency** (string) - Required - 3-letter ISO 4217 currency code. - **evidence** (string) - Optional - ID of an evidence object to attach. - **validation** (string) - Optional - ID of a validation object to attach. - **vat.inclusive** (boolean) - Required - Specifies if the amount is inclusive of VAT. ### Request Example { "amount": 1000, "country_code": "DE", "currency": "EUR", "vat": { "inclusive": true } } ### Response #### Success Response (200) - **id** (string) - Unique identifier for the created supply. - **evidence_status** (string) - Status of evidence sufficiency (sufficient/insufficient). - **vat.amount** (integer) - Calculated VAT amount in cents. - **vat.rate** (number) - Applied VAT rate. #### Response Example { "id": "sup_12345", "evidence_status": "insufficient", "vat": { "amount": 190, "rate": 0.19 } } ``` -------------------------------- ### Create Quote Request with jQuery (AJAX) Source: https://vatstack.com/docs/getting-started Perform an AJAX POST request using jQuery to the Vatstack API for creating quote requests. This requires jQuery to be included in your project. The function handles success and error callbacks for the API response. ```javascript var api_key = 'pk_live_6c46e7d65bc2caccdbf48f4a9c2fcba7' var amount = 10000 ​ // Perform an AJAX POST request. $.ajax({ url: 'https://api.vatstack.com/v1/quotes', type: 'post', data: { amount: amount }, dataType: 'json', headers: { 'X-API-KEY': api_key }, success: function(result) { // Do something with result.data. console.log(result.data) }, error: function(err) { // Handle the error. console.error(err.responseJSON) } }) ``` -------------------------------- ### GET /v1/batches Source: https://vatstack.com/docs/batches Retrieves a list of all batch objects created in the account. ```APIDOC ## GET /v1/batches ### Description Retrieves all batch objects in order of creation, with the latest appearing highest. ### Method GET ### Endpoint https://api.vatstack.com/v1/batches ### Response #### Success Response (200) - **data** (array) - List of batch objects. #### Response Example [ { "id": "5dae0611273f2a47db1acd27", "name": "Validations for November", "status": "pending" } ] ``` -------------------------------- ### GET /v1/validations/:id Source: https://vatstack.com/docs/validations Retrieves the details of a specific validation record by its unique identifier. ```APIDOC ## GET /v1/validations/:id ### Description Fetches the full details of a specific validation request using its ID. ### Method GET ### Endpoint /v1/validations/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique validation identifier. ### Response #### Success Response (200) - **id** (string) - Validation object ID. - **valid** (boolean) - Validation status. - **company_name** (string) - Associated company name. ``` -------------------------------- ### List All Rates Source: https://vatstack.com/docs/rates Retrieves all VAT rate objects, including standard VAT rates and VAT rates for digital products. Results can be filtered by country code, EU member state status, and paginated. ```APIDOC ## GET /v1/rates ### Description Retrieves all VAT rate objects, including standard VAT rates and VAT rates for digital products. You can filter the results by a 2-letter ISO country code to only obtain the rate object for a specific country. ### Method GET ### Endpoint /v1/rates #### Query Parameters - **country_code** (string) - Optional - Filter results by a 2-letter ISO country code. - **limit** (integer) - Optional - A limit on the number of objects to be returned. Limit can be 1 to 100, and the default is 20. - **member_state** (boolean) - Optional - Boolean to filter results by EU Member State. Always `true` without a subscription. - **page** (integer) - Optional - Integer for the current page. - **state_code** (string) - Optional - Filter results by a 2-letter US state code. Required if `country_code` is `US`. ### Request Example ```curl curl -X GET https://api.vatstack.com/v1/rates?country_code=DE\n -H "X-API-KEY: pk_live_6c46e7d65bc2caccdbf48f4a9c2fcba7" ``` ### Response #### Success Response (200) - **has_more** (boolean) - Indicates if there are more results available. - **rates_count** (integer) - The total number of rates returned. - **rates** (array) - An array of VAT rate objects. - **abbreviation** (string) - Abbreviation of `local_name`. - **categories** (object) - Categories relevant for digital products. Object contains VAT specific to `audiobook`, `broadcasting`, `ebook`, `eperiodical`, `eservice` and `telecommunication`. - **country_code** (string) - 2-letter ISO country code. - **country_name** (string) - Corresponding English name of `country_code`. - **currency** (string) - 3-letter ISO 4217 local currency code. - **local_name** (string) - Localized name of the VAT identification number. - **member_state** (boolean) - Boolean indicating whether the country is an EU Member State. - **reduced_rates** (array) - Array of reduced VAT rates in percent. - **standard_rate** (number) - Standard VAT rate in percent. - **state_code** (string) - 2-letter US state code. Only required if `country_code` is `US`. - **state_name** (string) - Corresponding English name of `state_code`. - **vat_abbreviation** (string) - Abbreviation of `vat_local_name`. - **vat_local_name** (string) - Localized name of the VAT. #### Response Example ```json { "has_more": false, "rates_count": 27, "rates": [ { "abbreviation": "UID", "categories": { "audiobook": 10, "broadcasting": 10, "ebook": 10, "eperiodical": 10, "eservice": 20, "telecommunication": 20 }, "country_code": "AT", "country_name": "Austria", "currency": "EUR", "local_name": "Umsatzsteuer-Identifikationsnummer", "member_state": true, "reduced_rates": [ 10, 13 ], "standard_rate": 20, "state_code": null, "state_name": null, "vat_abbreviation": "MwSt.", "vat_local_name": "Mehrwertsteuer" } ] } ``` ``` -------------------------------- ### GET /v1/validations Source: https://vatstack.com/docs/validations Retrieves a paginated list of all validation objects, sorted by creation date. ```APIDOC ## GET /v1/validations ### Description Fetches a list of previous validation records. Supports filtering by batch, external ID, query, and date ranges. ### Method GET ### Endpoint /v1/validations ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of objects to return (1-100, default 20). - **page** (integer) - Optional - Current page number. - **query** (string) - Optional - Filter by VAT ID. - **requested_since** (string) - Optional - Filter by date (YYYY-MM-DD). ### Response #### Success Response (200) - **validations** (array) - List of validation objects. - **has_more** (boolean) - Indicates if more pages are available. ### Response Example { "has_more": true, "validations_count": 55, "validations": [] } ``` -------------------------------- ### GET /v1/quotes/:id Source: https://vatstack.com/docs/quotes Retrieves the details of a specific quote object using its unique identifier. ```APIDOC ## GET /v1/quotes/:id ### Description Retrieves a single quote object by its ID. ### Method GET ### Endpoint /v1/quotes/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the quote. ### Response #### Success Response (200) - **id** (string) - The quote ID. - **amount** (integer) - The quote amount. #### Response Example { "id": "5dc490ea73c1ce2f69628900", "amount": 10000 } ``` -------------------------------- ### GET /v1/quotes Source: https://vatstack.com/docs/quotes Retrieves a paginated list of all quote objects, ordered by creation date with the most recent first. ```APIDOC ## GET /v1/quotes ### Description Retrieves all quote objects in order of creation. ### Method GET ### Endpoint /v1/quotes ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of objects to return (1-100, default 20). - **page** (integer) - Optional - Current page number. ### Response #### Success Response (200) - **quotes** (array) - List of quote objects. - **has_more** (boolean) - Indicates if more pages are available. #### Response Example { "has_more": true, "quotes_count": 23, "quotes": [] } ``` -------------------------------- ### GET /v1/evidences/:id Source: https://vatstack.com/docs/evidences Fetches the details of a specific evidence object using its unique identifier. ```APIDOC ## GET /v1/evidences/:id ### Description Retrieves an evidence object by the :id path parameter. ### Method GET ### Endpoint https://api.vatstack.com/v1/evidences/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the evidence object. ### Response #### Success Response (200) - **id** (string) - Evidence ID. - **bank_address** (object) - Bank details. - **billing_address** (object) - Customer billing address. - **ip_address** (object) - IP geolocation data. ### Response Example { "id": "5ed804577853dd1c229f938a", "bank_address": { "name": "Visa", "country_code": "IE" } } ``` -------------------------------- ### List Supplies Source: https://vatstack.com/docs/supplies Retrieves a list of supply objects. Supports pagination and filtering. ```APIDOC ## GET /v1/supplies ### Description Retrieves a list of supply objects. Supports pagination and filtering. ### Method GET ### Endpoint /v1/supplies ### Query Parameters - **limit** (integer) - Optional - Number of supplies to return. - **starting_after** (string) - Optional - A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For an expanded list, call `List Supplies` and use the `id` of the last object in the current view. ### Response #### Success Response (200) - **has_more** (boolean) - Indicates if there are more supplies to retrieve. - **supplies_count** (integer) - The total number of supplies returned in this request. - **supplies** (array) - An array of supply objects. #### Response Example ```json { "has_more": false, "supplies_count": 1, "supplies": [ { "amount": 9900, "amount_refunded": 0, "amount_total": 9900, "country_code": "IE", "created": "2020-06-04T21:53:37.326Z", "currency": "USD", "description": null, "evidence": { "bank_address": { "name": "VISA", "country_code": "IE" }, "billing_address": { "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "ip_address": { "label": "92.251.255.11", "provider": "MaxMind GeoIP2", "city": "East Wall", "state": "Leinster", "country_code": "IE" }, "required_count": 1, "created": "2020-06-04T21:53:21.698Z", "updated": "2020-06-04T21:53:21.698Z", "id": "5ed96d51336f006f30a50462" }, "evidence_status": "sufficient", "id": "5ed96d61336f006f30a50463", "invoice_number": "310B7863-0007", "issued": "2020-06-04T20:43:17.582Z", "name": "John Casper", "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "updated": "2020-06-04T21:53:37.326Z", "validation": null, "vat": { "inclusive": true, "rate_type": "standard", "rate": 23, "amount": 1851 } } ] } ``` ``` -------------------------------- ### List All Supplies Source: https://vatstack.com/docs/supplies Retrieves a list of all VAT supply objects, ordered by creation date with the most recent first. Supports filtering by country code, issue date range, customer name, and pagination. ```APIDOC ## GET /websites/vatstack/supplies ### Description Retrieves all supply objects in order of creation, with the most recent appearing highest. ### Method GET ### Endpoint /websites/vatstack/supplies ### Parameters #### Query Parameters - **country_code** (string) - Optional - Filter by 2-letter ISO country code. - **issued_since** (string) - Optional - Filter by issue date (YYYY-MM-DD) or later. - **issued_until** (string) - Optional - Filter by issue date (YYYY-MM-DD) or earlier. - **limit** (integer) - Optional - Number of objects to return (1-100, default 20). - **name** (string) - Optional - Filter by customer name. - **page** (integer) - Optional - Current page number for pagination. ### Request Example ```bash curl -X GET https://api.vatstack.com/v1/supplies?country_code=IE&limit=10 \ -H "X-API-KEY: sk_live_c283fd6d793076603646b197c7cb0424" ``` ### Response #### Success Response (200) Returns a list of supply objects matching the query parameters. #### Response Example ```json [ { "amount": 9900, "amount_refunded": 0, "amount_total": 9900, "country_code": "IE", "created": "2020-06-04T21:53:37.326Z", "currency": "USD", "description": null, "evidence": { "id": "5ed96d51336f006f30a50462" }, "evidence_status": "sufficient", "id": "5ed96d61336f006f30a50463", "invoice_number": "310B7863-0007", "issued": "2020-06-04T20:43:17.582Z", "name": "John Casper", "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "updated": "2020-06-04T21:53:37.326Z", "validation": null, "vat": { "inclusive": true, "rate_type": "standard", "rate": 23, "amount": 1851 } } // ... more supply objects ] ``` ``` -------------------------------- ### GET /quotes/{id} Source: https://vatstack.com/docs/quotes Retrieves a specific VAT quote object by its unique identifier, including validation results and tax breakdown. ```APIDOC ## GET /quotes/{id} ### Description Retrieves the details of a previously created VAT quote, including the validation status of the VAT number and associated tax calculations. ### Method GET ### Endpoint /quotes/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the quote to retrieve. ### Response #### Success Response (200) - **id** (string) - Unique identifier of the quote - **amount** (integer) - The base amount of the quote - **country_code** (string) - ISO country code - **validation** (object) - Object containing VAT validation details - **vat** (object) - Object containing tax rate and amount details #### Response Example { "id": "5dc490ea73c1ce2f69628900", "amount": 10000, "country_code": "IE", "validation": { "valid": true, "vat_number": "6388047V", "company_name": "GOOGLE IRELAND LIMITED" }, "vat": { "amount": 0, "rate": 0, "rate_type": "reverse_charge" } } ``` -------------------------------- ### Create Supply with Body Parameters Source: https://vatstack.com/docs/supplies This snippet demonstrates how to create a supply object by sending a POST request with specific body parameters. It highlights the required fields like 'amount', 'country_code', 'currency', 'invoice_number', and 'issued', as well as optional fields for enhanced detail. The 'amount' must be in cents to prevent rounding errors. The 'vat' object requires nested fields like 'inclusive', 'rate', and 'rate_type'. ```json { "amount": 9900, "country_code": "IE", "currency": "USD", "invoice_number": "INV-12345", "issued": "2023-01-01T10:00:00Z", "description": "Example Product", "vat": { "inclusive": false, "rate": 20 } } ```