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
string
downloaded
boolean
direction
string

Search by direction property.

Enum: "Subject1" "Subject2" "Subject3" "SubjectAuthorized"
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: application/json
required

Setup the downloaded flag for a collection of invoices

uuids
required
Array of strings

Invoice uuids

downloaded
required
boolean

Downloaded status

Responses
200

Invoice resource created

400

Invalid input

422

Unprocessable entity

post/invoices/downloaded
Request samples
application/json
{
  • "uuids": [
    ],
  • "downloaded": true
}
Response samples
null

Send Invoice (Fa3).

This endpoint allows you to send an invoice v3 (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)
Array of objects (BlokDanychAType)

Gets as zalacznik

Responses
201

Invoice resource created

400

Invalid input

422

Unprocessable entity

post/invoices/v3
Request samples
{
  • "naglowek": {
    },
  • "podmiot1": {
    },
  • "podmiot2": {
    },
  • "podmiot3": [
    ],
  • "podmiotUpowazniony": {
    },
  • "fa": {
    },
  • "stopka": {
    },
  • "zalacznik": [
    ]
}
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": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Convert Invoice format (Fa3).

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/v3/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": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "downloaded": true,
  • "downloadedAt": "string"
}

Validate invoice (Fa3).

This endpoint allows to validate the invoice Fa3.

SecurityBearer
Request
Request Body schema:
optional

The new Invoice resource

object (KsefInvoiceV3.TNaglowekType)
object (KsefInvoiceV3FakturaFakturaAType.Podmiot1AType)
object (KsefInvoiceV3FakturaFakturaAType.Podmiot2AType)
Array of objects (KsefInvoiceV3FakturaFakturaAType.Podmiot3AType)

Dane podmiotu/-ów trzeciego/-ich (innego/-ych niż sprzedawca i nabywca wymieniony w części Podmiot2), związanego/-ych z fakturą

object (KsefInvoiceV3FakturaFakturaAType.PodmiotUpowaznionyAType)
object (KsefInvoiceV3FakturaFakturaAType.FaAType)
object (KsefInvoiceV3FakturaFakturaAType.StopkaAType)
Array of objects (KsefInvoiceV3FakturaFakturaATypeZalacznikAType.BlokDanychAType)

Załącznik do faktury VAT

xmlns
string
Responses
200

Validation response

400

Invalid input

422

Unprocessable entity

post/invoices/v3/validate
Request samples
{
  • "Naglowek": {
    },
  • "Podmiot1": {
    },
  • "Podmiot2": {
    },
  • "Podmiot3": [
    ],
  • "PodmiotUpowazniony": {
    },
  • "Fa": {
    },
  • "Stopka": {
    },
  • "Zalacznik": [
    ],
}
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": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "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
{
  • "@id": "string",
  • "@type": "string",
  • "@context": "string",
  • "uuid": "string",
  • "filename": "string",
  • "legalEntityUUID": "string",
  • "createdAt": "string",
  • "invoiceDate": "string",
  • "invoiceNumber": "string",
  • "senderName": "string",
  • "recipientName": "string",
  • "invoiceCreatorNip": "string",
  • "invoiceRecipientNip": "string",
  • "invoiceType": "VAT",
  • "status": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "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": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "downloaded": true,
  • "downloadedAt": "string"
}

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": "new",
  • "subjectType": "Subject1",
  • "acquisition": "string",
  • "ksefReferenceNumber": "string",
  • "hasUpo": true,
  • "attachments": [
    ],
  • "payload": "string",
  • "currency": "string",
  • "amount": 0,
  • "amountNet": 0,
  • "amountInCurrency": 0,
  • "exchangeRate": 0,
  • "hasMultilines": true,
  • "dueDate": "string",
  • "invoiceVersion": "v3",
  • "originType": "default",
  • "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