Changes the status of an invoice between TYMCZASOWA (draft) and AKTYWNA (active).
createInvoiceHead → status = TYMCZASOWA (default)createInvoiceItemsetInvoiceStatus
array (
[ 'idInvoice' ] = string, // Invoice ID (32 char GUID) - REQUIRED
[ 'status' ] = string, // 'AKTYWNA' or 'TYMCZASOWA' - REQUIRED
)
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/' ; $params = array(); $params['idInvoice'] = '00000004M1G221031126JF1B44ASNQ6D'; $params['status'] = 'AKTYWNA'; $ret = $udds->setInvoiceStatus($params); // $ret['data']['idInvoice'] - invoice ID // $ret['data']['previousStatus'] - status before change // $ret['data']['newStatus'] - status after change
{
"status": "OK",
"data": {
"idInvoice": "00000004M1G221031126JF1B44ASNQ6D",
"previousStatus": "TYMCZASOWA",
"newStatus": "AKTYWNA"
},
"errors": []
}
{
"status": "ERROR",
"data": null,
"errors": [
{ "code": 1004, "message": "Nie można zmienić statusu faktury wysłanej do KSEF (numer KSEF: ...)" }
]
}
| Code | Description |
|---|---|
| 1001 | Missing required field (idInvoice or status) |
| 1002 | Invalid status value (must be 'AKTYWNA' or 'TYMCZASOWA') |
| 1003 | Invoice not found |
| 1004 | Invoice already sent to KSEF - cannot change status |
| 1005 | Database error |