Test buyers

A test buyer is a buyer TIN that makes Sandbox answer the way you choose, like a test card number in a payment system. Use test buyers to check how your app handles each answer. It can come from the FTA, from the buyer's provider, or from Wafeq e-invoicing ASP itself.

📘

A digit never makes a document non-compliant

Sandbox runs the code of Live on every path. A test buyer simulates only what is outside Wafeq e-invoicing ASP: the buyer's provider, the Peppol network and the FTA. It can also make Wafeq e-invoicing ASP unavailable. Validation errors and duplicate invoice numbers come only from the document, as in Live. To see a validation refusal, send a document with a real error.

This page uses these terms:

  • TIN: the 10-digit number that the FTA gives a business.
  • Report: the copy of the document for the FTA. Its status is tdd_status.
  • FTA-only route: Wafeq e-invoicing ASP reports the document to the FTA, but does not deliver it, because the buyer is not on Peppol.
  • Buyer's provider: the e-invoicing provider of the buyer, on Peppol. It answers each delivery with an MLS message (message level status).

Use a test buyer

  1. Select a test buyer from the lists below.
  2. Send its ID in customer.id. The ID is 0235: followed by the TIN.
  3. Send the VAT TRN of the buyer, if it has one:
    • A TIN that starts with 19992: the buyer is registered for VAT. Send the TIN followed by 00003 in customer.vat_number.
    • A TIN that starts with 19993: the buyer is registered for corporate tax only. It has no VAT TRN, so do not send customer.vat_number.
  4. Submit the document as usual.
"customer": {
  "id": "0235:1999200010",
  "name": "Test Buyer LLC",
  "vat_number": "199920001000003",
  "address": { "street": "1 Sheikh Zayed Road", "city": "Dubai", "country": "AE", "country_subentity": "DXB" }
}

Test buyers on Peppol

Sandbox simulates the delivery. The buyer's provider answers as the table says, with an MLS message that comes as a document.status event. For what each answer does, refer to D: the answer of the buyer's provider.

With L 3 or 4, the access point of the buyer never gives a verified receipt, so nothing answers. A queued delivery then ends attention_required, as in Live. Refer to L: the Peppol lookup.

The FTA answers the report as the table says. Its answer depends on the test buyer only: Sandbox does not check the report as the FTA does.

Registered for VATCorporate tax onlyThe answer of the buyer's providerThe answer of the FTA to the report
0235:19992000000235:1999300000Forwards (MLS AB): forwardedAccepted (REPORTED) after 5 seconds
0235:19992000100235:1999300010Forwards (MLS AB): forwardedRejected (NOT_COMPLIANT) after 5 seconds
0235:19992000200235:1999300020Forwards (MLS AB): forwardedRejected (NOT_COMPLIANT) after 5 seconds. A corrected report is accepted 60 seconds later.
0235:19992000300235:1999300030Forwards (MLS AB): forwardedNo answer: tdd_status stays reporting
0235:19992000400235:1999300040Forwards (MLS AB): forwardedAccepted (REPORTED) late, after 20 minutes
0235:19992000010235:1999300001Forwards (MLS AB): forwardedAccepted (REPORTED) after 60 seconds
0235:19992000020235:1999300002Forwards (MLS AB): forwardedAccepted (REPORTED) after 2 minutes
0235:19992000030235:1999300003Forwards (MLS AB): forwardedAccepted (REPORTED) after 20 minutes
0235:19992001000235:1999300100Confirms the document reached the buyer (MLS AP): delivered_confirmedAccepted (REPORTED) after 5 seconds
0235:19992002000235:1999300200Rejects (MLS RE, reason SV): rejectedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992003000235:1999300300Rejects (MLS RE, reason BV): rejectedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992004000235:1999300400Rejects (MLS RE, reason FD): failedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992005000235:1999300500Never answers: sent. For a queued submission, the document waits for review 10 minutes after the handover.Accepted (REPORTED) after 5 seconds
0235:19992005010235:1999300501Never answers: sent. For a queued submission, the document waits for review 60 seconds after the handover.Accepted (REPORTED) after 60 seconds
0235:19992006000235:1999300600Confirms later, after 60 seconds (MLS AP): delivered_confirmedAccepted (REPORTED) after 5 seconds
0235:19992007000235:1999300700The handover fails: failedAccepted (REPORTED) after 5 seconds. For a queued submission, withdrawn 30 minutes after the handover.
0235:19992008000235:1999300800Rejects (MLS RE, with no reason code and no text): rejectedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992009000235:1999300900Rejects (MLS RE, reasons FD and BV): failedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992030000235:1999303000Never answers. Every attempt gets HTTP 503: attention_required (retry_exhausted)Accepted (REPORTED) after 5 seconds. For a queued submission, withdrawn 30 minutes after the first attempt.
0235:19992040000235:1999304000Never answers. The receipt of HTTP 200 cannot be verified: attention_required (invalid_receipt)Accepted (REPORTED) after 5 seconds. For a queued submission, withdrawn 30 minutes after the first attempt.

