0 utilizadores on-line |
0 Convidados e 0 Registados

How do I add products to specials via the API?


POST: http://www.sitename.com/api_seller_products_edit.php?action=add_product_specials

 

Header Parameter Format
Token base64_encode()
Secret base64_encode()
E-mail base64_encode()

 

Parameter Format Description
products_id JSON

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

specials_price JSON Example: 20 or 20%
* FIELD REQUIRED
total_days JSON Example: 5, 10, 15, 20, 25 or 30
* FIELD REQUIRED

PHP Sample

	// sample add product specials

$url = $domain_url . '/api_seller_products_others.php?action=add_product_specials'; $data = array("products_id" => $_GET['products_id'], // Products ID (Only number is required) * FIELD REQUIRED "specials_price" => $_GET['specials_price'], // Special Price (Example: 20 or 20%) * FIELD REQUIRED "total_days" => $_GET['total_days'] // Total Days. 5, 10, 15, 20, 25 or 30 (Only number is required) * 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", 'Token: ' . base64_encode($token), 'Secret: ' . base64_encode($secret), 'E-mail: ' . base64_encode($email), 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); curl_close($ch); print_r($result); // sample add product specials eof

 

Return Error:

code
message

Return Success:

code
message

2019-09-05 20:18 MFORMULA FAQ {writeRevision}
Avaliação média: 0 (0 Avaliações)

Não pode comentar este artigo

Chuck Norris has counted to infinity. Twice.

{debugMessages}