DocumentService :: InsertDocumentEtLignes
The POST method, is used to retrieve data.
The list of necessary parameters for sending a query:
- Document document,
- List<LigneDocument> ligneList.
The list of parameters is not mandatory to request:
- bool useSageProcess.
Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).
Input parameters:
{
"document":
{
"__type": "DocumentVente:http://www.proconsult.lu/WebServices100",
"TypeDocument": 3,
"Domaine": 0,
"NumeroDocument": "",
"Date": "/Date(1172098800000+0100)/",
"Reference": "referentie",
"NumeroTiers": "CARAT",
"NumeroTiersPayeur": "CARAT",
"Statut": 2,
"Provenance": 0,
"DateLivraison": "/Date(-2208992400000+0100)/",
"DateLivraisonRealisee": "/Date(-2208992400000+0100)/",
"DateExpedition": "/Date(-2208992400000+0100)/",
"SectionAnalytique": "",
"Contact": "",
"NbFactures": 1,
"NbColis": 1,
"TauxEscompte": 3,
"Langue": 0,
"Donnee1": "hoofd 1",
"Donnee2": "",
"Donnee3": "",
"Donnee4": "",
"EstImprime": false,
"EstTransfere": false,
"EstCloture": false,
"EstReliquat": false,
"IdSouche": 0,
"IdCollaborateur": 0,
"IdDepot": 3,
"IdAdresseLivraison": 0,
"IdModeExpedition": 1,
"IdConditionLivraison": 1,
"IdCategorieComptable": 1,
"IdCategorieTarifaire": 1,
"IdModeleReglement": 0,
"IdDevise": 0,
"CoursDevise": 0,
"FraisExpedition": 15,
"TypeFraisExpedition": 0,
"TypePrixFraisExpedition": 0,
"FrancoDePort": 2500,
"TypeFrancoPort": 0,
"TypePrixFrancoPort": 0,
"ExpeditionCodeTaxe1": "V03",
"ExpeditionCodeTaxe2": null,
"ExpeditionCodeTaxe3": null,
"ExpeditionTaux1": 21,
"ExpeditionTaux2": 0,
"ExpeditionTaux3": 0,
"InfosLibres": [
{
"Name": "Commentaar",
"Type": 0,
"Size": 69,
"EstCalculee": false,
"Value": "commentaat"
},
{
"Name": "Divers",
"Type": 0,
"Size": 69,
"EstCalculee": false,
"Value": "divers"
}
]
},
"ligneList":
[
{
"__type": "LigneArticle:http://www.proconsult.lu/WebServices100",
"TypeDocument": 3,
"IdGamme1": 2,
"Quantite": 2,
"RefArticle": "BAOR01"
},
{
"__type": "LigneArticle:http://www.proconsult.lu/WebServices100",
"TypeDocument": 3,
"IdGamme1": 0,
"Quantite": 10,
"RefArticle": "BRAAR10"
}
],
"useSageProcess": true
}
Example:
require(__DIR__ . '/service/DocumentService.php'); use services\DocumentService; use services\WebServices100; $url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/DocumentService/rest/InsertDocumentEtLignes'; // add parameters $document= new Document(); //Set document properties $document->setDocumentType(0); ... $data = $document->getResponse(); $data_json = json_encode($data); // Send requests to receive data $result = WebServices100::getData($url, $data_json); $response = json_decode($result);
Result:
BL00078