A report that the FTA rejects has the reason code BV, and its detail starts with Simulated in Sandbox. An accepted report has no detail.

Test buyers not on Peppol

Wafeq e-invoicing ASP does not deliver the document. It uses the FTA-only route, as in Live:

  • The submission answers status: reporting_only.
  • Wafeq e-invoicing ASP reports the document with an FTA placeholder address: 0235:9900000099 for an export, and 0235:9900000098 for any other document.
  • The submission needs an Idempotency-Key header. Without it, Wafeq e-invoicing ASP refuses the submission with 422 idempotency_key_required.
Registered for VATCorporate tax onlyThe answer of the FTA to the report
0235:19992010000235:1999301000Accepted (REPORTED) after 5 seconds
0235:19992010100235:1999301010Rejected (NOT_COMPLIANT) after 5 seconds
0235:19992010200235:1999301020Rejected (NOT_COMPLIANT) after 5 seconds. A corrected report is accepted 60 seconds later.
0235:19992010300235:1999301030No answer: tdd_status stays reporting
0235:19992010400235:1999301040Accepted (REPORTED) late, after 20 minutes
🚧

In a file import

As in Live, a file import does not move a document to the FTA-only route by itself. A buyer that is not on Peppol needs attention. To test the FTA-only route, use the API.

A test buyer whose Peppol lookup fails

Registered for VATCorporate tax only
0235:19992020000235:1999302000
  • A check of the document warns smp_unavailable, with route: unconfirmed.
  • A submission is refused with 503 smp_unavailable. Wafeq e-invoicing ASP accepts nothing, so nothing is delivered or reported.

Test buyers for an unavailable Wafeq e-invoicing ASP

These test buyers are on Peppol. Their R digit makes Wafeq e-invoicing ASP answer the submission as the table says. Refer to R: the request.

Registered for VATCorporate tax onlyWhat Wafeq e-invoicing ASP answers
0235:19992300000235:1999330000503 idempotency_unavailable. Nothing is accepted.
0235:19992400000235:1999340000429, as the rate limit answers. Nothing is accepted.
0235:19992500000235:1999350000status: failed, with no document_id. Nothing is accepted or reported.
0235:19992600000235:1999360000The answer comes after 125 seconds. The document is accepted, and its events follow.
0235:19992700000235:1999370000503 idempotency_unavailable for the first send with each Idempotency-Key. Nothing is accepted. The retry with the same key is accepted, and its events follow.

Test buyers for a replacement

After a withdrawal, a replacement (corrects_document_id) of a document sent to a test buyer on Peppol is handed over and forwarded (MLS AB), whatever its L 3 or 4 and D digits. V and T keep their meaning for the replacement. With R 8, the first replacement gets the answer of L and D again, and the replacement after it is forwarded. With R 9, every replacement is confirmed as received by the buyer (MLS AP). Refer to A replacement.

