Adding Webhooks

This article shows how to integrate webhooks in your Teachable school on the Basic plan and up.

What are Webhooks?

Webhooks are an easy way to send information from one app to another. They can be configured in a way that will invoke behavior on another website.

You can create your own webhook to integrate into your Teachable school. There are 12 kinds of events that can be added with webhooks:

  1. New users join your school
  2. Users update their contact information
  3. New sales
  4. Transactions for one-time/recurring payments
  5. Student cancels a subscription
  6. Enrollment is created
  7. Lecture completions
  8. Lecture Progress Created (user completes a lecture)
  9. Response Created (user completes a graded quiz)
  10. Comment Created
  11. Transaction Refunded
  12. Enrollment Completed (user completes course)

NOTE: using Webhooks is a more advanced feature of Teachable. 

Adding a Webhook on Your Teachable School

  1. Log into your Teachable school.
  2. Select Settings from the admin sidebar.
  3. Click Webhooks. webhooks submenu
  4. Select New Webhook. add new webhook
  5. Enter a valid Webhook URL from a third-party application and select an Event Type from the list. Set the Send as JSON Array toggle to On if your integration needs that data format. Learn more about how to set up third-party Teachable integrations hereNew_Webhook___Admin_2.png

    NOTE: Make sure you include the correct web protocol (https or http) in your Webhook URL.

  6. Click the orange Create Webhook button at the bottom.

Your webhook is now set up! When the event type you chose occurs, it will fire off a webhook event and the status of your webhook will change from “pending" to “verified." 

Editing and Deleting Webhooks

To edit a webhook, click the teal pencil icon on the main webhooks page.edit webhook

There, you can change the URL, event type, and JSON array toggle, and view the webhook's trigger history. In the trigger history you will see whether the webhook was executed successfully or unsuccessfully each time it was triggered.

Edit_Webhook___Admin.png

If a webhook fails four times, it will be automatically disabled. If this happens, you can manually enable it from the edit page. This is what a failed webhook's edit page will look like:

failed webhook

To delete a webhook, click the red trash icon on the main webhooks page. delete webhook

Data Returned From Webhooks

If you'd like to see the test data for any event type as a JSON response:

  1. Log into the school for which you would like to view the test data.
  2. In your browser URL box, go to [SCHOOL_URL].teachable.com/api/v1/hooks/example?event_type=[EVENT.TYPE]. You'll have to replace [SCHOOL_URL] with the URL of your school, and [EVENT.TYPE] with the event type you would like to see the test data for (i.e. User.updated, Enrollment.created, etc. This URL is case specific.

    For example, if you would like to see the test data for a new sale for a school at designacademy.teachable.com, you would enter "designacademy.teachable.com/api/v1/hooks/ example?event_type=Sale.created" into the URL box.

NOTE: You must run the relevant webhook at least once in your school to view the test data. For example, if you'd like to see the test data for new sales, there must be at least one instance where the New Sales webhook was used in your school.

Listed below are examples of the test data that would be returned for a variety of event types:

Lecture Completions

[
{
 "type": "lectureprogress.created",
 "object": "event",
 "id": 1,
 "livemode": false,
 "created": 628232405,
 "data": {
   "object": {
     "id": 1,
     "is_completed": true,
     "course_id": 1,
     "lecture_id": 1,
     "school_id": 1,
     "course": {
       "id": 1
     },
     "lecture": {
       "id": 1
     },
     "user": {
       "id": 1,
       "role": "student",
       "email": "student@example.com"
     },
     "object": "lectureprogress",
     "created": 628232405,
     "livemode": false
   }
 }
}

New Sales

[

{
 "created": 1326853478,
 "livemode": false,
 "id": 345,
 "type": "sale.created",
 "object": "event",
 "data": {
   "object": {
     "object": "sale",
     "school_id": 1,
     "created": 1405501752,
     "id": 495,
     "price": 400,
     "currency": "USD",
     "product_id": 47,
     "course_id": 47,
     "is_active": true,
     "livemode": false,
     "is_recurring": false,
     "user_id": 1,
     "product": {
       "id": 47,
       "name": "foo"
     },
     "course": {
       "id": 47,
       "name": "foo"
     },
     "user": {
       "id": 1,
       "email": "foo@example.com"
     }
   }
 }
}

]
]

New Users Join Your School

[

{
 "type": "user.created",
 "object": "event",
 "id": 1,
 "livemode": false,
 "created": 628232400,
 "data": {
 "object": {
     "id":8014167,
     "role":"student",
     "email":"teachable@test.com",
     "name":"Tim @ Teachable",
     "school_id":116505,
     "src":null,
     "first_touch":null,
     "last_touch":null,
     "last_sign_in_at":"2017-11-06T22:38:34Z",
     "sign_in_count":3,
     "unsubscribe_from_marketing_emails":null
}
 }
}

]
]

Transactions for One-time/Recurring Sales

