Track In-App Purchase Status Updates

Status updates, like for subscriptions, can not be tracked by your app itself. Subscription status tracking is usually done on your backend or by some third party service. Apple or Google send real-timesubscription status updates that you interpret and take action on. This is why we provide a simple Web API to enable subscription lifetime value tracking for Mage. Apple or Google contact your backend, your backend contacts Mage. To submit a status change, use the following APIĀ definition.

Send a HTTPĀ Post request to the path /v1/aparecium for the host https://room-of-requirement.getmage.io. For authorization, you set your personal Web-API-Key in your request header as Token. You can access your personal Web-API-Key in the Mage Web App.

For the request body you need to set four required attributes (to submit a switch of subscription you need to define an additional attribute):

  • iapIdentifier : The identifier for the updated IAP.
  • appUserIdĀ : The id you identify your users' subscription status with.
  • subChangeState : The status type update.
  • stateChangeTime : The datetime of the status change.
  • newIapIdentifierĀ : The new subscriptions' identifier. (Only for 'Switch')

We distinguish between four fundamental status changes: Renewing a subscription, switching a subscription, refunding an In-App purchase (IAP) and rebuying an IAP. According to that the subChangeState can take four distinguished strings to define the status change: 'RENEW', 'SWITCH', 'REFUND' or 'REBUY'.

  
    POST /v1/aparecium HTTP/1.1
    Host: https://room-of-requirement.getmage.io
    Content-Type: application/json
    
    {
      "iapIdentifier": string,
      "appUserId": string,
      "subChangeState": string,
      "stateChangeTime": int,
      "newIapIdentifier": string
    }
  
  
    POST /v1/aparecium HTTP/1.1
    Host: https://room-of-requirement.getmage.io
    Content-Type: application/json
    
    {
        "iapIdentifier": "com.example.example_app.premium",
        "appUserId": "example_user_id",
        "subChangeState": "Renew",
        "stateChangeTime": 1593705685
    }
  
  
    POST /v1/aparecium HTTP/1.1
    Host: https://room-of-requirement.getmage.io
    Content-Type: application/json
    
    {
      "iapIdentifier": "com.example.example_app.premium",
      "appUserId": "example_user_id",
      "subChangeState": "Refund",
      "stateChangeTime": 1593705685
    }
  
  
    POST /v1/aparecium HTTP/1.1
    Host: https://room-of-requirement.getmage.io
    Content-Type: application/json
    
    {
        "iapIdentifier": "com.example.example_app.premium",
        "appUserId": "example_user_id",
        "subChangeState": "Switch",
        "stateChangeTime": 1593705685,
        "newIapIdentifier": "com.example.example_app.premium_plus"
    }
  
  
    POST /v1/aparecium HTTP/1.1
    Host: https://room-of-requirement.getmage.io
    Content-Type: application/json
    
    {
      "iapIdentifier": "com.example.example_app.premium",
      "appUserId": "example_user_id",
      "subChangeState": "Rebuy",
      "stateChangeTime": 1593705685
    }
  
Note: In case want to get a deeper understanding of our API, feel free to check out the Web API documentation. The API is documented according to the openapi3.0 standard.
Do you require support?
Contact us
By browsing this site, you agree to our Privacy Policy