Registered for VATCorporate tax onlyThe answer of the buyer's provider to the documentTo its first replacementTo the next replacementThe answer of the FTA to the report of the document
0235:19992803010235:1999380301Rejects (MLS RE, reason BV): rejectedRejects (MLS RE, reason BV): rejectedForwards (MLS AB): forwardedAccepted (REPORTED) after 60 seconds, then withdrawn.
0235:19992807010235:1999380701The handover fails: failedThe handover fails: failedForwards (MLS AB): forwardedAccepted (REPORTED) after 60 seconds. For a queued submission, withdrawn 30 minutes after the handover.
0235:19992903000235:1999390300Rejects (MLS RE, reason BV): rejectedConfirms the document reached the buyer (MLS AP): delivered_confirmedConfirms the document reached the buyer (MLS AP): delivered_confirmedAccepted (REPORTED) after 5 seconds, then withdrawn.
0235:19992930000235:1999393000Never answers. Every attempt gets HTTP 503: attention_required (retry_exhausted)Confirms the document reached the buyer (MLS AP): delivered_confirmedConfirms the document reached the buyer (MLS AP): delivered_confirmedAccepted (REPORTED) after 5 seconds. For a queued submission, withdrawn 30 minutes after the first attempt.

A replacement can go out only after the withdrawal of the report. After a rejection by the buyer's provider, that comes a few seconds after the answer of the FTA. After a handover with no verified receipt (D 7, L 3 or L 4), it comes a few seconds after the transport deadline, 30 minutes after the first attempt.

Make your own test buyer

Each test buyer TIN has the same shape. It starts with 1999. Each of the next six digits is one choice:

1 9 9 9   2    0    0    2    0    0
          B    R    L    D    V    T
          │    │    │    │    │    │
          │    │    │    │    │    └── When the answer comes
          │    │    │    │    └─────── The answer of the FTA
          │    │    │    └──────────── The buyer's provider
          │    │    └───────────────── The Peppol lookup
          │    └────────────────────── The request
          └─────────────────────────── The buyer

In this example, 1999200200:

  • The buyer is registered for VAT (B is 2).
  • Wafeq e-invoicing ASP accepts the submission (R is 0).
  • The buyer is on Peppol (L is 0).
  • The buyer's provider rejects the document, with the reason SV (D is 2).
  • The FTA accepts the report (V is 0), after the default time (T is 0). Then the report is withdrawn.

To make your own, select one value for each digit in the tables below. For example, a buyer registered for corporate tax only (3), not on Peppol (1), with a rejected report (1) after 2 minutes (2):

1999  3  0  1  0  1  2   →   0235:1999301012
      B  R  L  D  V  T

Or use the test buyer builder: choose what each party does, and copy the test buyer.

B: the buyer

1999 B · · · · ·

BThe buyer
2Registered for VAT, and so also for corporate tax. Its VAT TRN is the TIN followed by 00003.
3Registered for corporate tax only. It has no VAT TRN.

The other digits work the same way for both buyers.

R: the request

1999 · R · · · ·

R simulates whether Wafeq e-invoicing ASP is available. Wafeq e-invoicing ASP reads R first, before the Peppol lookup.

RWhat Wafeq e-invoicing ASP answers
0It accepts the submission. The other digits apply.
3503, with the code idempotency_unavailable. Nothing is accepted. Each submission to this buyer gets the same answer, also a retry with the same Idempotency-Key.
4429: the rate limit. Nothing is accepted.
5status: failed, with no document_id. Nothing is accepted or reported. A retry with the same Idempotency-Key gets the same answer, as in Live.
6It holds the answer for 125 seconds. A client with a read timeout of 120 seconds or less times out. The document is still accepted, and its events follow. During the hold, a retry with the same Idempotency-Key gets 409 idempotency_in_progress; afterwards, the original answer, as in Live.
7The first submission with each Idempotency-Key gets 503, with the code idempotency_unavailable. Nothing is accepted. The retry with the same Idempotency-Key is accepted, and the other digits apply.
8It accepts the submission, as with R 0. After a withdrawal, the first replacement of the document gets the answer of L and D again; the replacement after it is forwarded. Refer to A replacement.
9It accepts the submission, as with R 0. After a withdrawal, every replacement of the document is confirmed as received by the buyer (MLS AP): delivered_confirmed. Refer to A replacement.
  • With R 3, 4 or 5, the other digits have no effect, and no event comes.
  • With R 6, the other digits apply after the hold. Wafeq e-invoicing ASP holds only a few such answers at a time for your organization. Another submission that would start a hold gets 429; a retry of a finished submission gets its saved answer.
  • With R 7, the first submission gets no event. After the retry, the events come as with R 0. A submission without an Idempotency-Key gets 503 every time. A new Idempotency-Key starts again, also for the same document number: its first submission gets 503, and its retry gets the answer of Live for that number. When a document with this number is already accepted, that answer is status: duplicate_number.
  • With R 8, two failed attempts can follow each other: the document and its first replacement get the same answer.
  • With R 9, a replacement ends delivered_confirmed, the strongest answer of the buyer's provider.
  • A replacement ignores R, except R 4: Wafeq e-invoicing ASP answers it 429 too.
  • A batch ignores R 3 to 7, because they simulate the answer of a single submission call. A document of a batch is accepted as with R 0, and the other digits apply. Refer to Send many documents at once.
  • R has no values 1 and 2. A TIN with them is not a test buyer.
