Przejdź do głównej zawartości

List invoices

POST
/invoices.list
curl --request POST \
--url https://api.sancho-wms.pl/v1/invoices.list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "cursor": "example", "filters": { "documentNumber": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "externalNumber": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "issueDate": { "$gt": "2026-04-15T12:00:00Z", "$gte": "2026-04-15T12:00:00Z", "$lt": "2026-04-15T12:00:00Z", "$lte": "2026-04-15T12:00:00Z", "$meta": { "preset": "example", "scoped": true } }, "status": { "$eq": "draft", "$ne": "draft", "$in": [ "draft" ], "$nin": [ "draft" ], "$meta": { "preset": "example", "scoped": true } }, "kind": { "$eq": "purchase", "$ne": "purchase", "$in": [ "purchase" ], "$nin": [ "purchase" ], "$meta": { "preset": "example", "scoped": true } }, "documentSymbol": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "subject": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "totalNet": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "totalGross": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "integrationId": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } } }, "sort": { "field": "id", "dir": "asc" }, "limit": 100, "q": "example" }'

Lists purchase and sales invoices, with their lines, from the key’s integrations. Send the response’s nextCursor back as cursor, with the same q, filters and sort, until no nextCursor comes back; limit (default and maximum 100) applies to each integration, and an integration that failed to answer is named in failedIntegrationIds. q is a text search and filters narrows by field with operators such as $eq and $in, including integrationId ($eq or $in) to read only some integrations.

Media typeapplication/json
object
cursor
string
filters
object
documentNumber
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
externalNumber
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
issueDate
InstantCondition

Each bound is a UTC instant ending in Z.

object
$gt
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
$gte
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
$lt
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
$lte
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
$meta
object
preset
string
scoped
boolean
status
object
$eq
string
Allowed values: draft committed cancelled
$ne
string
Allowed values: draft committed cancelled
$in
Array<string>
Allowed values: draft committed cancelled
$nin
Array<string>
Allowed values: draft committed cancelled
$meta
object
preset
string
scoped
boolean
kind
object
$eq
string
Allowed values: purchase sales
$ne
string
Allowed values: purchase sales
$in
Array<string>
Allowed values: purchase sales
$nin
Array<string>
Allowed values: purchase sales
$meta
object
preset
string
scoped
boolean
documentSymbol
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
subject
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
totalNet
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
totalGross
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
integrationId
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
sort
object
field
required
string
Allowed values: id documentNumber issueDate paymentDueDate totalNet totalGross
dir
required
string
Allowed values: asc desc
limit
integer
default: 100 > 0 <= 100
q
string
>= 1 characters

Successful response

