Receive a document in the Sandbox
Use this page to try the side of the buyer in the Sandbox: your app reads a document that another Sandbox taxpayer sent to it. These steps are the real flow, with a sender. The Receive a test bill button of the portal, on Purchases → Bills, is a quick one-sided check of your webhook endpoint instead: it has no sender and no document file.
This page uses these terms:
- Sandbox taxpayer: a taxpayer that Wafeq e-invoicing ASP makes in Sandbox. No real business is behind it.
- Copy: the document as the buyer receives it.
Before you start
- Connect two Sandbox taxpayers to your organization: one is the seller, and one is the buyer. Refer to Connect a Sandbox taxpayer.
- Your grant from the buyer needs the scopes
invoices:readandinbound:read. - Your webhook endpoint has the
document.receivedevent.
Send and receive
- Submit a document from the seller. In
customer.id, send0235:followed by the TIN of the buyer. - Your organization receives a
document.receivedevent. - Read the copy as the buyer: fetch it with
GET /invoices/{document_id}/xmlwithin 2 minutes of its reception. The 2 minutes start when the document is received, not when your endpoint gets the event.
The delivery_status of the document that the seller submitted is then:
- Your app fetched the copy within 2 minutes:
sentuntil the fetch, thendelivered_confirmed. - Your app did not fetch it in time:
sentfor 2 minutes, thenforwarded, for good. A later fetch does not change it. - No organization has an
inbound:readgrant from the buyer:forwardedat once.
Live works the same way. When one of your taxpayers receives a valid document, Wafeq e-invoicing ASP answers the sender's provider one time only: MLS AP when your app fetched the document within 2 minutes of its reception, and MLS AB when it did not. The 2xx answer of your endpoint to the event only stops the retries of the event. Refer to Receive a document.
An active taxpayer in Sandbox is always on Peppol. Thus it receives a copy of each document of which it is the recipient:
- An invoice or a credit note: the taxpayer in
customer.id. - A self-billed document: the seller.
Updated 4 days ago