PHP code example of npservices / nps-soap

1. Go to this page and download the library: Download npservices/nps-soap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

npservices / nps-soap example snippets


use NPServices\NpsSoapPackage\NPS;

$nps = new NPS("url_wsdl","votre_identifiant", "votre_mot_de_passe");

$nps->getMakerCodes();

$itemsToCheck = [
	[
		'reference' => '835035',
		'makerCode' => 'VALEO',
		'positionNumber' => 1,
		'requestedQuantity' => 2,
	],
	[
		'reference' => '835035',
		'makerCode' => 'VALEO',
		'positionNumber' => 2,
		'requestedQuantity' => 3,
	],
];

$nps->getAvailability('TEST', $itemsToCheck);

$address = [
	'societe' => 'societe',
	'name1' => 'Alfred',
	'name2' => 'Archambault',
	'street1' => '53, rue Beauvau',
	'street2' => 'résidence B',
	'postalCode' => '57070',
	'city' => 'METZ',
	'countryIsoCode' => 'fr',
	'countryName' => 'France',
];

$itemsToOrder = [
	[
		'reference' => '835035',
		'makerCode' => 'VALEO',
		'positionNumber' => 1,
		'requestedQuantity' => 2,
	],
	[
		'reference' => '835035',
		'makerCode' => 'VALEO',
		'positionNumber' => 2,
		'requestedQuantity' => 3,
	],
];