Documents
-
getCoupon
getCoupon description: get the coupon details given the coupon code. An example using our simple to use PHP codebookie … Read more →
-
verify
verify description: verify the discounted price and the checkout token. This should be used after getCoupon has been used and … Read more →
-
confirmOrder
confirmOrder description: places the finalized order information into CodeBookie. Should use after payment has been completed and confirmed by the … Read more →
-
getTokenInfo
-
cancelCommission
description: API call to refund a transaction and reverse commission from a sale if required Example usage
1234567require "codeBookie.php";$codeBookie = new CodeBookie();$confirmationID = '1234567890';$result = $codeBookie->refundCouponCommission($confirmationID);Output variables:
-
generateCouponProduct
/coupon/generateCouponProduct Used to generate a one time usage coupon for a client. Example PHP Code using the Codebookie Class:
12345678910111213141516171819202122232425require "codeBookie.php";$codeBookie = new CodeBookie();//the email address the coupon will be generated for$email = "test@test.com";//coupon will expire in 3 days$daysExpire = 3;//discount type is either $ or %$discountType = '%';//we want the discount type to be 10% off original price$discountAmount = '10';//sku of the product$sku = 'PRODUCTCODE1';//website ID of your site you want the coupon generated for$websiteID = 1;$result = $codeBookie->createLimitedOneTimeCouponForProduct($email,$daysExpire,$discountType,$discountAmount,$sku,$websiteID);//coupon generated successfullyif ($result['status'] == "OK"):$coupon = $result['coupon_code'];//anthing else is an errorelse:$errorMessage = $result['message'];endif;