Foundations Apex API Developer Reference

fferpcore.ElectronicInvoicingDelivery

global with sharing class ElectronicInvoicingDelivery

Interfaces and data structures used to pass information to interested parties to update and create documents (Invoice/Credit Note) for an electronic invoice.
To receive notifications to update documents (Invoice/Credit Note), implement the interface IEInvoiceUpdateListener and add an fferpcore__Plugin__mdt record where fferpcore__ClassName__c points to your class and fferpcore__ExtensionPoint__c is set to 'fferpcore.ElectronicInvoicingDelivery.IEInvoiceUpdateListener'.
To receive document data to create documents (Invoice/Credit Note), implement the interface IDocumentCreateListener and add an fferpcore__Plugin__mdt record where fferpcore__ClassName__c points to your class and fferpcore__ExtensionPoint__c is set to 'fferpcore.ElectronicInvoicingDelivery.IDocumentCreateListener'.
To archive documents (Invoice/Credit Note), implement the interface IEInvoiceArchiveService and add an fferpcore__Plugin__mdt record where fferpcore__ClassName__c points to your class and fferpcore__ExtensionPoint__c is set to 'fferpcore.ElectronicInvoicingDelivery.IEInvoiceArchiveService'.

Enums

DocumentStatus

The delivery status of a document supported by e-invoicing.

Value Description
QUEUED The document is being prepared for sending to the e-invoicing network.
SENDING The document has been sent to the e-invoicing network, but has not yet reached the recipient.
DELIVERED The document has been successfully delivered to the final recipient.
FAILED The document has not reached the final recipient. There will be an accompanying error message containing more details.

fferpcore.ElectronicInvoicingDelivery.IEInvoiceUpdateListener

global interface IEInvoiceUpdateListener

To be implemented by systems that care about receiving updates about the status of e-invoices.

Methods

updateDocuments

void updateDocuments(Map<String, fferpcore.ElectronicInvoicingDelivery.DeliveryUpdate> responseByUniqueIdentifiers)

This will be called with updates about the status of e-invoices. If there are multiple systems sending electronic invoices, they might receive notifications about each other's invoices. These notifications can be safely ignored.

Input Parameters

Name Type Description
responseByUniqueIdentifiers Map<String, fferpcore.ElectronicInvoicingDelivery.DeliveryUpdate> The updates to be processed. The key will be an identifier for the invoice - this will match either the `getEInvoicingUniqueIdentifier()` or the `getEInvoicingExternalUniqueIdentifier()` method, so you will need to search by both values from your invoice. If both are available, the key will match `getEInvoicingUniqueIdentifier()`.

fferpcore.ElectronicInvoicingDelivery.IDocumentCreateListener

global interface IDocumentCreateListener

To be implemented by systems that care about receiving e-invoice data to create documents (Invoice/Credit Note).

Methods

createDocuments

List<ElectronicInvoicingService.DocumentResponse> createDocuments(List<fferpcore.ElectronicInvoicingService.Document> documents)

This will be called with the received invoice data to create documents (Invoice/Credit Note).

fferpcore.ElectronicInvoicingDelivery.IEInvoiceArchiveService

global interface IEInvoiceArchiveService

To be implemented by systems that care about archiving of sent and received documents.

Methods

archiveSentFiles

void archiveSentFiles(String libraryName, Map<String, String> ublByGuidMap)

This will be called with the Archive library name for sent files and a map of UBL by GUID to archive the sent documents(Invoice/Credit Note).

archiveReceivedFiles

void archiveReceivedFiles(String libraryName, List<fferpcore.ElectronicInvoicingService.Document> documents)

This will be called with the Archive library name and a list of received documents(Invoice/Credit Note) to archive.

fferpcore.ElectronicInvoicingDelivery.DeliveryUpdate

global with sharing class DeliveryUpdate

An update about how a particular electronic invoice is progressing in its delivery. Depending on the source of the update, the invoice may be identified using an identifier generated by FinancialForce (using the getEInvoicingUniqueIdentifier() method), one generated by the e-invoicing provider (using the getEInvoicingExternalUniqueIdentifier() method), or both. If there are multiple systems sending electronic invoices, they might receive notifications about each other's invoices. These notifications can be safely ignored.

Methods

DeliveryUpdate

global DeliveryUpdate(String uniqueIdentifier, fferpcore.ElectronicInvoicingDelivery.DocumentStatus status)

Constructs a delivery update indicating that the document identified by uniqueIdentifier has reached the given status.

Input Parameters

Name Type Description
uniqueIdentifier String The unique identifier of the document to be updated.
status fferpcore.ElectronicInvoicingDelivery.DocumentStatus The status that the document has reached.

DeliveryUpdate

global DeliveryUpdate(String uniqueIdentifier, String externalUniqueIdentifier, fferpcore.ElectronicInvoicingDelivery.DocumentStatus status)

Constructs a delivery update indicating that the document identified by uniqueIdentifier has reached the given status.

Input Parameters

Name Type Description
uniqueIdentifier String The unique identifier of the document to be updated.
externalUniqueIdentifier String The external unique identifier of the document to be updated.
status fferpcore.ElectronicInvoicingDelivery.DocumentStatus The status that the document has reached.

DeliveryUpdate

global DeliveryUpdate(String uniqueIdentifier, fferpcore.ElectronicInvoicingDelivery.DocumentStatus status, List<String> errorMessages)

Constructs a delivery update for an error status, with error messages providing additional information.

Input Parameters

Name Type Description
uniqueIdentifier String The unique identifier of the document to be updated.
status fferpcore.ElectronicInvoicingDelivery.DocumentStatus The status that the document has reached. This is expected to be a failure mode.
errorMessages List<String> Textual descriptions of all errors.

DeliveryUpdate

global DeliveryUpdate(String uniqueIdentifier, String externalUniqueIdentifier, fferpcore.ElectronicInvoicingDelivery.DocumentStatus status, List<String> errorMessages)

Constructs a delivery update for an error status, with error messages providing additional information.

Input Parameters

Name Type Description
uniqueIdentifier String The unique identifier of the document to be updated.
externalUniqueIdentifier String The external unique identifier of the document to be updated.
status fferpcore.ElectronicInvoicingDelivery.DocumentStatus The status that the document has reached. This is expected to be a failure mode.
errorMessages List<String> Textual descriptions of all errors.

getEInvoicingUniqueIdentifier

global String getEInvoicingUniqueIdentifier()

The UUID generated by our system that identifies the document to which this update pertains. This may be null if the update originated from the e-invoicing provider, in which case the invoice is identified by the getEInvoicingExternalUniqueIdentifier() method.

getDocumentStatus

global fferpcore.ElectronicInvoicingDelivery.DocumentStatus getDocumentStatus()

The current delivery status of the document.

getErrorMessages

global List<String> getErrorMessages()

Textual descriptions of the reasons that sending or delivering the e-invoice has failed.

getEInvoicingExternalUniqueIdentifier

global String getEInvoicingExternalUniqueIdentifier()

An identifier used by the e-invoicing provider to identify the invoice. This may be different from the EInvoicingUniqueIdentifier generated by our system. This may be null if the update has originated from our system, in which case the invoice is identified by the getEInvoicingUniqueIdentifier() method.

© Copyright 2009–2022 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.