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:read and inbound:read.
  • Your webhook endpoint has the document.received event.

Send and receive

  1. Submit a document from the seller. In customer.id, send 0235: followed by the TIN of the buyer.
  2. Your organization receives a document.received event.
  3. Read the copy as the buyer: fetch it with GET /invoices/{document_id}/xml within 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: sent until the fetch, then delivered_confirmed.
  • Your app did not fetch it in time: sent for 2 minutes, then forwarded, for good. A later fetch does not change it.
  • No organization has an inbound:read grant from the buyer: forwarded at 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.

Receive a document in the Sandbox