Skip to main content

Retrieve active promotions in cart

Retrieve active promotions in cart

Last updated: 29-Sep-2021
Rate this article:

Overview

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

Requirements

This method requires you to set a specific partner using setPartner.

Parameters

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

Response

Parameter Type/Description

Promotion

Array of objects

 

Details below

 

Name

String

 

 

Promotion name

 

Description

String

 

 

Promotion description

 

StartDate

String

 

 

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

 

EndDate

String

 

 

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

 

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.

 

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.

 

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.

 

Coupon

String

 

 

Promotion coupon/voucher.

 

DiscountLabel

String

 

 

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

Request

<?php

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

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getPromotions',
'params' => array($sessionID)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

Errors

Error Description

EMPTY_CART

The shopping cart is empty.

NO_PROMOTIONS

There are no promotions applied to the current shopping cart.

 

Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo