It is possible to query either salesInvoice or directly from salesInvoiceLines.
Querying salesInvoice allows you to retrieve entire documents with all their associated line items.
This is useful when you need the complete context of a document, including all details of the related lines.
Querying salesInvoiceLines directly is beneficial when you want to filter or aggregate specific line item data across multiple documents, such as analyzing product sales, quantities, or prices.
Both known as Sales Invoices in the API context and in the product interface.
This resource is pivotal for invoicing customers after order fulfillment and serves as a legally binding request for payment.
The Sales Invoices entity leverages both standard and custom fields, allowing businesses to create detailed invoices that include necessary information like customer codes, discounts, product lines, and tax details.
This ensures compliance and contributes to a smoother accounts receivable process.
Workflow
Create the Invoice and Optionally View or Modify It: Start by creating a sales invoice using the SalesInvoice service.
Once created, you can view and make any necessary modifications to the invoice before finalizing it.
Close the Invoice to Prevent Further Modifications: Use the CloseSalesInvoice service to confirm the invoice.
This action locks the invoice, ensuring that its content cannot be changed. This step is essential for securing the invoice details before posting.
Post the Invoice to Generate Accounting Entries: After closing, proceed with posting the invoice using the PostSalesInvoice service.
Posting the invoice will generate the necessary accounting entries, making the invoice part of the company’s financial records.
View the Invoice’s Payment Due Dates: Check the payment due dates and related information using the SalesInvoiceOpenItems service.
This allows you to see when payments are expected and track outstanding amounts for the invoice.
Apply Partial or Full Payments to the Invoice: Manage the payments on the invoice by using the SalesOpenItemSettlement service.
You can apply both partial and full payments, keeping track of amounts paid and any remaining balances.
Generate a Credit Note if Necessary: In case of returns, refunds, or corrections, you can issue a credit note related to the invoice using the generateCreditNote service.
DateTime DateThe GraphQL field type is DateTime, but only the date value is considered, the time value is ignored if provided.
Date of operation See InfoAdditional information is available in the Info block below
salesOrderNumber
String
External Order Number See InfoAdditional information is available in the Info block below
250
type
NORMAL
CREDIT_NOTE
Document type
hasCreditNote
Boolean
Indicates whether a credit note exists: true/false
firstDueDate NEWNew Feature Recently Added
DateTime DateThe GraphQL field type is DateTime, but only the date value is considered, the time value is ignored if provided.
The first due date for payment of the invoice
openItems[] COMING SOON This feature is currently in development and will be available in the next version. It’s already documented to keep you informed about its upcoming availability
Array
open Items
Specific to sales invoice documents type CREDIT_NOTE
Fields
Type
Description
sourceSalesInvoiceId
UUID
ID of the invoice if the type is CREDIT_NOTE
sourceSalesInvoiceDATALOADERUtilize the DATALOADER feature to enrich your query by adding additional resource fields directly in the query.
UUID
Fields of salesInvoice if the type is CREDIT_NOTE
Info
customerId: A unique identifier (UUID) for the Customer entity.
discount: Represents the total discount that has been applied to the document.
Indicates whether a customer is subject to the equivalence surcharge regime.
The equivalence surcharge (totalFeeSurcharge), as applied in Spain, is a form of simplified VAT for retail traders who cannot recover VAT.
The rates of the equivalence surcharge vary according to the VAT rate applicable to the products, with surcharge rates of 5.2% for products with a general VAT of 21%, 1.4% for products with a reduced VAT of 10%, and other rates for different products or categories.
The equivalence surcharge is calculated on amount of general VAT (totalVatFee).
unused for the German market
socialName :
mandatory for the French market
no mandatory for the Spanish market
no mandatory for the Germany market
Specific to sales invoice documents
operationDate: Represents the date on which the operation related to the sales invoice was carried out (Fulfillment date).
salesOrderNumber: This field allows the entry of an order number that has not been entered in Sage Active.
Additionally, this field can also accept an external invoice number in the context of importing invoices not entered in Sage Active.
Default value if not specified : “unspecified”
statusUPDATEDModifications have been made to the properties or attributes of this object recently.
Pending: (Draft) The invoice can be modified; it has not yet been transferred to accounting.
Closed: (Unposted) The invoice can no longer be modified; it was supposed to be transferred to accounting, but the operation failed or was canceled.
Posted: (Awaiting collection) The invoice can no longer be modified; it has been transferred to accounting.
PartiallyCollectedNEWNew Feature Recently Added: (Partially collected) The invoice is partially settled. Payments are pending.
CollectedNEWNew Feature Recently Added: (Collected) The invoice is fully settled.
PartiallyOverdueNEWNew Feature Recently Added: (Partially overdue) The invoice is partially settled. Payments are overdue.
OverdueNEWNew Feature Recently Added: (Overdue) The invoice is not settled. All payments are overdue.
vatNumber :
mandatory for VIES customers
no mandatory for Spanish market
no mandatory for Germany market
documentId :
no mandatory for French market
mandatory for not VIES customers
no mandatory for Germany market
salesInvoices/lines
Common to all documents
Fields
Type
Description
Length
idSSystem field that cannot be assigned
UUID
Id
creationDate SSystem field that cannot be assigned
DateTime
Date of creation
modificationDate SSystem field that cannot be assigned
DateTime
Last modification date
Product Information
productDATALOADERUtilize the DATALOADER feature to enrich your query by adding additional resource fields directly in the query.
ID of the sales delivery note line See InfoAdditional information is available in the Info block below
Info
firstDiscount: Various levels of discounts applicable to the document line. These are optional fields and are usually filled in based on promotional schemes or contractual obligations.
productId: The unique identifier for the product. Automatically filled when selecting a product.
vatPercentage: The percentage of Value Added Tax (VAT) applicable to this line. Important for accounting and for generating accurate invoices.
equivalenceSurchargePercentage: The percentage of equivalence surcharge applied in Spain .
Specific to sales invoice document lines
salesDeliveryNoteLineId: The unique identifier for the delivery note line that is associated with this sales invoice line.
salesInvoices/openItems COMING SOON This feature is currently in development and will be available in the next version. It’s already documented to keep you informed about its upcoming availability
An Open Item is a financial transaction that allows you to know if it has been fully settled or paid.
Each open item includes detailed information such as the total amount, accumulated amount paid, and the payment due date.
For a single invoice, there can be as many open items as there are different payment installments, which is why openItems is structured as an array to accommodate multiple entries per invoice.
The payment status provides insight into the progress of settling each item.
Additionally, the identifier of the payment method used is provided to track the settlement method.
Fields
Type
Description
idSSystem field that cannot be assigned
UUID
Unique identifier of the item
amount
Decimal
Total amount of the item See InfoAdditional information is available in the Info block below
creationDate
DateTime
Creation date of the item
modificationDate
DateTime
Last modification date of the item, null if not modified
paidAmountAccumulated
Decimal
Accumulated amount that has been paid See InfoAdditional information is available in the Info block below
dueDate
DateTime
Due date for the payment See InfoAdditional information is available in the Info block below
status
NOT_SPECIFIED
COLLECTED
PARTIAL
Status of the payment See InfoAdditional information is available in the Info block below
paymentMeanDATALOADERUtilize the DATALOADER feature to enrich your query by adding additional resource fields directly in the query.
creationDate : Indicates when the item was initially created.
modificationDate : Timestamp of the last update to the item, null if no updates have been made.
paidAmountAccumulated : Total amount that has been paid towards the item up to the current date.
dueDate : Date by which the payment for the item is due.
status: Represents the current status of the payment, indicating the extent to which the item has been settled. The possible values are:
NOT_SPECIFIED: No specific payment status has been detailed.
COLLECTED: Payment has been fully collected from customers.
PARTIAL: Payment for the item has been made partially.
salesInvoices/addresses
Common to all documents
Do not use the addresses[] array.
Instead, use mainAddress for the primary address and deliveryAddress for the delivery address.
Each of these objects contains only one address, representing a singular primary or delivery address, respectively.
countryDATALOADERUtilize the DATALOADER feature to enrich your query by adding additional resource fields directly in the query.
String
Fields of Country
countryIsoCodeAlpha2MutThis field can only be used in mutations, not in queries
String
Country Code See InfoAdditional information is available in the Info block below
2
countryNameRThis field is read-only, its value cannot be assigned
String
CountryName
name
String
Code
50
firstLine
String
First Line
35
secondLine
String
Second Line
35
city
String
Town
35
zipCode
String
Postal Code
9
province
String
Province
25
Info
countryIsoCodeAlpha2 : ISO2 country code.
This field can be used for creation and serves as a simple alternative to assign the country of the address by using the ISO2 code directly, rather than the country ID in the Countries resource.