Why would i get an app store server notification of type CANCEL without a cancellation_date_ms field in the receipt info
Cancel server notification with no cancellation_date_ms
I don't know the actual reason, because the documentation about notifications is incomplete, confusing and changing... I don't know if the cancellation_date appears when CANCEL means a refund (of a auto-renewing subscription). But this is just an idea, in case this gives you a clue.
In Handling Subscriptions Billing it it says:
To identify whether a subscription has been refunded, look for the cancellation_date field in the receipt. The App Store notifies your server of refunds with a status update notification of type CANCEL, at which point you can handle the refund. For example, if the user upgraded the subscription, immediately unlock service for the higher level subscription product purchased.
But I'm not sure of anything about notifications... They are a actual mess...
I've found several articles writing about the uselessness of server-to-server notifications (recreate the URL from this fragments, deleting spaces and End-Of-Line chars, that I can't post URLs):
In Handling Subscriptions Billing it it says:
Detect a Refund
Users pay for a subscription when they purchase it, and they can receive a refund by contacting Apple customer service. For example, if the user accidentally buys the wrong product and requests a refund, customer support can cancel the subscription and issue a full or partial refund. Customers may cancel a subscription in the middle of a subscription period, but the subscription remains paid through the end of the same period. Additionally, users may also receive a refund when they upgrade their subscription to another subscription product at a higher level in the same subscription group.To identify whether a subscription has been refunded, look for the cancellation_date field in the receipt. The App Store notifies your server of refunds with a status update notification of type CANCEL, at which point you can handle the refund. For example, if the user upgraded the subscription, immediately unlock service for the higher level subscription product purchased.
But I'm not sure of anything about notifications... They are a actual mess...
I've found several articles writing about the uselessness of server-to-server notifications (recreate the URL from this fragments, deleting spaces and End-Of-Line chars, that I can't post URLs):
https://www.
https://
Additional information (such as it appears today 20210405):
In https://developer.apple.com/documentation/appstoreservernotifications/unified_receipt/latest_receipt_info
it says:
string
The time when Apple customer support canceled a transaction, in a date-time format similar to the ISO 8601. This field is only present for refunded transactions.
string
The time when Apple customer support canceled a transaction, or the time when the user upgraded an auto-renewable subscription plan, in UNIX epoch time format, in milliseconds. This field is only present for refunded transactions. Use this time format for processing dates. For more information, see cancellation_date_ms.
string
The time when Apple customer support canceled a transaction, in the Pacific Time zone. This field is only present for refunded transactions.
string
The reason for a refunded transaction. When a customer cancels a transaction, the App Store gives them a refund and provides a value for this key. A value of “1” indicates that the customer canceled their transaction due to an actual or perceived issue within your app. A value of “0” indicates that the transaction was canceled for another reason; for example, if the customer made the purchase accidentally.
Possible values: 1, 0
So those fields would be expected only when there was a refund.
In https://developer.apple.com/documentation/appstoreservernotifications/unified_receipt/latest_receipt_info
it says:
Properties
cancellation_date
string
The time when Apple customer support canceled a transaction, in a date-time format similar to the ISO 8601. This field is only present for refunded transactions.
cancellation_date_ms
string
The time when Apple customer support canceled a transaction, or the time when the user upgraded an auto-renewable subscription plan, in UNIX epoch time format, in milliseconds. This field is only present for refunded transactions. Use this time format for processing dates. For more information, see cancellation_date_ms.
cancellation_date_pst
string
The time when Apple customer support canceled a transaction, in the Pacific Time zone. This field is only present for refunded transactions.
cancellation_reason
string
The reason for a refunded transaction. When a customer cancels a transaction, the App Store gives them a refund and provides a value for this key. A value of “1” indicates that the customer canceled their transaction due to an actual or perceived issue within your app. A value of “0” indicates that the transaction was canceled for another reason; for example, if the customer made the purchase accidentally.
Possible values: 1, 0
So those fields would be expected only when there was a refund.