Medusa
Medusa is a REST API that enables you to authenticate your user, apply for a spending limit, create a lease, sign the lease, and perform other operations on behalf of the user.
The following guide walks you through the end-to-end journey of the customer through Medusa, and outlines the required steps to complete this journey.
Customer
The customer must exist in Medusa and have a payment method on file. You'll need a customer authentication token for actions such as applying for a spending limit, creating a lease, and signing the lease.
Check if customer exists
You must first check if your customer already exists in Medusa, which you can do by calling the Verify User Exists endpoint. If the customer exists, their ID will be returned.
Authenticate an existing customer
If your customer aleady exists in Medusa, you can obtain a customer authentication token by calling the Create Authorization Token endpoint. The user's ID you'll need for this endpoint is returned from the Verify User Exists endpoint.
Create a customer
If your customer doesn't exist and you need to perform a customer action, then you must create a customer by calling the Create User endpoint. If the customer is successfully created, their ID and customer authentication token will be returned.
Collect a payment method
Once a customer is created, you must collect their payment method(s) and provide them to Medusa.
You can provide the payment methods in the payload when applying for a spending limit, or you can interact with the Add Payment Method endpoint. You may use that endpoint at any point after creating a customer.
Generally, the customer must have at least one payment method in Medusa to complete this flow.
Decision & Spending Limit
Once your customer is in Medusa, it's time to ensure they have an active decision, a spending limit, and are not on a spending hold.
An active decision ensures your customer has is allowed to create and sign leases.
The spending limit amount helps you understand what your customer's maximum order value is, as you won't be able to create a lease for them with a total higher than the spending limit.
A spending hold may be applied by FlexShopper to customers for various reasons. If a customer has a spending hold applied, no new leases will be created for them.
Check if decision exists
You can check the decision status and spending limit by calling the Get User endpoint.
Apply for a decision
If no decision is returned, then you must apply for a spending limit for this customer. You can do that by calling the Apply for Spending Limit endpoint.
If your customer is approved to spend, you can proceed with creating a lease. If the customer is denied, then they unfortuantely cannot proceed.
Lease & Fulfillment
Now that your customer is created, and has an active decision and an available spending limit, you can proceed with the lease process.
Create a lease
Firstly, you must create a lease, which you can do by calling the Create Lease endpoint.
The response will include the FlexShopper lease document in HTML format. You must render and present this to the customer and enable them to read it in full.
Sign the lease
Once a lease is created and presented to the user, you must give them the option to sign it virtually. Then, when the customer signs the lease on your end, you must subsequently sign the lease through Medusa by calling the Sign Lease endpoint.
Finalize the lease
After the lease is signed, the lease must be finalized (confirmed). This can be done by calling the https://github.com/FlexShopper/medusa/blob/development/docs/api/lease/finalize-lease.md endpoint.
Once a lease is finalized, we begin the fulfillment and billing processes.
Last updated
Was this helpful?