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!

22482248

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.

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_compelted - Learning pat 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
{
    "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",
  "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
}