Overview
Perch created its public API to provide our partners with an easy-to-use, leading as a service (LaaS) offering. Using the Perch API, partners can programmatically drive mortgage seekers towards securing mortgage products through Perch’s online ecosystem (purchase, renewal, refinance, etc.). This guide provides detailed steps and examples on how your company can integrate our Leads submission and monitoring functionality into your internal systems to keep track of Leads and monitor their progress once they’ve joined Perch.Requirements
To use this guide you will need the following pieces of data (all of which are provided to you by Perch):x-api-key: A UUID V4 which grants you access to the Perch APIFirm.id: The unique identifier of your firmReferralCode.id: The unique identifier of your firm’s referral code
1. Creating a Lead
Leads is a group of highly flexible endpoints which enable the submission of customer data to Perch (refer to the Leads API Spec) and retrieval of Lead and associated Plan data.Using the Perch API partners can:
- Remove much of the overhead in the client’s application process by proactively populating a client profile prior to that client’s registration with Perch
- Track the status of the submitted Lead (i.e. have they completed registration with Perch, have they started a mortgage application, have they received a pre-approval, etc.)
Rest assured, Perch has prioritized the security of your data. Perch employs robust encryption measures to safeguard all Lead data, both at rest and in transit, ensuring your clients’ sensitive information remains protected.
Upon submitting a Lead to Perch you can expect:
- The Lead will be populated in Perch’s database and made accessible via
GETand update viaPATCH - Perch will immediately send a personalized, co-branded welcome message to the email address provided in the Lead request. The email will provide a brief overview of Perch and invite the user to sign up. Please note that this email can be disabled if you wish to send your own automated communication when submitting Leads to Perch
- Perch’s customer experience team will automatically be deployed to help assist in onboarding the Lead
- When the client signs up for Perch their Lead data will be converted into a client profile (we call this “conversion”). The
leadobject will be updated with aconvertedAtdate, adeletedAtdate (the lead is automatically archived upon conversion) and ifPlandata was included in thelead’sclientDataobject then the plan(s) will be created and the lead will be updated with the relatedplan_idsso that you can either join thePlanson the leads (with an optional param:includes=Plans) or look them up directly
Important: to automatically populate the client’s profile with the submitted
Lead data, the client must sign up using the same email address that was used to create the Lead.Plan is simply the name we’ve given to the resource which contains details related to one or more mortgage applications (e.g. home buying plan, refinancing plan, etc.). Since it is possible for a client to have simultaneous mortgage applications (e.g 1st & 2nd position mortgage / 1st position mortgage + HELOC), we created the Plans resource to allow for the bucketing of the related applications. You can assume that 90% of the time a Plan has only one mortgage application.
To create a Lead, make a POST request to the endpoint /firms//leads. Upon successful creation of a Lead we recommend storing the Lead.id primary key in your own system so that you can periodically check for updates on the Lead’s conversion (i.e. did they actually sign up, where are they at in their process, etc.).
Example Request
Example Response
Lead associated with your firm, with details like email, name, and client data. Firms is the resource used to denote partner organizations. In this case the :id will be your firm’s unique Firm.id value which will be provided by your Perch account representative.
2. Monitoring the Conversion Status of a Lead
You can monitor the status of aLead by making a GET request to /leads/. The convertedAt parameter in the response indicates if/when the lead was converted for a ClientProfile.
Please make sure you use ?scope=withDeleted to ensure that the endpoint returns even deleted Leads.
Example Request
Example Response
convertedAt datetime value denotes the time at which the Lead was promoted from a Lead to a ClientProfile. In most cases, this is when the client completes the Perch registration process.
The deletedAt datetime value is set at the same time as convertedAt to automatically archive the lead record by setting the deletedAt value. If a Perch Representative archives a Lead the deletedAt value will be populated, but the convertedAt value will not.
When a lead converts, you can expect the following:
- The
Leadrecord will receive a one time update in which theconvertedAtanddeletedAtvalue will be set - All
Firm Memberowners associated with theFirm, who have an active Perch Notification subscription will receive an email alert letting them know the lead has converted. Your Perch Account Manager can help you set this up - If
Planswere included in theClientDataof theLead, aplanIdwill also be set in the Plan object response. You can extend your GET request to fetch Leads to include Plan data or use thisplan_idto access thePlandetails via the Plan endpoint. You can learn more about includingPlandata in yourLeadin section 4 below
3. Retrieve all Leads for a Given Firm
In the event that you would like to see all the leads you’ve created for your firm you can use the GET firms/:id/leads endpoint.Example Request
Leads created by the provided Firm. The default list limit is 50 and offset is 0. Please refer to our detailed API documentation to learn about the use of params like limit and offset to page through results.
4. Creating a Lead with Plan Data
When you providePlan data as part of your Lead submission, we will automatically make you an owner of that plan upon conversion which means you’ll be able to access the Plan via API should you wish to monitor the Client’s application progress. You’ll also be subscribed to email updates for Plans where you are an owner.
To protect Client privacy,
Plans created by a client after registration will not automatically be accessible by the Lead owner.Plan data when creating a lead is simple as seen in the example below. Notice the inclusion of Plans array in the clientData object in request body. In this case we are including one plan with the deal purpose of Buying (Please make note of the various Plan types in our full API documentation). Plans is an array and can accept one or more values (e.g. the client is looking to Buy and Renew an existing mortgage).
Example Request
Example Response
Plan object to contain a plan.id value which you can use to retrieve that plan’s details. The plan is automatically created during the lead conversion workflow (i.e. when the lead accepts the invitation and signs up for Perch).
5. Retrieving Plans
5.1 Get Plans where you are the Lead Owner
When you create aLead with one or more Plans, you are automatically granted access to those plans THROUGH your ownership of the Lead. The simplest way to access those Plans is to simply join the Plans data onto a GET Leads request as seen below. Include the withDeleted scope to ensure that both converted and unconverted Leads are returned in your response.
Example Request
firmId. This response provides a snapshot of the current mortgage applications that you are able to access.
The response will contain an array of Leads owned by the provided firmId and any associated Plans. The default list limit is 50 and offset is 0. Please refer to our detailed API documentation to learn about the use of params like limit and offset to page through results.
6. Updating a Lead
You can continue to update aLead with additional details up until the point where the lead has converted (as denoted by the convertedAt and deletedAt datetime value being set). Updating a Lead after conversion is not advantageous as the conversion process whereby lead data populates the client’s profile will have already taken place.
You can update a lead through the PATCH /leads/.
Example Request
7. Disabling Perch’s Default Outreach Automation
As discussed above, when a Lead is created in Perch, we automatically send a welcome message to the email address in the submittedLead. To disable this default messaging when creating a Lead, you can use the disableClientOutreach parameter in your POST /firms//leads/.
You may wish to apply this flag if you want to manage your own automated lead outreach messaging strategy.
Example Request
8. Retrieving all Leads (Including Deleted Leads)
To get all leads for your firm, including those that have been deleted, use thewithDeleted scope in your GET /firms//leads:
Example Request
Next Steps
- Review the Partner API Overview for conceptual understanding
- Explore the full Partner API documentation for detailed endpoint specifications
- Set up Postman for API testing
- Contact partnersupport@myperch.io for implementation assistance