Invoice

Retrieve the collection of Invoice resources.

Retrieve the collection of Invoice resources.

SecurityBearer
Request
query Parameters
page
integer
Default: 1

The collection page number

createdAt[before]
string

Search by equal or greater value of "createdAt" property.

createdAt[after]
string

Search by equal or less value of "createdAt" property.

invoiceDate[before]
string

Search by equal or greater value of "invoiceDate" property.

invoiceDate[after]
string

Search by equal or less value of "invoiceDate" property.

invoiceDate
string
invoiceCreatorNip
string
invoiceRecipientNip
string
invoiceType
string
invoiceNumber
string
status
integer
downloaded
boolean
direction
string

Search by direction property.

Enum: "sent" "received"
invoiceStatus
string
order[createdAt]
string
Enum: "asc" "desc"
order[invoiceDate]
string
Enum: "asc" "desc"
order[invoiceCreatorNip]
string
Enum: "asc" "desc"
order[invoiceRecipientNip]
string
Enum: "asc" "desc"
order[invoiceType]
string
Enum: "asc" "desc"
order[invoiceNumber]
string
Enum: "asc" "desc"
order[status]
string
Enum: "asc" "desc"
Responses
200

Invoice collection

400

Bad Request

401

Unauthorized

404

Resource not Found

get/invoices
Request samples
Response samples
{
  • "hydra:member": [
    ],
  • "hydra:totalItems": 0,
  • "hydra:view": {
    },
  • "hydra:search": {
    }
}

Setup the downloaded flag for a collection of invoices.

Setup the downloaded flag for a collection of invoices.

SecurityBearer
Request
Request Body schema:
required

The new Invoice resource

uuid
string <uuid>
legalEntity
string or null <iri-reference>
status
integer
Default: 10
invoiceNumber
string
invoiceProducedAt
string <date-time>
invoiceDate
string <date-time>
invoiceCreatorNip
string
invoiceRecipientNip
string or null
invoiceRecipientCompanyName
string
invoiceRecipientCustomerId
string or null
invoiceRecipientEmail
string or null
referenceNumber
string or null
elementReferenceNumber
string or null
KSeFReferenceNumber
string or null
uploadMode
string or null
Enum: "single" "batch" "external"
upo
string or null <iri-reference>
acquisition
string or null <date-time>
invoiceType
string
Enum: "VAT" "KOR" "ZAL" "ROZ" "UPR" "KOR_ZAL" "KOR_ROZ"
ownerId
integer
jsonFilePath
string or null
senderName
string
isDemo
boolean or null
originType
string
Default: "sent"
Enum: "sent" "received"
invoiceAttachments
Array of strings <iri-reference>
accessCode
string
downloaded
boolean or null
downloadedAt
string or null <date-time>
currency
string or null
amount
string or null
amountNet
string or null
amountInCurrency
string or null
exchangeRate
string or null
hasMultilines
boolean
dueDate
string or null <date-time>
lastWebhookStatus
integer or null
lastWebhookDate
string or null <date-time>
invoiceSchemaType
string
Enum: "V1" "V2" "RR"
invoiceOrigin
integer
invoiceProvider
integer or null
originGatewayUuid
string or null
createdAt
string <date-time>
otcCode
string or null
otcIsUsed
boolean
otcExpiredAt
string or null <date-time>
kSeFReferenceNumber
string or null
filePath
string
Responses
200

Invoice resource created

400

Invalid input

422

Unprocessable entity

post/invoices/downloaded
Request samples
{
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "legalEntity": "/entity/1",
  • "status": 10,
  • "invoiceNumber": "string",
  • "invoiceProducedAt": "2019-08-24T14:15:22Z",
  • "invoiceDate": "2019-08-24T14:15:22Z",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceRecipientCompanyName": "string",
  • "invoiceRecipientCustomerId": "string",
  • "invoiceRecipientEmail": "string",
  • "referenceNumber": "string",
  • "elementReferenceNumber": "string",
  • "KSeFReferenceNumber": "string",
  • "uploadMode": "single",
  • "upo": "/entity/1",
  • "acquisition": "2019-08-24T14:15:22Z",
  • "invoiceType": "VAT",
  • "ownerId": 0,
  • "jsonFilePath": "string",
  • "senderName": "string",
  • "isDemo": true,
  • "originType": "sent",
  • "invoiceAttachments": [
    ],
  • "accessCode": "string",
  • "downloaded": true,
  • "downloadedAt": "2019-08-24T14:15:22Z",
  • "currency": "string",
  • "amount": "string",
  • "amountNet": "string",
  • "amountInCurrency": "string",
  • "exchangeRate": "string",
  • "hasMultilines": true,
  • "dueDate": "2019-08-24T14:15:22Z",
  • "lastWebhookStatus": 0,
  • "lastWebhookDate": "2019-08-24T14:15:22Z",
  • "invoiceSchemaType": "V1",
  • "invoiceOrigin": 0,
  • "invoiceProvider": 0,
  • "originGatewayUuid": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "otcCode": "string",
  • "otcIsUsed": true,
  • "otcExpiredAt": "2019-08-24T14:15:22Z",
  • "kSeFReferenceNumber": "string",
  • "filePath": "string"
}
Response samples
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Send Invoice (V2).

This endpoint allows you to send an invoice v2 (json or XML format based on the Content-Type header) to the KSeF.

SecurityBearer
Request
Request Body schema:
required