[
[  
   {  
      "type":"Transaction.created",
      "id":1459433,
      "livemode":true,
      "created":"2018-01-29T17:21:03+00:00",
      "hook_event_id":1,
      "object":{  
         "id":1459433,
         "user_id":8014167,
         "school_id":116505,
         "final_price":100,
         "currency":"USD",
         "affiliate_percent":0.0,
         "author_percent":0.0,
         "fedora_percent":0.0,
         "amount_refunded":100,
         "status":"paid",
         "is_recurring":false,
         "sale_id":9980514,
         "coupon_id":null,
         "net_charge":0,
         "stripe_charge_token":"ch_Bikl1YiiuxgHl0",
         "net_charge_usd":0,
         "fedora_fee":0,
         "net_revenue_usd":0,
         "processor_fee_description":null,
         "affiliate_fees":0,
         "earnings_usd":0,
         "paypal_payment_id":null,
         "legacy_id":null,
         "purchased_at":"2017-11-06T22:39:36Z",
         "author_fees":0,
         "stripe_invoice_id":null,
         "stripe_event_id":null,
         "refunder_id":4106241,
         "processor_fee":0,
         "total_fedora_fee":0,
         "is_chargeback":null,
         "is_stripe_connect":null,
         "author_id":6431807,
         "credential_id":null,
         "is_custom_paypal":null,
         "data":{  
            "id":"ch_Bikl1YiiuxgHl0",
            "paid":true,
            "order":null,
            "amount":100,
            "object":"charge",
            "review":null,
            "source":{  
               "id":"card_BiklccgLu7l1vj",
               "name":null,
               "brand":"Visa",
               "last4":"2620",
               "object":"card",
               "country":"US",
               "funding":"debit",
               "customer":"cus_BiklLYMCywOhdY",
               "exp_year":2019,
               "metadata":{  

               },
               "cvc_check":"pass",
               "exp_month":1,
               "address_zip":"11803",
               "fingerprint":"heQqrn9EjJ7BaUsD",
               "address_city":null,
               "address_line1":null,
               "address_line2":null,
               "address_state":null,
               "dynamic_last4":null,
               "address_country":null,
               "address_zip_check":"pass",
               "address_line1_check":null,
               "tokenization_method":null
            },
            "status":"succeeded",
            "created":1510007975,
            "dispute":null,
            "invoice":null,
            "outcome":{  
               "type":"authorized",
               "reason":null,
               "risk_level":"normal",
               "network_status":"approved_by_network",
               "seller_message":"Payment complete."
            },
            "refunds":{  
               "url":"/v1/charges/ch_Bikl1YiiuxgHl0/refunds",
               "data":[  
                  {  
                     "id":"re_BilDRxVhyo1c7I",
                     "amount":100,
                     "charge":"ch_Bikl1YiiuxgHl0",
                     "object":"refund",
                     "reason":null,
                     "status":"succeeded",
                     "created":1510009679,
                     "currency":"usd",
                     "metadata":{  

                     },
                     "receipt_number":null,
                     "balance_transaction":{  
                        "id":"txn_BilD0b66ok1Pis",
                        "fee":-33,
                        "net":-67,
                        "type":"refund",
                        "amount":-100,
                        "object":"balance_transaction",
                        "source":"ch_Bikl1YiiuxgHl0",
                        "status":"available",
                        "created":1510009679,
                        "currency":"usd",
                        "description":"REFUND FOR CHARGE (sagdsag)",
                        "fee_details":[  
                           {  
                              "type":"stripe_fee",
                              "amount":-33,
                              "currency":"usd",
                              "application":null,
                              "description":"Stripe processing fee refund"
                           }
                        ],
                        "available_on":1510099200,
                        "sourced_transfers":{  
                           "url":"/v1/transfers?source_transaction=re_BilDRxVhyo1c7I",
                           "data":[  

                           ],
                           "object":"list",
                           "has_more":false,
                           "total_count":0
                        }
                     }
                  }
               ],
               "object":"list",
               "has_more":false,
               "total_count":1
            },
            "captured":true,
            "currency":"usd",
            "customer":"cus_BiklLYMCywOhdY",
            "livemode":true,
            "metadata":{  
               "email":"teachable@test.com",
               "order":"order_8vzqtpdp",
               "country":"US",
               "school_id":"116505",
               "product_id":"429527",
               "course_name":"How to Have Fun!",
               "product_name":"sagdsag"
            },
            "refunded":true,
            "shipping":null,
            "application":null,
            "description":"sagdsag",
            "destination":null,
            "failure_code":null,
            "on_behalf_of":null,
            "fraud_details":{  

            },
            "receipt_email":null,
            "receipt_number":null,
            "transfer_group":null,
            "amount_refunded":100,
            "application_fee":null,
            "failure_message":null,
            "source_transfer":null,
            "balance_transaction":{  
               "id":"txn_Biklw7uNS6Dtal",
               "fee":33,
               "net":67,
               "type":"charge",
               "amount":100,
               "object":"balance_transaction",
               "source":"ch_Bikl1YiiuxgHl0",
               "status":"available",
               "created":1510007979,
               "currency":"usd",
               "description":"sagdsag",
               "fee_details":[  
                  {  
                     "type":"stripe_fee",
                     "amount":33,
                     "currency":"usd",
                     "application":null,
                     "description":"Stripe processing fees"
                  }
               ],
               "available_on":1510099200,
               "sourced_transfers":{  
                  "url":"/v1/transfers?source_transaction=ch_Bikl1YiiuxgHl0",
                  "data":[  

                  ],
                  "object":"list",
                  "has_more":false,
                  "total_count":0
               }
            },
            "statement_descriptor":"How to Have Fun"
         },
         "vat_fees":0,
         "usd_conversion_rate":null,
         "school_plan_id":20,
         "sale":{  
            "id":9980514,
            "price":100,
            "currency":"USD",
            "is_active":true,
            "is_recurring":false,
            "user_id":8014167,
            "school_id":116505,
            "final_price":100,
            "course":{  
               "id":158157,
               "name":"How to Have Fun!",
               "url":"http://timkimtest.teachable.com/courses/158157",
               "friendly_url":"how-to-aoihdgoiahdgoih",
               "meta_description":"oaidhgaodughadoiughadoighadiog",
               "description":"\u003cp\u003eTESTESTESTESTESTESTETEWSRTSTESTESTESTESTESTSETESTEST\n\u003c/p\u003e",
               "author_bio":{  
                  "created_at":"2017-10-19T20:08:55Z",
                  "headline":"sdgsdag",
                  "profile_image_url":null,
                  "bio":"\u003cp\u003easdgasd\n\u003c/p\u003e",
                  "position":null,
                  "user_id":null,
                  "name":"sgsa",
                  "id":115523,
                  "meta":{  
                     "class":"authorbio",
                     "url":"/author_bios/115523",
                     "name":"sgsa",
                     "description":"",
                     "image_url":null
                  }
               }
            },
            "product":{  
               "id":429527,
               "is_recurring":false,
               "price":100,
               "name":"sagdsag",
               "currency":"USD"
            },
            "user":{  
               "id":8014167,
               "role":"student",
               "email":"teachable@test.com",
               "name":"Tim @ Teachable",
               "school_id":116505,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2017-11-06T22:39:37Z",
               "sign_in_count":4,
               "unsubscribe_from_marketing_emails":null
            },
            "coupon":null,
            "affiliate":null,
            "transactions":[  
               {  
                  "created_at":"2017-11-06T22:39:36Z",
                  "custom_gateway?":false,
                  "fully_refunded?":true,
                  "is_stripe_connect?":false,
                  "is_custom_paypal?":false,
                  "user_id":8014167,
                  "final_price":100,
                  "currency":"USD",
                  "affiliate_percent":0.0,
                  "author_percent":0.0,
                  "author_id":6431807,
                  "teachable_percent":0.0,
                  "teachable_processor_fee":0,
                  "amount_refunded":100,
                  "status":"paid",
                  "affiliate_fees":0,
                  "author_fees":0,
                  "sale_id":9980514,
                  "coupon_id":null,
                  "net_charge":0,
                  "earnings_usd":0,
                  "net_charge_usd":0,
                  "teachable_fixed_fee":0,
                  "total_teachable_fee":0,
                  "is_recurring":false,
                  "stripe_charge_token":"ch_Bikl1YiiuxgHl0",
                  "paypal_payment_id":null,
                  "stripe_invoice_id":null,
                  "purchased_at":"2017-11-06T22:39:36Z",
                  "refundable":false,
                  "vat_fees":0,
                  "is_chargeback":null,
                  "id":1459433,
                  "net_tax_charge":0,
                  "net_product_charge_usd":0,
                  "meta":{  
                     "class":"transaction",
                     "url":null,
                     "name":"1459433",
                     "description":"",
                     "image_url":null
                  }
               }
            ]
         },
         "user":{  
            "id":8014167,
            "role":"student",
            "email":"teachable@test.com",
            "name":"Tim @ Teachable",
            "school_id":116505,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-11-06T22:39:37Z",
            "sign_in_count":4,
            "unsubscribe_from_marketing_emails":null
         },
         "coupon":null
      }
   }
]
]

