How to edit CFOP via API?


POST: http://www.nomedoseusite.com.br/api_products_others.php?action=add_cfop

Parameter Format Description
cfop_id JSON ID of cfop
Format: int(11)
* FIELD REQUIRED
cfop_name_text JSON

Main name of cfop
Format: varchar(255)
* FIELD REQUIRED

cfop_code JSON Code of cfop
Format: varchar(255)
* FIELD REQUIRED

PHP Sample

 

	// sample edit cfop
	
	$url = $domain_url . '/api_products_others.php?action=edit_cfop';

	$data = array("cfop_id" => "ID of cfop", // ID of cfop * FIELD REQUIRED
				  "cfop_name_text" => "Main name of cfop", // Main name of cfop * FIELD REQUIRED
				  "cfop_code" => "Code of cfop" // Code of cfop * 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 cfop eof

 

Return Error:

code
message

Return Success:

code
id
message

2018-08-30 12:56 MFORMULA {writeRevision}
Average rating: 0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

{debugMessages}