Stykite
  1. Webhooks
Stykite
  • Introduction
  • Pre-requisites: Account & API Keys
  • Integration
    • Self-Serve Integration on your SaaS/AI App
    • Usage-Based Billing
    • Customer Facing Widgets
      • Pricing Widget Integration Guide
      • My Account Widget Integration
      • Subscribe Button
    • API Reference
      • Webhooks
        • Customer Subscription Status Update
          POST
        • Add-on Purchase Success
          POST
      • Usage
        • Send Usage
      • Customer
        • Create Customer with Auto Subscribe
        • Get Customer and Subscription Details
      • Subscription
        • Cancel Subscription
        • Update Subscription
  • Learning Stykite
    • Subscriptions & Plans
    • Add-ons
    • Pricing Versions
    • Manual Subscriptions & Exclusive Plans
    • Invoices
    • Payments
    • Sales Tax
    • Customers
    • Transactions & Refunds
    • Settings
  1. Webhooks

Customer Subscription Status Update

POST
/

Overview#

Event Name: customer.subscription_status.update
Description: This event is triggered when a customer's subscription status changes (e.g., from active to inactive, canceled, or suspended).
{
  "id": "evt_123456",
  "event": "customer.subscription_status.update",
  "data": {
    "reason": null,
    "company_id": "COM-0FNWT0H89QS36",
    "country_id": "CON-0AZZVPQHM475V",
    "customer_id": "CUS-0FQHMZE17MASC",
    "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
    "timestamp": 1717645444289,
    "status": "ACTIVE",
    "trial_used": false
  },
  "created_at": 1717645444289
}
Payload Fields#

Root Fields#

id (string): Unique identifier for the event.
Example: WBH-0G8TFMWR5QYAX
event (string): Name of the event.
Example: customer.subscription_status.update
data (object): Contains the event-specific data.
created_at (number): The timestamp when the event was created, in milliseconds since epoch.
Example: 1717645444289

Data Object Fields#

reason (string or null): The reason for the subscription when status is on ON_HOLD. It can be null if no specific reason is provided.
company_id (string): The unique identifier of the company associated with the customer.
Example: COM-0FNWT0H89QS36
country_id (string): The unique identifier of the country associated with the customer.
Example: CON-0AZZVPQHM475V
customer_id (string): The unique identifier of the customer.
Example: CUS-0FQHMZE17MASC
customer_identifier (string): An identifier for the customer, specified by merchant.
Example: c56164ad-3d54-4eaa-ae3d-46fe3969972b
timestamp (number): The timestamp when the event occurred, in milliseconds since epoch.
Example: 1717645444289
status (string): The new status of the customer's subscription.
Values: ACTIVE TRIAL CANCELLED ON_HOLD PAUSE
trial_used (boolean): Indicates whether the trial period has been used.
Example: false

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
x-api-host
string 
required
Example:
stykite
Body Params application/json
id
string 
required
event
string 
required
data
object 
required
reason
null 
required
company_id
string 
required
country_id
string 
required
customer_id
string 
required
customer_identifier
string 
required
timestamp
integer 
required
status
string 
required
trial_used
boolean 
required
created_at
integer 
required
Example
{
  "id": "evt_123456",
  "event": "customer.subscription_status.update",
  "data": {
    "reason": null,
    "company_id": "COM-0FNWT0H89QS36",
    "country_id": "CON-0AZZVPQHM475V",
    "customer_id": "CUS-0FQHMZE17MASC",
    "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
    "timestamp": 1717645444289,
    "status": "ACTIVE",
    "trial_used": false
  },
  "created_at": 1717645444289
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sandbox.api.stykite.com/' \
--header 'x-api-host: stykite' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": "evt_123456",
  "event": "customer.subscription_status.update",
  "data": {
    "reason": null,
    "company_id": "COM-0FNWT0H89QS36",
    "country_id": "CON-0AZZVPQHM475V",
    "customer_id": "CUS-0FQHMZE17MASC",
    "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
    "timestamp": 1717645444289,
    "status": "ACTIVE",
    "trial_used": false
  },
  "created_at": 1717645444289
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2024-06-08 10:21:08
Previous
Subscribe Button
Next
Add-on Purchase Success
Built with