Field Mappings for Sales Invoice to Electronic Invoice
When you send an Accounting sales invoice as an electronic invoice, FinancialForce converts it to an internal structured data format before passing it to Storecove. Storecove then converts it to the format required by the recipient.
The table below shows how fields on a sales invoice are mapped to the internal format, and then to Storecove. Some fields are populated with hardcoded values.
Header Field Mapping
Sales Invoice |
ElectronicInvoicingService.Document |
Storecove InvoiceSubmission |
Notes |
---|---|---|---|
Hardcoded - true | CreatePrimaryImage | createPrimaryImage | |
c2g__EInvoiceIdentifier__c | DocumentIdentifier | idempotencyGuid | |
- | Attachments | attachments | |
c2g__Account__c | AccountingCustomerParty.AccountId | invoice.accountingCustomerParty.accountId | |
c2g__Account__r.Name | AccountingCustomerParty.CompanyName | invoice.accountingCustomerParty.party.companyName | |
c2g__Account__r.c2g__CODAFinanceContact__c | AccountingCustomerParty.ContactId | invoice.accountingCustomerParty.party.contact.id | |
c2g__Account__r.c2g__CODAFinanceContact__r.Name | AccountingCustomerParty.ContactName | invoice.accountingCustomerParty.party.contact.lastName | |
c2g__Account__r.c2g__CODAInvoiceEmail__c | AccountingCustomerParty.EmailAddress | invoice.accountingCustomerParty.party.contact.email | |
c2g__Account__r.Phone | AccountingCustomerParty.Telephone | invoice.accountingCustomerParty.party.contact.phone | |
c2g__Account__r.BillingStreet | AccountingCustomerParty.PostalAddress.AddressLine1 | invoice.accountingCustomerParty.party.address.street1 | |
- | AccountingCustomerParty.PostalAddress.AddressLine2 | invoice.accountingCustomerParty.party.address.street2 | |
c2g__Account__r.BillingCity | AccountingCustomerParty.PostalAddress.CityName | invoice.accountingCustomerParty.party.address.city | |
- | AccountingCustomerParty.PostalAddress.County | invoice.accountingCustomerParty.party.address.county | |
c2g__Account__r.BillingCountry | AccountingCustomerParty.PostalAddress.Country | - | |
c2g__Account__r.c2g__CODAECCountryCode__c | AccountingCustomerParty.PostalAddress.CountryIdentificationCode | invoice.accountingCustomerParty.party.address.country | |
c2g__Account__r.BillingPostalCode | AccountingCustomerParty.PostalAddress.PostalCode | invoice.accountingCustomerParty.party.address.zip | |
c2g__Account__r.fferpcore__AccountExtension__r[0].fferpcore__EInvoicingAddressIdentifier__c | AccountingCustomerParty.PublicIdentifiers[0].Id | invoice.accountingCustomerParty.publicIdentifiers[0].id | |
c2g__Account__r.fferpcore__AccountExtension__r[0].fferpcore__EInvoicingSchemeID__c | AccountingCustomerParty.PublicIdentifiers[0].Scheme | invoice.accountingCustomerParty.publicIdentifiers[0].scheme | |
c2g__Account__r.c2g__CODAVATRegistrationNumber__c | AccountingCustomerParty.PublicIdentifiers[1].Id | invoice.accountingCustomerParty.publicIdentifiers[1].id | |
c2g__Account__r.c2g__CODAECCountryCode__c | AccountingCustomerParty.PublicIdentifiers[1].Scheme | invoice.accountingCustomerParty.publicIdentifiers[1].scheme | Country code is used to work out the appropriate scheme for a VAT identifier for this country (in FFA code). |
- | AccountingSupplierParty.ContactName | invoice.accountingSupplierParty.party.contact.lastName | |
c2g__OwnerCompany__r.c2g__ContactEmail__c | AccountingSupplierParty.EmailAddress | invoice.accountingSupplierParty.party.contact.email | |
c2g__OwnerCompany__r.c2g__Phone__c | AccountingSupplierParty.Telephone | invoice.accountingSupplierParty.party.contact.phone | |
Name | InvoiceNumber | invoice.invoiceNumber | |
Hardcoded - INVOICE | DocumentType | - | In Storecove, prices are negated if type is CREDIT_NOTE. |
c2g__InvoiceDate__c | IssueDate | invoice.issueDate | |
c2g__InvoiceDate__c | TaxPointDate | ||
c2g__DueDate__c | DueDate | invoice.dueDate | |
c2g__InvoiceTotal__c | DocumentTotal | invoice.amountIncludingVat | Amount is negated if the document is a credit note. |
c2g__CustomerReference__c | CustomerReference | invoice.buyerReference | |
c2g__CustomerReference__c | CustomerOrderReference | invoice.orderReference | |
Hardcoded - false | ConsumerTaxMode | invoice.consumerTaxMode | |
c2g__Currency__c | DocumentCurrencyCode | invoice.documentCurrencyCode | |
c2g__OwnerCompany__r.c2g__EInvoicingLegalEntityID__c | LegalEntityId | legalEntityId | |
c2g__Account__r.fferpcore__AccountExtensions__r[0].fferpcore__EInvoicingAddressIdentifier__c | Routing.EIdentifiers[0].Id | routing.eIdentifiers[0].id | |
c2g__Account__r.fferpcore__AccountExtensions__r[0].fferpcore__EInvoicingSchemeID__c | Routing.EIdentifiers[0].Scheme | routing.eIdentifiers[0].scheme | |
c2g__Account__r.c2g__CODAVATRegistrationNumber__c | Routing.EIdentifiers[1].Id | routing.eIdentifiers[1].id | |
c2g__Account__r.c2g__CODAECCountryCode__c | Routing.EIdentifiers[1].Scheme | routing.eIdentifiers[1].scheme | Country code is used to work out the appropriate scheme for a VAT identifier for this country. |
c2g__Account__r.c2g__CODAInvoiceEmail__c | Routing.Emails[0] | routing.emails | |
- | AccountingCostCentre | invoice.accountingCost | |
- | AllowanceCharges | invoice.allowanceCharges | |
- | PrepaidAmount | invoice.prepaidAmount | Amount is negated if the document is a credit note. |
- | BillingReference | invoice.billingReference | |
- | ContractDocumentReference | invoice.contractDocumentReference | |
- | Note | invoice.note | |
- | InvoicePeriod | invoice.invoicePeriod | |
- | PaymentMeans | invoice.paymentMeansArray | |
- | Delivery.ActualDate | invoice.delivery.actualDate | |
- | Delivery.Quantity | invoice.delivery.quantity | |
- | Delivery.Location.Id | invoice.delivery.location.id | |
- | Delivery.Location.SchemeAgencyId | invoice.delivery.location.schemeAgencyId | |
- | Delivery.Location.SchemeId | invoice.delivery.location.schemeId | |
- | DeliveryAddress | invoice.delivery.location.address | |
- | PaymentTerms | invoice.paymentTerms | |
- | ProjectReference | invoice.projectReference | |
- | SalesOrderId | invoice.salesOrderId | |
- | TaxPointDate | invoice.taxPointDate | |
- | TaxSubtotals | invoice.taxSubtotals | These are worked out automatically from the taxes on the lines. |
- | UblExtensions | invoice.ublExtensions | |
- | - | invoice.taxSystem | Hardcoded to either 'tax_line_percentages' or 'tax_no_tax', depending on whether there is any tax information. |
Line Field Mapping
Sales Invoice Line Item |
ElectronicInvoicingService.DocumentLine |
Storecove InvoiceLine |
Notes |
---|---|---|---|
c2g__LineNumber__c | LineId | lineId | |
c2g__LineDescription__c | Description | description | |
c2g__Product__r.Name | ItemName | name | |
c2g__ProductCode__c | SellersItemIdentification | sellersItemIdentification | |
c2g__UnitPrice__c | UnitPrice | itemPrice | Amount is negated if the document is a credit note. |
c2g__Quantity__c | Quantity | quantity | |
c2g__NetValue__c | NetValue | amountExcludingVat | Amount is negated if the document is a credit note. Rounded to 2 decimal places. |
c2g__TaxValue1__c | TaxBreakdown[0].Amount | taxes_duties_fees[0].amount | Amount is negated if the document is a credit note. Rounded to 2 decimal places. |
c2g__OwnerCompany__r.c2g__ECCountryCode__c | TaxBreakdown[0].CountryIdentificationCode | taxes_duties_fees[0].country | |
c2g__TaxRate1__c | TaxBreakdown[0].Percent | taxes_duties_fees[0].percentage | Rounded to 2 decimal places. |
c2g__OwnerCompany__r.EInvoicingTaxCategory__c | TaxBreakdown[0].TaxCode | taxes_duties_fees[0].category | |
c2g__TaxValue2__c | TaxBreakdown[1].Amount | taxes_duties_fees[1].amount | Amount is negated if the document is a credit note. Rounded to 2 decimal places. |
c2g__OwnerCompany__r.c2g__ECCountryCode__c | TaxBreakdown[1].CountryIdentificationCode | taxes_duties_fees[1].country | |
c2g__TaxRate2__c | TaxBreakdown[1].Percent | taxes_duties_fees[1].percentage | Rounded to 2 decimal places. |
c2g__OwnerCompany__r.EInvoicingTaxCategory__c | TaxBreakdown[1].TaxCode | taxes_duties_fees[1].category | |
c2g__TaxValue3__c | TaxBreakdown[2].Amount | taxes_duties_fees[2].amount | Amount is negated if the document is a credit note. Rounded to 2 decimal places. |
c2g__OwnerCompany__r.c2g__ECCountryCode__c | TaxBreakdown[2].CountryIdentificationCode | taxes_duties_fees[2].country | |
c2g__TaxRate3__c | TaxBreakdown[2].Percent | taxes_duties_fees[2].percentage | Rounded to 2 decimal places. |
c2g__OwnerCompany__r.EInvoicingTaxCategory__c | TaxBreakdown[2].TaxCode | taxes_duties_fees[2].category | |
- | AccountingCostCentre | accountingCost | |
- | AdditionalItemProperties | additionalItemProperties | |
- | DiscountAmount | allowanceCharge | Value is negated, unless the document is a credit note. |
- | CustomerItemIdentification | buyersItemIdentification | |
- | Period | invoicePeriod | |
- | OrderLineReferenceLineId | orderLineReferenceLineId | |
- | UnitCode | quantityUnitCode | |
- | StandardItemIdentification | standardItemIdentification | |
- | StandardItemIdentificationSchemeAgencyId | standardItemIdentificationSchemeAgencyId | |
- | StandardItemIdentificationSchemeId | standardItemIdentificationSchemeId | |
- | Delivery.ActualDate | delivery.actualDate | |
- | Delivery.Quantity | delivery.quantity | |
- | Delivery.Location.Id | delivery.location.id | |
- | Delivery.Location.SchemeAgencyId | delivery.location.schemeAgencyId | |
- | Delivery.Location.SchemeId | delivery.location.schemeId | |
- | DeliveryAddress | delivery.location.address |
Notes About Line-Level Tax Details
- A sales invoice line item can have up to three taxes but Storecove only handles one. If you populate the sales invoice line item fields for more than one tax, Storecove will report an error.
- The E-Invoicing Tax Category field on the Accounting Company (c2g__OwnerCompany__r.EInvoicingTaxCategory__c) is a picklist of values specified by Storecove. For the list of possible values, see Storecove's API documentation for tax category:
https://www.storecove.com/docs/#_openapi_tax