Upsert Payment
Creates or updates payment information for an existing customer loan. This endpoint should be used in real-time to report new loan payments or payment 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
payment_id
stringrequiredThe LMS generated payment ID.
payment_amount
integerThe payment amount in cents.
payment_type
stringEnum:
Funding PaymentFirst PaymentPaymentAdditional PaymentMakeup PaymentPayoffOtherpayment_mode
stringEnum:
ACHACH CollectionCashier CheckPersonal CheckCashCredit CardDebit CardMoney OrderMoney GramLoan TransferWire TransferWestern UnionOtherpayment_status
stringEnum:
PendingPaidPartially PaidLateReturnedFailedOtherprincipal
integerTotal amount in cents of principal paid.
interest
integerTotal amount in cents of interest paid.
fees
integerTotal amount in cents of any fees paid.
bank_routing_number
stringThe routing transit number for the bank account processing the payment.
bank_account_number
stringThe account number for the bank account processing the payment.
return_code
stringThe ACH return code if the payment is a reversal.
returned_at
stringrequired withThe datetime the return came back from the bank. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
DANGER
Required with return_code
fail_code
stringThe payment transaction response fail code.
failed_at
stringrequired withThe datetime the payment transaction failed. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
DANGER
Required with fail_code
payment_at
stringThe datetime of this payment transaction. Must be a valid date in ISO 8601 format YYYY-MM-DDTHH:mm:ssZ.
POST /api/v1/loan-performance/customers/{customerId}/payments
curl --request POST \
"https://api.decisioncloud.me/api/v1/loan-performance/customers/1/payments" \
--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,
\"payment_id\": \"{PAYMENT_ID}\",
\"payment_amount\": 8500,
\"payment_type\": \"First Payment\",
\"payment_mode\": \"ACH\",
\"payment_status\": \"Returned\",
\"principal\": 6500,
\"interest\": 500,
\"fees\": 1500,
\"bank_routing_number\": \"091000019\",
\"bank_account_number\": \"434343434\",
\"return_code\": \"RO1\",
\"returned_at\": \"2021-09-25T04:02:05Z\",
\"fail_code\": \"01\",
\"failed_at\": \"2021-09-25T04:02:05Z\",
\"payment_at\": \"2021-09-25T04:01:57Z\"
}"const url = new URL(
"https://api.decisioncloud.me/api/v1/loan-performance/customers/1/payments"
);
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,
"payment_id": "{PAYMENT_ID}",
"payment_amount": 8500,
"payment_type": "First Payment",
"payment_mode": "ACH",
"payment_status": "Returned",
"principal": 6500,
"interest": 500,
"fees": 1500,
"bank_routing_number": "091000019",
"bank_account_number": "434343434",
"return_code": "RO1",
"returned_at": "2021-09-25T04:02:05Z",
"fail_code": "01",
"failed_at": "2021-09-25T04:02:05Z",
"payment_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/payments',
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'loan_id' => '{LOAN_ID}',
'lead_id' => 1,
'management_system_id' => 1,
'payment_id' => '{PAYMENT_ID}',
'payment_amount' => 8500,
'payment_type' => 'First Payment',
'payment_mode' => 'ACH',
'payment_status' => 'Returned',
'principal' => 6500,
'interest' => 500,
'fees' => 1500,
'bank_routing_number' => '091000019',
'bank_account_number' => '434343434',
'return_code' => 'RO1',
'returned_at' => '2021-09-25T04:02:05Z',
'fail_code' => '01',
'failed_at' => '2021-09-25T04:02:05Z',
'payment_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/payments'
payload = {
"loan_id": "{LOAN_ID}",
"lead_id": 1,
"management_system_id": 1,
"payment_id": "{PAYMENT_ID}",
"payment_amount": 8500,
"payment_type": "First Payment",
"payment_mode": "ACH",
"payment_status": "Returned",
"principal": 6500,
"interest": 500,
"fees": 1500,
"bank_routing_number": "091000019",
"bank_account_number": "434343434",
"return_code": "RO1",
"returned_at": "2021-09-25T04:02:05Z",
"fail_code": "01",
"failed_at": "2021-09-25T04:02:05Z",
"payment_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