question

larissa avatar image
larissa asked

RedeemCoupon Timeout and GrantedCurrency

Hi! :)

---

I recently encountered two problems with the RedeemCoupon API.

1.) There seems to be a timeout, if the bundle associated with the CouponCode contains too many items

For example, the following Error was returned, when I tried to Redeem a coupon for a Bundle with 24 items, that had a Quantity of 10 each. If I reduce the Quantity from 24 x 10 to 24 x 5 it works.

{
	"Level": "Error",
        "Message": "PlayFab API request failure",
        "Data":
	{
        	"api": "/Server/RedeemCoupon",
		"request":
		{
                	"PlayFabId": "3AD264F1DD7F6299",
                        "CouponCode": "nei-z5gm-gde"
                },
                "error": "Timeout"
        }
}


2.) The RedeemCouponResult only has informations on the items that were granted, but is missing information on the granted currency amounts.

This makes it very difficult to display to the user, what they have received (currency-wise). The only way I see right now would be to manually query the currency right before and right after the RedeemCoupon call, and even then there's a chance this might incorporate currency-differences from other sources than the coupon.

Most likely a "GrantedCurrencies" field should be added to the RedeemCouponResult, analogously to the GrantedItems field which is already there.

---

Thanks!

apisCloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Actually, that's not the RedeemCoupon call timing out - the error is saying that your Cloud Script call timed out, due to taking too long. Specifically in this case, due to the RedeemCoupon call taking too long to return. If you're adding 24 individual items, or 24 stackable items (x 10), that would be quite speedy. But if you're trying to add hundreds of individual items (24 x 10 non-stackable items), that's going to take a long time, potentially causing the call to timeout. Actually, I'd expect your reduced number to still time out sometimes, as 120 individual items is a lot to be adding all at once. Of course, if you can make them stackable, that would be greatly preferable.

For the currency, yes, that's a known issue for which we have an open work item (https://community.playfab.com/questions/5552/coupon-response-doesnt-include-currencies.html). We haven't had much feedback on that, hence the reason it hasn't been prioritized.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

larissa avatar image larissa commented ·

Thanks for the help!

---

I'm not sure if I'm understanding this correctly. The coupon I used was actually for a bundle that contains 24 different stackable items - each item with a quantity of 10. From your description this should be fast then...?

Should bug posts be liked in order to upvote the bug or...?

0 Likes 0 ·
brendan avatar image brendan larissa commented ·

I would expect adding 10 of a stackable item to be practically the same as adding 5. What is the Title ID, Item IDs, and what PlayFab ID were you using for the test?

For the issue that VC isn't reported, I misspoke - that's not really a bug, as all the items added are returned. The issue is that if you have a bundle containing VC, you'd also like to get that data. I've edited that above, to clarify. What I'd recommend is adding a post to our Feature Requests forum, so that others can "like" getting the VC returned in the data.

0 Likes 0 ·
larissa avatar image larissa brendan commented ·

TitleID: 6131

PlayFabID: 3AD264F1DD7F6299

ItemIDs: com.forestringgames.towerduel.card.attacker.boomerang,

com.forestringgames.towerduel.card.attacker.chargepod, ...

(All 24 com.forestringgames.towerduel.card.[...])

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.