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

Add-on Purchase Success

POST
/

Overview#

Event Name: addon.purchase.success
Description: This event is triggered when a customer successfully purchases an add-on for their subscription.
{
  "id": "WBH-0G9GYY7451S6G",
  "event": "addon.purchase.success",
  "data": {
    "company_id": "COM-0FNWT0H89QS36",
    "country_id": "CON-0AZZVPQHM475V",
    "customer_id": "CUS-0G8HWQ8FMK2WA",
    "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
    "timestamp": 1717834002209,
    "addon": {
      "tsid": "ADV-0FREQGYPG8TR0",
      "adon_tsid": "ADO-0FREQGYM88QQV",
      "name": "Add On 1",
      "description": "Addon on 1",
      "price": 11,
      "created_at": 1713251878582,
      "updated_at": 1713251878582,
      "is_deleted": false,
      "status": "ACTIVE",
      "position": null,
      "plan_versions": [
        "PLV-0FQKQ3HRPVRX6",
        "PLV-0G07MCNH4NWTA"
      ],
      "show_with_pricing_widget": false
    },
    "transaction_tsid": "TRN-0G9GYWEJX1TCS",
    "status": "SUCCESS"
  },
  "created_at": 1717834002209
}
Payload Fields#

Root Fields#

id (string): Unique identifier for the webhook event.
Example: WBH-0G9GYY7451S6G
event (string): Name of the event.
Example: addon.purchase.success
data (object): Contains the event-specific data.
created_at (number): The timestamp when the event was created, in milliseconds since epoch.
Example: 1717834002209

Data Object Fields#

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-0G8HWQ8FMK2WA
customer_identifier (string): An identifier for the customer, such as a UUID or email address.
Example: c56164ad-3d54-4eaa-ae3d-46fe3969972b
timestamp (number): The timestamp when the event occurred, in milliseconds since epoch.
Example: 1717834002209
addon (object): Contains information about the purchased add-on.
tsid (string): The unique identifier of the add-on.
Example: ADV-0FREQGYPG8TR0
name (string): The name of the add-on.
Example: Add On 1
description (string): A description of the add-on.
Example: Addon on 1
price (number): The price of the add-on.
Example: 11
created_at (number): The timestamp when the add-on was created, in milliseconds since epoch.
Example: 1713251878582
updated_at (number): The timestamp when the add-on was last updated, in milliseconds since epoch.
Example: 1713251878582
is_deleted (boolean): Indicates whether the add-on has been deleted.
Example: false
status (string): The current status of the add-on.
Example: ACTIVE
plan_versions (array of strings): A list of plan version identifiers that the add-on is associated with.
Example: ["PLV-0FQKQ3HRPVRX6", "PLV-0G07MCNH4NWTA"]
transaction_tsid (string): The unique identifier of the transaction associated with the add-on purchase.
Example: TRN-0G9GYWEJX1TCS
status (string): The status of the add-on purchase transaction.
Example: SUCCESS

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
company_id
string 
required
country_id
string 
required
customer_id
string 
required
customer_identifier
string 
required
timestamp
integer 
required
addon
object 
required
transaction_tsid
string 
required
status
string 
required
created_at
integer 
required
Example
{
    "id": "WBH-0G9GYY7451S6G",
    "event": "addon.purchase.success",
    "data": {
        "company_id": "COM-0FNWT0H89QS36",
        "country_id": "CON-0AZZVPQHM475V",
        "customer_id": "CUS-0G8HWQ8FMK2WA",
        "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
        "timestamp": 1717834002209,
        "addon": {
            "tsid": "ADV-0FREQGYPG8TR0",
            "adon_tsid": "ADO-0FREQGYM88QQV",
            "name": "Add On 1",
            "description": "Addon on 1",
            "price": 11,
            "created_at": 1713251878582,
            "updated_at": 1713251878582,
            "is_deleted": false,
            "status": "ACTIVE",
            "position": null,
            "plan_versions": [
                "PLV-0FQKQ3HRPVRX6",
                "PLV-0G07MCNH4NWTA"
            ],
            "show_with_pricing_widget": false
        },
        "transaction_tsid": "TRN-0G9GYWEJX1TCS",
        "status": "SUCCESS"
    },
    "created_at": 1717834002209
}

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": "WBH-0G9GYY7451S6G",
    "event": "addon.purchase.success",
    "data": {
        "company_id": "COM-0FNWT0H89QS36",
        "country_id": "CON-0AZZVPQHM475V",
        "customer_id": "CUS-0G8HWQ8FMK2WA",
        "customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
        "timestamp": 1717834002209,
        "addon": {
            "tsid": "ADV-0FREQGYPG8TR0",
            "adon_tsid": "ADO-0FREQGYM88QQV",
            "name": "Add On 1",
            "description": "Addon on 1",
            "price": 11,
            "created_at": 1713251878582,
            "updated_at": 1713251878582,
            "is_deleted": false,
            "status": "ACTIVE",
            "position": null,
            "plan_versions": [
                "PLV-0FQKQ3HRPVRX6",
                "PLV-0G07MCNH4NWTA"
            ],
            "show_with_pricing_widget": false
        },
        "transaction_tsid": "TRN-0G9GYWEJX1TCS",
        "status": "SUCCESS"
    },
    "created_at": 1717834002209
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2024-06-08 10:21:08
Previous
Customer Subscription Status Update
Next
Send Usage
Built with