Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Events

NameParametersSupported PlatformsDescription
PRODUCT_PURCHASED
  • packageName (String)
  • productId (String)
  • transactionId (String)
  • deviceId or accountId

Status
subtletrue
colourGreen
titleAndroid

Status
subtletrue
colourYellow
titleiOS

Triggered for a new one-time product purchase (single purchase). NOTE: A purchase is considered new, if the receipt was uploaded within 10 minutes of purchasing.
PRODUCT_CANCELLED
  • packageName (String)
  • productId (String)
  • transactionId (String)
  • deviceId or accountId

Status
subtletrue
colourGreen
titleAndroid

Status
subtletrue
colourYellow
titleiOS

Triggered when a one-time product purchase (single purchase) was cancelled, e.g. due to a refund by

customer

Apple support / the developer.

SUBSCRIPTION_PURCHASED


NameTypeDescription
packageName
(
String
)

productId
(
String
)

transactionId
(String)
  • deviceId or accountId (String)
  • trialPeriod (Boolean)
  • String
    originalTransactionIdStringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId
    trialPeriodBoolean
    introOfferPeriodBoolean
    introOfferPeriod (Boolean)


    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    Triggered for new subscription purchases. NOTE: A purchase is considered new, if the receipt was uploaded within 10 minutes of purchasing.
    SUBSCRIPTION_UPGRADED
    • packageName (String)
    • previousProductId (String)
    • nextProductId (String)
    • transactionId (String)
    • deviceId or accountId (String)

    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The subscripton has been upgraded by the user. 

    For iOS: The current subscription will end immediately and then the new one will start. 

    For Android: 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
    • packageName (String)
    • previousProductId (String)
    • nextProductId (String)
    • transactionId (String)
    • deviceId or accountId (String)

    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The subscripton has been downgraded by the user. 

    For iOS: The current subscription will end normally and then the new one will start. 

    For Android: 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


    NameTypeDescription
    packageName
    (
    String
    )

    productId
    (
    String
    )

    transactionId
    (String)
    deviceId or accountId (
    String
    )
    status
    Status
    subtletrue
    colourYellow
    titleiOS

    originalTransactionId
    subtletruecolourGreentitleAndroid
    StringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId



    A previously expired subscription has ben restarted/resubscribed by the user.
    SUBSCRIPTION_RESUBSCRIBED_OTHER
    • packageName (String)
    • previousProductId (String)
    • nextProductId (String)
    • transactionId (String)
    • deviceId or accountId (String)

    Status
    subtletrue
    colourYellow
    titleiOS

    A subscription has expired; user resubscribed to another SKU (upgrade or downgrade)
    SUBSCRIPTION_CANCELLED
    packageName (String)


    NameTypeDescription
    packageNameString
    productId
    (
    String
    )

    transactionId
    (String)
    deviceId or accountId (
    String
    )
    status
    Status
    subtletrue
    colourYellow
    titleiOS

    originalTransactionId
    subtletruecolourGreentitleAndroid
    StringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually 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
    packageName (String)


    NameTypeDescription
    packageNameString
    productId
    (
    String
    )

    transactionId
    (String)
    deviceId or accountId (
    String
    )
    status
    Status
    subtletrue
    colourYellow
    titleiOS

    originalTransactionId
    subtletruecolourGreentitleAndroid
    StringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId



    A subscription has been cancelled after it failed to renew the subscription due to billing problems.
    SUBSCRIPTION_RENEWED
    packageName (String)


    NameTypeDescription
    packageNameString
    productId
    (
    String
    )

    transactionId
    (String)
    String
    originalTransactionIdStringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId
    deviceId or accountId (String)


    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The subscription has been renewed for another period.
    SUBSCRIPTION_RENEWAL_FAILED


    NameTypeDescription
    packageName
    (
    String
    )

    productId
    (
    String
    )

    transactionId
    (String)
    String
    originalTransactionIdStringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId
    deviceId or accountId (String)


    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The subscription could not be renewed due to billing issues. It is still active and the system will retry to renew it.

    When it succeeds it will result in a SUBSCRIPTION_RECOVERED event or if it fails in a SUBSCRIPTION_CANCELLED_INVOLUNTARY event,

    SUBSCRIPTION_RECOVERED


    NameTypeDescription
    packageName
    (
    String
    )

    productId
    (
    String
    )

    transactionId
    (String)
    deviceId or accountId (
    String
    )
    status
    Status
    subtletrue
    colourYellow
    titleiOS

    originalTransactionId
    subtletruecolourGreentitleAndroid
    StringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId



    A subscription that previously failed to renew has been renewed / recovered.

    SUBSCRIPTION_EXPIRED


    NameTypeDescription
    packageName
    (
    String
    )

    productId
    (
    String
    )

    transactionId
    (String)
    String
    originalTransactionIdStringAn identifier that stays the same across all events for this subscription
    deviceIdStringmutually exclusive with accountId
    accountIdStringmutually exclusive with deviceId
    deviceId or accountId (String)


    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The subscription reached its expiration date and is now considered expired. 

    ACCOUNT_ASSIGNMENTS_CHANGED


    NameTypeDescription
    appIdString
    accountIdString


    Status
    subtletrue
    colourGreen
    titleAndroid

    Status
    subtletrue
    colourYellow
    titleiOS

    The assignments of an account changed

    Event format

    Code Block
    languagejs
    titleExample
    {
      "version": "1.0",
      "type": "SUBSCRIPTION_CANCELEDCANCELLED",
      "properties": {
        "deviceId": "1122334455",
    	"productId": "com.example.product1"
      },
      "eventTimeMillis": 11223344L
    }
    


    Code Block
    languagejs
    titleJSON Schema
    {
      "$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"
      ]
    }