PartnerStack 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

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 or name changes
  • partnership_deleted - Partner removed from program
  • partnership_group_updated - Partner group changes
{
   "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_deleted - Transaction is archived
{
   "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
}

Offer Events

The following event types are sent:

  • offer_created - New Offer is created
  • offer_deleted - Offer is archived
{
    "id": 123,
    "body": "$79.64 USD for every sale made",
    "archived": false,
    "default": true,
    "challenge": {
       "id": 33,
       "name": "Summer Sale",
       "key": "chal_1113"
    },
    "created_at": 1524913412966,
    "updated_at": 1524913412966,
    "value": 7964,
    "currency": "USD",
    "type_": "flat",
    "product_key": "",
    "group": {
       "id": 22,
       "name": "Top Sellers",
       "slug": "topsellers"
    },
    "description": "",
    "has_description": false,
    "event": "offer_polled"
}

Lead Events

The following event types are sent:

  • lead_created - A new lead is created
  • lead_updated - An existing lead has been updated
  • lead_approved - An existing lead has been marked as approved
  • lead_declined - An existing lead has been marked as lead_declined
  • lead_status_updated - The status of 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
}

Deal Events

The following event types are sent:

  • deal_created - A new deal is created
  • deal_updated - An existing deal has been updated
  • deal_stage_update - An existing deal has had its stage 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
}