Accepting an Offer
Commit the lead to the applicant's chosen partner and handle each response.
POST /api/v2/accept is the second step of the Comparisons integration. It commits the lead to the partner the applicant chose from the offers.
See POST /api/v2/accept in the API Reference →
1. Accept the chosen match
Send the offer's lead id as hashid and the chosen match's id as partner_id:
curl -X POST "https://your-api-origin/api/v2/accept" \
-H "Authorization: Bearer fce_your_key" \
-H "Content-Type: application/json" \
-d '{
"hashid": "k3mN9pQx",
"partner_id": 227
}'
Only send a partner that appeared in the offer's matches.
2. Handle the response
The partner determines which of three successful responses you receive. Check for each in this order.
A redirect
{
"redirect": "https://partner.example.com/apply/k3mN9pQx"
}
Send the applicant to redirect. Always use the URL exactly as returned.
Partner details
{
"id": "k3mN9pQx",
"status": "success",
"api": [
{
"id": 227,
"company_name": "Example Lender",
"partner_type": "api",
"live_scoring_api": true,
"end_to_end": false
}
]
}
The partner received the lead directly. api describes the accepted partner. If the response also has a redirect, send the applicant there.
A link that is ready later
{
"id": "k3mN9pQx",
"status": "success"
}
For end-to-end partners the link may follow the acceptance. Fetch it with the lead id:
curl "https://your-api-origin/api/v2/accept/k3mN9pQx/link" \
-H "Authorization: Bearer fce_your_key" \
-H "Accept: application/json"
{
"ready": true,
"link": "https://partner.example.com/apply/k3mN9pQx"
}
When ready is false, wait two seconds and try again. Stop after about a minute and show the applicant that the partner will contact them. Never build or guess a partner URL.
See GET /api/v2/accept/{hashid}/link in the API Reference →
If the accept is rejected
HTTP 422 means the request was valid but this partner cannot be accepted now:
If the chosen partner declines, the lead's state becomes declined and the applicant can accept a different match from the same offer.