--- title: "Retrieve e-invoicing addresses with the Peppol API" slug: "récupérer-les-adresses-de-facturation-électronique-via-l-api-peppol" description: "Frisbii retrieves e-invoicing addresses and schema codes from the Peppol directory using customer SIREN or SIRET numbers." updated: 2026-11-04T10:18:57Z published: 2026-11-04T10:18:57Z canonical: "help.frisbii.com/récupérer-les-adresses-de-facturation-électronique-via-l-api-peppol" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.frisbii.com/llms.txt > Use this file to discover all available pages before exploring further. # Retrieve e-invoicing addresses with the Peppol API To send an electronic invoice to a customer, you need their e-invoicing address. Instead of entering it manually, Frisbii can retrieve it automatically from the Peppol directory, based on your customers' SIREN or SIRET number, using two dedicated batches. 💡 This feature is available from version **0.38** of the **Frisbii e-invoice** package. ## How does the retrieval work? The batch queries the Peppol directory for each eligible customer and automatically fills in: - the customer's **e-invoicing address**; - the associated **schema identifier code** (Scheme Identifier Code), for example 0225. Two separate batches are available: | Batch | Object updated | Fields filled in | | --- | --- | --- | | `DirectoryApiSyncAccountBatch` | Account (`Account`) | Electronic billing address (`fiix__ElectronicBillingAddress__c`) and Schema identifier code (`fiix__SchemaIdentifierCode__c`) on the **Account** | | `DirectoryApiSyncAccountingDataBatch` | Accounting Data (`sofactoapp__Donnee_Comptable__c`) | Electronic billing address (`fiix__ElectronicBillingAddress__c`) and Schema identifier code (`fiix__SchemaIdentifierCode__c`) on the **Accounting Data** | ### Trigger conditions The batch only processes records that meet both of the following conditions: - the **e-invoicing address is empty**; - **at least one identifier is filled in**: the SIREN, the SIRET, or the field defined in your custom mapping (BT-46 / BT-47), if any. A few details: - The batch checks your custom mapping first, then the SIRET, then the SIREN. It uses the first valid identifier. - A SIRET is automatically reduced to its SIREN (its first 9 digits). - Spaces are ignored: "879 038 990" is read as "879038990". - If no identifier is a valid French SIREN or SIRET (for example a foreign identifier), the record is skipped and does not appear in the report. Records that already have an e-invoicing address are never modified. ## Which companies are listed in the Peppol directory? A company can only be found through the Peppol API if both of these conditions are met: - **its receiving Approved Platform (PA-R) uses the Peppol communication protocol**; - **its PA has registered it in the Peppol directory**. If either condition is missing, the customer is not found and their e-invoicing address stays empty. In that case, ask your customer for it directly. ⚠️ **The Peppol directory is not the Chorus Pro directory.** Public entities are not listed in it. For example, a public administration, a school or a hospital will not be found: its e-invoicing address stays empty. ## Set up the retrieval step by step ### Step 1: Check your customers' SIREN or SIRET The batch relies on the SIREN to query the directory. Make sure the SIREN or SIRET is filled in on your Accounts and Accounting Data records. 💡 If you store this identifier in a custom field, the batch takes your custom mapping (BT-46 / BT-47) into account: no additional configuration is needed. ### Step 2: Schedule the batches The batches are run with Apex scheduling. Repeat the procedure for each of the two batches (Account and Accounting Data). 1. In Salesforce, go to **Setup**, then search for **Apex Classes**. 2. Click **Schedule Apex**. 3. Enter a **Job Name** (for example "Peppol address retrieval – Accounts"). 4. In **Apex Class**, select `DirectoryApiSyncAccountBatch` (or `DirectoryApiSyncAccountingDataBatch` for Accounting Data). 5. Set the **frequency**, the **start and end dates** and the **preferred start time** to suit your needs. 6. Click **Save**. 💡 No frequency is required: adapt it to how often you create new customers. Since the batch only processes records without an e-invoicing address, it can be run as many times as needed without overwriting existing data. ℹ️ The Peppol directory limits the number of requests per second. If this limit is reached, the records not yet processed stay without an address and are automatically picked up on the next run. #### Run a batch immediately You can also run a batch on demand, without waiting for the next scheduled run, for example right after importing new customers. 1. Open the **Developer Console** (gear icon at the top right > **Developer Console**). 2. Click **Debug > Open Execute Anonymous Window**. 3. Enter the line for the batch you want to run: - for Accounts: `fiix.DirectoryApiSyncAccountBatch.runNow();` - for Accounting Data: `fiix.DirectoryApiSyncAccountingDataBatch.runNow();` 4. Click **Execute**. The batch runs in the background. You receive the end-of-processing notification, just as for a scheduled run. ### Step 3: Check the results Once the batch has run, open a few processed records: the **Electronic billing address** and **Schema identifier code** fields are filled in. ## The end-of-processing notification At the end of each batch, a **Salesforce notification** appears in the notification bell (top right of your screen) of the user who scheduled or ran the batch. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-0CXHO7S2.png?sv=2026-02-06&spr=https&st=2026-12-02T18%3A21%3A00Z&se=2026-12-02T19%3A21%3A00Z&sr=b&sp=r&sig=3KlAgJ1huHcW3hxiwIGdF1X7I7tYbODT%2F%2FNyLboAt3M%3D) Its title shows the result and the object processed, for example: - "Directory API Sync Batch Success (Account)" - "Directory API Sync Batch finished with error(s) (Accounting Data)" It then lists: - **the number of records updated** with their e-invoicing address; - **the records that failed**, with their Id and the reason for the failure, including customers for whom several addresses were found; - **the records not found in the directory**, in the form "Customer name - SIREN". 📧 The notification is limited to 750 characters. If there are errors, the full report is also sent to you **by email**, and clicking the notification opens that email. ## What happens to customers who are not found or ambiguous? - **No address found**: the customer is not registered in the Peppol directory (see the conditions above). The field stays empty and the customer appears in the list of records not found. This case is not treated as an error. - **Several addresses found**: the customer has several e-invoicing addresses. The batch does not choose for you: the field stays empty and the notification lists all the addresses found. Fill in manually the one your customer gave you. 💡 One exception: if the same SIREN is registered with both code 0225 (French e-invoicing) and code 9957 (French VAT number), it is the same company. The batch then automatically keeps the 0225 address. ⚠️ An invoice sent to the wrong address may be misrouted or rejected. If in doubt, check with your customer.