Users Update Their Profiles

[
{
 "type":"User.updated",
      "id":1234567,
      "livemode":true,
      "created":"2017-05-15T18:49:45+00:00",
      "hook_event_id":1,
      "object":{  
         "id":1234567,
         "role":"student",
         "email":"test@teachable.com",
         "name":"john doe",
         "school_id":12345,
         "src":null,
         "first_touch":null,
         "last_touch":null,
         "last_sign_in_at":"2017-04-11T17:58:41Z",
         "sign_in_count":2,
         "unsubscribe_from_marketing_emails":null,
         "old_email":"test@teachable.com",
         "new_email":"test@teachable.com",
         "old_name":"john doe",
         "new_name":"john doe"
  }
}
]
 

Student Cancels A Subscription

[

{
       "type" => "Sale.subscription_canceled",
         "id" => 4242424242,
   "livemode" => "true",
    "created" => "2016-03-24T11:26:30-04:00",
     "object" => {
                 "id" => 1289757,
              "price" => 1000,
           "currency" => "USD",
          "is_active" => false,
       "is_recurring" => true,
            "user_id" => 4567,
          "school_id" => 1234,
        "final_price" => 1000,
             "course" => {
             "id" => 686868,
           "name" => "How To Groove: A Songwriter's Guide To Drum-Writing",
            "url" => "http://holistic-songwriting.teachable.com/courses/how-to-groove"
       },
            "product" => {
                     "id" => 73593,
           "is_recurring" => true,
                  "price" => 1000,
                   "name" => "Monthly Payment (12 months)",
               "currency" => "USD"
       },
               "user" => {
                        "id" => 4567,
                      "role" => "guest",
                     "email" => "test@testing.com",
                      "name" => "Barry",
                 "school_id" => 1234,
                       "src" => nil,
               "first_touch" => nil,
                "last_touch" => nil,
           "last_sign_in_at" => "2016-03-08T19:31:05Z",
             "sign_in_count" => 6
       },
             "coupon" => nil,
          "affiliate" => nil,
       "transactions" => [
           [0] {
                   "custom_gateway?" => nil,
                   "fully_refunded?" => false,
                                "id" => 166020,
                           "user_id" => 4567,
                         "school_id" => 1234,
                        "created_at" => "2016-02-08T18:39:32Z",
                        "updated_at" => "2016-03-08T18:40:32Z",
                       "final_price" => 1000,
                          "currency" => "USD",
                 "affiliate_percent" => nil,
                    "author_percent" => 0.0,
                         "author_id" => nil,
                    "fedora_percent" => 0.1,
               "total_processor_fee" => 59,
                   "amount_refunded" => 0,
                            "status" => "paid",
                    "affiliate_fees" => 0,
                       "author_fees" => 0,
                         "coupon_id" => nil,
                        "net_charge" => 1000,
                      "earnings_usd" => 747,
                    "net_charge_usd" => 1000,
                        "fedora_fee" => 1,
                  "total_fedora_fee" => 194,
                   "net_revenue_usd" => 747,
                      "purchased_at" => "2016-02-08T18:39:32Z",
                        "refundable" => true,
                          "vat_fees" => 0,
                     "is_chargeback" => nil,
                              "meta" => {
                         "class" => "transaction",
                           "url" => nil,
                          "name" => nil,
                   "description" => nil,
                     "image_url" => nil
         }

     }

  }

]
]

Enrollment Created

[

  {

     "type":"Enrollment.created",

     "id":1,

     "livemode":"true",

     "created":"2016-08-08T10:38:24-04:00",

     "hook_event_id":31,

     "object":{

        "created_at":null,

        "coupon":null,

        "user_id":1,

        "course_id":2,

        "primary_course_id":2,

        "sale_id":1,

        "is_active":true,

        "enrolled_at":"2016-08-08T14:38:24Z",

        "percent_complete":0.0,

        "has_full_access":false,

        "id":1,

        "meta":{

           "class":"enrollment",

           "url":null,

           "name":"1",

           "description":null,

           "image_url":null

        },

        "course":{

           "created_at":"2016-08-05T20:38:32Z",

           "path":"/courses/good-course",

           "safe_image_url":"//d6xfpzo6h49n1.cloudfront.net/O3FPQEI9tlnWDtlA0vVKvDA8gLM=/fit-in/705x0/https://d3gvvapon6fqzo.cloudfront.net/icons/default-course-image.png",

           "default_product_formatted_price":"$10",

           "has_published_lecture":false,

           "has_published_product":true,

           "promo_video":null,

           "name":"Good course",

           "heading":null,

           "page_title":"Good course",

           "meta_description":null,

           "friendly_url":"good-course",

           "description":null,

           "author_bio_id":1,

           "position":0,

           "conversion_pixels":null,

           "closing_letter":null,

           "image_url":null,

           "hero_image_url":"https://d3gvvapon6fqzo.cloudfront.net/bg/default-hero.png",

           "is_published":false,

           "bundled_courses_count":0,

           "child_course_ids":[

           ],

           "preenrollment_call_to_action":"Sign up to get this course when it launches",

           "is_open":true,

           "is_accepting_preenrollments":false,

           "use_old_course_page":null,

           "purchase_redirect_url":null,

           "skip_thank_you_page":null,

           "onboarded_at":null,

           "id":2,

           "meta":{

              "class":"course",

              "url":"/courses/2/",

              "name":"Good course",

              "description":null,

              "image_url":null

           },

           "categories":[

           ],

           "author_bio":{

              "created_at":"2016-08-03T04:03:58Z",

              "headline":"Da Boss",

              "profile_image_url":null,

              "bio":"Bacon ipsum dolor amet shankle ham pork belly jowl.",

              "position":null,

              "user_id":2,

              "name":"Noah",

              "id":1,

              "meta":{

                 "class":"authorbio",

                 "url":"/author_bios/1",

                 "name":"Noah",

                 "description":null,

                 "image_url":null

              }

           }

        },

        "user":{

           "created_at":"2016-08-03T04:03:58Z",

           "Role":"owner",

"gravatar_url":"https://s.gravatar.com/avatar/4cb1f144288e5d61695b0d3f9c63835c?d=mm\u0026s=70",

"email":"owner@example.com",

           "notes":null,

           "affiliate_code":"1_12orpy2s",

           "name":"John Doe",

           "is_owner":true,

           "sign_in_count":7,

           "is_student":true,

           "is_affiliate":false,

           "is_author":false,

           "src":null,

           "current_sign_in_at":"2016-08-05T20:17:15Z",

           "last_four":null,

           "paypal_email":"owner@example.com",

           "affiliate_revenue_share":null,

           "joined_at":"2016-08-03T14:13:37Z",

           "transactions_gross":0,

           "signed_up_affiliate_code":null,

           "author_revenue_share":0.0,

           "last_sign_in_ip":"::1",

           "current_sign_in_ip":"::1",

           "id":1,

           "school_id":1,

           "meta":{

              "class":"user",

              "url":null,

              "name":"John Doe",

              "description":"owner@example.com",

"image_url":"https://s.gravatar.com/avatar/4cb1f144288e5d61695b0d3f9c63835c?d=mm\u0026s=100"

   },

           "author_bio_id":null,

           "total_sales":0,

           "author_bio":null

        }

     }

  }

]
]

