Once JoFotara, Jordan's national e-invoicing system, accepts an invoice, it stays exactly as you sent it. You correct it by sending a return invoice, which the technical guide from the Income and Sales Tax Department (ISTD) calls an invoice with a credit note. If the sale still stands with another price or another buyer, our reading of the guide is that you then issue a new invoice with the right details.
The rules below describe how a billing system should behave under version 1.5 of ISTD's guide. Ask your accountant or ISTD how a specific case is treated for tax.
What ISTD allows after an invoice is accepted
The return invoice is the only document the guide describes for changing an accepted invoice. It sets these conditions:
- A return covers quantities only.
- It cannot exceed the quantity sold on the original invoice.
- You may send one or more returns against the same original until all of its quantities are used.
- Each return carries the original's invoice number, its UUID (the unique ID your system gives each invoice) and its total.
- The return's type and currency follow the original, so a local cash invoice gets a local cash return.
- The buyer details on the return match those on the original.
- Each return states its reason.
Conditions 1 to 4 are on page 23 of the guide, 5 on page 24, 6 on page 26 and 7 on page 27.
Separate rejected and accepted states
Every submission gets a response, and its status field, EINV_STATUS, tells you which fix applies. The guide lists three values: SUBMITTED (accepted), ALREADY_SUBMITTED (accepted on an earlier attempt) and NOT_SUBMITTED (rejected because of an error).
| State | How you know | What to do |
|---|---|---|
| Draft, never sent | No response is stored | Edit or delete it under your own approval rules |
| Sent, no answer yet | The request timed out or the connection dropped | Keep it locked and send it again with the same invoice number and UUID. If the first attempt was accepted, the answer is ALREADY_SUBMITTED with the original QR code |
| Rejected | NOT_SUBMITTED, with the errors listed in EINV_RESULTS | Fix the data where it was entered, then resubmit |
| Accepted | SUBMITTED or ALREADY_SUBMITTED, with a QR code | Leave it as it is and issue a return invoice |
Store the full response to every attempt: the status, the QR code, the UUID and any errors. That record proves the original was accepted and shows what it contained. Our JoFotara developer guide explains where rejections usually come from and how to resubmit.
Choose the fix for each mistake
| Mistake on an accepted invoice | What to send |
|---|---|
| Goods came back or a service was refunded | A return for the returned quantities |
| The quantity billed was too high | A return for the extra quantity |
| The whole sale was cancelled | Returns for every quantity on the invoice, in one return or several |
| Wrong price, discount or tax rate on a line (our reading) | A return for that line's full quantity, then a new invoice with the right values |
| Wrong buyer (our reading) | A return for all quantities, carrying the original buyer's details, then a new invoice to the right buyer |
| The quantity billed was too low (our reading) | A new invoice for the missing quantity |
The last three rows are our reading of the guide, which allows returns on quantities only and describes no document that changes a price or a buyer. Agree them with your accountant before you build them.
Never hard-delete accepted history
Make accepted invoices immutable in business meaning. Each later document has its own identity, state, and link to the original. Your system can label the original as returned or partly returned. It should keep the original, every return and every new invoice, along with who requested, approved and sent each one, and why.
ClinicTek, the clinic system we build and run, keeps its own issued invoices fixed in the same way. After an invoice is issued, an attempt to change it shows "This invoice can no longer be edited." To cancel one, Void invoice asks for a Reason for voiding and warns that "Voiding is permanent and audited." A paid invoice must be refunded before it can be voided, and a voided invoice stays on record with who voided it and when.
Send a return in nine steps
- Open the original and confirm that its stored status is
SUBMITTEDorALREADY_SUBMITTED, with a QR code. - Check that no other return on the same invoice is waiting to be sent, so two people cannot create two returns.
- Pick the lines and quantities to return. Block any quantity above what remains: the quantity sold minus what earlier returns took back.
- Enter the reason.
- Have an authorised person approve the return. Ask for a second approval on a full return.
- Save the return with its own number and UUID before anything is sent, then put it in the sending queue.
- Send it and store the response. If it is rejected, fix the data and resend it with the same number and UUID. The original stays accepted throughout.
- If the sale stands with new details, issue the new invoice and link it to the return.
- Record the money as its own entry: a refund, a credit on the customer's account, or an allocation to another invoice.
Keep refunds and credits apart from the invoice
A return changes what the customer owes. Record any money paid back in a separate entry. Leave the original payment as it was, and record the refund or credit with its amount, method, reference and approval. Show a refund through a payment provider as pending until the provider confirms it.
ClinicTek's Refund payment form works this way. It asks for the Refund amount, a Reason and, for electronic payments, the Provider refund reference, and it refuses an amount above what is still refundable. When one invoice carries a patient share and an insurer share, a return can change the insurer's claim too. Open a follow-up for whoever handles claims. Our guide to reconciling payments with e-invoices covers matching these entries in the daily close.
Make retries safe
A request is idempotent when sending it twice has the same effect as sending it once. The national system supports this. The invoice number and UUID together form the key that blocks a duplicate invoice (guide, page 23). Resending an accepted invoice returns ALREADY_SUBMITTED with the original QR code (page 99). To use it:
- Create the number and UUID once, when the document is saved, and reuse them on every retry.
- Keep the number of a timed-out invoice. A new number would create a second invoice.
- Lock the invoice and its returns in the database, so two sessions cannot approve two returns at once. A disabled button in the browser cannot stop a second request.
What our connector checks before a return is sent
Our JoFotara connector follows version 1.5 of ISTD's guide. Before a return leaves the billing system, the connector checks three things: the return references the original invoice number and UUID, the original total is above zero, and the return states a reason. It also blocks an ordinary invoice from referencing an original, because only returns may point to one.
When the national system answers with an error, the connector sorts it by who can fix it:
- The connector retries a temporary error, such as a timeout or an unreachable server, with the same number and UUID.
- It marks a setup error, such as a wrong Client-Id or Secret-Key or a wrong tax number, for whoever administers the account.
- It marks a data error for correction by whoever entered the data, who fixes it and resends.
Your billing system decides who sees each marked error.
If your current billing system deletes or overwrites submitted invoices, the JoFotara integration service page explains how we connect a system you already run.
Test these cases before go-live
| Case | Expected result |
|---|---|
| Edit a draft | Saved; nothing sent |
| Timeout on the first send, then a retry | One accepted invoice; the retry answers ALREADY_SUBMITTED |
| Rejected invoice, fixed and resent | Accepted; no second invoice |
| Full return of an unpaid invoice | Return accepted; balance zero; no refund created |
| Partial return of a paid invoice | Return accepted for those quantities; refund recorded separately |
| Second partial return on the same invoice | Accepted up to the remaining quantity; anything above it is blocked |
| Return with no reason | Blocked before sending |
| Wrong price on a paid invoice | Full return of the line, a new invoice, and a refund or credit for the difference |
| The return is rejected | Original unchanged; the return goes back to its owner with the error |
| Two people return the same line at once | One return created; the second person sees the change |
Run each case with test data, then check the exports and the invoice history.
Cancelling an invoice at the till without a gap in the numbers has its own test in invoice numbering and cancellation at the till.
Checked against version 1.5 of ISTD's technical integration guide (approved 14 May 2026) on 4 November 2026.




