Updates an existing invoice line item. Automatically recalculates values and updates invoice totals.
value × 100 (e.g., 0.5 pieces = 50)
array (
// === REQUIRED ===
[ 'idItem' ] = string, // Item ID (32 char GUID from createInvoiceItem)
// === OPTIONAL FIELDS (only provided ones are updated) ===
[ 'name' ] = string, // Product/service name
[ 'quantity' ] = int, // Quantity × 100 (e.g., 1 pc = 100, 0.5 kg = 50)
[ 'unit' ] = string, // Unit of measure (from dictionary)
[ 'vatRate' ] = string, // VAT rate (from dictionary)
[ 'priceNetto' ] = int, // Net unit price in grosze (for 'netto' invoices)
[ 'priceBrutto' ] = int, // Gross unit price in grosze (for 'brutto' invoices)
// === MANUAL MODE (optional) ===
[ 'manualMode' ] = bool, // If true, all values below are required
[ 'valueNetto' ] = int, // Total net value in grosze (only with manualMode)
[ 'valueBrutto' ] = int, // Total gross value in grosze (only with manualMode)
[ 'valueVat' ] = int, // VAT amount in grosze (only with manualMode)
// === OTHER OPTIONAL ===
[ 'sww' ] = string, // SWW code
[ 'gtu' ] = string, // GTU code
[ 'accountNumber' ] = string, // Accounting account number
)
require_once ( 'classUddsOx.php' ) ; $udds = new classUddsOx ; $udds->customerCode = [your_customerCode] ; $udds->login = [your_login] ; $udds->password = [your_password] ; $udds->serverUrl = 'http://api.dlaoperatora.pl/udds/' ; // Update item - change name and quantity $params = array(); $params['idItem'] = 'ABCD1234EFGH5678IJKL9012MNOP3456'; $params['name'] = 'Usługa konsultingowa - ZMIANA'; $params['quantity'] = 200; // Change to 2 pieces (×100) $ret = $udds->updateInvoiceItem($params); // $ret['status'] == 'OK' on success // $ret['idItem'] = item ID // $ret['idInvoice'] = parent invoice ID // $ret['calculatedValues'] = recalculated prices and values
// Update just the price, keep everything else $params = array(); $params['idItem'] = '...'; $params['priceNetto'] = 75000; // Change to 750.00 PLN/unit $ret = $udds->updateInvoiceItem($params); // Quantity, unit, vatRate, name stay unchanged // Values are recalculated based on existing quantity + new price
// Change VAT rate from 23% to 8% $params = array(); $params['idItem'] = '...'; $params['vatRate'] = '8'; $ret = $udds->updateInvoiceItem($params); // All values recalculated with new VAT rate
{
"status": "OK",
"idItem": "ABCD1234EFGH5678IJKL9012MNOP3456",
"idInvoice": "00000004M1G221031126JF1B44ASNQ6D",
"calculatedValues": {
"priceNettoPLN": 50000,
"priceBruttoPLN": 61500,
"valueNettoPLN": 100000,
"valueBruttoPLN": 123000,
"valueVatPLN": 23000,
"priceNettoEUR": 50000,
"priceBruttoEUR": 61500,
"valueNettoEUR": 100000,
"valueBruttoEUR": 123000,
"valueVatEUR": 23000
},
"errors": []
}
{
"status": "ERROR",
"errors": [
{ "code": 1002, "message": "Pozycja o ID 'XXX' nie istnieje" }
]
}
| Code | Description |
|---|---|
| 1001 | Missing idItem parameter |
| 1002 | Item not found |
| 1003 | Invoice not found (parent invoice deleted?) |
| 1004 | Invoice already sent to KSEF (cannot modify) |
| 1005 | Invalid dictionary value (unit, vatRate) |
| 1006 | Manual mode requires all value fields |
| 1007 | Database error |