Integrations - Event Payloads

Any change to an In App Purchase resource will trigger an event, you can subscribe to these events through our Integrations service.

Event payload properties

Name Type Description
id UUID The Mbaasy database ID of the event. Not to be mistaken with the resource ID.
type String The resource type, the only possible value is “in_app_purchase”.
name String The name of the event, possible values are “in_app_purchase.created” and “in_app_purchase.updated”.
data Object The current (at the of the event) data of the resource. See In-App Purchase Resource for more information.
previous_attributes Object Previous values of attributes that have changed as a result of the event. Note Only attributes that have changed will be included.
new_attributes Object New values of attributes that have changed as a result of the event. Note Only attributes that have changed will be included.
created_at Timestamp1 The date and time when the event was created.

Example event payload JSON

{
  "id": "a38c8405-0116-45c3-b0bc-00adf75ab966",
  "type": "in_app_purchase",
  "name": "in_app_purchase.updated",
  "data": {
    "id": "b981d914-9453-483f-a970-f70c350ad780",
    "version": 3,
    "marketplace": "itunes_connect",
    "app_family_id": "8b111c2b-5971-493f-8bee-3fcf3cfcc215",
    "fact_id": "2bad56e0-e550-4dd5-a258-a0c4d91ae8f5",
    "app_identifier": "com.mbaasy.demo",
    "product_id": "premium.1year",
    "quantity": 1,
    "type": "subscription",
    "environment": "production",
    "country_code": "DE",
    "currency_code": "EUR",
    "user_identifier": "ee56eaef-4795-4d36-83a9-b6586742cb30",
    "is_auto_renewing": false,
    "in_trial_period": false,
    "in_grace_period": false,
    "unique_identifier": 123456789012345,
    "metadata": {
      "campaign_id": "0074db55-999b-4470-8e87-a71fe549a9bb"
    },
    "entitlements": [
      "premium/annually"
    ],
    "purchased_at": {
      "utc": "2018-02-26 10:35:47 UTC",
      "ms": 1519641347834
    },
    "current_period_start_at": {
      "utc": "2018-03-28 12:35:32 UTC",
      "ms": 1522240532357
    },
    "current_period_end_at": {
      "utc": "2019-03-28 12:35:32 UTC",
      "ms": 1553776532357
    },
    "created_at": {
      "utc": "2018-02-26 10:35:50 UTC",
      "ms": 1519641350456
    },
    "updated_at": {
      "utc": "2018-03-28 10:35:38 UTC",
      "ms": 1522233338639
    }
  },
  "previous_attributes": {
    "in_trial_period": true,
    "current_period_start_at": {
      "utc": "2018-02-26 10:35:47 UTC",
      "ms": 1519641347834
    },
    "current_period_end_at": {
      "utc": "2018-03-28 12:35:32 UTC",
      "ms": 1522240532357
    },
    "updated_at": {
      "utc": "2018-02-26 10:36:04 UTC",
      "ms": 1519641364097
    }
  },
  "new_attributes": {
    "in_trial_period": false,
    "current_period_start_at": {
      "utc": "2018-03-28 12:35:32 UTC",
      "ms": 1522240532357
    },
    "current_period_end_at": {
      "utc": "2019-03-28 12:35:32 UTC",
      "ms": 1553776532357
    },
    "updated_at": {
      "utc": "2018-03-28 10:35:38 UTC",
      "ms": 1522233338639
    }
  },
  "created_at": {
    "utc": "2018-03-28 10:35:38 UTC",
    "ms": 1522233338702
  }
}
  1. Timestamps are objects that contain an ms (Unix Timestamp in milliseconds) and utc property. e.g.

    {
      "utc": "2018-02-26 10:35:47 UTC",
      "ms": 1519641347834
    }