Webhooks
As a Jiko Partner API user, you may want to be made aware of events surrounding your account, as they happen in real time. For this, we recommend setting up subscriptions to Jiko Partner API webhooks.
Available Webhook Subscriptions
To view available event types, make an authenticated request to List Event Types:
send_jiko_request "GET" "/api/v1/events/types/"
It should return a 200 OK response with an object that looks something like this:
{ "offset":0, "count": 16, "items": [ { "event":"application.approved", "object_type":"EventType" }, { "event":"application.documents_needed", "object_type":"EventType" }, ... ], "object_type":"List" }
The list of available event types are found in your response object, by looping through items[“event”]
.
The following event types are currently available:
application.approved
application.documents_needed
application.manual_review
application.rejected
card.status.closed
card.status.frozen
card.status.locked
card.status.open
card.transaction.approved
card.transaction.rejected
transfers.ach.out.success
transfers.ach.out.rejected
transfers.ach.in.success
transfers.ach.in.rejected
Creating a Subscription
Call Create Subscription with the following data in the request body:
- list of event types to subscribe to
- URL to invoke when an event is created
shared_secret
from your Jiko point-of-contact- optional description of the subscription
Your request should look something like this:
body='{ "description": "Webhook subscription for application statuses", "events": [ "application.approved", "application.documents_needed", "application.manual_review", "application.rejected" ], "url": "https://example.com/webhooks/application-status", "shared_secret": "0123456789123456" }'; send_jiko_request "POST" "/api/v1/subscriptions/" $body
If you get a 201 status code response then you’re up and running and your response should look something like this:
{ "description": "Webhook subscription for application statuses", "events": [ "application.approved", "application.manual_review", "application.documents_needed", "application.rejected" ], "url": "https://example.com/webhooks/application-status", "id": "55b53873-3abf-4abd-971f-65331ce6dcc4", "time_created": "2022-08-09T17:30:52.646971+00:00", "updated_at": "2022-08-09T17:30:52.647004+00:00", "status": "enabled", "object_type": "Subscription" }
Last updated: June 9, 2023