Lecture Progress Created (user completes a lecture)

[
  {
     "type":"LectureProgress.created",
     "id":45454545454,
     "livemode":true,
     "created":"2016-08-31T16:54:47+00:00",
     "hook_event_id":1,
     "object":{
        "id":54545454545,
        "is_completed":true,
        "course_id":444444,
        "lecture_id":32322,
        "school_id":859,
        "percent_complete":21.0,
        "course":{
           "id":232323232,
           "name":"The Profitable Teacher",
           "url":"http://academy.teachable.com/courses/the-profitable-teacher"
        },
        "user":{
           "id":111111,
           "role":"student",
           "email":"test@gmail.com",
           "name":"Test Wilson",
           "school_id":859,
           "src":null,
           "first_touch":null,
           "last_touch":null,
           "last_sign_in_at":"2016-08-28T18:07:23Z",
           "sign_in_count":10
        },
        "lecture":{
           "id":43444344444,
           "name":"Lead Magnet #1: The \"Checklist\"",
           "is_published":true
        }
     }
  }
]
]

Response Created (User Completes a graded quiz)

[
  {
     "type":"Response.created",
     "id":3333333,
     "livemode":true,
     "created":"2016-08-31T16:56:00+00:00",
     "hook_event_id":1,
     "object":{
        "id":323232,
        "user_id":33333,
        "custom_form_id":122,
        "answers":{
           "answer-1":[
              "Make a quiz"
           ],
           "answer-2":[
              "Ankur"
           ]
        },
        "created_at":"2016-08-28T08:14:03Z",
        "updated_at":"2016-08-28T08:14:22Z",
        "school_id":859,
        "submitted_at":"2016-08-28T08:14:22Z",
        "grade":{
           "total":2,
           "correct":1,
           "answered":2,
           "remaining":0,
           "percent_correct":0.5,
           "percent_answered":1.0
        },
        "custom_form":{
           "id":122,
           "type":"Quiz",
           "topic_id":3333334,
           "topic_type":"Attachment",
           "data":{
              "graded":true,
              "answerKey":{
                 "answer-1":[
                    "Make a quiz"
                 ],
                 "answer-2":[
                    "Conrad",
                    "Ankur"
                 ]
              }
           },
           "school_id":859,
           "is_published":false,
           "identifier":null,
           "created_at":"2015-06-08T17:05:26Z",
           "updated_at":"2015-06-08T17:50:23Z",
           "schema":{
              "type":"object",
              "required":[
                 "answer-1",
                 "answer-2"
              ],
              "properties":{
                 "answer-1":{
                    "enum":[
                       "Make a quiz",
                       "Start a blog",
                       "Create an email campaign"
                    ],
                    "type":"string",
                    "title":"What is one of the easiest ways to engage your audience?"
                 },
                 "answer-2":{
                    "enum":[
                       "Conrad",
                       "Ankur",
                       "Oprah Winfrey"
                    ],
                    "type":"string",
                    "title":"Who are the founders of Fedora?"
                 }
              }
           },
           "attachment":{
              "id":22222222,
              "attachable_type":"Lecture",
              "attachable_id":22222222,
              "kind":"quiz"
           }
        },
        "user":{
           "id":22222222,
           "role":"student",
           "email":"thedrumboostermail@gmail.com",
           "name":"Ruggero",
           "school_id":859,
           "src":null,
           "first_touch":null,
           "last_touch":null,
           "last_sign_in_at":"2016-08-30T07:51:52Z",
           "sign_in_count":46
        }
     }
  }
]

