Tools · For developers and accountants

Check the ROT and RUT XML file

A payment request for ROT and RUT work is usually uploaded as an XML file to Skatteverket’s e-service. Here are the formats, what is checked before and after the import, and the mistakes that most often stop a file.

What the file is

A company doing ROT or RUT work is paid the rest by the customer and requests the tax reduction from Skatteverket. The request must arrive electronically by 31 January of the year after the customer paid (section 8, Act 2009:194).

Instead of typing every buyer into the e-service Rot och rut – företag, the company can upload an XML file produced by its invoicing or business system. One file is either ROT or RUT, with at most 100 buyers.

Formats Skatteverket accepts

FormatNamespaceIn useIn the file
XML version 6…/ht/begaran/6.0since 2021-01-01buyers, amounts, work
XML version 1.0…/skattered/begaran/1.0today+ the performer’s number
XML version 1.1…/skattered/begaran/1.1from 2027-01-01+ subcontractors and staffing company

Versions 3 and 4 still work but are being phased out, according to Skatteverket.

From 1 January 2027

On 11 November 2026 the Riksdag decided (2026/27:SkU3) that a payment request is given on one’s honour (“på heder och samvete”) and states whether subcontractors or staffing companies were used.

Version 1.1 carries the answers in the file (Underentreprenor and Bemanningsforetag, true or false). With version 6 or 1.0 the file still imports, but the answers are entered by hand in the e-service.

How Closepact builds the payment request →

The schema and the e-service check different things

A file can follow Skatteverket’s XML schema and still be stopped after import. The schema describes the structure; the rules on amounts, dates and people are checked in the e-service.

The schema (XSD) checks

  • that elements exist, in order and in the right namespace
  • that amounts are whole numbers and dates valid from 2009-07-01
  • that identity numbers have the right number of digits
  • at most 100 buyers (in version 1.1)

The e-service checks after import

  • requested amount at most the amount paid, and requested plus paid at most the labour cost
  • that every buyer paid in the same year
  • that the buyer turns 18 in the payment year and is not the performer
  • that identity and organisation numbers are formally correct (the check digit)
  • that the service code fits the request type: in version 1.x the schema accepts any text
  • that hours and material are given for at least one work area, and actual hours also for fixed-price work

Common mistakes

  • REQUESTED_EXCEEDS_PAIDThe requested amount is larger than what the customer paid.
  • REQUESTED_PLUS_PAID_EXCEEDS_LABOURRequested plus paid is more than the labour cost, often because material or travel was included.
  • ROT_REQUESTED_EXCEEDS_SHAREROT: more than three sevenths of the amount paid is requested (30 percent of the labour cost).
  • PAYMENT_YEAR_MIXEDDecember and January payments in the same file.
  • ROT_PROPERTY_REQUIREDROT without a property designation, or a cooperative flat without the cooperative’s number.
  • SERVICE_CODE_INVALIDA ROT service in a RUT file, or a misspelt code.
  • BUYER_ID_INVALIDA personnummer with the wrong check digit.
  • DEADLINE_PASSEDLast year’s payments requested after 31 January.

Check the file yourself: rot-rut-xml

We have published our check as open source: a PHP library and CLI (MIT) that validates versions 6, 1.0 and 1.1 against Skatteverket’s XSD and the rules above, each linked to the statute or Skatteverket’s rule. It can also generate the files.

Everything runs on your computer. The file is sent nowhere, and the report never contains identity numbers.

composer require closepact/rot-rut-xml
vendor/bin/rot-rut schemas:fetch
vendor/bin/rot-rut validate begaran.xml --as-of=2027-01-12

How Closepact does it

In Closepact the file is built from the invoices the customer has paid and checked before it is saved. You upload it in the e-service and sign with e-legitimation. From 2027 Closepact reminds you that the answers on subcontractors and staffing companies are entered in the e-service; it writes version 1.1 with the answers only once that format has been import-tested.

What this does not check

  • A check is not a decision by Skatteverket: a file that passes can still be refused.
  • Whether the buyer is entitled to the deduction, or earlier requests for the same buyer in the year.
  • A version 1.1 file from the toolkit has not yet been import-tested in the e-service.