API reference
API reference
Every endpoint in one place, plus the conventions shared by the whole API.
All endpoints
| Invoices and corrections | |
|---|---|
GET/v1/invoices | List invoices |
POST/v1/invoices | Create an invoice from a paid order |
GET/v1/invoices/{id} | Retrieve an invoice or a correction |
GET/v1/invoices/{id}/pdf | Download the PDF |
POST/v1/invoices/{id}/corrections | Create a correction (refund) |
| Account | |
GET/v1/account | Retrieve the account |
| Webhook endpoints | |
GET/v1/webhook_endpoints | List webhook endpoints |
POST/v1/webhook_endpoints | Create a webhook endpoint |
GET/v1/webhook_endpoints/{id} | Retrieve a webhook endpoint |
DELETE/v1/webhook_endpoints/{id} | Delete a webhook endpoint |
| Events | |
GET/v1/events | List events |
GET/v1/events/{id} | Retrieve an event |
Address and format
- Base URL:
https://app.ksefshop.pl, every path starts with/v1. - Request and response bodies: JSON in UTF-8 (
Content-Type: application/json); the PDF is the exception. - Authentication:
Authorization: Bearer sk_test_.... Keys - Amounts are strings with a dot (
"49.00") to avoid floating point rounding errors. - Timestamps in responses (
created,updated) are Unix seconds; dates in requests are ISO 8601.
Identifiers
| Prefix | Object |
|---|---|
inv_ |
Invoice |
cor_ |
Correction |
we_ |
Webhook endpoint |
evt_ |
Event |
acct_ |
Account |
req_ |
Request (Request-Id header) |
Response headers
| Header | Meaning |
|---|---|
Request-Id |
Request id, quote it in support requests. |
KSeF-Api-Version |
API version (a date). |
RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset |
Rate limit. |
Idempotent-Replayed |
true when the response is a replay. Idempotency |
Retry-After |
With 429: seconds to wait. |
Specification
The full OpenAPI 3.1 specification: openapi.yaml. Postman collection with ready scenarios: ksef-faktury.postman_collection.json.