Comment Created

[
   {
      "type":"Comment.created",
      "id":214950,
      "livemode":true,
      "created":"2017-05-15T18:53:43+00:00",
      "hook_event_id":1,
      "object":{
         "id":214950,
         "user_id":3119253,
         "school_id":69842,
         "created_at":"2017-01-19T17:39:02Z",
         "updated_at":"2017-01-19T17:39:02Z",
         "user":{
            "id":3119253,
            "role":"student",
            "email":"johnandmary@gmail.com",
            "name":"John Smith \u0026 Mary Jones",
            "school_id":69842,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-01-19T17:38:48Z",
            "sign_in_count":11,
            "unsubscribe_from_marketing_emails":null
         },
         "commentable":{
            "created_at":"2017-01-19T17:30:13Z",
            "plain_text_html":"",
            "content_type":null,
            "audio_type":null,
            "should_be_uploaded_to_wistia?":false,
            "data":null,
            "schema":null,
            "url":null,
            "host_id":null,
            "source":"user",
            "kind":"native_comments",
            "name":null,
            "host":null,
            "position":1,
            "attachable_id":2034508,
            "is_published":true,
            "downloadable":false,
            "text":null,
            "attachable_type":"Lecture",
            "thumbnail_url":null,
            "embeddable":true,
            "id":3910132,
            "meta":{
               "class":"attachment",
               "url":null,
               "name":null,
               "description":null,
               "image_url":null
            }
         }
      }
   }
]