Example, registered for VATCorporate tax onlyWhat happens
0235:19992300000235:1999330000503. Nothing is accepted.
0235:19992400000235:1999340000429. Nothing is accepted.
0235:19992500000235:1999350000status: failed, with no document_id. Nothing is accepted.
0235:19992600000235:1999360000The answer comes after 125 seconds. The document is accepted.
0235:19992700000235:1999370000503 for the first submission. The retry with the same Idempotency-Key is accepted.
0235:19992803010235:1999380301Accepted. The buyer's provider rejects the document with BV, and its first replacement too. The second replacement is forwarded.
0235:19992903000235:1999390300Accepted. The buyer's provider rejects the document with BV. Its replacement is confirmed as received by the buyer (MLS AP).

L: the Peppol lookup

1999 · · L · · ·

LWhere the document goes
0The buyer is on Peppol. Sandbox simulates the delivery.
1The buyer is not on Peppol. Wafeq e-invoicing ASP uses the FTA-only route. D has no effect.
2The lookup fails. Wafeq e-invoicing ASP refuses the submission with 503 smp_unavailable. D, V and T have no effect.
3The buyer is on Peppol, but its access point answers every attempt with HTTP 503. A queued delivery ends attention_required, with the code retry_exhausted. D has no effect.
4The buyer is on Peppol, but its access point answers HTTP 200 with a receipt that cannot be verified. A queued delivery ends attention_required, with the code invalid_receipt. D has no effect.

With L 3 and 4, the access point of the buyer never gives a verified receipt, so the buyer's provider never answers:

  • L 3: Wafeq e-invoicing ASP tries again, as in Live, until it reaches max_attempts. Meanwhile delivery_status is retrying, and a document.status event comes after each attempt. Then the delivery ends attention_required, with the code retry_exhausted.
  • L 4: the delivery ends attention_required after one attempt, with the code invalid_receipt.
  • GET /deliveries/{delivery_job_id} shows each attempt in attempts, with its phase, outcome, error_code and http_status, as in Live: first the lookup (discovery, prepared), then the transport attempts.
  • The report to the FTA is still filed. 30 minutes after the first attempt, the transport deadline of Live passes, and a report that the FTA accepted is withdrawn. Then your app can send a replacement. Refer to A replacement.
  • A submission without Prefer: respond-async has no queued delivery and no deadline, as in Live. With L 3, it answers status: failed, and its error starts with HTTP 503. With L 4, it is handed over, because the direct sender of Live does not verify the receipt. Nothing answers it.
Example, registered for VATCorporate tax onlyWhat happens
0235:19992030000235:1999303000Every attempt gets HTTP 503. The delivery ends attention_required with retry_exhausted. The report is accepted, then withdrawn after 30 minutes.
0235:19992040000235:1999304000The receipt cannot be verified. The delivery ends attention_required with invalid_receipt. The report is accepted, then withdrawn after 30 minutes.

D: the answer of the buyer's provider

1999 · · · D · ·

D applies only when L is 0. With L 1, nothing is delivered. With L 3 and 4, nothing answers. So D has no effect. Each answer of the buyer's provider comes as a document.status event with simulated: true, as in Live.

