Translation of the article from the Law of Criminal Procedure:
“Witnesses who appear to testify before the Court will be entitled to compensation, if they claim it.
The Judicial Clerk will fix it by decree, taking into account only the expenses of the trip and the amount of the wages lost by the witness on the occasion of his appearance to declare”.
On arrival at the court house, visit the Judicial clerk with information of your intention to apply for your expenses. Provide your ID, Address, Bank Details and a driving licence if the claim for transport included your private vehicle. After the case, proceed again to the official who will complete your claim and details on the computer. When completed you should receive a stamped copy.
CAB Spain cannot provide guarantees for amount of expenses covered. This would be a decision of the courts.