Fields

uuid
UUIDv4 generated by fenerum

endpoint
string, not null
URL that will be POSTed with event data.

basic_auth_username
string, nullable
username for HTTP Basic Auth if required to reach the endpoint

basic_auth_password
string, nullable
username for HTTP Basic Auth if required to reach the endpoint

enabled
bool
signifies whether the webhook should be notified of events

List Webhooks

GET /api/v1/webhooks/
Response

[
    {
        "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
        "endpoint": "http://localhost:8000/asd",
        "basic_auth_username": null,
        "basic_auth_password": null,
        "enabled": true
    },
    {
        "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
        "endpoint": "http://localhost:8000",
        "basic_auth_username": null,
        "basic_auth_password": null,
        "enabled": true
    }
]

Retrieve a Webhook

GET /api/v1/webhooks/<webhook_uuid>/
Response

{
    "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
    "endpoint": "http://localhost:8000/asd",
    "basic_auth_username": "admin",
    "basic_auth_password": "hunter8",
    "enabled": true
}

Create a Webhook

POST /api/v1/webhooks/
Request

{
"endpoint": "http://localhost:8000/asd",
"basic_auth_username": "admin",
"basic_auth_password": "hunter8",
}

Response

{
    "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
    "endpoint": "http://localhost:8000/asd",
    "basic_auth_username": "admin",
    "basic_auth_password": "hunter8",
    "enabled": true
}

Update a Webhook

PUT /api/v1/webhooks/<webhook_uuid>/
Request

{
"endpoint": "http://localhost:8000/asd",
"basic_auth_username": "admin",
"basic_auth_password": "hunter18",
}

Response

{
    "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
    "endpoint": "http://localhost:8000/asd",
    "basic_auth_username": "admin",
    "basic_auth_password": "hunter18",
    "enabled": true
}

Callbacks

All callbacks HTTP POST to all endpoints of all enabled webhooks.

Account created

{
    "event": "account.created",
    "data": {
            "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "code": "important_client",
            "company_name": "Important client",
            "legal_address": "Important street 12",
            "legal_zipcode": "1234",
            "legal_city": "Aarhus",
            "legal_country": "DK",
            "legal_vat_number": "DK12345678",
            "billing_same_as_legal": True,
            "billing_address": null,
            "billing_zipcode": null,
            "billing_city": null,
            "billing_country": null,
            "created_date": "2018-11-20T11:25:23.889915+00:00"
    }
}

Account updated

{
    "event": "account.updated",
    "data": {
            "uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "code": "important_client",
            "company_name": "Important client",
            "legal_address": "Important street 12",
            "legal_zipcode": "1234",
            "legal_city": "Aarhus",
            "legal_country": "DK",
            "legal_vat_number": "DK12345678",
            "billing_same_as_legal": True,
            "billing_address": null,
            "billing_zipcode": null,
            "billing_city": null,
            "billing_country": null,
            "created_date": "2018-11-20T11:25:23.889915+00:00"
    }
}

Plan terms created
Possible values of vat_type: physical, services, unknown

{
    "event": "plan_terms.created",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "plan_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "plan_name": "Enterprise",
            "plan_collect_vat": True,
            "plan_vat_type": "services",
            "interval_type": "month",
            "interval_count": 1,
            "price": 99.99,
            "currency": "DKK"
    }
}

Plan terms updated

{
    "event": "plan_terms.updated",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "plan_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "plan_name": "Enterprise",
            "plan_collect_vat": True,
            "plan_vat_type": "services",
            "interval_type": "month",
            "interval_count": 1,
            "price": 99.99,
            "currency": "DKK"
    }
}

New invoice
Possible values of status: open, due, paid, nonpayment
Possible values of collection_method: payment_card, invoice

{
    "event": "new_invoice",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "invoice_number": 2193,
            "account_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "account_code": "important_client",
            "date": "2018-11-20T11:25:23.889915+00:00",
            "due_date": "2018-11-30T11:25:23.889915+00:00",
            "invoice_api_url": "https://app.fenerum.com/api/v1/invoices/b84948d2-30b8-4060-a5b4-6aa92db59b50/",
            "currency": "DKK",
            "status": "open",
            "collection_method": "payment_card"
    }
}

Paid invoice

{
    "event": "paid_invoice",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "invoice_number": 2193,
            "account_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "account_code": "important_client",
            "date": "2018-11-20T11:25:23.889915+00:00",
            "due_date": "2018-11-30T11:25:23.889915+00:00",
            "invoice_api_url": "https://app.fenerum.com/api/v1/invoices/b84948d2-30b8-4060-a5b4-6aa92db59b50/",
            "currency": "DKK",
            "status": "paid",
            "collection_method": "payment_card"
    }
}

Subscription cancelled
Possible values of collection_method: payment_card, invoice

{
    "event": "cancel_subscription",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "account_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "account_code": "important_client",
            "terms_uuid": "320ac230-a004-4cb3-9caa-fca0bee3e053",
            "start_date": "2018-01-21T11:25:23.889915+00:00",
            "end_date": None,
            "next_renewal_date": "2018-11-21T11:25:23.889915+00:00",
            "quantity": 1.5,
            "collection_method": "payment_card,
            "payment_terms": 10,
            "po_number": "A21"
    }
}

Subscription to renew soon
Sent when a subscription is due to be renewed in the next 2 hours.

{
    "event": "renew_subscription_soon",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "account_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "account_code": "important_client",
            "terms_uuid": "320ac230-a004-4cb3-9caa-fca0bee3e053",
            "start_date": "2018-01-21T11:25:23.889915+00:00",
            "end_date": None,
            "next_renewal_date": "2018-11-21T11:25:23.889915+00:00",
            "quantity": 1.5,
            "collection_method": "payment_card,
            "payment_terms": 10,
            "po_number": "A21"
    }
}

New Activity
Possible values of type: new, reactivate, renew, cancle, upgrade_qty, downgrade_qty, upgrade_subscription, downgraded_subscription, modified.
old_mrr, new_mrr and mrr_change always have two decimal places and are serialized as strings to avoid losing exactness.
Sent on a subscription-related activity: new subscription, renewal and cancellation. Focuses on financial impact of the action.

{
    "event": "new_activity",
    "data": {
            "uuid": "b84948d2-30b8-4060-a5b4-6aa92db59b50",
            "account_uuid": "5c838347-d3ce-40fb-951c-b3190ccf2cba",
            "account_code": "important_client",
            "subscription": "320ac230-a004-4cb3-9caa-fca0bee3e053",
            "invoice": "e947c739-0e32-4954-aa78-9ec8605d58d5",
            "date": "2018-01-21T11:25:23.889915+00:00",
            "type": "upgrade_qty",
            "old_mrr": "150.30",
            "new_mrr": "200.40",
            "old_quantity": 3,
            "new_quantity": 4,
            "old_terms": "580eb744-8746-4e78-85a3-b927605db7ad",
            "new_terms": "580eb744-8746-4e78-85a3-b927605db7ad",
            "mrr_change": "50.10",
            "quantity_change": 1
    }
}

Did this answer your question?