0 utilizadores on-line |
0 Convidados e 0 Registados

How to edit the price of products via API?


POST: http://www.nomedoseusite.com.br/api_products_edit.php?action=update_products_price

 

Header Parameter Format
Usuario1 base64_encode()
Senha1 base64_encode()

 

Parameter Format Description
products_id JSON

Product ID
Only number is required
Format: int(11)
* FIELD REQUIRED

products_price JSON Example: 1542.56 (Do not use , "comma" only . "point" to indicate decimals)
Format: decimal(15,4)
* FIELD REQUIRED

PHP Sample

	// sample edit products price
	
	$url = $domain_url . '/api_products_edit.php?action=update_products_price';

	$data = array("products_id" => "442", // Product ID (Only number is required) * FIELD REQUIRED
				  "products_price" => "1542.56" // Example: 1542.56 (Do not use , "comma" only . "point" to indicate decimals) * FIELD REQUIRED
				  );
				  
	$data_string = json_encode($data);  

	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);                                                                   
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
		'Content-Type: application/json',
		"Cache-Control: no-cache", 
		'Usuario1: ' . base64_encode($usuario1),
		'Senha1: ' . base64_encode($senha1),                                                                                
		'Content-Length: ' . strlen($data_string))                                                                       
	);                                                                                                                   
																														 
	$result = curl_exec($ch);
	curl_close($ch);

	print_r($result);
	
	// sample edit products price eof

 

Return Error:

code
message

Return Success:

code
products_price
products_id
message

2018-08-30 12:46 MFORMULA {writeRevision}
Avaliação média: 0 (0 Avaliações)

Não pode comentar este artigo

Chuck Norris has counted to infinity. Twice.

{debugMessages}