# 🚧 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 or updating 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",
  "recurring_day": "monday",
  "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://api.tratta.io/api/v1/payment-plans/{payment-plan-uuid}

curl https://api.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://api.tratta.io/api/v1/payment-plans/{payment-plan-uuid}

curl https://api.tratta.io/api/v1/payment-methods/{payment-method-uuid} \
 -H "Authorization: Bearer eyJ0eXA3asdk..." \
 -d frequency="weekly" \
 -d recurring_day="tuesday" \
 -d amount="700"
 -X PUT

# Parameters


frequency required|string

Specified the the periodicity of payments.

Supported frequencies:

  • weekly
  • every_other_week
  • monthly

recurring_day required|string

Specified the day, payment will run.

Supported weekly and every_other_week recurring days:

  • monday
  • tuesday
  • wednesdy
  • thursday
  • friday
  • saturday
  • sunday

Supported monthly recurring days:

  • 1st
  • 15th
  • last_day

amount required|numeric

Specified the the amount of payment.

# Returns

A json with data property that contains created payment-plan object.

{
  "id": "1234-5678-1234",
  "frequency": "weekly",
  "recurring_day": "monday",
  "amount": 1000,
  "rules": {
    "unscheduled_payment_plan_editable": false
  },
  "charges": [{
    "charge_date": "ISO8601",
    "amount": 1000,
    "scheduled": false,
    "charged_at": "ISO8601"
  },...]
}

# Delete Payment Plan

DELETE https://api.tratta.io/api/v1/payment-plans/{payment-plan-uuid}

curl https://api.tratta.io/api/v1/payment-plans/{payment-plan-uuid} \
 -H "Authorization: Bearer eyJ0eXA3asdk..."

# Returns

{
  "success": "boolean"
}