GetCoupons

Description

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:

Attributes

package
modernbill
subpackage
mbapi
version
0.1
author
Andy Christ

Example Request

	<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>

		

Example Response

None
		

Request Elements

mbapi
Type
None
Description
None
Children
command
Type
None
Description
None
showXMLHeader
Type
None
Description
None
params
Type
None
Description
None
Children
couponID
Type
int
Description

The ID of the coupon to fetch. This will always select at most 1 coupon.

couponCode
Type
string
Description

The user designated code for this coupon. This is the string that a customer enters to redeem the coupon on the order form.

couponComments
Type
string
Description

The coupon comments.

couponActive
Type
int
Description

Whether the coupon is active.

couponNewOnly
Type
int
Description

Set to 1 to fetch those coupns that are set to apply to new orders only

couponType
Type
int
Description

Coupon type.

couponDiscountLessThan
Type
double
Description

The maximum monetary or percentage discount for a coupon in the result set.

couponDiscount
Type
double
Description

The exact monetary or percentage discount for a coupon in the result set.

couponDiscountGreaterThan
Type
double
Description

The minimum monetary or percentage discount for a coupon in the result set.

couponDateCreatedLessThan
Type
int
Description

The maximum UNIX timestamp for when a coupon was created.

couponDateCreated
Type
int
Description

The exact UNIX timestamp for when a coupon was created.

couponDateCreatedGreaterThan
Type
int
Description

The minimum UNIX timestamp for when a coupon was created.

couponDateStartedLessThan
Type
int
Description

The maximum UNIX timestamp for when a coupon offering started.

couponDateStarted
Type
int
Description

The exact UNIX timestamp for when a coupon offering started.

couponDateStartedGreaterThan
Type
int
Description

The minimum UNIX timestamp for when a coupon offering started.

couponDateEndedLessThan
Type
int
Description

The maximum UNIX timestamp for when a coupon offering ended.

couponDateEnded
Type
int
Description

The exact UNIX timestamp for when a coupon offering ended.

couponDateEndedGreaterThan
Type
int
Description

The minimum UNIX timestamp for when a coupon offering ended.

couponCountLessThan
Type
int
Description

The maximum number in the result set a coupon has been redeemed for.

couponCount
Type
int
Description

The exact number in the result set a coupon has been redeemed for.

couponCountGreaterThan
Type
int
Description

The minimum number in the result set a coupon has been redeemed for.

couponNumCyclesLessThan
Type
int
Description

The maximum number of cycles in the result set to which a coupon can be applied.

couponNumCycles
Type
int
Description

The exact number of cycles in the result set to which a coupon can be applied.

couponNumCyclesGreaterThan
Type
int
Description

The minimum number of cycles in the result set to which a coupon can be applied.

couponMaxCountLessThan
Type
int
Description

The maximum number in the result set a coupon can be redeemed for.

couponMaxCount
Type
int
Description

The exact number in the result set a coupon can be redeemed for.

couponMaxCountGreaterThan
Type
int
Description

The minimum number in the result set a coupon can be redeemed for.

couponApplyNumber
Type
int
Description

Whether this coupon can apply to 1 item or all.

getOrderFormData
Type
int
Description

Set to 1 to obtain all order information that the selected coupons are associated with.

getProductData
Type
int
Description

Set to 1 to obtain all product information that the selected coupons apply to.

productIDs
Type
group
Description

This is a container tag that holds productID tags. Multiple productID tags can be used to associate multiple products with this coupon.

Children
productID
Type
int
Description

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
Type
group
Description

This is a container tag that holds productID tags. Multiple productID tags can be used to remove multiple product associations with this coupon.

Children
productID
Type
int
Description

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
Type
group
Description

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.

Children
orderFormID
Type
int
Description

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
Type
group
Description

This is a container tag that holds orderFormID tags. Multiple orderFormID tags can be used to remove multiple order form associations with this coupon.

Children
orderFormID
Type
int
Description

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
Type
None
Description
None
sortColumn
Type
None
Description
None
recordOffset
Type
None
Description
None
numRecords
Type
None
Description
None

Response Elements

None