Destiny API

Modified on Thu, Jun 29, 2023 at 10:03 AM

Destiny API

Overview

This task is used to import Fees, Waivers, and Refunds from Destiny, and export Waivers and Refunds to Destiny using their API. To see what is being imported and what is being exported, a CSV file for each will be created when the task is run.

Importing Fees/Fines

If the "Import Fees from Destiny" checkbox is selected, you must also select a fee category to import these fines to, and a date for when you want to import fines until. When the task is run, we will first look in Genesis for a fee with an Other Fine ID that is equal to the Destiny Fine ID. If the fee doesn't exist in Genesis, we will create it. Then, we are looking for a student fee in Genesis that matches the student's fine who we are looking at from Destiny. If we can't find this in Genesis we will create it. 

Importing Refunds

If the "Import refunds from Destiny" checkbox is selected, you must also select a fee category to import refunds to, and a date for when you want to import fines until. When the task is run, we look for fees in Genesis that match the Destiny Fine ID. If no fee exists, we skip it. If a fee does exist, we look for a student fee in Genesis that matches the student from Destiny and is linked to the fee we found. After we have found the fee and student fee in Genesis, we check to see if a refund has already been linked. If no refund is found, we are creating a new fee and student fee in Genesis. These will be duplicates of the ones found, but the description will include "- Refund" at the end. When the refund is paid back to the student, the student fee in Genesis can be waived to indicate it has been paid to the student. 

Importing Waivers

If the "Import Waivers from Destiny" checkbox is selected, you must also select a date for when you want to import fines until. When the import is run, we will grab the fee and student fee in Genesis that match the Destiny Fine ID. If either do not exist in Genesis, we will skip this Destiny fine. If both do exist, we check to see if this student fee already has a payment. If it does we will skip, and if it doesn't we will create a new waived payment for the student fee.  

Exporting Refunds

If the "Send waived refunds (waived Genesis fines in refund category) to Destiny as refund" checkbox is selected, you must also select a fee category to grab refunds from and also a date for when you want to export refunds until. When the task is run, we will grab any payments from Genesis that have not yet been sent to Destiny, that are waived, and has a fee category that is the same as the selected refund category. Any of these payments found are then sent to Destiny.

Exporting Waivers

If the "Send all other waived payments to Destiny as waiver" checkbox is selected, you must also select a fee category to grab waivers that are not in the refund category and also a date for when you want to export waivers until. When the task is run, we will grab any payments from Genesis that have not yet been sent to Destiny, that are waived, and are not in the fee category that is the selected refund category. Any of these payments found are then sent to Destiny.

Exporting Payments

If the "Send payments to Destiny" checkbox is selected, you must also select a fee category to grab payments that are not in the refund category and also a date for when you want to export payments until. When the task is run, we will grab any payments from Genesis that have not yet been sent to Destiny, that are not waived, and are not in the fee category that is the selected refund category. Any of these payments found are then sent to Destiny.

Options

Main Options

  • Client ID (required) - the ID used to connect to Destiny's API
  • Client Secret (required) - the secret used to connect to Destiny's API
  • Web Service URL (required) - default is "https://mc.ebnet.org/"
  • API Version (required) - default is "1"
  • Context Name (required) - default is "destiny"

Testing:

  • Run in test mode - Having this option selected will not save any changes in Genesis and won't send anything to Destiny. CSV files for Import and Export data will still be created. This is useful for if you want to see what fines are being changed when the task is run.

Importing Fees/Fines:

  • Import fees from Destiny
  • Fee Category
  • Do not import fines with a creation date equal to or older than

Importing Waivers/Refunds:

  • Import waivers from Destiny
  • Import refunds from Destiny (as Genesis fines in refund category)
  • Fee Category to post Refunds to
  • Do not import waivers/refunds with a creation date equal to or older than

Exporting to Destiny

  • Send waived refunds (waived Genesis fines in refund category) to Destiny as refund
  • Send all other waived payments to Destiny as waiver
  • Send payments to Destiny
  • Do not export anything that has a creation date equal to or older than

Schools

  • Include these schools

 

Outline of everything that happens:

Importing Fees:

Options:

  • Waive fees (in Genesis) that have an amount of zero (in Destiny): If a Fee has a balance of zero in Destiny, we will waive it in Genesis
  • Import fees from Destiny: Turning this on will have the API try to import any fees from Destiny
  • Fee Category: This is the Fee Category that we will be putting imported Fees into. This should be different from the refund category
  • Do not import fines with a creation date equal to or older than: Set a limit on how far back you'd like to grab Destiny Fees (Date Created in Destiny)