Transaction Refunded

[
   {
      "type":"Transaction.refunded",
      "id":867110,
      "livemode":true,
      "created":"2017-05-15T18:57:24+00:00",
      "hook_event_id":1,
      "object":{
         "id":867110,
         "user_id":4831317,
         "school_id":5783,
         "final_price":500,
         "currency":"USD",
         "affiliate_percent":null,
         "author_percent":0.0,
         "fedora_percent":0.2,
         "amount_refunded":500,
         "status":"paid",
         "is_recurring":false,
         "sale_id":5810934,
         "coupon_id":null,
         "net_charge":0,
         "stripe_charge_token":"ch_AY0FKRtbaknGkg",
         "net_charge_usd":0,
         "fedora_fee":0,
         "net_revenue_usd":0,
         "processor_fee_description":null,
         "affiliate_fees":0,
         "earnings_usd":0,
         "paypal_payment_id":null,
         "legacy_id":null,
         "purchased_at":"2017-04-26T17:47:53Z",
         "author_fees":0,
         "stripe_invoice_id":null,
         "stripe_event_id":null,
         "refunder_id":2184202,
         "processor_fee":0,
         "total_fedora_fee":0,
         "is_chargeback":null,
         "is_stripe_connect":null,
         "author_id":null,
         "credential_id":null,
         "is_custom_paypal":null,
         "data":{
            "id":"ch_AY0FKRtbaknGkg",
            "paid":true,
            "order":null,
            "amount":500,
            "object":"charge",
            "review":null,
            "source":{
               "id":"card_AY0FxSi8RQOeB5",
               "name":null,
               "brand":"Visa",
               "last4":"3649",
               "object":"card",
               "country":"US",
               "funding":"debit",
               "customer":"cus_AY0FVVai6WZzXI",
               "exp_year":2020,
               "metadata":{

               },
               "cvc_check":"pass",
               "exp_month":6,
               "address_zip":null,
               "fingerprint":"fP9eBiwm0Vv87jVC",
               "address_city":null,
               "address_line1":null,
               "address_line2":null,
               "address_state":null,
               "dynamic_last4":null,
               "address_country":null,
               "address_zip_check":null,
               "address_line1_check":null,
               "tokenization_method":null
            },
            "status":"succeeded",
            "created":1493228874,
            "dispute":null,
            "invoice":null,
            "outcome":{
               "type":"authorized",
               "reason":null,
               "risk_level":"normal",
               "network_status":"approved_by_network",
               "seller_message":"Payment complete."
            },
            "refunds":{
               "url":"/v1/charges/ch_AY0FKRtbaknGkg/refunds",
               "data":[
                  {
                     "id":"re_AY0GAxB9SEbnZT",
                     "amount":500,
                     "charge":"ch_AY0FKRtbaknGkg",
                     "object":"refund",
                     "reason":null,
                     "status":"succeeded",
                     "created":1493228931,
                     "currency":"usd",
                     "metadata":{

                     },
                     "receipt_number":null,
                     "balance_transaction":{
                        "id":"txn_AY0GA2XjmR7MOE",
                        "fee":-43,
                        "net":-457,
                        "type":"refund",
                        "amount":-500,
                        "object":"balance_transaction",
                        "source":"ch_AY0FKRtbaknGkg",
                        "status":"pending",
                        "created":1493228931,
                        "currency":"usd",
                        "description":"REFUND FOR CHARGE (Paid Course)",
                        "fee_details":[
                           {
                              "type":"stripe_fee",
                              "amount":-43,
                              "currency":"usd",
                              "application":null,
                              "description":"Stripe processing fee refund"
                           }
                        ],
                        "available_on":1493337600,
                        "sourced_transfers":{
                           "url":"/v1/transfers?source_transaction=re_AY0GAxB9SEbnZT",
                           "data":[

                           ],
                           "object":"list",
                           "has_more":false,
                           "total_count":0
                        }
                     }
                  }
               ],
               "object":"list",
               "has_more":false,
               "total_count":1
            },
            "captured":true,
            "currency":"usd",
            "customer":"cus_AY0FVVai6WZzXI",
            "livemode":true,
            "metadata":{
               "name":"mack",
               "email":"mike+another-test@teachable.com",
               "country":"US",
               "sale_id":"5810934",
               "user_id":"4831317",
               "school_id":"5783",
               "product_id":"300137",
               "course_name":"Bundle Course",
               "product_name":"Paid Course"
            },
            "refunded":true,
            "shipping":null,
            "application":null,
            "description":"Paid Course",
            "destination":null,
            "failure_code":null,
            "on_behalf_of":null,
            "fraud_details":{

            },
            "receipt_email":null,
            "receipt_number":null,
            "transfer_group":null,
            "amount_refunded":500,
            "application_fee":null,
            "failure_message":null,
            "source_transfer":null,
            "balance_transaction":{
               "id":"txn_AY0GPvRLx8rVIh",
               "fee":43,
               "net":457,
               "type":"charge",
               "amount":500,
               "object":"balance_transaction",
               "source":"ch_AY0FKRtbaknGkg",
               "status":"pending",
               "created":1493228914,
               "currency":"usd",
               "description":"Paid Course",
               "fee_details":[
                  {
                     "type":"stripe_fee",
                     "amount":43,
                     "currency":"usd",
                     "application":null,
                     "description":"Stripe processing fees"
                  }
               ],
               "available_on":1493337600,
               "sourced_transfers":{
                  "url":"/v1/transfers?source_transaction=ch_AY0FKRtbaknGkg",
                  "data":[

                  ],
                  "object":"list",
                  "has_more":false,
                  "total_count":0
               }
            },
            "statement_descriptor":"This works now?"
         },
         "vat_fees":0,
         "usd_conversion_rate":null,
         "school_plan_id":3,
         "sale":{
            "id":5810934,
            "price":500,
            "currency":"USD",
            "is_active":true,
            "is_recurring":false,
            "user_id":4831317,
            "school_id":5783,
            "final_price":500,
            "course":{
               "id":82791,
               "name":"Bundle Course",
               "url":"http://faheyhalvorsonharber.teachable.com/courses/82791",
               "friendly_url":"terms",
               "meta_description":"master cleanse DIY",
               "description":"\u003cp\u003e\u003cbr\u003e\n\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http:google.com\u0026quot;\u0026gt;\u0026lt;/a\u0026gt; \u0026lt;script\u0026gt;alert(\u0026quot;xss\u0026quot;);\u0026lt;/script\u0026gt;\u0026lt;a href=\u0026quot;http://google.com\"\u003enice job garfield\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\u003cp\u003efff\n\u003c/p\u003e\n\u003cp\u003exxx{{ course}}\n\u003c/p\u003e\n\u003cp\u003e{{current_user}}\n\u003c/p\u003e\n\u003cp\u003eThis is great!!!! Ooooo no obama\n\u003c/p\u003e\n\u003cscript src=\"https://zapier.com/zapbook/embed/widget.js?services=teachable\u0026limit=6\"\u003e\u003c/script\u003e\n\u003cscript\u003e$(document).ready(function(){\n  if ($(\".enrolled-in-course-alert\").length \u0026gt; 0 ) {\n    window.location = \"http://google.com\"\n  }\n});\n\u003c/script\u003e",
               "author_bio":{
                  "created_at":"2015-03-09T16:08:46Z",
                  "headline":"foasdf",
                  "profile_image_url":null,
                  "bio":null,
                  "position":null,
                  "user_id":null,
                  "name":"Reggie Bush",
                  "id":5083,
                  "meta":{
                     "class":"authorbio",
                     "url":"/author_bios/5083",
                     "name":"Reggie Bush",
                     "description":null,
                     "image_url":null
                  }
               }
            },
            "product":{
               "id":300137,
               "is_recurring":false,
               "price":500,
               "name":"Paid Course",
               "currency":"USD"
            },
            "user":{
               "id":4831317,
               "role":"student",
               "email":"mike+another-test@teachable.com",
               "name":"mack",
               "school_id":5783,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2017-04-26T17:47:20Z",
               "sign_in_count":2,
               "unsubscribe_from_marketing_emails":null
            },
            "coupon":null,
            "affiliate":{
               "id":250053,
               "role":"affiliate",
               "email":"poage@usefedora.com",
               "name":"Mike Poage",
               "school_id":5783,
               "src":null,
               "first_touch":null,
               "last_touch":null,
               "last_sign_in_at":"2015-02-03T17:43:29Z",
               "sign_in_count":1,
               "unsubscribe_from_marketing_emails":null
            },
            "transactions":[
               {
                  "created_at":"2017-04-26T17:47:55Z",
                  "custom_gateway?":null,
                  "fully_refunded?":true,
                  "is_stripe_connect?":false,
                  "is_custom_paypal?":false,
                  "user_id":4831317,
                  "final_price":500,
                  "currency":"USD",
                  "affiliate_percent":null,
                  "author_percent":0.0,
                  "author_id":null,
                  "teachable_percent":0.2,
                  "teachable_processor_fee":0,
                  "amount_refunded":500,
                  "status":"paid",
                  "affiliate_fees":0,
                  "author_fees":0,
                  "sale_id":5810934,
                  "coupon_id":null,
                  "net_charge":0,
                  "earnings_usd":0,
                  "net_charge_usd":0,
                  "teachable_fixed_fee":0,
                  "total_teachable_fee":0,
                  "is_recurring":false,
                  "stripe_charge_token":"ch_AY0FKRtbaknGkg",
                  "paypal_payment_id":null,
                  "stripe_invoice_id":null,
                  "purchased_at":"2017-04-26T17:47:53Z",
                  "refundable":false,
                  "vat_fees":0,
                  "is_chargeback":null,
                  "id":867110,
                  "net_tax_charge":0,
                  "net_product_charge_usd":0,
                  "meta":{
                     "class":"transaction",
                     "url":null,
                     "name":"867110",
                     "description":null,
                     "image_url":null
                  }
               }
            ]
         },
         "user":{
            "id":4831317,
            "role":"student",
            "email":"mike+another-test@teachable.com",
            "name":"mack",
            "school_id":5783,
            "src":null,
            "first_touch":null,
            "last_touch":null,
            "last_sign_in_at":"2017-04-26T17:47:20Z",
            "sign_in_count":2,
            "unsubscribe_from_marketing_emails":null
         },
         "coupon":null
      }
   }
]

