6.0.0 • Published 5 years ago

@datafire/vatapi v6.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@datafire/vatapi

Client library for VAT API

Installation and Usage

npm install --save @datafire/vatapi
let vatapi = require('@datafire/vatapi').create({
  apikey: ""
});

.then(data => {
  console.log(data);
});

Description

A developer friendly API to help your business achieve VAT compliance

Actions

country_code_check

Retrieve a countries VAT rates by its 2 digit country code

vatapi.country_code_check({
  "code": ""
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • code required string: The 2 digit country code

Output

currency_conversion

Convert a currency

vatapi.currency_conversion({
  "currency_from": "",
  "currency_to": ""
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • currency_from required string: The currency code you are converting from
    • currency_to required string: The currency code you are converting to
    • amount integer: Optional, an amount you are wanting to convert. Leave blank to just get the current rate

Output

create_invoice

Create a VAT invoice

vatapi.create_invoice({
  "body": null
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • body required Invoice_Data

Output

invoice_delete

Delete an invoice

vatapi.invoice_delete({
  "id": 0
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • id required integer: Enter an invoice id

Output

Output schema unknown

get_invoice

Retrieve an invoice

vatapi.get_invoice({
  "id": 0
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • id required integer: Enter the invoice id

Output

invoice_update

Update an existing invoice

vatapi.invoice_update({
  "id": 0,
  "body": null
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • id required integer: Enter an invoice id
    • body required Update_Invoice_Array

Output

ip_check

Retrieve a countries VAT rates from an IP address

vatapi.ip_check({
  "address": ""
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • address required string: The IP address to search against

Output

api_usage

Check api requests remaining on current subscription plan

vatapi.api_usage({}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML

Output

vat_number_validate

vatapi.vat_number_validate({
  "vatid": ""
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • vatid required string: The VAT number to validate

Output

Output schema unknown

convert_price

Convert a price to or from VAT price.

vatapi.convert_price({
  "code": "",
  "price": 0
}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML
    • code required string: The 2 digit country code
    • country_rate string: The VAT rate to get the price for. Default: standard
    • price required integer: The price you want converting
    • type string: Optional, if the price is including VAT set the type to 'incl'. Otherwise the default is assumed as excluding VAT already, 'excl'

Output

vat_rates

Retrieve all current EU VAT rates

vatapi.vat_rates({}, context)

Input

  • input object
    • Response-Type string: The default response type is application/json if you would like to receive an XML response then set this to XML

Output

Definitions

Api_Usage

  • Api_Usage object
    • requests_remaining required integer: The number of api requests remaining in the current billing period
    • requests_used required integer: The number of api requests consumed within the last 30 days
    • status required integer: Response code

Convert_Price

  • Convert_Price object
    • country_code required string: The 2 digit country code
    • country_rate required string: The country_rate
    • price_excl_vat required integer: The price excluding VAT
    • price_incl_vat required integer: The price including VAT
    • rate required integer: The rate % for the country_rate
    • status required integer: Response code
    • vat required integer: The total amount of VAT applied

Country_Code_Check

  • Country_Code_Check object
    • country required string: The country name
    • country_code required string: The 2 digit country code
    • rates required Country_Rates
    • status required integer: Response code
    • vat_applies required string: TRUE or FALSE, depending if country is within the EU.

Country_Data

  • Country_Data object
    • country required string: The country name
    • rates required Country_Rates

Country_Rates

Create_Invoice

  • Create_Invoice object
    • invoice required Invoice_Array
    • status required integer: Response code

Currency_Conversion

  • Currency_Conversion object
    • amount_from string: The amount you are converting from
    • amount_to string: The result amount you have converted to
    • currency_from required string: The currency code you are converting from
    • currency_to required integer: The currency code you are converting to
    • rate required string: The rate according to HMRC at time of sale
    • status required integer: Response code

IP_Check

  • IP_Check object
    • country required string: The country name
    • country_code required string: The 2 digit country code
    • rates required Country_Rates
    • status required integer: Response code
    • vat_applies required string: TRUE or FALSE, depending if country is within the EU.

Invoice_Array

  • Invoice_Array object
    • business_address required string: Your business address
    • business_name required string: Your business name
    • conversion_rate integer: The rate of conversion at time of supply
    • currency_code required string: 3 character currency code for invoice
    • currency_code_conversion string: 3 character currency code to be converted from original transaction currency
    • customer_address string: Your customers address
    • customer_name string: Your customers name or trading name
    • customer_vat_number string: Customers VAT number
    • date required string: The date the invoice was issued
    • discount_rate integer: The discount rate per item
    • discount_total required integer: Total amount of discount
    • invoice_number required integer: A sequential invoice number
    • invoice_url required string: A perminant URL to your VAT invoice
    • items required array: An array of your invoice items
    • logo_url string: A URL to your logo image. Must be SSL hosted. https://sslimagehost.com is recommended
    • notes string: Any notes attached to the invoice
    • subtotal required integer: Total amount excluding VAT
    • tax_point required string: (or 'time of supply') if this is different from the invoice date
    • total required integer: Total amount of including VAT
    • type required string: The type of invoice. Either 'sale' or 'refund'
    • vat_number required string: Your VAT number
    • vat_total required integer: Total amount of VAT

Invoice_Data

  • Invoice_Data object
    • business_address required string: Your business address
    • business_name required string: Your business name
    • conversion_rate integer: The rate of conversion at time of supply
    • currency_code required string: 3 character currency code for invoice
    • currency_code_conversion string: 3 character currency code to be converted from original transaction currency
    • customer_address string: Your customers address
    • customer_name string: Your customers name or trading name
    • customer_vat_number string: Optional customers VAT number
    • date string: The date the invoice was issued
    • discount_rate string: The discount rate per item
    • items required array: An array of your invoice items
    • notes string: Add a note to the invoice.
    • price_type string: Optional, if the price is including VAT set the type to 'incl'. Otherwise the default is assumed as excluding VAT already, 'excl'
    • tax_point string: (or 'time of supply') if this is different from the invoice date
    • type required string: The type of invoice. Either 'sale' or 'refund'
    • vat_number required string: Your VAT number
    • zero_rated string: To Zero-Rate the VAT, set to true.

Invoice_Items

  • Invoice_Items object
    • description required string: The item line description
    • price_each required integer: The price of the individual item (Ex VAT)
    • quantity required integer: The quantity of the item
    • vat_rate required integer: The VAT rate at which the item is charged

Retrieve_Invoice

Retrieve_Invoice_Array

  • Retrieve_Invoice_Array object
    • business_address required string: Your business address
    • business_name required string: Your business name
    • conversion_rate integer: The rate of conversion at time of supply
    • currency_code required string: 3 character currency code for invoice
    • currency_code_conversion string: 3 character currency code to be converted from original transaction currency
    • customer_address string: Your customers address
    • customer_name string: Your customers name or trading name
    • customer_vat_number string: Optional, customers VAT number
    • date required string: The date the invoice was issued
    • discount_rate integer: The discount rate per item
    • discount_total required integer: Total amount of discount
    • id required integer: The invoice ID
    • invoice_url required string: A perminant URL to your VAT invoice
    • items required array: An array of your invoice items
    • logo_url string: A URL to your logo image. Must be SSL hosted. https://sslimagehost.com is recommended
    • notes string: Any notes attached to the invoice
    • price_type string: Optional, if the price is including VAT set the type to 'incl'. Otherwise the default is assumed as excluding VAT already, 'excl'
    • subtotal required integer: Total amount excluding VAT
    • tax_point required string: (or 'time of supply') if this is different from the invoice date
    • total required integer: Total amount of including VAT
    • type required string: The type of invoice. Either 'sale' or 'refund'
    • vat_number required string: Your VAT number
    • vat_total required integer: Total amount of VAT
    • zero_rated string: To Zero-Rate the VAT, set to true.

Update_Invoice

Update_Invoice_Array

  • Update_Invoice_Array object
    • business_address required string: Your business address
    • business_name required string: Your business name
    • conversion_rate integer: The rate of conversion at time of supply
    • currency_code required string: 3 character currency code for invoice
    • currency_code_conversion string: 3 character currency code to be converted from original transaction currency
    • customer_address string: Your customers address
    • customer_name string: Your customers name or trading name
    • customervat_number required string: Customers VAT number
    • date string: The date the invoice was issued
    • discount_rate string: The discount rate per item
    • items required array: An array of your invoice items
    • logo_url string: A URL to your logo image. Must be SSL hosted. https://sslimagehost.com is recommended
    • notes string: Add a note to the invoice.
    • tax_point string: (or 'time of supply') if this is different from the invoice date
    • type required string: The type of invoice. Either 'sale' or 'refund'
    • vat_number string: Your VAT number

Vat_Rates

  • Vat_Rates object
    • countries required array: An array of the EU VAT countries and their respective rates
    • status required integer: Response code

Vat_Rates_Countries

  • Vat_Rates_Countries object

parking

  • parking object
    • applies_to required string: The type of goods the rate applies to
    • value required integer: The % VAT rate

reduced

  • reduced object
    • applies_to required string: The type of goods the rate applies to
    • value required integer: The % VAT rate

reduced_alt

  • reduced_alt object
    • applies_to required string: The type of goods the rate applies to
    • value required integer: The % VAT rate

standard

  • standard object
    • value required integer: The % VAT rate

super_reduced

  • super_reduced object
    • applies_to required string: The type of goods the rate applies to
    • value required integer: The % VAT rate
6.0.0

5 years ago

5.0.0

7 years ago

4.0.0

7 years ago

3.0.0

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

0.0.3

9 years ago

0.0.1

9 years ago