Subscriptions

Summary

Subscriptions (also known as webhooks or callbacks) are a means to provide asynchronous responses to you. Subscriptions are event based. The available events are documented below. To receive an event you must register a subscription for the events of interest to you.

Register for Subscriptions

Dynamic registration and callback management are performed through the Subscriptions api which are documented in the api-docs. You can create, delete and list your events. In future, you will be able to view a list of historical events as well as view delivery status and retry.

Subscription Structure

Our subscriptions share the same basic structure.

  • event_id : a unique idempotent UUID. In the event of an event replay, this ID will remain the same.
  • event_date : the date time the event was generated
  • event_type : the type of event with subsequent details specific to the event
  • event_data : business data specific to the event being generated

Our events are purposefully lightweight. They contain only critical information for decision making. Should you need an extended information set, perform an enrichment by calling the appropriate GET endpoint using the IDs provided in the events.

Copy
Copied
{
  "event_id": "<unique_uuid>",
  "event_date": "<datetime>",
  "event_type": "<event_type>",
  "event_data":{
    <event_data_here>
  }
}

Available Subscription Events

Applications

Event Type Description
APPLICATION_READY_FOR_SUBMISSION Generated when an application status changes to "ready_for_submission"
APPLICATION_SUBMITTED Generated when an application status changes to "submitted"
APPLICATION_PROCESSING Generated when an application status changes to "processing"
APPLICATION_CHANGE_REQUESTED Generated when an application status changes to "changes_requested"
APPLICATION_REJECTED Generated when an application status changes to "rejected"
APPLICATION_APPROVED Generated when an application status changes to "approved"

Customers

Event Type Description
CUSTOMER_ACTIVE Generated when an customer status is set to ‘active’
CUSTOMER_CLOSED Generated when an customer status is set to 'closed'
CUSTOMER_PENDING Generated when an customer status is set to ‘pending’
CUSTOMER_EDD Generated when an customer status is set to ‘edd’ (enhanced due diligence)
CUSTOMER_FROZEN Generated when an customer status is set to ‘frozen’

Accounts

Event Type Description
ACCOUNT_OPEN Generated when an account status is set to ‘open’
ACCOUNT_CLOSED Generated when an account status is set to ‘closed’
ACCOUNT_FROZEN Generated when an account status is set to ‘frozen’
ACCOUNT_PENDING Generated when an account status is set to ‘pending’
ACCOUNT_EDD Generated when an account status is set to ‘edd’ (enhanced due diligence)
ACCOUNT_DORMANT Generated when an account status is set to ‘dormant’

Transactions

Event Type Description
TRANSACTION_AUTHORIZED Generated when a transaction is created with status ‘authorized’. See Get Transaction for field details.
TRANSACTION_PENDING Generated when a transaction status changes to status ‘pending’. See Get Transaction for field details.
TRANSACTION_POSTED Generated when a transaction status changes to status ‘posted’. See Get Transaction for field details.
TRANSACTION_CANCELLED Generated when a transaction status changes to status ‘cancelled’. See Get Transaction for field details.

Call Back Details

APPLICATION_READY_FOR_SUBMISSION

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_READY_FOR_SUBMISSION",
  "event_data":{
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "READY_FOR_SUBMISSION"
    }
  }
}

APPLICATION_SUBMITTED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_SUBMITTED",
  "event_data":{
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "SUBMITTED"
    }
  }
}

APPLICATION_PROCESSING

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_PROCESSING",
  "event_data":{
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "PROCESSING"
    }
  }
}

APPLICATION_CHANGE_REQUESTED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_CHANGE_REQUESTED",
  "event_data":{  
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "CHANGES_REQUESTED"
    }
  }
}

APPLICATION_REJECTED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_REJECTED",
  "event_data":{
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "REJECTED"
    }
  }
}

APPLICATION_APPROVED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "APPLICATION_APPROVED",
  "event_data":{
    "application": {
        "id": "10000000-1000-1000-1000-100000000000",
        "status": "APPROVED"
    }
  }
}

CUSTOMER_ACTIVE

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "CUSTOMER_ACTIVE",
  "event_data":{
    "customer": {
        "id": "CUSTOMER_ID_SET_DURING_ONBOARDING",
        "status": "ACTIVE"
    }
  }
}

