Agent Wranglers

PAY-49Required EU law

Reverse-charge B2B sales with a checked VAT number

For services sold to a business in another EU country, check the buyer's VAT number in VIES. Charge no VAT and print "Reverse charge" on the invoice.

Region

European Union (EU). The duty comes from the law there. The rule applies only when the project serves people there, and its Applies when also holds.

How to do it

Ask for the VAT number at checkout. Check it with the European Commission's VIES service, through its REST API or your tax service. Send your own VAT number with the request to get a consultation number, and store it with the date. If VIES is down, charge VAT or hold the order, then check again. Sales to businesses in your own country still carry VAT. Print the buyer's VAT number with the other required invoice fields.

Examples

JavaScript example

async function checkVatNumber(countryCode, vatNumber) {
  const response = await fetch('https://ec.europa.eu/taxation_customs/vies/rest-api/check-vat-number', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ countryCode, vatNumber, requesterMemberStateCode: 'SE', requesterNumber: '556677889901' }),
    signal: AbortSignal.timeout(10_000),
  })
  if (!response.ok) throw new Error(`VIES answered ${response.status}`)
  const result = await response.json()
  return { valid: result.valid, consultationNumber: result.requestIdentifier, checkedAt: new Date().toISOString() }
}

Python example

import requests
from datetime import datetime, timezone

def check_vat_number(country_code: str, vat_number: str) -> dict:
    response = requests.post(
        "https://ec.europa.eu/taxation_customs/vies/rest-api/check-vat-number",
        json={"countryCode": country_code, "vatNumber": vat_number,
              "requesterMemberStateCode": "SE", "requesterNumber": "556677889901"},
        timeout=10,
    )
    response.raise_for_status()
    result = response.json()
    return {"valid": result["valid"], "consultation_number": result.get("requestIdentifier"),
            "checked_at": datetime.now(timezone.utc).isoformat()}

How to check

A checkout test with an invalid VAT number charges VAT. A valid number from another EU country gives zero VAT, a stored consultation number and the reverse charge note on the invoice.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/payments/tax/reverse-charge-vies">Agent Wranglers payments and billing playbook</a>. In code you write, add a comment next to it with the same link.