question

zacarias avatar image
zacarias asked

ValidateIOSReceiptRequest returns 400 bad request

Hello,

We have some users that are experiencing problems with their purchase validation on iOS. OnPlayfabValidationError we get:

Code string: ServiceUnavailable

ErrorMessage: HTTP/1.1 400 Bad Request

ApiEndPoint: /Client/ValidateIOSReceipt

HttpCode: 400

HttpStatus: BadRequest

CustomData: {id of the purchase}

The field error details is null

The iOS version that they are using are: 12.4 and 12.4.1.

We can't replicate in our devices, everything seems fine.

Thank you.

apis
2 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.

marcospaulis avatar image marcospaulis commented ·

Hey @Citrus Yan! We are having exactly the same issue, plus two more error scenarios, where the error response can be a 400 Bad Request, a 500 Service Unavailable or a complete lack of server response.

We can reproduce it in iPad with iOS 13.1.2, some of these errors happen 50% of the times we try to make a purchase. We reproduce this error in sandbox, tesflight and live. We tested it using Unity 2019.1.12f, and playfab sdk 2.76.191015. Also, the request type is set to Unity Web Request

If we´ve got a 400 bad request error, we see a http load failed, similar to what @Zacarias described, but we don´t know where this error come from. Maybe a malformed payload? Or some sort of error with payload and playfab validation?

I attach payloads for every error we get (400, 500 and no server response), if that can help.

Has anyone found a solution to this problem?

0 Likes 0 ·
admin-12 avatar image admin-12 marcospaulis commented ·

We are having the exact same issue with our game. PF receipt validation request either doesn't return at all, or returns a Service Unavailable. The receipt we are passing along is a valid receipt.

0 Likes 0 ·
brendan avatar image
brendan answered

The thing to look at when you get this is the complete response package, including the headers. If you're seeing the LocalUploadTask error in the response, and you're using Unity, it's likely you're running into this:

https://forum.unity.com/threads/unable-to-post-using-a-unitywebrequest-but-only-on-ios.672697/

1 comment
10 |1200

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

admin-12 avatar image admin-12 commented ·

Thank you Brendan! This was indeed the issue.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

Hi @Zacarias,

We do occasionally see the 400 Bad Request Error, but generally speaking, it’s fairly rare. It’s possible that the real issue may have been a problem with being able to get to our endpoints from your player’s region entirely, what's the response the got when they retry?

If you're seeing it with any frequency, we'd appreciate the details: What’s your Title Id ? How often are you seeing it?

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

zacarias avatar image zacarias commented ·

We have seen the problem from users located on United Kingdom and United States mainly, and they report that they get the problem again when they retry (we could get the stack traces of a few of them and it confirms).

Our Title Id is 6EE47

We had it happen more than usual and had to compensate a lot of purchases.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan zacarias commented ·

Can you provide the stack traces? Feel free to obfuscate sensitive Infos.

0 Likes 0 ·
zacarias avatar image zacarias Citrus Yan commented ·

It's esentially the same as I said on the first post, stack trace below.

We're using Unity 2019.1.10f

stacktrace.txt

0 Likes 0 ·
stacktrace.txt (28.1 KiB)
Show more comments
fujitrace avatar image
fujitrace answered

@Citrus Yan

I am having the same problem. ValidateIOSReceiptRequest returns 400 bad request. Is there a solution?

10 |1200

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

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.