SalesInvoice
HTTP | Operation | Type | Object | DTO Why-DTOs? |
---|---|---|---|---|
Mutation | createSalesInvoice |
SalesInvoiceCreateGLDtoInput |
||
Mutation | updateSalesInvoice |
SalesInvoiceUpdateGLDtoInput |
||
Mutation | deleteSalesInvoice |
SalesInvoiceDeleteGLDtoInput |
||
Query | salesInvoices filtered by id Why? |
|||
Query | salesInvoices |
|||
Query | salesInvoiceLines |
Description
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.
To see examples of mutations that include the adding of Invoice :
download the Postman collection: Quick start / 5. Test your first query in Postman
Would you like to see an example of how to add an invoice?
graphQL Mutation
mutation ($values: SalesInvoiceCreateGLDtoInput!) {
createSalesInvoice(input: $values) {
id
}
}
graphQL Variables
{
"values": {
"customerId": "{customerId}",
"documentDate": "2023-12-05",
"lines": [
{
"productId": "{productId1}",
"totalQuantity": 50,
"unitPrice": 11,
"firstDiscount": 5
},
{
"productId": "{productId2}",
"totalQuantity": 1,
"unitPrice": 140
}
]
}
}
Header
Key | Value |
---|---|
Authorization |
Bearer Current access Token How to find? |
X-TenantId |
Current tenant id How to find? |
X-OrganizationId |
Current organization Id How to find? |
x-api-key |
Primary or secondary subscription key of your app How to find? |
salesInvoices
Common to all documents
Fields | Type | Description | Length |
---|---|---|---|
id | UUID | Id | |
creationDate |
DateTime | Creation Date | |
modificationDate |
DateTime | Modification Date | |
General Infos | |||
customer |
Customer | Fields of Customer | |
customerId |
UUID | ID of the Customer entity. No mandatory for Quote |
|
documentDate | DateTime |
Document Date | |
operationalNumber | String | Document Number | 50 |
status | String |
|
15 |
socialName |
String | Social Name |
50 |
contactName | String | Contact Name | 50 |
contactPhone | String | Contact Phone | 15 |
contactEmail | String | Contact Email | 50 |
countryAcronym | String | Country Acronym | 2 |
Invoice Lines | |||
lines[] |
Array | Document Lines | |
Totals and discount | |||
totalGross | Decimal | Total Gross | |
totalDiscount | Decimal | Total Discount | |
totalNet | Decimal | Total Net | |
discount | Decimal | Discount |
|
totalCustomerDiscount | Decimal | Total discount specific to the customer | |
totalLiquid | Decimal | Total Liquid | |
totalVat | Decimal | Total Vat | |
totalVatBase | Decimal | Total Vat Base | |
totalFeeSurcharge | Decimal | Total Vat Surcharge |
|
totalVatFee | Decimal | Total Surcharge Base |
|
Notes | |||
comments | String | Comments | 1000 |
remarks | String | Remarks | 1000 |
Customer Information | |||
documentID | String | Identification Number |
20 |
vatNumber | String | Vat Number |
20 |
invoiceEmail | String | Invoice Email | 50 |
hasEquivalenceSurcharge | Boolean | Subject to the equivalence surcharge regime |
|
mainAddress | ObjectType | Main Address | |
deliveryAddress | ObjectType | Delivery Address | |
salesDiscountGroup |
SalesDiscount | Fields of SalesDiscount | |
salesDiscountGroupId | UUID | Sales Discount ID | |
salesTariff |
SalesTariff | Fields of SalesTariff | |
salesTariffId | UUID | Sales tariff ID |
Specific to sales invoice documents
Fields | Type | Description | Length |
---|---|---|---|
operationDate | DateTime |
Date of operation |
|
salesOrderNumber |
String | External Order Number |
250 |
Info
- customerId: A unique identifier (UUID) for the Customer entity.
- discount: Represents the total discount that has been applied to the document.
- hasEquivalenceSurcharge/totalFeeSurcharge/totalVatFee :
unused for the French market
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.
- 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” - status
Pending
: (Draft) The invoice can be modified; it has not yet been transferred to accounting.Posted
: (Posted) The invoice can no longer be modified; it has been transferred to accounting.Closed
: (Created) The invoice can no longer be modified; it was supposed to be transferred to accounting, but the operation failed or was canceled.
- 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 |
---|---|---|---|
id |
UUID | Id | |
creationDate |
DateTime | Date of creation | |
modificationDate |
DateTime | Last modification date | |
Product Information | |||
product |
Product | Fields of Product | 36 |
productId | UUID | Product ID |
|
productCode | String | Product code | 15 |
productName | String | Product name | 100 |
Tax and Price Information | |||
totalQuantity | Int | Quantity product | |
unitPrice | Decimal | Unit price | |
totalNet | Decimal | Net price | |
vatPercentage |
Decimal | VAT percentage |
|
equivalenceSurchargePercentage |
Decimal | Surcharge percentage |
|
Discounts | |||
firstDiscount | Decimal | First discount percentage |
Specific to sales invoice document lines
Fields | Type | Description | Length |
---|---|---|---|
salesDeliveryNoteLineId | UUID | ID of the sales delivery note line |
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/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.
Fields | Type | Description | Length |
---|---|---|---|
countryId | UUID | Country Id | |
countryIsoCodeAlpha2 | String | Country Code |
2 |
countryName |
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.