Media typeapplication/json
InvoicePage
object
items
required
Array<object>
Invoice
One of: discriminator: integrationType
ComarchOptimaInvoice
object
id
required
number | string
type
required
string
Allowed value: invoice
kind
required
string
Allowed values: purchase sales
documentNumber
required
string | null
externalNumber
required
string | null
issueDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
saleDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
paymentDueDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
currency
required
string | null
exchangeRate
required
Any of:
DocumentExchangeRateOutput
object
rate
required
number
units
required
number
date
required
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
sourceId
required
number
warehouse
required
Any of:
object
id
required
number | string
code
required
string | null
name
required
string | null
totalNet
required
number | null
totalGross
required
number | null
totalVat
required
number | null
status
required
string
Allowed values: draft committed cancelled
documentSymbol
required
string | null
accountingDocumentId
required
number | null
relatedDocuments
required
Array<object>
default:
RelatedDocumentOutput
One of: discriminator: integrationType
IntegrationRelatedDocumentOutput
One of: discriminator: integrationType
object
label
required
string | null
linkId
required
number | null
integrationType
required
string
Allowed values: comarch-optima erp-next fakturownia comarch-bmp custom
integrationId
required
number
id
required
number | string
type
required
string
Allowed value: goodsReceivedNote
kind
required
string
Allowed values: external internal
modifiedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
modifiedBy
required
string | null
integrationId
required
number
integrationType
required
string
Allowed value: comarch-optima
subject
required
Any of:
DocumentSubject
object
id
required
number | string
code
required
string | null
name
required
string
taxId
required
string | null
address
required
string | null
city
required
string | null
postalCode
required
string | null
country
required
string | null
countryCode
required
string | null
status
required
string
Allowed values: draft committed
active
required
boolean | null
vatTransactionKind
required
Any of:
string
Allowed values: domestic nonEu nonEuVatRefund intraCommunity intraCommunityTriangular domesticBuyerLiable outsideCountry outsideCountryNp intraCommunityBuyerLiable nonEuBuyerLiable ossProcedure smeProcedure
taxIdCountry
required
string | null
currency
required
string | null
kind
required
string
Allowed values: counterparty employee
recipient
required
Any of:
DocumentSubject
object
id
required
number | string
code
required
string | null
name
required
string
taxId
required
string | null
address
required
string | null
city
required
string | null
postalCode
required
string | null
country
required
string | null
countryCode
required
string | null
status
required
string
Allowed values: draft committed
active
required
boolean | null
vatTransactionKind
required
Any of:
string
Allowed values: domestic nonEu nonEuVatRefund intraCommunity intraCommunityTriangular domesticBuyerLiable outsideCountry outsideCountryNp intraCommunityBuyerLiable nonEuBuyerLiable ossProcedure smeProcedure
taxIdCountry
required
string | null
currency
required
string | null
kind
required
string
Allowed values: counterparty employee
items
required
Array<object>
object
productId
required
number | string | null
productCode
required
string | null
productName
required
string | null
quantity
required
number | null
unit
required
string | null
priceNet
required
number | null
priceNetBeforeDiscount
required
number | null
discountPercent
required
number | null
pricePrecision
required
integer
default: 2 >= 2 <= 4
quantityPrecision
required
integer
default: 4 <= 4
valueNet
required
number | null
valueGross
required
number | null
vatRate
required
number | null
nextCursor
string
failedIntegrationIds
required
Array<number>

Example

{
"items": [
{
"type": "invoice",
"kind": "purchase",
"exchangeRate": null,
"warehouse": null,
"status": "draft",
"documentSymbol": null,
"relatedDocuments": [],
"modifiedAt": null,
"modifiedBy": null,
"integrationType": "comarch-optima",
"subject": {
"countryCode": null,
"status": "draft",
"vatTransactionKind": null,
"taxIdCountry": null,
"currency": null,
"kind": "counterparty"
},
"recipient": {
"countryCode": null,
"status": "draft",
"vatTransactionKind": null,
"taxIdCountry": null,
"currency": null,
"kind": "counterparty"
},
"items": [
{
"priceNetBeforeDiscount": null,
"discountPercent": null,
"pricePrecision": 2,
"quantityPrecision": 4
}
]
}
]
}

Bad request

Media typeapplication/json
error.BAD_REQUEST

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Bad request",
"issues": []
}

Unauthorized

Media typeapplication/json
error.UNAUTHORIZED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}

Payment required

Media typeapplication/json
error.PAYMENT_REQUIRED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"issues": []
}

Forbidden

Media typeapplication/json
error.FORBIDDEN

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Forbidden",
"issues": []
}

Not found

Media typeapplication/json
error.NOT_FOUND

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}

Unprocessable content

Media typeapplication/json
error.UNPROCESSABLE_CONTENT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNPROCESSABLE_CONTENT",
"message": "Unprocessable content",
"issues": []
}

Too many requests

Media typeapplication/json
error.TOO_MANY_REQUESTS

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests",
"issues": []
}

Internal server error

Media typeapplication/json
error.INTERNAL_SERVER_ERROR

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}

Service unavailable

Media typeapplication/json
error.SERVICE_UNAVAILABLE

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable",
"issues": []
}