Products
Products and services form the catalog of line items you use when issuing documents. The API exposes full CRUD under /products.
Required scopes: products:browse, products:read, products:create, products:update, products:delete (one per operation).
Listing products
curl -s "https://prod.api.fakturnia.pl/external/v1/products?searchQuery=hosting¤tPage=1&itemsPerPage=20" \
-H "Authorization: Bearer $TOKEN"
searchQuery filters by name. The list is paginated.
Creating a product
The only required field is name. Amounts work the same way as document line items: send netPrice or grossPrice together with vatRate and the API computes the missing values using the same rules as document amounts.
curl -s -X POST https://prod.api.fakturnia.pl/external/v1/products \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Web hosting (year)",
"unitOfMeasure": "pcs",
"netPrice": 400,
"vatRate": 23,
"currency": "PLN",
"gtu": "GTU_12"
}'
| Field | Meaning |
|---|---|
name |
product or service name (required) |
netPrice / grossPrice |
net or gross unit price |
vatRate |
VAT rate: a number (e.g. 23) or a special code from the dictionaries (e.g. zw, oo) |
quantity, discount |
default quantity and percentage discount |
unitOfMeasure |
unit (e.g. pcs, h) |
currency |
currency, defaults to PLN |
gtu |
GTU code, if the product requires one |
pkwiu |
PKWiU symbol |
Fetching, updating and deleting
# Details
curl -s https://prod.api.fakturnia.pl/external/v1/products/{id} \
-H "Authorization: Bearer $TOKEN"
# Update (PUT, full replacement)
curl -s -X PUT https://prod.api.fakturnia.pl/external/v1/products/{id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Web hosting (year)", "netPrice": 450, "vatRate": 23 }'
# Delete
curl -s -X DELETE https://prod.api.fakturnia.pl/external/v1/products/{id} \
-H "Authorization: Bearer $TOKEN"
Deleting a product does not change documents it was used on: document line items keep a copy of the product data from the moment of issue.
Warehouse fields
A product has the Warehouse module fields: productType (goods = goods tracked in stock, service = a service; missing = a service), sku, ean and purchasePrice (net purchase price, the default price of PZ/PW receipts). Send them with the rest of the data when creating; on update they are saved only when present in the request, so a client unaware of them does not clear them. quantity is optional (defaults to 1). Warehouse documents: Warehouse.
Webhooks
Write operations emit webhook events: product.created, product.updated, product.deleted.