Foundations Apex API Developer Reference

fferpcore.ElectronicInvoicingDelivery

global with sharing class ElectronicInvoicingDelivery

Interfaces and data structures used to notify interested parties of updates during the delivery of an electronic invoice. To receive notifications, 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 'ElectronicInvoicingDelivery.IEInvoiceUpdateListener'.

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.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–2021 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.