DThe buyer's providerdelivery_status
0Forwards the document to the buyer (MLS AB).forwarded
1Confirms that the document reached the buyer (MLS AP).delivered_confirmed
2Rejects the document, with the reason SV (MLS RE).rejected
3Rejects the document, with the reason BV (MLS RE).rejected
4Rejects the document, with the reason FD (MLS RE).failed
5Never answers.sent
6Confirms that the document reached the buyer, after a delay: 60 seconds after the handover, or the T time.delivered_confirmed
7Never gets the document: the handover to its access point fails. document.sent has status: failed, with a document_id. The report to the FTA is still filed.failed
8Rejects the document, with no reason code and no text (MLS RE). The reason is not clear.rejected
9Rejects the document, with the reasons FD and BV together (MLS RE). The reason is not clear.failed

As in Live, a forward (AB) or a confirmed delivery (AP) comes only when the document asks for every answer: mls_type: ALWAYS_SEND, the default. With mls_type: FAILURE_ONLY, only a rejection comes.

Example, registered for VATCorporate tax onlyWhat happens
0235:19992000000235:1999300000Forwarded. The report is accepted.
0235:19992001000235:1999300100Delivery confirmed (MLS AP). The report is accepted.
0235:19992002000235:1999300200Rejected by the buyer's provider, with SV. The report is accepted, then withdrawn.
0235:19992004000235:1999300400Rejected by the buyer's provider, with FD. The report is accepted, then withdrawn.
0235:19992002100235:1999300210Rejected by the buyer's provider, with SV. The FTA rejects the report, so nothing is withdrawn.
0235:19992005000235:1999300500No answer from the buyer's provider. A queued submission has a deadline of 10 minutes. Then, as in Live, the document waits for review.
0235:19992005010235:1999300501No answer from the buyer's provider, with a deadline of 60 seconds. The FTA answers after 60 seconds.
0235:19992006000235:1999300600Delivery confirmed after 60 seconds.
0235:19992007000235:1999300700The handover fails. The report is still filed.
0235:19992008000235:1999300800Rejected by the buyer's provider, with no reason. The report is accepted, then withdrawn.
0235:19992009000235:1999300900Rejected by the buyer's provider, with FD and BV. The report is accepted, then withdrawn.

V: the answer of the FTA

1999 · · · · V ·

VThe answer to the report
0Accepted: REPORTED.
1Rejected: NOT_COMPLIANT, with the reason code BV.
2Rejected. Then a corrected report is filed and accepted.
3No answer. tdd_status stays reporting.
4Accepted late.

T: when the answer comes

1999 · · · · · T

TWhen the answer comes
0The default time: 5 seconds. A late answer (V 4) comes after 20 minutes. A corrected report (V 2) comes 60 seconds after the rejection.
1After 60 seconds.
2After 2 minutes.
3After 20 minutes.

T counts from the moment Wafeq e-invoicing ASP accepts the document. For a corrected report (V 2), T counts from the rejection. When there is no answer (V 3), T has no effect.

T also times the buyer's provider, with the same values:

  • D 5: the deadline of the answer, for a queued submission. The default is 10 minutes, as in Live.
  • D 6: when the confirmation comes. The default is 60 seconds.

For example, 1999200501 gets no answer from the buyer's provider, with a deadline of 60 seconds. The FTA answers after 60 seconds.

After a rejection by the buyer's provider

A rejection by the buyer's provider (D 2, 3, 4, 8 or 9) starts the recovery of Live:

  • The FTA accepts the report. Wafeq e-invoicing ASP withdraws it, and the simulated FTA accepts the withdrawal. Then document.reported comes with tax_authority_status: WITHDRAWN and simulated: true, and tdd_status becomes withdrawn.
  • The FTA rejects the report (V 1). Nothing is withdrawn.
  • The FTA does not answer (V 3). Nothing is withdrawn while the answer is missing.

The record of the document, its document.status events and its document.reported events carry reporting_recovery. Its trigger tells why the report is withdrawn: c3_validation_rejected for D 2 and 3, c3_delivery_rejected for D 4, and c3_rejection_unclassified for D 8 and 9. With D 8 and 9, the reason is not clear: reporting_recovery.resolution is operator_review, and Wafeq e-invoicing ASP also reviews the case.

No answer, or a failed handover

