In this post we explain you that how you can get sub-reseller's promo prices using httpapi.com api with php and returns the prices details. It requires GET HTTP Method. You need auth-userid and api-key or auth-password parameters for do that. You will be get the below details in response:
Reseller Id (resellerid)
Product Key (productkey)
Promo Start Time (starttime)
Promo End Time (endtime)
Promo Period (period)
Discounted Price (resellerpriceone)
Standard Price (resellerpricetwo)
Customer Price (customerprice)
Barrrier Price (barrierprice)
Price Applicable to the Sub-Reseller (resellerprice)
Type of Action the Promo is Applicable for (actiontype)
Selling Currency of the Registration Service Provider (serviceprovidersellingcurrency)
Promo Status (isactive)
Whether the Promo can be trickled down the Sub-Reseller chain (istrickleallow)
In case of any errors, a status key with value as ERROR alongwith an error message will be returned. For Promo Prices you can use following function.
<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function Promo_Prices() { # API Url: for test=>https://test.httpapi.com , for live=>https://httpapi.com $api_url = 'https://test.httpapi.com'; $auth_userid = ''; // reseller unique id $api_key = ''; // api-key or reseller password $promodetails = $api_url.'/api/resellers/promo-details.json?auth-userid='.$auth_userid.'&api-key='.$api_key; $result = @file_get_contents($promodetails); $response = json_decode($result, true); if($response) { return $response; } else { return false; } } ?>
Function USAGE
<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ $prices_details = Promo_Prices(); if($prices_details) { echo ""; print_r($prices_details); echo ""; } else { echo "Invalid request."; } ?>
0 comments:
Post a Comment