How to check KSeF invoice status and retrieve the UPO
When you create an invoice, the POST /invoices response usually returns submitted with a KSeF reference number (if it returns draft with ksef_submitting, Notaly resends it itself — do not create a new invoice), and the final decision — accepted or rejected — arrives later. You can verify it by polling GET /invoices/{id}, which re-checks KSeF while the invoice is still submitted, or by listening for the signed status webhook. With the accepted status you get the KSeF number; Notaly then requests the UPO, which is available when KSeF issues it.