Process for Importing Fees:

  1. Connect to Destiny API and grab all fees from them
  2. Look for Genesis Fees that match the Destiny Other Fine ID
    1. If no Fee exists in Genesis:
      1. Create a new Genesis Fee with the information from Destiny
      2. Create a new Genesis Student Fee with the information from Destiny
    2. If the Fee already exists in Genesis:
      1. Create a new Genesis Student Fee with the information from Destiny
  3. If we are in test mode, these will not save in Genesis

Process for waiving fees with balance of zero:

  1. Connect to Destiny API and grab all fees from them
  2. Get fees that have an amount of zero
  3. Make sure a Fee exists in Genesis that matches the Destiny Other Fine ID
    1. If one doesn't exist, we will skip this
  4. Make sure a Student Fee exists in Genesis that is for this Fee and the student
    1. If one doesn't exist, we will skip this
  5. Make sure no payments exist, if there are any we will skip this
  6. Create a new Genesis payment
    1. Set amount to amount from Destiny
    2. Set it to waived
    3. Set a note as "Waived through Destiny API Import"
  7. If we are in test mode, these will not save in Genesis

Importing Refunds:

Options:

  • Import refunds from Destiny (as Genesis fines in refund category): Turning this on will have the API try to import any refunds from Destiny
  • Fee Category to post Refunds to: A Fee Category that will be used to store refunds in Genesis
  • Do not import waivers/refunds with a creation date equal to or older than: Set a limit on how far back you'd like to grab Destiny Refunds/Waivers (Date Created in Destiny)

Process:

  1. Connect to Destiny API and grab all fees from them
  2. Get Fees that have a refund amount greater than zero
  3. Find the Fee in Genesis that matches the Other Fine ID field from Destiny
    1. If the Fee does not exist in Genesis, we skip it
  4. Make sure the Student in Genesis has this Fee and that this refund doesn't already exist
  5. Create a new Fee in Genesis for the Refund
    1. Fee Category will be set to the refund fee category
    2. Fee Description will be the same as the original fee, with "- Refund" added to the end
    3. Amount will be set to the refund amount from Destiny
  6. Create a new Student Fee in Genesis for the Refund
    1. This links the refund fee we created to the student
  7. If we are in test mode, these will not save in Genesis

Importing Waivers:

Options:

  • Import waivers from Destiny: Turning this on will have the API try to import any waivers from Destiny
  • Fee Category to post Refunds to: A Fee Category that will be used to store refunds in Genesis
  • Do not import waivers/refunds with a creation date equal to or older than: Set a limit on how far back you'd like to grab Destiny Refunds/Waivers (Date Created in Destiny)

Process:

  1. Connect to Destiny API and grab all fees from them
  2. Get Fees that have a waived amount greater than zero (and no refund amount)
  3. Find the Fee in Genesis that matches the Other Fine ID field from Destiny
    1. If the Fee does not exist in Genesis, we skip it
  4. Make sure the Student in Genesis has this Fee and that this Genesis Fee is open and does not have any payments
    1. If any payment exists, we skip this entire fee
  5. Create a new Fee Payment in Genesis for this Student Fee
    1. Payment amount will be set to the waived amount from Destiny
    2. Payment source will be "Destiny API Import"
    3. Waived will be set to true
  6. If we are in test mode, these will not save in Genesis

Exporting to Destiny:

Options:

  • Send waived refunds (waived Genesis fines in refund category) to Destiny as refund: This will send any refunds created in Genesis that have been waived back to Destiny
  • Send all other waived payments to Destiny as waiver: This will send waived payments that are not in the refund category to Destiny
  • Send payments to Destiny: This will send all payments that do not belong to the refund category and aren't waived to Destiny
  • Do not export anything that has a creation date equal to or older than: Set a limit on how far back you want the creation date of a Genesis Payment to be

Process:

  1. Get payments from Genesis:
    1. If we are exporting refunds:
      1. Get any payments in Genesis that belong to the Refund Category and are waived
      2. When sending to Destiny:
        1. Fine ID set to the Genesis Fee's Other Fine ID
        2. External Payment ID set to the Genesis Payment's Object ID
        3. Refund set to the Genesis Payment's amount
    2. If we are exporting waivers:
      1. Get any payments in Genesis that do not belong to the Refund Category and are waived
      2. When sending to Destiny:
        1. Fine ID set to the Genesis Fee's Other Fine ID
        2. External Payment ID set to the Genesis Payment's Object ID
        3. Waiver set to the Genesis Payment's amount
    3. If we are exporting payments:
      1. Get any payments in Genesis that do not belong to the Refund Category and are not waived
      2. When sending to Destiny:
        1. Fine ID set to the Genesis Fee's Other Fine ID
        2. External Payment ID set to the Genesis Payment's Object ID
        3. Payment set to the Genesis Payment's amount
  2. Connect to Destiny and send these payments to them
  3. Any information and or errors will be shown on the logs
  4. If we are in test mode, these payments will not be sent to Destiny

 

 

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article