getCoupon
description: get the coupon details given the coupon code.
Parameter | Type | Description | Required |
---|---|---|---|
api_token | string | API Token | YES |
coupon_code | string | Coupon code to be checked and validated | YES |
product_code | string | Product code or SKU | YES |
price | decimal | Price of the product | YES |
An example using our simple to use PHP codebookie class file:
1 2 3 4 5 6 7 8 |
require "codeBookie.php"; $codeBookie = new CodeBookie(); $couponCode = 'TESTCOUPON'; $productCode = 'PRODUCTCODE'; $price = 29.99; $result = $codeBookie->getCoupon($couponCode,$productCode,$price); |
Output:
Variable | Type | Description |
---|---|---|
status | string | OK - getCoupon call is successful ERROR - Coupon code can no longer be used, or limit has been reached NOT_VALID - Coupon code does not exist |
coupon_code | string | Coupon Code |
discount_type | string | The discount type either $ or % |
discount | decimal | the discount $ or % to take off the original price |
discount_amount | decimal | the dollar amount to be discounted off the original price |
new_price | decimal | the discounted price. Original price - discount amount |
checkout_token | string | A token that will expire in an hr after the initial call has been made to store the information from the getCoupon call |