Upsert Loan
Creates or updates loan information for an existing customer. This endpoint should be used in real-time to report new customer loans or loan updates.
Authorization OAuth 2.0
This request requires OAuth 2.0 authorization.
Header Parameters
Path Parameters
customerId
stringrequiredThe LMS generated customer ID.
Request Parameters
loan_id
stringrequiredThe LMS generated loan ID.
lead_id
integerrequired withoutThe Decision Cloud generated lead ID.
DANGER
Required without management_system_id
management_system_id
integerrequired withoutThe Decision Cloud generated management system ID.
DANGER
Required without lead_id
application_type
stringEnum:
NewReturningRefinancedloan_type
stringEnum:
PaydayInstallmentLine Of Creditloan_status
stringEnum:
PendingExpiredWithdrawnDeniedApprovedOriginatedReversedPast DueWritten OffCurrentPaid In Fullloan_amount
integerrequiredThe principal loan amount in cents.
funded_amount
integerThe amount in cents of cash that was actually supplied to the consumer.
first_payment_date
stringThe first payment due date. Must be a valid date in ISO 8601 format YYYY-MM-DD.
applied_at
stringrequiredThe datetime the application was submitted. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
esigned_at
stringThe datetime the electronic signature was received. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
withdrawn_at
stringThe datetime the loan was withdrawn. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
originated_at
stringThe datetime the loan was originated. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
POST /api/v1/loan-performance/customers/{customerId}/loans
curl --request POST \
"https://api.decisioncloud.me/api/v1/loan-performance/customers/1/loans" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"loan_id\": \"{LOAN_ID}\",
\"lead_id\": 1,
\"management_system_id\": 1,
\"application_type\": \"New\",
\"loan_type\": \"Installment\",
\"loan_status\": \"Pending\",
\"loan_amount\": 75000,
\"funded_amount\": 35000,
\"first_payment_date\": \"2021-09-25\",
\"applied_at\": \"2021-09-25T04:01:57Z\",
\"esigned_at\": \"2021-09-25T04:01:57Z\",
\"withdrawn_at\": \"2021-09-25T04:01:57Z\",
\"originated_at\": \"2021-09-25T04:01:57Z\"
}"const url = new URL(
"https://api.decisioncloud.me/api/v1/loan-performance/customers/1/loans"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"loan_id": "{LOAN_ID}",
"lead_id": 1,
"management_system_id": 1,
"application_type": "New",
"loan_type": "Installment",
"loan_status": "Pending",
"loan_amount": 75000,
"funded_amount": 35000,
"first_payment_date": "2021-09-25",
"applied_at": "2021-09-25T04:01:57Z",
"esigned_at": "2021-09-25T04:01:57Z",
"withdrawn_at": "2021-09-25T04:01:57Z",
"originated_at": "2021-09-25T04:01:57Z"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.decisioncloud.me/api/v1/loan-performance/customers/1/loans',
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'loan_id' => '{LOAN_ID}',
'lead_id' => 1,
'management_system_id' => 1,
'application_type' => 'New',
'loan_type' => 'Installment',
'loan_status' => 'Pending',
'loan_amount' => 75000,
'funded_amount' => 35000,
'first_payment_date' => '2021-09-25',
'applied_at' => '2021-09-25T04:01:57Z',
'esigned_at' => '2021-09-25T04:01:57Z',
'withdrawn_at' => '2021-09-25T04:01:57Z',
'originated_at' => '2021-09-25T04:01:57Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://api.decisioncloud.me/api/v1/loan-performance/customers/1/loans'
payload = {
"loan_id": "{LOAN_ID}",
"lead_id": 1,
"management_system_id": 1,
"application_type": "New",
"loan_type": "Installment",
"loan_status": "Pending",
"loan_amount": 75000,
"funded_amount": 35000,
"first_payment_date": "2021-09-25",
"applied_at": "2021-09-25T04:01:57Z",
"esigned_at": "2021-09-25T04:01:57Z",
"withdrawn_at": "2021-09-25T04:01:57Z",
"originated_at": "2021-09-25T04:01:57Z"
}
headers = {
'Authorization': 'Bearer {ACCESS_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()nullnull