I'm submitting an iOS7-style App Receipt (obtained from the "appStoreReceiptURL") for validation and getting back unexpected results for an auto-renewing subscription. The JSON I get back from Apple contains an array of "array of in-app purchase receipts". Here's an example of one of those:
{
"quantity":"1",
"product_id":"far_12_upgrade",
"transaction_id":"1000000268698070",
"original_transaction_id":"1000000268692660",
"purchase_date":"2017-01-27 03:12:32 Etc/GMT",
"purchase_date_ms":"1485486752000",
"purchase_date_pst":"2017-01-26 19:12:32 America/Los_Angeles",
"original_purchase_date":"2017-01-27 03:11:46 Etc/GMT",
"original_purchase_date_ms":"1485486706000",
"original_purchase_date_pst":"2017-01-26 19:11:46 America/Los_Angeles",
"expires_date":"2017-01-27 04:12:32 Etc/GMT",
"expires_date_ms":"1485490352000",
"expires_date_pst":"2017-01-26 20:12:32 America/Los_Angeles",
"web_order_line_item_id":"1000000034212100",
"is_trial_period":"false"
},
What is confusing to me is the "expires_date" field. Here's what the documentation says:
Subscription Expiration Date
The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
ASN.1 Field Type 1708
ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date
JSON Field Name expires_date
JSON Field Value number
This key is only present for auto-renewable subscription receipts.
I read this to say that the JSON field should contain a number, "expressed as the number of milliseconds". Instead, it is returning an RFC 3339 date as a string. I also note that there is an undocumented "expires_date_ms" field -- but we are expressly told not to use undocumented fields.
Help!?