For the complete documentation index, see llms.txt. This page is also available as Markdown.

Retrieve active promotions in cart

Use this method to list all promotions applied to products added to cart.

Request parameters

Parameter
Type / Description

sessionID

Required (String) Session identifier, output of the Login method. An exception is thrown if the values are incorrect.

Request sample

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

try {
    $Promotions= $client->getPromotions ($sessionID);
} catch (SoapFault $e) {
    Echo "AllDiscounts: " . $e->getMessage();
    exit;
}
var_dump ("AllDiscounts", $Promotions);

Response parameters

Parameter
Type / Description

Promotion

Array of objects

Details below

Promotion.Name

String

Promotion name

Promotion.Description

String

Promotion description

Promotion.StartDate

String

Promotion start date. NULL for promotions that start immediately after they're created.

Promotion.EndDate

String

Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely.

Promotion.MaximumOrdersNumber

Int

When the maximum number of orders is reached the promotion stops. NULL if you want the promotion to apply to an unlimited number of orders.

Promotion.MaximumQuantity

Int

Discount only applies to a specific number of products, smaller than the maximum defined quantity. NULL if you want the promotion to apply to an unlimited number units. Any extra quantity added to the cart will be sold at full price.

Promotion.InstantDiscount

Boolean

Selecting the instant discount option auto-applies the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon.

Promotion.Coupon

String

Promotion coupon/voucher.

Promotion.DiscountLabel

String

Set discounts as percentage from the product price or as a fixed amount in the chosen currency.

Errors

Error
Description

EMPTY_CART

The shopping cart is empty

NO_PROMOTIONS

There are no promotions applied to current shopping cart

Last updated

Was this helpful?