# Payment Plans
Payment plans allow customers to pay down their debt in recurring fashion. You can create payment plan by passing payment_plan
parameters when creating a Debt Account.
# Payment Plan
Once a Payment Plan is created for a Debt Account, it will be attached to the resource.
{
"id": "1234-5678-1234",
"frequency": "weekly",
"start_date": "2021-01-01",
"amount": 1000,
"rules": {
"unscheduled_payment_plan_editable": false
},
"charges": [{
"charge_date": "ISO8601",
"amount": 1000,
"scheduled": false,
"charged_at": "ISO8601"
},...]
}
charges
Charges associated with payment plan. Once customer agrees on Payment Plan, scheduled
will be updated to true
. Successful charge will be updated with charged_at
datetime.
# Get Payment Plan
GET https://<org-uuid>.production.tratta.io/api/v1/payment-plans/{payment-plan-uuid}
curl https://<org-uuid>.production.tratta.io/api/v1/payment-plans/{payment-plan-uuid} \
-H "Authorization: Bearer eyJ0eXA3asdk..."
# Update Payment Plan
If payment plan doesn't have any scheduled charges and the rule unscheduled_payment_plan_editable
is set to true
it can be edited.
PUT https://<org-uuid>.production.tratta.io/api/v1/payment-plans/{payment-plan-uuid}
curl https://<org-uuid>.production.tratta.io/api/v1/payment-methods/{payment-method-uuid} \
-H "Authorization: Bearer eyJ0eXA3asdk..." \
-d frequency="weekly" \
-d start_date="2021-01-01" \
-d amount="700"
-X PUT
# Parameters
frequency required|string
Specified the periodicity of payments.
Supported frequencies:
weekly
every_other_week
monthly
last_of_month
start_date required|date
It must be a date at least 1 day after enrolment and within the number of days defined in the payment_plan_max_days_until_start_date
rule, which defaults to 31.
amount required|numeric
Specifies the amount of payment.
# Returns
A json with data
property that contains created payment-plan
object.
{
"id": "1234-5678-1234",
"frequency": "weekly",
"start_date": "2021-01-01",
"amount": 1000,
"rules": {
"unscheduled_payment_plan_editable": false
},
"charges": [{
"charge_date": "ISO8601",
"amount": 1000,
"scheduled": false,
"charged_at": "ISO8601"
},...]
}
# Delete Payment Plan
DELETE https://<org-uuid>.production.tratta.io/api/v1/payment-plans/{payment-plan-uuid}
curl https://<org-uuid>.production.tratta.io/api/v1/payment-plans/{payment-plan-uuid} \
-H "Authorization: Bearer eyJ0eXA3asdk..."
# Returns
{
"success": "boolean"
}