#akii

1 messages · Page 1 of 1 (latest)

rotund smeltBOT
keen hill
north hearth
#

Great now how will i get the Applicable products here??

keen hill
#

so for example it's probably helpful to use expand:["data.coupon.applies_to"] when listing the PromotionCode API so you can get that information back immediately

north hearth
#

Okay trying that

#

In the promotion code object, i also have the coupon object but the coupon object does not have the applies_to information Its showing me null

keen hill
#

then it applies to all products

#

also make sure you are using expand to get applies_to

#

it is not included by default.

north hearth
#

In the PromotionCode object I already have the coupon object, how do i use the expand param now???

keen hill
#

what exact code did you use to get the PromotionCode object?

north hearth
#

AT50

#

here is the id promo_1MPmr0ELLM3Jv5QRqJx6NtyT

keen hill
#

what exact code did you use to get the PromotionCode object?

north hearth
#

AT50

keen hill
#

if you list PromoCodes and use expand:["data.coupon.applies_to"] as I mention, that should work to get the applies_to information.

keen hill
north hearth
#

Well i passed this case sensitive code only AT50

keen hill
#

no no

#

I mean, what programming code did you write to call the API

north hearth
#

Oh okay

keen hill
north hearth
#

Map<String, Object> params = new HashMap<>();
params.put("code", "AT50");
PromotionCodeCollection promotionCodes = PromotionCode.list(params);

keen hill
#

cool so why don't you add expand like I told you?

north hearth
keen hill
#

you are not passing expand, which you should

#

params.addExpand("data.coupon.applies_to")

#

if you do that and then look at your list of PromotionCodes you should see the coupon and the AppliesTo information returned.