The Masav returns file consolidates unhonoured debits from every bank. How to match the original transaction, update a customer balance without double-charging, and act on the reason.
Key takeaways
- A return is an inbound event. If no process reads it, the customer balance is wrong and nobody knows.
- The file consolidates returns from all banks into one uniform structure with reason codes, instead of separate notices per bank.
- Reasons Masav names include insufficient funds, a cancelled instruction and a closed account - each needing a different response.
- The matching key is the reference you generated in the original charges file, never the customer name or the amount.
- Ingestion must be idempotent: the same return read twice cannot create the debt twice.
The Masav returns file consolidates the return notices received from every bank for debits that were not honoured, transmitted to the organisation as one uniform file - daily, or on several fixed dates each month. It carries the details of the original transaction that was returned and a coded reason for the return. Until it is read, the debt still looks paid in your system.
Why the debt does not reappear when a debit fails
Because in many systems "charge sent" is recorded as "collected". The moment the charges file is submitted the invoice is marked paid, and if the bank did not honour the debit, nothing goes back to correct it.
The result is familiar: a customer who stopped paying keeps receiving service for months, because on the books they are fine. Repairing that retroactively is hard work, because it means cross-checking months of submitted charges against what actually landed in the account. The daily habit that prevents the gap is described in the daily bank reconciliation process for a small business.
What the returns file actually carries
For each return the file identifies the original transaction that was returned and the reason for it. Three kinds of value your process needs to extract:
- The original transaction identifier - the reference you sent the charge with. It is the only matching key you can rely on.
- The coded return reason - what decides the next action, rather than merely recording that something failed.
- The charge details - amount and date, used to confirm the match is correct.
That is why the reference must be generated in your system, be unique, and be stored on the charge row. A reference regenerated on every run, or built from a customer number alone, makes automatic matching impossible.
What do you do with each type of return reason?
The correct response differs sharply between reasons. An automatic retry is right for some and actively harmful for others:
| Reason class | What it means in practice | Appropriate automatic action |
|---|---|---|
| Insufficient funds | The mandate is valid, the money was not there that day | Reopen the debt, retry next cycle, notify the customer |
| Instruction cancelled | The mandate no longer exists | Reopen the debt, stop future charges, ask the customer to re-establish it |
| Account closed | This account can never be charged again | Reopen the debt, mark the payment method invalid, request new details |
The simple rule: an automatic retry is allowed only when the reason is temporary in nature. Re-submitting a charge against a cancelled mandate produces another return and another cost, not money.
What a dependable ingestion process looks like
- Collect. Pull the file from the secure channel it is transmitted through, on a fixed schedule.
- Store raw. Keep the file exactly as received, before any parsing. That is what lets you investigate a dispute six months later.
- Parse. Read records against the official returns specification, failing loudly on an unrecognised record rather than skipping it silently.
- Match. Link each return to its charge row by reference. Anything unmatched goes to a manual queue.
- Update. Clear the paid flag, reopen the debt, and write an event into the customer's history.
- Respond. Apply the response rule for that return reason.
Step 2 is the one teams skip, and the only one that cannot be reconstructed after the fact.
Step 4 decides how much manual work survives. A good matcher returns exactly three outcomes: matched, not found, or more than one candidate. That third outcome is the clearest sign your reference is not genuinely unique, and it should be treated as a bug in the charges file rather than an edge case in ingestion. The manual queue should be a list with a stated reason per row, not a pile of files that failed to load.
How do you avoid double debt when a file is read twice?
Define a unique key per return - reference, return date and amount together - and enforce it as a database uniqueness constraint, not as a check in application code. Re-ingesting the same file then fails on the constraint instead of creating a second row.
This matters in practice because a repeat read happens in every one of these cases: a run that died halfway and was restarted, a file received twice, or a transmission that includes an overlapping period. A process assuming each file is read exactly once will create duplicate debts on the first day that assumption breaks.
What to measure once the process works
Once ingestion is automatic, the returns file becomes a measurement source rather than only an incident queue. Four metrics surface a problem before it becomes written-off debt:
- Return rate by reason, over time. A rise in insufficient funds tells a completely different story from a rise in cancelled mandates: the first points at customer distress, the second at churn.
- Age of the unmatched queue. Returns never linked to a charge row are debt that was never recorded. A growing queue means your reference key is not stable.
- Time from return to debt creation. If it is measured in days rather than hours, the problem is your collection frequency, not your code.
- Retry success rate by reason. This is the number that decides whether your retry rule earns its keep or merely generates fees.
Keep one operational metric alongside them: how many returns were handled manually. A figure that does not fall over time means the automation only covers the easy case.
What the customer should see
A return is a sensitive moment. The customer usually does not know the charge failed, and a generic "payment failed" message produces a support call instead of a resolution.
What works: a message stating the amount, the date of the failed charge, and the action required - and where the reason is a cancelled mandate or a closed account, a direct route to fixing it. The scheduling and follow-up of those messages is the same mechanism described in automating invoicing and payment reminders, and the collection side that produced the charge is covered in Masav direct debits versus card payments.
Sources
Frequently asked questions
How often does the returns file arrive?
Masav states the information is transmitted in a daily file or on four fixed dates during the month, according to the organisation's needs. The frequency you choose determines how long a debt stays invisible in your system, which makes it an operational decision rather than only a technical one.
What do you match a return against?
The unique reference you generated and sent in the charges file. Matching on customer name or amount breaks the moment two similar charges exist on the same day, so it is unsuitable for an automated process. Amount and date are used to confirm the match, not as the key.
Should failed charges be retried automatically?
It depends on the reason. Insufficient funds is a temporary state and a retry next cycle is reasonable. A cancelled mandate or a closed account is permanent, and retrying produces another return and another cost with no prospect of collection. The rule should be defined per reason code.
Where do I find the returns file structure?
In the specifications Masav publishes on its file-specifications page. There are separate specifications for the charges returns file and the credits returns file - collections and payments respectively - and each carries a revision date. Field positions and reason codes must come from there and nowhere else.
Keep reading
Related service
Business Automation
I build custom automations that remove repetitive work end to end.
About the author
Yehonatan Saadia
Freelance automation, web & MVP developer
I'm Yehonatan Saadia, a senior developer who builds business automation, custom websites, and MVPs for small and mid-sized companies across the US, Europe, and Israel. These guides come from real client work, not theory.
Work with meHave a project like this?
Tell me what you're trying to automate or build. I reply within 24 business hours with a few targeted questions, then we walk through it on a free 30-minute call, with no commitment. You come away with a scope, a timeline and a fixed price - or a straight answer that it isn't worth building.