CUSTOMER_CLOSED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "CUSTOMER_CLOSED",
  "event_data":{
    "customer": {
        "id": "CUSTOMER_ID_SET_DURING_ONBOARDING",
        "status": "CLOSED"
    }
  }
}

CUSTOMER_PENDING

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "CUSTOMER_PENDING",
  "event_data":{
    "customer": {
        "id": "CUSTOMER_ID_SET_DURING_ONBOARDING",
        "status": "PENDING"
    }
  }
}

CUSTOMER_EDD

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "CUSTOMER_EDD",
  "event_data":{
    "customer": {
        "id": "CUSTOMER_ID_SET_DURING_ONBOARDING",
        "status": "EDD"
    }
  }
}

CUSTOMER_FROZEN

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "CUSTOMER_FROZEN",
  "event_data":{
    "customer": {
        "id": "CUSTOMER_ID_SET_DURING_ONBOARDING",
        "status": "FROZEN"
    }
  }
}

ACCOUNT_OPEN

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_OPEN",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "OPEN"
    }
  }
}

ACCOUNT_CLOSED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_CLOSED",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "CLOSED"
    }
  }
}

ACCOUNT_FROZEN

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_FROZEN",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "FROZEN"
    }
  }
}

ACCOUNT_PENDING

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_PENDING",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "PENDING"
    }
  }
}

ACCOUNT_EDD

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_EDD",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "EDD"
    }
  }
}

ACCOUNT_DORMANT

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "ACCOUNT_DORMANT",
  "event_data":{
    "account": {
        "id": "ACCOUNT_ID_SET_DURING_ACCOUNT_OPENING",
        "status": "DORMANT"
    }
  }
}

TRANSACTION_AUTHORIZED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "TRANSACTION_AUTHORIZED",
  "event_data":{
    "transaction": {
        "id": "10000000-1000-1000-1000-100000000000",
        "account_id": "ID_OF_ACCOUNT_WHERE_TRANSACTION_OCCURRED",
        "value": 99.99,
        "transaction_date": "2022-11-08T19:53:09Z",
        "transaction_posted_date": null,
        "transaction_status": "AUTHORIZED",
        "transaction_type": "TRANSFER_IN",
        "category_type": "DEPOSIT",
        "category_id": "00000000-0000-1234-0000-000012340000"
    }
  }
}

TRANSACTION_PENDING

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "TRANSACTION_PENDING",
  "event_data":{
    "transaction": {
        "id": "10000000-1000-1000-1000-100000000000",
        "account_id": "ID_OF_ACCOUNT_WHERE_TRANSACTION_OCCURRED",
        "value": 99.99,
        "transaction_date": "2022-11-08T19:53:09Z",
        "transaction_posted_date": null,
        "transaction_status": "PENDING",
        "transaction_type": "TRANSFER_IN",
        "category_type": "DEPOSIT",
        "category_id": "00000000-0000-1234-0000-000012340000"
    }
  }
}

TRANSACTION_POSTED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "TRANSACTION_POSTED",
  "event_data":{
    "transaction": {
        "id": "10000000-1000-1000-1000-100000000000",
        "account_id": "ID_OF_ACCOUNT_WHERE_TRANSACTION_OCCURRED",
        "value": 99.99,
        "transaction_date": "2022-11-08T19:53:09Z",
        "transaction_posted_date": "2022-11-08T19:53:09Z",
        "transaction_status": "POSTED",
        "transaction_type": "TRANSFER_IN",
        "category_type": "DEPOSIT",
        "category_id": "00000000-0000-1234-0000-000012340000"
    }
  }
}

TRANSACTION_CANCELLED

Copy
Copied
{
  "event_id": "00000000-0000-0000-0000-000000000000",
  "event_date": "2022-11-08T19:53:09",
  "event_type": "TRANSACTION_CANCELLED",
  "event_data":{
    "transaction": {
        "id": "10000000-1000-1000-1000-100000000000",
        "account_id": "ID_OF_ACCOUNT_WHERE_TRANSACTION_OCCURRED",
        "value": 99.99,
        "transaction_date": "2022-11-08T19:53:09Z",
        "transaction_posted_date": "2022-11-08T19:53:09Z",
        "transaction_status": "CANCELLED",
        "transaction_type": "TRANSFER_IN",
        "category_type": "DEPOSIT",
        "category_id": "00000000-0000-1234-0000-000012340000"
    }
  }
}
© 2023 Layer2 Financial Inc. All Rights Reserved.