Enrollment Completed (Course Completed)

[
   {
      "type":"Enrollment.completed",
      "id":12345,
      "livemode":true,
      "created":"2016-08-31T16:50:28+00:00",
      "hook_event_id":1,
      "object":{
         "created_at":"2016-08-31T16:27:34Z",
         "coupon":null,
         "user_id":43434343,
         "course_id":444444,
         "primary_course_id":444444,
         "sale_id":333333,
         "is_active":true,
         "enrolled_at":"2016-08-31T16:27:34Z",
         "percent_complete":100.0,
         "has_full_access":false,
         "id":22232323,
         "meta":{
            "class":"enrollment",
            "url":null,
            "name":"222232323",
            "description":null,
            "image_url":null
         },
         "user":{
            "created_at":"2016-08-31T16:27:34Z",
            "role":"student",
            "gravatar_url":"https://s.gravatar.com/avatar/947826003b5e9f4b1c08a49231a6995b?d=mm",
            "email":"test@gmail.com",
            "notes":null,
            "affiliate_code":"5559_9r2htpcz",
            "name":"Kanwar",
            "is_owner":false,
            "sign_in_count":3,
            "is_student":true,
            "is_affiliate":false,
            "is_author":false,
            "src":null,
            "current_sign_in_at":"2016-08-31T16:27:35Z",
            "last_four":null,
            "paypal_email":"test@gmail.com",
            "affiliate_revenue_share":null,
            "joined_at":"2016-08-31T16:27:34Z",
            "transactions_gross":0,
            "signed_up_affiliate_code":null,
            "author_revenue_share":0.0,
            "last_sign_in_ip":"99.224.146.47",
            "current_sign_in_ip":"99.224.146.47",
            "id":2058707,
            "school_id":859,
            "meta":{
               "class":"user",
               "url":null,
               "name":"Kanwar",
               "description":"test@gmail.com",
               "image_url":"https://s.gravatar.com/avatar/947826003b5e9f4bfffff1c08a49231a6995b?d=mm\u0026size=100"
            },
            "author_bio_id":null,
            "total_sales":0,
            "author_bio":null
         },
         "course":{
            "id":4444444,
            "name":"Teachable 2015 Summit Replays",
            "url":"http://academy.teachable.com/courses/teachable-summit-replays"
         }
      }
   }
]
thanks_illustration

Can't find what you're looking for?

Contact us
thanks_illustration