Envoyer une demande de paiement à l'Urssaf

Pour remplir les champs vous devez consulter la documentation de l'Urssaf Documentation-API-TiersPrestation_v1.1.11.pdf partie "3.3 Méthode 050 – Transmettre des demandes de paiement pour un
tiers de prestation".

var myHeaders = new Headers();

myHeaders.append("Authorization", "Bearer <token>");

var jsonData = {
  "payments": {
    "invoice_id": "",
    "dateDebutEmploi": "",
    "dateFinEmploi": "",
    "mntAcompte": "",
    "dateVersementAcompte": "",
    "payments": {
      "prestation_percentPrestationTVA": "",
      "prestation_mntUnitaireTTC": "",
      "prestation_quantite": "",
      "prestation_complement2": "",
      "prestation_codeNature": "",
      "prestation_unite": "",
    },
  }
};

var requestOptions = {
		method: 'POST',
		headers: myHeaders,
		body: JSON.stringify(jsonData),
		redirect: 'follow'
};

fetch("https://api.sinao.app/v1/apps/:appId/urssaf/register_customer", requestOptions)
		.then(response => response.text())
		.then(result => console.log(result))
		.catch(error => console.log('error', error));
{
  "code": 200, 
  "response_urssaf": {
    [
       {
         "idClient": "11000000000104",
         "idDemandePaiement": "",
         "numFactureTiers": "11000000000104",
         "statut": "10",
         "errors": [
           {
           "code": "PARAM_INVALIDE",
           "message": "Requête incorrecte",
           "description": "Le format du champ numDemandeExterne est incorrect"
           }
         ]
       }
    ]
  }
  "request_urssaf": {
  	[
    	{
      	"idTiersFacturation": "",
        "idClient": "",
        "dateNaissanceClient": "",
        "numFactureTiers": "",
        "dateFacture": "",
        "mntFactureTTC": "",
        "mntFactureHT": "",
        "dateDebutEmploi": "",
        "dateFinEmploi": "",
        "mntAcompte": "",
        "dateVersementAcompte": "",
        "inputPrestations": "",
      }
    ]
  }
}