A Graph record is an object that’s a part of the graph structure, representing both the fields and relationships among different objects. Each record in the graph can contain attributes, which are fields of the object, and references to other related records.
Invoice ingestion supports a Graph record count of 500. The supported Graph attribute types for invoice ingestion are Account, Contact, Invoice, InvoiceLine, InvoiceLineTax, and InvoiceAddressGroup.
A Graph record has these properties and associated fields.
Field
Description
referenceId
Unique identifier of the record that’s used to reference the record in the graph.
record
Object containing the actual data for the record.
record.attributes.type
Standard object of the referenced record. In this scenario, this field indicates an InvoiceAddressGroup attribute type.
record.attributes.method
Method that defines the operation on the record. For example, POST to create a record, PUT to update a record, or GET to get record data.
JSON Example
1{2 "referenceId": "refBillingAddress",3 "record": {4 "attributes": {5 "type": "InvoiceAddressGroup",6 "method": "POST"7 },8 //Contains the actual data9 }10}
Account Record
Keep these considerations in mind when you specify an Account record as the Graph attribute type.
The supported Graph attribute method is GET only.
The supported record count that you can specify for each account is one only.
Keep these considerations in mind when you specify an Invoice record as the Graph attribute type.
The supported Graph attribute method is POST only.
The supported record count that you can specify for Invoice is one only.
An invoice with Draft status can’t have a posted date.
You can’t use an invoice with Draft status when the taxCalculationStatus property value is Posted. The taxCalculationStatus property must be Estimated or Pending.
You can’t use an invoice with Posted status when the shouldCalculateTax property is true.
An invoice with Posted status can’t include the Estimated or Pending as the taxCalculationStatus property values. The tax processing status must be Posted.
An invoice with Posted status with an invoice line marked as taxable must include an invoiceLineTax for that invoice line.
An invoice with Posted status with an invoice line marked as nontaxable must not include an invoiceLineTax for that invoice line.
The invoice.CreationMode field value is External. This field differentiates the invoices created from a billing schedule or an invoice ingestion. For invoices created from a billing schedule, the value is Salesforce. For invoices created from an invoice ingestion, the value is External.
The due date of an invoice graph is in the future or with a valid payment term, or your Salesforce org has a default payment term set.
Billing account associated with this invoice, which you can resolve with the externalId field by using the GET method.
Required
billToContactId
Invoice.billToContactId
Contact to whom the invoice is billed, which you can resolve with the externalId field by using the GET method.
Required
paymentTermId
Invoice.paymentTermId
Payment term associated with the invoice. If a value isn’t specified, then the default payment term ID is used.
Optional
referenceEntityId
Invoice.referenceEntityId
Reference to a related object, if applicable. To generate invoices from debit memos, specify the debit memo ID as the property value. Make sure that the debit memo is in Posted status. Available in API version 66.0 and later. The invoice is generated in Draft status.
Optional
status
Invoice.status
Status of the invoice. Valid values are Draft or Posted. The default value is Draft.
Optional
currencyIsoCode
Invoice.currencyIsoCode
ISO code representing the currency of the invoice. This property must be specified if multi-currency is enabled in the organization.
Optional
dueDate
Invoice.dueDate
Due date for the invoice payment. If a value isn’t specified, then this value is set based on the payment term.
Optional
postedDate
Invoice.postedDate
Date the invoice was posted to the system. Until API version 64.0, the default value is the current date irrespective of the value that’s specified in the input payload. In API version 65.0 and later, the posted date specified in the input payload is considered.
Required in API version 65.0 and later.
invoiceNumber
Invoice.invoiceNumber
Unique identifier for the invoice.
Optional
uniqueIdentifier
Invoice.uniqueIdentifier
Unique identifier for the invoice. This property is used as the idempotency key to avoid duplicate invoice generation.
Optional
description
Invoice.description
Short description of the invoice or the billed items.
Optional
shouldExcludePayment
Invoice.shouldExcludePayment
Indicates whether to exclude the payment during invoice generation and skip creating payment schedules and payment schedule items for the invoice (true) or not (false). The default value is false. Available in API version 68.0 and later.
Optional
paymentExclusionReason
Invoice.paymentExclusionReason
Reason for excluding the payment for the invoice. Available in API version 68.0 and later.
Optional
Invoice Line Record
Keep these considerations in mind when you specify an Invoice Line record as the Graph attribute type.
The supported Graph attribute method is POST only.
The Graph must include at least one Graph record with the InvoiceLine attribute type.
The invoice line end date must be greater than or equal to the invoice line start date.
Start date for the invoice line period. For example, the date when the product or service is provided.
Required
invoiceLineEndDate
InvoiceLine.invoiceLineEndDate
End date for the invoice line period. For example, the date when the product or service ends.
Required
quantity
InvoiceLine.quantity
Quantity of the product or billed service in this invoice line.
Required
unitPrice
InvoiceLine.unitPrice
Price per unit of the product or billed service.
Required
chargeAmount
InvoiceLine.chargeAmount
Total charge amount for this invoice line, which is calculated as quantity * unit price.
Required
invoiceId
InvoiceLine.invoiceId
Reference to the invoice that this invoice line is associated with.
Required
shippingAddressId
InvoiceLine.shippingAddressId
Shipping address associated with this invoice line.
Required
billingAddressId
InvoiceLine.billingAddressId
Billing address associated with this invoice line.
Required
referenceEntityItemId
InvoiceLine.referenceEntityItemId
Reference to a related object record for this invoice line.
Optional
taxTreatmentId
InvoiceLine.taxTreatmentId
Tax treatment applied to this invoice line such as taxable or nontaxable. If the TaxTreatmentId property isn’t specified in the request, it’s retrieved from the organization’s default values. If the organization’s defaults aren’t set, an error is thrown.
Optional
legalEntityId
InvoiceLine.legalEntityId
Legal entity that this invoice line belongs to. If the LegalEntityId property isn’t specified in the request, it’s retrieved from the organization’s default values. If the organization’s defaults aren’t set, an error is thrown.
Optional
legalEntityAccountingPeriodId
InvoiceLine.legalEntityAccountingPeriodId
Accounting period for the legal entity that this invoice line belongs to.
Optional
product2Id
InvoiceLine.product2Id
Identifier for the product that’s billed in this invoice line.
Optional
usageProductId
InvoiceLine.usageProductId
Identifier for the usage-based product if this invoice line is for usage-based billing.
Optional
isUsageBasedInvoiceLine
InvoiceLine.isUsageBasedInvoiceLine
Boolean value that indicates whether this invoice line is for a usage-based product (true) or not (false).
Optional
usageOverageQuantity
InvoiceLine.usageOverageQuantity
Quantity of usage overage for this invoice line, if applicable.
Optional
unitOfMeasureId
InvoiceLine.unitOfMeasureId
Identifier for the unit of measure for the product or service, such as each, kg, or lb.
Optional
description
InvoiceLine.description
Description of the invoice line item with additional details.
Optional
Tax Record
Keep these considerations in mind when you specify a Tax record as the Graph attribute type.
The supported Graph attribute method is POST only.
The associated standard object is InvoiceLineTax.
The invoiceLineTax graph record must not include the taxCalculationStatus property value as Pending.