---
title: Receipt Events
slug: editorial/receipt-events
description: This article contains receipt events as well as an example and a JSON schema of the event format.
createdAt: 2024-10-22T12:04:49.413Z
---

## Events

| **Name**                             | **Parameters**                                                                                                                                                                                                                                                                                                                                                                                                        | **Supported Platforms**                                                                | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PRODUCT_PURCHASED`                  | - packageNam&#x65;*&#x20;(String)*<br />- productI&#x64;*&#x20;(String)*<br />- transactionI&#x64;*&#x20;(String)*<br />- deviceI&#x64;*&#x20;or&#x20;*&#x61;ccountId                                                                                                                                                                                                                                                 | ****<font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font> | Triggered for a new one-time product purchase (single purchase). <br />*NOTE: A purchase is considered new, if the receipt was uploaded within 10 minutes of purchasing.*                                                                                                                                                                                                                                                                                            |
| `PRODUCT_CANCELLED`                  | - packageNam&#x65;*&#x20;(String)*<br />- productI&#x64;*&#x20;(String)*<br />- transactionI&#x64;*&#x20;(String)*<br />- deviceI&#x64;*&#x20;or&#x20;*&#x61;ccountId                                                                                                                                                                                                                                                 | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | Triggered when a one-time product purchase (single purchase) was cancelled, e.g. due to a refund by Apple support / the developer.                                                                                                                                                                                                                                                                                                                                   |
| `SUBSCRIPTION_PURCHASED`             | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId<br />- trialPeriod, Boolean<br />- introOfferPeriod, Boolean<br /> | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | Triggered for new subscription purchases. <br />*NOTE: A purchase is considered new, if the receipt was uploaded within 10 minutes of purchasing.*                                                                                                                                                                                                                                                                                                                   |
| `SUBSCRIPTION_UPGRADED`              | - packageNam&#x65;*&#x20;(String)*<br />- previousProductI&#x64;*&#x20;(String)*<br />- nextProductI&#x64;*&#x20;(String)*<br />- transactionI&#x64;*&#x20;(String)*<br />- deviceI&#x64;*&#x20;or&#x20;*&#x61;ccountI&#x64;*&#x20;(String)*                                                                                                                                                                          | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The subscription has been upgraded by the user. <br />**For&#x20;**<font color="#ff6900">**iOS**</font>**:&#x20;**&#x54;he current subscription will end immediately and then the new one will start. <br />**For&#x20;**<font color="#3b9f0f">**ANDROID**</font>**:** A subscription has been changed to a different product and the new subscription has a higher price. The start of the new subscription depends on the selected proration mode during purchase. |
| `SUBSCRIPTION_DOWNGRADED`            | - packageNam&#x65;*&#x20;(String)*<br />- previousProductI&#x64;*&#x20;(String)*<br />- nextProductI&#x64;*&#x20;(String)*<br />- transactionI&#x64;*&#x20;(String)*<br />- deviceI&#x64;*&#x20;or&#x20;*&#x61;ccountI&#x64;*&#x20;(String)*                                                                                                                                                                          | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The subscription has been downgraded by the user. <br />For <font color="#ff6900">**iOS**</font>: The current subscription will end normally and then the new one will start. <br />For <font color="#3b9f0f">**ANDROID**</font>: A subscription has been changed to a different product and the new subscription has a lower price. The start of the new subscription depends on the selected proration mode during purchase.                                       |
| `SUBSCRIPTION_RESUBSCRIBED`          | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    |                                                                                        | A previously expired subscription has ben restarted/resubscribed by the user.                                                                                                                                                                                                                                                                                                                                                                                        |
| SUBSCRIPTION\_RESUBSCRIBED\_OTHER    | - packageNam&#x65;*&#x20;(String)*<br />- previousProductI&#x64;*&#x20;(String)*<br />- nextProductI&#x64;*&#x20;(String)*<br />- transactionI&#x64;*&#x20;(String)*<br />- deviceI&#x64;*&#x20;or&#x20;*&#x61;ccountI&#x64;*&#x20;(String)*                                                                                                                                                                          | <font color="#ff6900">**iOS**</font>                                                   | A subscription has expired; user resubscribed to another SKU (upgrade or downgrade)                                                                                                                                                                                                                                                                                                                                                                                  |
| `SUBSCRIPTION_CANCELLED`             | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    |                                                                                        | Triggered when the renewal of a subscription has been cancelled by the user. The subscription will continue until the expiration date is reached.                                                                                                                                                                                                                                                                                                                    |
| `SUBSCRIPTION_CANCELLED_INVOLUNTARY` | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    |                                                                                        | A subscription has been cancelled after it failed to renew the subscription due to billing problems.                                                                                                                                                                                                                                                                                                                                                                 |
| `SUBSCRIPTION_RENEWED`               | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The subscription has been renewed for another period.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `SUBSCRIPTION_RENEWAL_FAILED`        | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The subscription could not be renewed due to billing issues. It is still active and the system will retry to renew it.<br />When it succeeds it will result in a SUBSCRIPTION\_RECOVERED event or if it fails in a SUBSCRIPTION\_CANCELLED\_INVOLUNTARY event,                                                                                                                                                                                                       |
| `SUBSCRIPTION_RECOVERED`             | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    |                                                                                        | A subscription that previously failed to renew has been renewed / recovered.                                                                                                                                                                                                                                                                                                                                                                                         |
| `SUBSCRIPTION_EXPIRED`               | **Name, Type, Description**<br />- packageName, String<br />- productId, String<br />- transactionId, String<br />- originalTransactionId, String, An identifier that stays the same across all events for this subscription<br />- deviceId, String, mutually exclusive with accountId<br />- accountId, String, mutually exclusive with deviceId                                                                    | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The subscription reached its expiration date and is now considered expired.                                                                                                                                                                                                                                                                                                                                                                                          |
| ACCOUNT\_ASSIGNMENTS\_CHANGED        | **Name, Type, Description**<br />- appId, String<br />- accountId, String<br />                                                                                                                                                                                                                                                                                                                                       | <font color="#3b9f0f">**ANDROID**</font><br /><font color="#ff6900">**iOS**</font>     | The assignments of an account changed                                                                                                                                                                                                                                                                                                                                                                                                                                |

## Event format

### Example

```javascript
{
  "version": "1.0",
  "type": "SUBSCRIPTION_CANCELLED",
  "properties": {
    "deviceId": "1122334455",
    "productId": "com.example.product1"
  },
  "eventTimeMillis": 11223344L
}
```

### JSON Schema

```javascript
{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "contentMediaType": "application/vnd+sprylab.purple.aeb.event+json",
  "title": "Event",
  "properties": {
    "version": {
      "type": "string",
      "const": "1.0"
    },
    "type": {
      "type": "string"
    },
    "eventTimeMillis": {
      "type": "number"
    },
    "properties": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "required": [
    "type",
    "properties",
    "eventTimeMillis"
  ]
}
```

