Webhooks

Listen for events in your PartnerStack instance as they occur.

PartnerStack uses webhooks to notify an external service that some event has taken place in your instance. This allows you to listen for events without continuously polling our PartnerStack API for new information.

How do webhooks work?

A webhook has two main components: the event and the endpoint receiving the event. This endpoint can be any API endpoint that can accept HTTP POST requests. Whenever a certain event occurs in PartnerStack (for example, when a partner joins your program), we send an HTTP POST request to the URL of your choice. The payload contains information about the event that occurred, which you can use to kick off a series of integrations!

2248

First, an event occurs in PartnerStack. Then, PartnerStack makes an HTTP POST request at the event endpoint you specify. Once this is received, you can use the information in the event payload to kick off other integrations!

Registering a webhook

To register for a webhook, you need to use our Webhooks API endpoints. You'll need to know the event you want to listen for, as well as the URL you want us to send new events to. You can find a list of events we support below!

Events we support

We currently support sending webhooks for the following events. All of our webhooks serve JSON in the request body. A sample payload is available for each type of event.

Agreement Events:

The following event types are sent:

  • agreement.accepted - Terms of service has been accepted
{
	"team_member": {
		"team_owner_email": "[email protected]",
		"team_name": "Smith inc",
		"team_key": "stck_PHPFhrDgpNf468",
		"joined_at": 1680615382836,
		"first_name": "John",
		"last_name": "Smith",
		"email": "[email protected]",
		"key": null,
		"created_at": null,
		"updated_at": null
	},
	"team": {
		"name": "Smith inc",
		"key": "stck_PHPFhrDgpNf468",
		"created_at": 1573497642179,
		"updated_at": 1707285621649
	},
	"approved": true,
	"group": {
		"name": "Referral",
		"slug": "referral",
		"archived": false,
		"default": false,
		"features": {
			"application_enabled": false,
			"deals_enabled": true,
			"disable_link_create": false,
			"leads_enabled": true
		},
		"key": "grup_hs8kJ3YZJEoXl7",
		"created_at": 1694442310603,
		"updated_at": 1707403201441
	},
	"tier": null,
	"first_name": "Jane",
	"last_name": "Smith",
	"email": "[email protected]",
	"partner_key": "janesmith2319",
	"fields": [],
	"field_data": {},
	"fraud_flagged": false,
	"meta": {},
	"manager_name": null,
	"manager_email": null,
	"tags": null,
	"key": "part_f2a02a0a3d9c47e29",
	"created_at": 1460036266235,
	"updated_at": 1707403393365
}

Application Events

The following event types are sent:

  • application.created - New application has been created
  • application.approved - Application has been approved
  • application.declined - Application has been declined
{
  "approved": null,
  "content": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "[email protected]",
    "business_name": "Best Company",
    "website": null
  },
  "decline_reason": "",
  "group_name": "Affiliates",
  "group_slug": "affiliates",
  "group": {
    "key": "grup_12345abcde",
    "name": "Affiliates",
    "slug": "affiliates"
  },
  "mold_key": "mold_12345abcde",
  "partnership_key": "part_12345abcde",
  "partner_key": "johnsmith1234",
  "top_partner": false,
  "premium_partner": false,
  "high_potential_partner": false,
  "fraud_flagged": false,
  "team_name": "John Smith",
  "team_key": "stck_12345abcde",
  "with_profile": false,
  "key": "appl_12345abcde",
  "created_at": 1686318608314,
  "updated_at": 1687977496375,
  "meta": {}
}

Partnership Events

The following event types are sent:

  • partnership.created - New Partner joins program
  • partnership.updated - Partner Key / Partner Group changed through API action
  • partnership.tags_updated - Partner Tag updates
{
   "id": 123,
   "partner_key": "JohnSmith",
   "first_name": "John",
   "last_name": "Smith",
   "email": "[email protected]",
   "group": {
      "id": 22,
      "name": "Top Sellers",
      "slug": "topsellers"
   },
   "event": "partnership_created",
   "archived": "false"
}

Customer Events

