Récupérer le statut d’une facture envoyée à l’Urssaf

Pour consulter le statut d'une facture envoyé à l'Urssaf, vous aurez besoin de l'identifiant de la facture sur Sinao

var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <token>");

var formdata = new FormData();
formdata.append("invoices_ids[0]", ":sinao_invoice_id");

var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    body: formdata,
    redirect: 'follow'
};

fetch("https://api.sinao.app/v1/apps/:appId/urssaf/payment", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
{
    "code": 200,
    "response_urssaf": {
        "infoDemandePaiements": [
            {
                "idDemandePaiement": "c00000bf-d3b4-az70-964d-7902yze02760",
                "demandePaiement": {
                    "idTiersFacturation": "daff4a46-68f5-43f2-bd9a-0z38a36d88e7",
                    "idClient": "0d3dpehh-38b6-459c-0974-dafheçdjfddd",
                    "dateNaissanceClient": "1995-12-05T00:00:00",
                    "numFactureTiers": "FAC00001",
                    "dateFacture": "2024-12-09T00:00:00",
                    "dateDebutEmploi": "2024-12-09T00:00:00",
                    "dateFinEmploi": "2024-12-09T00:00:00",
                    "mntAcompte": 0,
                    "mntFactureTTC": 259.99,
                    "mntFactureHT": 216.66,
                    "inputPrestations": [
                        {
                            "codeNature": "160",
                            "quantite": 1,
                            "unite": "FORFAIT",
                            "mntUnitaireTTC": 259.99,
                            "mntPrestationTTC": 259.99,
                            "mntPrestationHT": 216.66,
                            "mntPrestationTVA": 43.33,
                            "dateDebutEmploi": "2024-12-09T00:00:00",
                            "dateFinEmploi": "2024-12-09T00:00:00",
                            "complement2": "SAPxxxxxxxxx"
                        }
                    ]
                },
                "statut": {
                    "code": "30",
                    "libelle": "Validée"
                },
                "infoVirement": {
                    "mntVirement": 259.99,
                    "dateVirement": "2024-12-17T00:00:00"
                }
            }
        ]
    },
    "request_urssaf": {
        "idDemandePaiements": [
            "c00000bf-d3b4-az70-964d-7902yze02760"
        ]
    },
    "clientsNames": {
        "c00000bf-d3b4-az70-964d-7902yze02760": "John Doe"
    }
}