No answer (D 5) and a failed handover (D 7, L 3 and L 4) have deadlines only for a queued submission (Prefer: respond-async), as in Live:

  • D 5: the deadline is 10 minutes after the handover, as in Live, or the T time. Then, as in Live, the document waits for review: a document.status event comes with c3_deadlines.state: attention_required and reason_code: c3_mls_overdue. The report is not withdrawn.
  • D 7: the transport deadline of Live, 30 minutes after the handover. Then the recovery of Live starts, and a report that the FTA accepted is withdrawn.
  • L 3 and 4: the same transport deadline, 30 minutes after the first attempt. Then the recovery of Live starts, and a report that the FTA accepted is withdrawn.
  • D 6 with a T time over 10 minutes: the confirmation comes after the deadline. As in Live, the document waits for review at the deadline, and the late confirmation then settles it.

A submission without Prefer: respond-async has no deadlines, as in Live. Its document keeps the delivery state that the table of D gives.

A replacement

After a withdrawal, your app can send a replacement, as in Live: the same document with the same number and type, a new Idempotency-Key, and corrects_document_id with the document_id of the withdrawn document. Send it when reporting_recovery.state of the original is withdrawn or original_rejected. Before that, it gets 409 correction_not_ready. Refer to Correct or cancel a document.

  • The answer of the buyer's provider: a replacement to a test buyer on Peppol is handed over and forwarded (MLS AB), whatever its L 3 or 4 and D digits. Thus the road can be walked to the end: rejected or not delivered, withdrawn, sent again, delivered. As for any forward, the answer comes only with mls_type: ALWAYS_SEND, the default.
  • R 8: the first replacement gets the answer of L and D again, so it fails as the original did and is withdrawn too. The replacement after it is forwarded.
  • R 9: every replacement is confirmed as received by the buyer (MLS AP): delivered_confirmed. This answer also comes only with mls_type: ALWAYS_SEND.
  • V and T keep their meaning: the FTA answers the report of the replacement as V and T say.
  • A replacement is always a queued submission, with or without Prefer: respond-async. A document that your app sent without Prefer: respond-async cannot get a replacement, as in Live.
  • The original keeps tdd_status: withdrawn. Its reporting_recovery.state becomes replacement_queued, and reporting_recovery.replacement_id names the replacement. The replacement has corrects_id.
Example, registered for VATCorporate tax onlyWhat happens
0235:19992003010235:1999300301Rejected with BV, withdrawn. The replacement is forwarded, and its report is accepted after 60 seconds.
0235:19992007010235:1999300701The handover fails; a queued submission is withdrawn after 30 minutes. The replacement, with the same content, is forwarded.
0235:19992803010235:1999380301Rejected with BV twice: the document and its first replacement are withdrawn. The second replacement is forwarded.
0235:19992807010235:1999380701The handover fails twice: the document and its first replacement are withdrawn after 30 minutes each. The second replacement is forwarded.
0235:19992903000235:1999390300Rejected with BV, withdrawn a few seconds after the report is accepted. The replacement is confirmed as received by the buyer (MLS AP): delivered_confirmed.
0235:19992930000235:1999393000Every attempt gets HTTP 503; a queued submission is withdrawn after 30 minutes. The replacement is confirmed as received by the buyer (MLS AP). The whole road takes about 31 minutes.

A TIN that is not a test buyer

  • 19992… or 19993… with a value that the tables do not give, for example R 1 or L 5. Wafeq e-invoicing ASP treats the buyer as not on Peppol.
  • 1999 with another value of B, for example 19994…. Wafeq e-invoicing ASP treats the TIN as any other TIN.

Read the list from the API

  • GET /sandbox/test-buyers gives all the test buyers on this page.
  • GET /sandbox/test-buyers/{tin} gives one test buyer.

Call them with your Sandbox API key. In Live, they answer 404.

An answer that no test buyer gives

A failed report (FAILED) comes only from a test event. A test event contains test: true, and it changes no document. Use it to check how your app handles the event.

  1. In the Wafeq e-invoicing ASP portal, go to Developer → Webhooks.
  2. Select a webhook endpoint that has the document.reported event.
  3. Send a test event, and select the outcome of the report.
Outcomedata.tax_authority_status
AcceptedREPORTED
RejectedNOT_COMPLIANT
FailedFAILED

Test buyers