The following event types are sent:

  • customer.created - New Customer signup tracked
  • customer.updated - Customer information updated (name, email, etc.)
  • customer.deleted - Customer is archived
{
   "id": 123,
   "key": "crust_a1xlr0s3",
   "email": "[email protected]",
   "name": "Roger Axel",
   "partner_key": "bertramgilfoyle",
   "created_at": 1537205154288,
   "updated_at": 1537205159876,
   "archived": false,
   "event": "customer_updated"
}

Transaction Events

The following event types are sent:

  • transaction.created - New Transaction is tracked in program
  • transaction.updated - Transaction is updated
{
   "id": 123,
   "customer_key": "crust_Lg23wNmkIF8hnB",
   "partner_key": "MurryFlatley",
   "currency": "USD",
   "amount": 153809,
   "key": "tran_SoaaRTEY7QFA1k",
   "event": "transaction_polled",
   "archived": false,
   "created_at": 1537205154288,
   "updated_at": 1537205159876
}

Lead Events

The following event types are sent:

  • lead.created - A new lead is created
  • lead.updated - An existing lead has been updated
{
    "approved": None,
    "archived": False,
    "company_id": 6,
    "created_at": 1584730345695,
    "decline_reason": '',
    "email": "[email protected]",
    "external_key": "[email protected]",
    "key": "lead_KkGd8UAMVMAcWR",
    "meta": {
        "country": "United States",
        "first_name": "austen",
        "firsttype_phWcnMuA8mpJ": "",
        "last_name": "bostron",
        "online_monthly_revenue": "Under $10K per month",
        "phone": "7189084190",
        "picklist_fkNFmN8IIEaP": "",
        "secondwithdefault_NEElyEIGrnAv": "default"
    },
    "name": "austen bostron",
    "owner": "company",
    "partner_key": "austensutherland9896",
    "partnership_id": 134,
    "status": "open",
    "updated_at": 1584730345695,
    "event": "lead_created"
}

Deal Events

The following event types are sent:

  • deal.created - A new deal is created
  • deal.updated - An existing deal has been updated
{
    "account_name": "Robert Reilly",
    "amount": 8753,
    "close_date": 1583038800000,
    "company_id": 6,
    "contact_first_name": "Stephanie",
    "contact_last_name": "Sullivan",
    "created_at": 1582908052302,
    "key": "deal_fLvIgE6Yb43CLO",
    "meta": {
        "company_name_38n83e3e3": "Some Company",
        "favorite_number_122jdfu232": 2,
    },
    "partner_key": "brendachapman3787",
    "stage": "Working",
    "updated_at": 1582908052302
}

Training Events

The following event types are sent:

  • training.course_completed - Training completed
  • training.learning_path_completed - Learning path completed
{
  "id": 982931,
  "partner_key": "JohnSmith",
    "first_name": "John",
   "last_name": "Smith",
    "email": "[email protected]",
    "group": {
       "id": 22,
        "name": "Top Sellers",
         "slug": "topsellers",
     },
     "event": "partnership_created",
     "archived": "false",
 }

Reward Events

The following event types are sent:

  • reward.created - Partner reward created
  • reward.updated - Partner reward updated
{
  "created_at":1584730345695,
  "key":"lead_KkGd8UAMVMAcWR",
  "updated_at": 1584730345695,
  "amount": 100,
  "description": "description of the created reward",
  "target":{
    "key": "key_123",
    "type": "customer"
  }
}

Partner Team Member Event

The following event types are sent:

  • partner_team.member_created - Company's partner team member created
  • partner_team.member_removed - Company's partner team member removed
{
	"key": "key_123",
  "created_at": 1584730345695,
  "updated_at": 1584730345695,
  "first_name": "John",
  "last_name": "Smith",
  "email": "[email protected]",
  "team_name": "team greatest",
  "team_key": "tem_key_123",
  "team_owner_email":"[email protected]",
  "joined_at": 1584730345695
}

Action Events

The following event types are sent:

  • action.created - Action created
  • action.updated - Action updated
{
  "created_at":1584730345695,
  "key":"lead_KkGd8UAMVMAcWR",
  "updated_at": 1584730345695,
  "target_key": "target_key",
 	"target_type": "customer",
  "type": "type_string",
  "value": 100
}