The new Invoice resource

object (TNaglowekType)
object (Podmiot1AType)
object (Podmiot2AType)
Array of objects (Podmiot3AType)

Gets as podmiot3

object (PodmiotUpowaznionyAType)
object (FaAType)
object (StopkaAType)
Responses
201

Invoice resource created

400

Invalid input

422

Unprocessable entity

post/invoices/v2
Request samples
{
  • "naglowek": {
    },
  • "podmiot1": {
    },
  • "podmiot2": {
    },
  • "podmiot3": [
    ],
  • "podmiotUpowazniony": {
    },
  • "fa": {
    },
  • "stopka": {
    }
}
Response samples
application/json
{
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Convert Invoice format (V2).

GET XML or JSON version of an invoice document.

HTTP Header Content-Type must be set to application/json or application/xml accordingly with the invoice source sent to the API.

SecurityBearer
Request
Request Body schema:
required

The new Invoice resource

any
Responses
201

Invoice resource created

400

Invalid input

422

Unprocessable entity

post/invoices/v2/convert
Request samples
null
Response samples
{
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Validate invoice (V2).

This endpoint allows to validate the invoice V2.

SecurityBearer
Request
Request Body schema:
optional

The new Invoice resource

object (KSeFInvoiceV2.TNaglowekType)
object (KSeFInvoiceV2.Faktura.FakturaAType.Podmiot1AType)
object (KSeFInvoiceV2.Faktura.FakturaAType.Podmiot2AType)
Array of objects (KSeFInvoiceV2.Faktura.FakturaAType.Podmiot3AType)

Entity's data/-ich/-ich (other than the seller and buyer mentioned in part of the entity2), related to the invoice

object (KSeFInvoiceV2.Faktura.FakturaAType.PodmiotUpowaznionyAType)
object (KSeFInvoiceV2.Faktura.FakturaAType.FaAType)
object (KSeFInvoiceV2.Faktura.FakturaAType.StopkaAType)
xmlns
string
Responses
200

Validation response

400

Invalid input

422

Unprocessable entity

post/invoices/v2/validate
Request samples
{
  • "Naglowek": {
    },
  • "Podmiot1": {
    },
  • "Podmiot2": {
    },
  • "Podmiot3": [
    ],
  • "PodmiotUpowazniony": {
    },
  • "Fa": {
    },
  • "Stopka": {
    },
}
Response samples
application/json
{
  • "isValid": true,
  • "errors": [
    ]
}

Retrieve a Invoice resource.

You can get an invoice in many different formats just specifying a different Accept header:

  • application/json, default, you get some metadata information together with the json payload that represent the invoice
  • application/xml, you get the XML format
  • text/html, you get the invoice formatted with the chosen stylesheet (via X-PrintTheme header, see below)
  • application/pdf, same as HTML but as a PDF file
SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Responses
200

Invoice resource

404

Resource not found

get/invoices/{uuid}
Request samples
Response samples
{
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Remove the Invoice resource.

Remove the Invoice resource.

SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Responses
204

Invoice resource deleted

404

Resource not found

delete/invoices/{uuid}
Request samples

Activate access code.

Activate access code.

SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Request Body schema:
required

The new Invoice resource

any
Responses
201

Invoice resource created

400

Invalid input

404

Resource not found

422

Unprocessable entity

post/invoices/{uuid}/activate-access-code
Request samples
null
Response samples
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Retrieve a Invoice resource.

Retrieve a Invoice resource.

SecurityBearer
Request
path Parameters
access_code
required
string

Access code

uuid
required
string

Resource identifier

Responses
200

Invoice resource

404

Resource not found

get/invoices/{uuid}/code/{access_code}
Request samples
Response samples
{
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Get invoice upo with code

Get invoice upo with code

SecurityBearer
Request
path Parameters
access_code
required
string

Access code

uuid
required
string

Resource identifier

Responses
200

Invoice resource

404

Resource not found

get/invoices/{uuid}/code/{access_code}/upo
Request samples

Send invoice webhook

Send invoice data to webhook

SecurityBearer
Request
path Parameters
type
required
string
Enum: "legal-entity-invoice-receiver" "legal-entity-invoice-sender" "legal-entity-invoice-sync" "legal-entity-invoice-upo"
uuid
required
string

Resource identifier

Request Body schema:
required

The new Invoice resource

any
Responses
200

Invoice resource created

400

Invalid input

404

Resource not found

422

Unprocessable entity

post/invoices/{uuid}/notify/{type}
Request samples
null
Response samples
null

Send access code to recipient email.

Send access code to recipient email.

SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Request Body schema:
required

The new Invoice resource

any
Responses
200

Invoice OTC Code request

400

Invalid input

404

Resource not found

422

Unprocessable entity

post/invoices/{uuid}/send-access-code
Request samples
null
Response samples
application/json
{
  • "otcCode": "string",
  • "otcLifetime": 0
}

Get invoice status.

Get invoice status.

SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Responses
200

Invoice resource

404

Resource not found

get/invoices/{uuid}/status
Request samples
Response samples
application/json
{
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "string",
  • "error": "string",
  • "errorDescription": "string",
  • "direction": "sent",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "string",
  • "originType": "string",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Get invoice upo

Get invoice upo

SecurityBearer
Request
path Parameters
uuid
required
string

Resource identifier

Responses
200

Invoice resource

404

Resource not found

get/invoices/{uuid}/upo
Request samples