Posting Loans and Events
The CRF Exchange API provides endpoints that allow you to post new loan events and documents to the Exchange. This is useful for automating the process of updating loan information and ensuring that your Exchange portfolio is current. This guide will walk you through how to use the posting endpoints effectively.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following:
- Your API key
- Your Partner ID
If you don’t have an API key or Partner ID, please refer to the Getting Started guide.
Posting Loan Events
Section titled “Posting Loan Events”The Exchange API provides an endpoint for posting loan events. This allows you to create new events associated with loans in your portfolio.
Endpoint
Section titled “Endpoint”POST https://qa.exchange.crfusa.com/api/loan/events?partnerId={{partnerId}}&whatIf=true|falsex-api-key: {{key}}Content-Type: application/json
[ { "kind": "Add", "sellerLoanId": "LOAN-12345", "listingMetadata": { "loanAmount": 250000, "percent": 0.8, "dateFunded": "2025-01-15T00:00:00Z", "listingTag": "ssbci-ny", "interestRate": 8.5, "termMonths": 120, "principalAndInterestPaymentAmount": 3051.45, "dateFirstPayment": "2025-02-15T00:00:00Z", "isRefinance": false, "serviceFee": { "type": "PercentWithFloor", "percentAnnual": 0.05, "floorFeeMonthly": 100 }, "businessType": "LLC", "businessAddressState": "California", "businessAddressCity": "San Francisco", "businessEmployeeCount": 25, "businessIndustry": "541511", "ProgramCustomQuestion1": "Custom Answer 1" }, "privateMetadata": { "businessName": "Acme Corporation", "businessAddress": { "line1": "123 Main Street", "line2": "Suite 100", "city": "San Francisco", "state": "CA", "postalCode": "94105" } } }]Parameters
Section titled “Parameters”partnerId: Your Partner ID.whatIf: Optional boolean parameter. If set totrue, the API will validate the request without actually creating the event.
Request Body
Section titled “Request Body”The request body should be a JSON array of event objects. Each event object must conform to the structure defined in the Event Types guide.
Response Body
Section titled “Response Body”The response will contain the loans affected by your posted events, along with their updated information, or errors if any occurred.
Posting Loan Documents
Section titled “Posting Loan Documents”Because the above endpoint expects a JSON payload, it does not support direct file uploads. Instead, the below endpoint can be used to upload documents associated with loans.
Endpoint
Section titled “Endpoint”POST https://qa.exchange.crfusa.com/api/loan/document?partnerId={{partnerId}}&sellerLoanId={{sellerLoanId}}&documentName={{documentName}}&tags=tag1&tags=tag2&whatIf=true|falsex-api-key: {{key}}Content-Type: multipart/form-data--boundaryContent-Disposition: form-data; name="file"; filename="{{filename}}"{{file-content}}--boundary--Parameters
Section titled “Parameters”partnerId: Your Partner ID.sellerLoanId: The id of the loan to which the document will be attached, not the full loan GUID used elsewhere.documentName: A friendly name for the document.tags: Optional. One or more tags to categorize the document. Programs may require specific tags for certain document types in order to list your loan.whatIf: Optional boolean parameter. If set totrue, the API will validate the request without actually uploading the document.
Request Body
Section titled “Request Body”The request body should be a multipart/form-data payload containing the file to be uploaded.
Response Body
Section titled “Response Body”The response is shaped the same as the above event posting endpoint, returning the affected loans or errors if any occurred.