How can I correctly delete a product from an invoice using Fakturownia API? (Jak poprawnie usunąć produkt z faktury korzystając z API Fakturownia?)ere are the details:
1. **Creating an Invoice**:
```sh
curl -X POST https://xxx.fakturownia.pl/invoices.json \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "QQQ",
"invoice": {
"kind": "receipt",
"lang": "pl",
"number": null,
"seller_name": "My firma",
"show_discount": 1,
"positions": [
{
"name": "price2",
"tax": 20.00000,
"total_price_gross": 2000.00,
"quantity": 2.0,
"discount_percent": 1.0,
"discount": 20.0000,
"quantity_unit": "szt"
},
{
"name": "percent2",
"tax": 20.00000,
"total_price_gross": 2000.00,
"quantity": 2.0,
"discount_percent": 10.0,
"discount": 200.0000,
"quantity_unit": "szt"
}
],
"buyer_company": 0,
"buyer_last_name": "0664324794",
"buyer_first_name": "0664324794"
}
}'
Updating an Invoice (changing product names):
curl -X PUT https://xxx.fakturownia.pl/invoices/304979117.json \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "QQQ",
"invoice": {
"kind": "receipt",
"lang": "pl",
"seller_name": "My firma",
"show_discount": 1,
"positions": [
{
"id": 720511219,
"name": "price3",
"tax": 20.00000,
"total_price_gross": 2000.00,
"quantity": 2.0,
"discount_percent": 1.0,
"discount": 20.0000,
"quantity_unit": "szt"
},
{
"id": 720511220,
"name": "percent3",
"tax": 20.00000,
"total_price_gross": 2000.00,
"quantity": 2.0,
"discount_percent": 10.0,
"discount": 200.0000,
"quantity_unit": "szt"
}
],
"buyer_company": 0,
"buyer_last_name": "0664324794",
"buyer_first_name": "0664324794"
}
}'
Issue: I need to delete a product from the invoice. I tried using the deleted field in the PUT request, but it did not work.
Attempt to Delete a Product:
curl -X PUT https://xxx.fakturownia.pl/invoices/304979117.json \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "QQQ",
"invoice": {
"kind": "receipt",
"lang": "pl",
"seller_name": "My firma",
"show_discount": 1,
"positions": [
{
"id": 720511219,
"name": "price3",
"tax": 20.00000,
"total_price_gross": 2000.00,
"quantity": 2.0,
"discount_percent": 1.0,
"discount": 20.0000,
"quantity_unit": "szt"
},
{
"id": 720511220,
"deleted": true
}
],
"buyer_company": 0,
"buyer_last_name": "0664324794",
"buyer_first_name": "0664324794"
}
}'
Question:
How can I correctly delete a product from an invoice using Fakturownia API? Is there a specific field or method I should use? Any advice or examples would be greatly appreciated.
Pytanie:
Jak mogę poprawnie usunąć produkt z faktury za pomocą Fakturownia API? Czy jest jakieś konkretne pole lub metoda, której powinienem użyć? Wszelkie porady lub przykłady byłyby mile widziane.