Subscription Status

Learn how to get subscription status changes to your server via webhooks

This webhook service keeps you informed about any changes related to subscriptions, such as new subscriptions, renewals, updates in grace status, or subscription cancellations.

Setup the Endpoint URL

Webhook events are sent to your server via HTTP POST. You configure the endpoint URL through Developer Tools / Webhooks menu under your project.

Events Format

Webhook events are serialized in JSON. The body of a POST request to your server will contain the serialized event.

{
  "queue" : {
    "type" : "SubscriberUpdate",
    "createDate" : "2020-04-20 21:29:20",
    "appId" : "2"
  },
  "parameters" : {
    "package" : {
      "currency" : "USD",
      "packageType" : "subscription",
      "packageId" : "zotlo_premium",
      "price" : 2.9900000000000002,
      "name" : "Zotlo Premium"
    },
    "newPackage" : {
      "discountPrice" : "0.00",
      "period" : 30,
      "startDate" : "2020-08-04 10:48:30",
      "price" : "2.99",
      "packageId" : "zotlo_premium",
      "createDate" : "2020-08-04 10:48:30",
      "currency" : "USD",
      "subscriberId" : "3133"
    },
    "customer" : {
      "email" : "test@zotlo.com",
      "id" : 1,
      "createDate" : "2020-05-13 12:57:36",
      "country" : "TR",
      "lastname" : "Test",
      "firstname" : "Test"
    },
    "card" : {
      "cardNumber" : "411111******1111",
      "expireDate" : "12\/20"
    },
    "profile" : {
      "customParameters" : {
        "country" : "RU",
        "source" : "Landing"
      },
      "quantity" : 1,
      "cancellation" : {
        "date" : "2020-08-13 13:25:08",
        "code" : "CU00001",
        "reason" : "Not Interest"
      },
      "originalTransactionId" : "325afb73-8abe-4bbb-a1f9-679066ed3002",
      "subscriptionType" : "paid",
      "pendingQuantity" : 0,
      "subscriberId" : "3133",
      "language" : "tr",
      "expireDate" : "2020-09-03 10:48:30",
      "package" : "zotlo_premium",
      "realStatus" : "active",
      "startDate" : "2020-08-04 10:48:30",
      "country" : "TR",
      "status" : "active",
      "phoneNumber" : "+905555555555"
    },
    "package_update" : 0
  }
}

Fields

queue

It contains information on the webhook type and history.

parameters

Contains the details on Webhook info.

package

Includes information on the subscriber's active or most recently used package.

newPackage

This field contains the package information to be sent if the subscriber has downgraded their package. It is returned as null if there is no package change.

customer

This is the parameter through which the subscriber's Zotlo information is sent.

card

It's the service that sends registered credit card information.

profile

This is the service that sends the subscriber's subscription status, such as the expiration date. The subscriber's status can be determined by looking at the status value.

profile.customParameters

This parameter is used to send relevant records to the subscriber if specific parameters are supplied to the subscriber during the subscription. Null is the default value

profile.quantity

The number of people who have access to a subscription is returned here if it has been opened to more than one user. The default values is 1.

profile.cancellation

If the subscription is canceled, this parameter contains the reason for the cancellation as well as the cancellation date. The subscription is sent as null if it is not canceled. This parameter should be used to check the subscriber's cancellation status

profile.originalTransactionId

This is the transactionId value of the subscriber's first purchase.

profile.subscriptionType

It can take paid or trial values. If it's a trial, the subscriber is still in the trial period, and if it's a paid subscription, at least one payment has been received

profile.subscriberId

This is the subscriber's unique ID value sent by the client at the start of the subscription. This subscriberId is used to make all system queries.

profile.expireDate

The subscription's expiration date.

profile.package

This is the subscriber's current active package ID.

profile.status

The subscriber's current status. It can be set to active, passive, or grace parameters. The subscription will continue if it is active. The subscription is terminated if it is passive. If the subscription parameter is grace, it means that the subscription could not be renewed because it could not be charged. The status value for users who cancel their subscription appears as active until the expireDate arrives

profile.realStatus

The subscriber's actual status. Unlike the active parameter, it returns the subscriber's current status. Even if the subscription does not expire, users who cancel it are treated as passive in this parameter.

profile.country

The subscriber's country code.

profile.phoneNumber

This is the phone number of the subscriber that is on file in the system.

package_update

The value 1 is used if the notification is sent after the package change. In all other cases, the value 0 is sent.

Last updated