Transaction Type
Transaction Type
Determine transaction type and reverse charge applicability based on issuer and customer information.
Uses VIES (VAT Information Exchange System) validation internally for EU tax numbers.
Check transaction type
/transaction-type/checkCheck transaction type and reverse charge applicability based on issuer and customer information.
Country Resolution:
- Country names are automatically resolved to ISO country codes (handles variations like "Slovenija" → "SI")
- If both country and country_code are provided, country_code takes precedence
Transaction Types:
- domestic: Same country for issuer and customer
- intra_eu_b2b: Cross-border EU sale to business with valid tax number
- intra_eu_b2c: Cross-border EU sale to consumer (no tax number)
- 3w_b2b: Non-EU sale to business (with tax number)
- 3w_b2c: Non-EU sale to consumer (no tax number, or is_end_consumer=true)
Reverse Charge:
Applies when:
- Issuer is an EU tax subject
- Customer is in a different EU country with valid tax number, OR customer is outside EU
It is always false for an issuer outside the EU, including a Northern Ireland seller whose goods sale to the EU is classified intra_eu_b2b: taxes on UK sellers' documents are not changed automatically.
Northern Ireland:
A customer is in Northern Ireland when its country_code is XI, or GB with an XI-prefixed VAT number. Great Britain and Northern Ireland are one country for domestic sales. Between the EU and Northern Ireland, supply_type decides: goods are an intra-EU supply (intra_eu_b2b when VIES confirms the XI number or VIES is unavailable, intra_eu_b2c when VIES rejects it or there is no number), services are a third-country supply (3w_b2b / 3w_b2c). Instead of supply_type you can send the document's items (classification and item_id per line): the supply type is then derived exactly as for a saved document. Without either, the sale is classified as third-country and warning says so.
UK VAT numbers:
A UK customer's tax number with a GB or XI prefix that VIES does not cover gets a format check (9 or 12 digits with valid check digits); a failed check is reported in warning. A number without the prefix that is not a VAT number (a company number, a UTR) is ignored. hmrc_valid carries HMRC's answer when the HMRC lookup is enabled. Neither changes transaction_type.
End Consumer Override:
When customer.is_end_consumer is true, forces B2C classification for non-EU transactions even if the customer has a tax number. For intra-EU transactions, VIES validation takes precedence.
Non-Tax Subjects:
When issuer.is_tax_subject is false, all transactions are treated as B2C (no VIES validation, no reverse charge).
Entity VIES setting:
When the request selects an entity (X-Entity-Id header or an entity-scoped API key) whose tax_rules.eu.vies_validate_vat is false, no VIES request and no UK VAT number check is made and the customer tax number is trusted as provided, the same as when saving a document for that entity. The same applies to a UK entity whose tax_rules.uk.validate_vat_number is false. Without an entity, VIES validation runs as before.
Header parameters
Optional entity whose tax rules apply to the check: when its tax_rules.eu.vies_validate_vat (or tax_rules.uk.validate_vat_number for a UK entity) is false, no VIES request or UK VAT number check is made. No default entity is selected when omitted.
Body parameters
Issuer (seller) information
Customer (buyer) information
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.transactionType.checkTransactionType({
issuer: {
country: "Slovenia",
is_tax_subject: true
},
customer: {
country: "Germany",
tax_number: "DE123456789"
}
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"transaction_type": "intra_eu_b2b",
"reverse_charge_applies": true,
"issuer_country_code": "SI",
"customer_country_code": "DE",
"vies_valid": true,
"warning": null,
"is_tax_subject": true
}