Mono Logo
  • Why Mono
    • Why Choose Mono
      Here's why 250+ Businesses & Developers use Mono APIs
    • Pricing
      Affordable pricing for developers, SMEs, and enterprises
    • See a Demo
      Experience Mono APIs in action
  • Products
    • Connect
      Financial account linking
    • Statement Pages
      No-code bank statement collection
    • DirectPay
      Direct bank payment collection
    • DirectPay Pages
      No-code bank payment collection
    • Portal
      Linked account management
    • Percept
      Corporate finance management
  • Learn
    • About us
    • Blog
    • Tutorials
    • Coverage
  • Developers
    • Overview
    • Documentation
Create free account
Why Mono
  • Why Choose Mono
  • Pricing
  • See a Demo
Products
  • Connect
  • Statement Pages
  • DirectPay
  • DirectPay Pages
  • Portal
  • Percept
Learn
  • About us
  • Blog
  • Tutorials
  • Coverage
Developers
  • Overview
  • Documentation
Create free account
Mono Blog

Understanding Data Sync and Re-authorisation [Part 1]

1 Mar, 2021Engineering
  • King Kenway
    Growth
  • On this page
    • Data Sync
    • Webhooks
    • Webhook Events
    • Types of Data Sync
    • Expected Responses
    • Interested in using Mono?
    Share article
    • Twitter
    • LinkedIn

    Data Sync

    Data sync allows you to fetch recent data (balance and transactions) from financial accounts linked to your web or mobile app, without requiring your user to login again.

    The financial accounts in this case are of two natures:

    i. The financial accounts that only require username and password to login on the Mono widget.

    ii. The financial accounts that require Multi-factor Authentication (MFA).

    There are two types of Data Sync. But before we delve fully into these types, we need to first understand how Mono's webhooks (events) run under the hood, and then we can understand what nature of data and response we are to expect.

    Webhooks

    Mono sends Webhook events to your Webhook URL to notify you of data updates.

    To get started, it is important that you verify your webhook headers. This can be achieved with what we call "mono-web-secret". This is a secret key that Mono parses into the header, which helps you verify the authenticity of the webhook source on your end. This secret key can be gotten on your dashboard right after an app is created.

    If you do not have this mono-web-secret, you can go through this guide. Right after this guide, head on to "Edit app" on your Mono Dashboard, and add your webhook URL to the field. Once added, you would get a webhook secret (e.g sec_webhook_key) displayed on the screen. Ensure to take note of this key, since you will need it to authorize your webhook connection.

    Webhook Events

    Webhook events is how Mono notifies you when there are updates to balance and transactions via events.

    The snippet below is a typical successful response gotten from the Webhook account updates (account_updated event)

    Mono's webhook events are of three categories.

    1. mono.events.account_updated

    2. mono.events.reauthorisation_required

    3. mono.events.account_reauthorized

    1. mono.events.account_updated

    This webhook event is fired to notify you about updates to connected accounts.

    For this particular event, a meta data_status is sent to indicate the current state of events for account updated.

    The various meta data_status parameters are:

    AVAILABLE | PROCESSING | FAILED

    The snippet below is a typical response gotten from the account_updated event:

    2. mono.events.reauthorisation_required

    This event is sent when the connected account has Multi-factor Authentication (MFA) enabled and requires a token/OTP.  MFA-enabled accounts need to be re-authenticated, and then the account ID will be sent to the data field.

    3. mono.events.account_reauthorized

    This event is sent after a successful account is reauthorised. The account ID. would be sent to the data field.

    Types of Data Sync

    With a solid understanding on how Webhook events run under the hood, we can then move onto the types below.

    1. Automatic Refresh:

    Mono automatically refreshes all the accounts connected to your business on a daily basis and notifies you via webhook events as soon as the connected account data is available for you to use. What this implies is that once you have your backend setup to receive requests and updates via webhooks, you could then save the updated account to your DB with the account id that is provided in the data field.

    NOTE: By default, all connected accounts are automatically refreshed once, every 24 hours. You can contact us at hi@mono.co, if you want to change the update frequency to:

    • 6h, all connected accounts will be refreshed every 6h (4 times a day)

    • 12h, all connected accounts will be refreshed every 12h (2 times a day)

    2. Manual trigger endpoint:

    Manual Trigger allows you to force-trigger data refresh which can be used to enable an option for your users to manually refresh their financial data, using the manual trigger sync Endpoint.

    The snippet below is a basic implementation of triggering the data sync manually:

    Once this is performed and a response code "SYNCED_SUCCESSFULLY" is received, Mono will notify you via webhook, you can then go on to update the connected user profile on your database(DB) at the webhook event → mono.events.account_updated

    Expected Responses

    a. Successful Response

    This response is received when data sync for a connected account is successful. This implies that Mono will notify you via webhook, and then you can update the connected user profile on your database (DB) at the webhook event → mono.events.account_updated
    A typical response that would be received from the sync endpoint when successful would be:

    b. Re-authorisation Response

    This response is received when data sync is unsuccessful. A typical response is seen in the snippet below:

    Interested in using Mono?

    Request access to get started with a N2000 free API call credit or reach out to us at hi@mono.co. Make sure to follow us on Twitter to stay in the loop of our latest announcements.

    Like what you read?

    Become a subscriber and receive notifications about blog posts, company events and announcements, products and more.

    Next Read

    3 Oct, 2024Engineering

    Building an automated loan recovery process with Mono Direct Debit APIs

    Read the story
    Building an Automated Loan Recovery Process using Mono Direct Debit APIs
    17 Jul, 2024Engineering

    How to Implement the Mono Telco Data API

    Read the story
    How to Implement the Mono Telco Data API

    Start building with Mono

    Access high-quality financial data and start processing payments directly from bank accounts in minutes.

    Start now for freeTalk to Sales
    Products
    • Connect
    • Statement Pages
    • DirectPay
    • DirectPay Pages
    • Portal
    • Transactions
    • Income
    • Information
    • Realtime Data
    Resources
    • Developers
    • Documentation
    • API Reference
    • SDKs
    • Demo
    • Join Slack
    • Consumers
    Company
    • About us
    • Partner stories
    • Blog
    • Coverage
    • Careers
    • Contact
    Legal
    • End-User Policy
    • Privacy Policy
    • Developer Policy
    • Terms of Use
    • Cookies
    • Security
    © Mono Technologies Nigeria Limited
    TwitterLinkedIn