what's the likely max length of apple ios purchase receipt-data?

I was using a varchar (4096) to store my base64 encoded receipts.

But to be honest, I couldn't find anything regarding receipt length on the official documentation (or anywhere else). The only thing I did find on Apple's docs was that the receipt content/format is subject to change:

The contents and format of the store receipt is private and subject to change. Your application should not attempt to parse the receipt data directly. Use the mechanism described here to validate the receipt and retrieve the information stored inside it.

So probably going for text instead of varchar really is the best option.


receipt-data could grow to be much larger due to it containing older subscription information.

In practice, typical size is probably under 10KB. But I've seen receipt-data as large as over 500KB in automated testing, due to repeatedly creating new subscriptions.

It's better to use varchar(max) or text where it's not bounded.


In MySQL, it's safe to use MEDIUMTEXT which has capacity 16 MB.

We were using TEXT but didn't fit well at one point.

TEXT has only 64kb capacity but it's more likely that receipt size will be morethan this after repeated transactions. I only observed this after many transaction in sandbox mode.

TINYTEXT: 255 characters - 255 B

TEXT 65,535 bytes - 64kb

MEDIUMTEXT: 16,777,215 - 16 MB

GBTEXT: 65,535 characters - 64 MB

KBLONGTEXT: 4,294,967,295 characters - 4 GB