This class retrieves coupon information and optinonally product and order form information. This class should only be instantiated by dispatchMBAPI() found in include/mbapi/mbapi.php. Something similar to the following XML should be passed to dispatchMBAPI() when you want to call the GetCoupons command:
<mbapi> <command><!-- None --></command> <showXMLHeader><!-- None --></showXMLHeader> <params> <couponID><!-- int --></couponID> <couponCode><!-- string --></couponCode> <couponComments><!-- string --></couponComments> <couponActive><!-- int --></couponActive> <couponNewOnly><!-- int --></couponNewOnly> <couponType><!-- int --></couponType> <couponDiscountLessThan><!-- double --></couponDiscountLessThan> <couponDiscount><!-- double --></couponDiscount> <couponDiscountGreaterThan><!-- double --></couponDiscountGreaterThan> <couponDateCreatedLessThan><!-- int --></couponDateCreatedLessThan> <couponDateCreated><!-- int --></couponDateCreated> <couponDateCreatedGreaterThan><!-- int --></couponDateCreatedGreaterThan> <couponDateStartedLessThan><!-- int --></couponDateStartedLessThan> <couponDateStarted><!-- int --></couponDateStarted> <couponDateStartedGreaterThan><!-- int --></couponDateStartedGreaterThan> <couponDateEndedLessThan><!-- int --></couponDateEndedLessThan> <couponDateEnded><!-- int --></couponDateEnded> <couponDateEndedGreaterThan><!-- int --></couponDateEndedGreaterThan> <couponCountLessThan><!-- int --></couponCountLessThan> <couponCount><!-- int --></couponCount> <couponCountGreaterThan><!-- int --></couponCountGreaterThan> <couponNumCyclesLessThan><!-- int --></couponNumCyclesLessThan> <couponNumCycles><!-- int --></couponNumCycles> <couponNumCyclesGreaterThan><!-- int --></couponNumCyclesGreaterThan> <couponMaxCountLessThan><!-- int --></couponMaxCountLessThan> <couponMaxCount><!-- int --></couponMaxCount> <couponMaxCountGreaterThan><!-- int --></couponMaxCountGreaterThan> <couponApplyNumber><!-- int --></couponApplyNumber> <getOrderFormData><!-- int --></getOrderFormData> <getProductData><!-- int --></getProductData> <productIDs> <productID><!-- int --></productID> </productIDs> <removeProductIDs> <productID><!-- int --></productID> </removeProductIDs> <orderFormIDs> <orderFormID><!-- int --></orderFormID> </orderFormIDs> <removeOrderFormID> <orderFormID><!-- int --></orderFormID> </removeOrderFormID> <sortDir><!-- None --></sortDir> <sortColumn><!-- None --></sortColumn> <recordOffset><!-- None --></recordOffset> <numRecords><!-- None --></numRecords> </params> </mbapi>
None
mbapi
command
showXMLHeader
params
couponID
The ID of the coupon to fetch. This will always select at most 1 coupon.
couponCode
The user designated code for this coupon. This is the string that a customer enters to redeem the coupon on the order form.
couponComments
The coupon comments.
couponActive
Whether the coupon is active.
couponNewOnly
Set to 1 to fetch those coupns that are set to apply to new orders only
couponType
Coupon type.
couponDiscountLessThan
The maximum monetary or percentage discount for a coupon in the result set.
couponDiscount
The exact monetary or percentage discount for a coupon in the result set.
couponDiscountGreaterThan
The minimum monetary or percentage discount for a coupon in the result set.
couponDateCreatedLessThan
The maximum UNIX timestamp for when a coupon was created.
couponDateCreated
The exact UNIX timestamp for when a coupon was created.
couponDateCreatedGreaterThan
The minimum UNIX timestamp for when a coupon was created.
couponDateStartedLessThan
The maximum UNIX timestamp for when a coupon offering started.
couponDateStarted
The exact UNIX timestamp for when a coupon offering started.
couponDateStartedGreaterThan
The minimum UNIX timestamp for when a coupon offering started.
couponDateEndedLessThan
The maximum UNIX timestamp for when a coupon offering ended.
couponDateEnded
The exact UNIX timestamp for when a coupon offering ended.
couponDateEndedGreaterThan
The minimum UNIX timestamp for when a coupon offering ended.
couponCountLessThan
The maximum number in the result set a coupon has been redeemed for.
couponCount
The exact number in the result set a coupon has been redeemed for.
couponCountGreaterThan
The minimum number in the result set a coupon has been redeemed for.
couponNumCyclesLessThan
The maximum number of cycles in the result set to which a coupon can be applied.
couponNumCycles
The exact number of cycles in the result set to which a coupon can be applied.
couponNumCyclesGreaterThan
The minimum number of cycles in the result set to which a coupon can be applied.
couponMaxCountLessThan
The maximum number in the result set a coupon can be redeemed for.
couponMaxCount
The exact number in the result set a coupon can be redeemed for.
couponMaxCountGreaterThan
The minimum number in the result set a coupon can be redeemed for.
couponApplyNumber
Whether this coupon can apply to 1 item or all.
getOrderFormData
Set to 1 to obtain all order information that the selected coupons are associated with.
getProductData
Set to 1 to obtain all product information that the selected coupons apply to.
productIDs
This is a container tag that holds productID tags. Multiple productID tags can be used to associate multiple products with this coupon.
productID
A product that the coupon is to be associate with. You can set multiple product associations by including multiple productID tags. Only one ID can be included with each tag.
removeProductIDs
This is a container tag that holds productID tags. Multiple productID tags can be used to remove multiple product associations with this coupon.
productID
A product that is no longer to be associated with the coupon. You can remove multiple product associations by including multiple productID tags. Only one ID can be included with each tag. This will only remove the association and not the product itself.
orderFormIDs
This is a container tag that holds orderFormID tags. Multiple orderFormID tags can be used to allow this coupon to be used on multiple order forms.
orderFormID
An order form that the coupon is to be used on. You can set multiple order form associations by including multiple orderFormID tags. Only one ID can be included with each tag.
removeOrderFormID
This is a container tag that holds orderFormID tags. Multiple orderFormID tags can be used to remove multiple order form associations with this coupon.
orderFormID
An order form that the coupon is no longer to be used on. You can remove multiple order form associations by including multiple orderFormID tags. Only one ID can be included with each tag.
sortDir
sortColumn
recordOffset
numRecords