This section includes all webhooks available through API.
All requests require authentication.
About webhooks
Kompar provides webhooks to alert of changes regarding clients' applications. These are POST requests to your server that are sent as soon as an event occurs. The body of the request contains details of the event.
Applications webhook
To register applications webhook you have to make call towards the endpoint:
POST url/webhooks/applications
The header of this POST request in addition to the required authorization header must contains the following parameter:
The body of this POST request must contain the following parameter:
Value
The url that will listen to notifications (must be HTTPS).
On success, the response has the status code 200 OK and the following JSON data in the response body:
On error, the response has the status code 400 NOT FOUND and the following JSON data in the response body:
message
string
Message about error.
For INTERNAL SERVER ERROR the response has status 500 and returns no data.
An example request to the applications webhook endpoint will look something like this:
Response to the applications webhook endpoint will look like this:
{
"success": true
}
Client's decision webhook
To register decisions webhook you have to make call towards the endpoint:
POST url/webhooks/decisions
The header of this POST request in addition to the required authorization header must contain the following parameter:
The body of this POST request must contain the following parameter:
Value
The url that will listen to notifications (must be HTTPS).
On success, the response has the status code 200 OK and the following JSON data in the response body:
On error, the response has the status code 400 NOT FOUND and the following JSON data in the response body:
message
string
Message about error.
For INTERNAL SERVER ERROR the response has status 500 and returns no data.
An example request to the decisions webhook endpoint will look something like this:
Response to the decisions webhook endpoint will look like this:
{
"success": true
}
Remove webhook
To remove application webhook you have to make call towards the endpoint:
DELETE url/webhooks/applications
To remove decisions webhook you have to make call towards the endpoint:
DELETE url/webhooks/decisions
On success, the response has the status code 200 OK and the following JSON data in the response body:
On error, the response has the status code 400 NOT FOUND and the following JSON data in the response body:
message
string
Message about error.
For INTERNAL SERVER ERROR the response has status 500 and returns no data.
An example request to the delete webhook endpoint will look something like this:
Response to the delete webhook endpoint will look like this:
{
"success": true
}
Webhook security
After registering webhook you will receive event as soon as it occurs. The request authorization header will have a token. You should verify the token on your server to prevent attackers from imitating valid webhooks.
The header of our requests will have the following parameters:
Value
token xxxxx-yyyyy-zzzzz
(this token was provided for you during registration)
Content-Type
application/json
An example cheking of token will look something like this:
Application details
Application sent to you via webhook will always have the same structure. The body JSON will has the following fields:
Description
Base64 string which includes ecrypted application
iv
string
Base64 string which includes initialization vector
You will have to decrypt data using provided key.
Sample code may look something like this:
The decrypted JSON will have the following fields:
Key
application_id
string
Description
Id of application in Kompar's system.
name
string
The full name of the client.
company_id
string
The Swedish Business Registration Number (Organisationsnummer).
company_name
string
The name of client's company.
company_type
string
The type of client's company.
company_revenue
float
Monthly revenue of client's company.
company_age
float
The age of client's company.
amount
int
The amount requested by the client.
duration
int
The desired repayment term requested by the client (in months).
purpose
string
The purpose of the application. Available options you may find in the option lists section.
ssn
string
Personal id of applicant
guarantors
array of { "ssn": string }
Guarantors
Additional fields will be determined with lender:
company_last_year_revenue
float
company_description
string
attachments
array of strings
description_of_property
text
Client's decision details
Client details sended to you via webhook will always have the same structure. The body JSON will have the following fields:
Key
application_id
string
If offer is accepted you will receive as well:
Fields and actions will be determined with lender.
Confirmation of receiving
Upon receiving a webhook notification, you should acknowledge success by responding with an HTTP 200 response within 10 seconds. Otherwise, we will attempt to resend the notification 4 times according to the following schedule:
- 30 seconds after the first attempt
- 2 minutes after the second attempt
- 15 minutes after the third attempt
- 1 hour after the fourth attempt