Sale Invoices
5 min
Sale invoices
The invoices you issue to customers.
Query
query GetSaleInvoices($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int, $after: String) {
documents {
saleInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
key
documentType
number
series
date
dueDate
createdOn
status
company { key name fiscalCode }
customer { key id firstName lastName personalIdentificationNumber externalCode }
products {
quantity
amount
vatAmount
vatRate
discount
costAmount
saleAccount
accountingProductType
product { key name code }
warehouse { key name }
}
}
}
}
}Variables
{
"organization": "<organization key>",
"dateBegin": "2026-10-01T00:00:00",
"dateEnd": "2026-10-31T23:59:59",
"first": 30,
"after": null
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetSaleInvoices($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int, $after: String) { documents { saleInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first, after: $after) { totalCount pageInfo { hasNextPage endCursor } items { key documentType number series date dueDate createdOn status company { key name fiscalCode } customer { key id firstName lastName personalIdentificationNumber externalCode } products { quantity amount vatAmount vatRate discount costAmount saleAccount accountingProductType product { key name code } warehouse { key name } } } } } }", "variables": {"organization": "<organization key>", "dateBegin": "2026-10-01T00:00:00", "dateEnd": "2026-10-31T23:59:59", "first": 30, "after": null}}'Response
{
"data": {
"documents": {
"saleInvoices": {
"totalCount": 1,
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ=="
},
"items": [
{
"key": 2001,
"documentType": "FacturaFiscala",
"number": "1001",
"series": "EXP",
"date": "2026-10-06T00:00:00",
"dueDate": "2026-10-20T00:00:00",
"createdOn": "2026-10-06T09:00:00",
"status": "Finalized",
"company": {
"key": "00000000-0000-0000-0000-000000000002",
"name": "Example Supplier SRL",
"fiscalCode": "87654321"
},
"customer": null,
"products": [
{
"quantity": 5.0,
"amount": 50.0,
"vatAmount": 10.5,
"vatRate": 21.0,
"discount": 0.0,
"costAmount": 30.0,
"saleAccount": "707",
"accountingProductType": "Merchandise",
"product": {
"key": "00000000-0000-0000-0000-000000000003",
"name": "Flour 1 kg",
"code": "P001"
},
"warehouse": {
"key": "00000000-0000-0000-0000-000000000004",
"name": "Main warehouse"
}
}
]
}
]
}
}
}
}A sale invoice has a company (a business customer) or a customer (a person). saleAccount and accountingProductType help you post the invoice. See Accounting Notes and Accounts.
Business day sale invoices
The invoices that come from the cash register orders of a business day.
Query
query GetBusinessDaySaleInvoices($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int, $after: String) {
documents {
businessDaySaleInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
id
key
documentType
number
series
date
dueDate
createdOn
delegate
company { key name fiscalCode }
location { key name }
customer { key firstName lastName }
products {
quantity
amount
vatAmount
vatRate
product { key name }
}
orders {
key
number
createdOn
isRefund
}
}
}
}
}Variables
{
"organization": "<organization key>",
"dateBegin": "2026-10-01T00:00:00",
"dateEnd": "2026-10-31T23:59:59",
"first": 30,
"after": null
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetBusinessDaySaleInvoices($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int, $after: String) { documents { businessDaySaleInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first, after: $after) { totalCount pageInfo { hasNextPage endCursor } items { id key documentType number series date dueDate createdOn delegate company { key name fiscalCode } location { key name } customer { key firstName lastName } products { quantity amount vatAmount vatRate product { key name } } orders { key number createdOn isRefund } } } } }", "variables": {"organization": "<organization key>", "dateBegin": "2026-10-01T00:00:00", "dateEnd": "2026-10-31T23:59:59", "first": 30, "after": null}}'Response
{
"data": {
"documents": {
"businessDaySaleInvoices": {
"totalCount": 1,
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ=="
},
"items": [
{
"id": 1,
"key": "00000000-0000-0000-0000-000000000020",
"documentType": "FacturaFiscala",
"number": 301,
"series": "EXP",
"date": "2026-10-06T00:00:00",
"dueDate": null,
"createdOn": "2026-10-06T22:00:00",
"delegate": null,
"company": {
"key": "00000000-0000-0000-0000-000000000002",
"name": "Example Supplier SRL",
"fiscalCode": "87654321"
},
"location": {
"key": "00000000-0000-0000-0000-000000000005",
"name": "Downtown Store"
},
"customer": null,
"products": [
{
"quantity": 2.0,
"amount": 20.0,
"vatAmount": 4.2,
"vatRate": 21.0,
"product": {
"key": "00000000-0000-0000-0000-000000000003",
"name": "Flour 1 kg",
"code": "P001"
}
}
],
"orders": [
{
"key": "00000000-0000-0000-0000-000000000021",
"number": 17,
"createdOn": "2026-10-06T12:10:00",
"isRefund": false
}
]
}
]
}
}
}
}Here key is a GUID and number is a number. Each invoice lists the orders it was made from.