0 utilizadores on-line |
0 Convidados e 0 Registados

How to edit the request of a number via API?


POST: http://www.nomedoseusite.com.br/api_orders.php?action=update_orders

Parameter Format Description
oID JSON Order ID
Only number is required
Check the API to get the Order Number
Format: bigint(11)
* FIELD REQUIRED
status JSON

Use the API to list the status and get name and id
Only number is required
Format: int(2)
* FIELD REQUIRED

comments JSON Text to comment the order status or situation
Format: text
restock JSON Use the on to enable restock, also change the status to cancel or leave blank
Format: varchar(11)
repayment JSON Use the true to enable repayment or leave blank
Format: varchar(11)
reorder JSON Use the true to enable reorder or leave blank
Format: varchar(11)
assinatura_recorrente JSON Use the 1 to enable recurring subscription or leave blank
Format: int(1)
cancel_assinatura_recorrente JSON Use the 1 to enable cancel recurring subscription or leave blank
Format: int(1)
confirm_fraud JSON Use the true to enable confirm fraud or leave blank
Format: varchar(11)
customer_status_account JSON Use the true to enable block customer account or leave blank
Format: varchar(11)

PHP Sample

	// sample edit orders
	
	$url = $domain_url . '/api_orders.php?action=update_orders';

	$data = array("oID" => "12302006081632", // Order ID (Only number is required) * FIELD REQUIRED
				  "status" => "116", // Use the API to list the status and get name and id (Only number is required) * FIELD REQUIRED
				  "comments" => "Teste", // Use the API to list the email templates
//				  "notify" => "on", // Use the on to enable notify by email, also change the status or leave blank
//				  "notify_comments" => "on", // Use the on to enable notify comments, also change the status or leave blank
				  "restock" => "", // Use the on to enable restock, also change the status to cancel or leave blank
				  "repayment" => "", // Use the true to enable repayment or leave blank
				  "reorder" => "", // Use the true to enable reorder or leave blank
				  "assinatura_recorrente" => "", // Use the 1 to enable recurring subscription or leave blank
				  "cancel_assinatura_recorrente" => "", // Use the 1 to enable cancel recurring subscription or leave blank
				  "confirm_fraud" => "", // Use the true to enable confirm fraud or leave blank
				  "customer_status_account" => "" // Use the true to enable block customer account or leave blank
				  );
				  
	$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 orders eof

 

Return Error:

code
message

Return Success:

code
oID
message

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

Não pode comentar este artigo

Chuck Norris has counted to infinity. Twice.

{debugMessages}