Skip to main content
POST
/
billing
/
payment-plan
/
create-with-charges
Create Payment Plan With Charges
curl --request POST \
  --url https://api.decodahealth.com/billing/payment-plan/create-with-charges \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "charges": [
    {
      "patientId": "<string>",
      "totalOutstanding": 123,
      "id": "<string>",
      "patient": {
        "id": "<string>",
        "type": "PROVIDER",
        "createdDate": "2023-11-07T05:31:56Z",
        "firstName": "<string>",
        "lastName": "<string>",
        "phoneNumber": "<string>",
        "email": "<string>",
        "locationId": "<string>",
        "externalId": "<string>",
        "address": "<string>",
        "addressLineTwo": "<string>",
        "city": "<string>",
        "state": "<string>",
        "zipCode": "<string>",
        "country": "<string>",
        "addressValid": true,
        "meta": {},
        "isArchived": true,
        "primaryLocationId": "<string>",
        "gender": "<string>",
        "dateOfBirth": "2023-12-25",
        "patientMedications": [
          "<string>"
        ],
        "onSchedulingBlacklist": true,
        "surchargeDisabled": true,
        "tags": [
          {
            "id": "<string>",
            "name": "<string>",
            "isActive": true,
            "createdDate": "2023-11-07T05:31:56Z",
            "emoji": "<string>",
            "color": "<string>",
            "updatedDate": "2023-11-07T05:31:56Z"
          }
        ],
        "creditBalance": 123,
        "preferredProviderId": "<string>"
      },
      "total": 0,
      "description": "<string>",
      "status": "OUTSTANDING",
      "discountAmount": 0,
      "discountPercentage": 0,
      "externalId": "<string>",
      "externalCreatedDate": "2023-11-07T05:31:56Z",
      "ruleSetId": "<string>",
      "createdDate": "2023-11-07T05:31:56Z",
      "creatorId": "<string>",
      "items": [],
      "tips": [],
      "locationId": "<string>",
      "eventId": "<string>",
      "memberId": "<string>",
      "comment": "<string>",
      "meta": {},
      "merchantAccountId": "<string>",
      "payments": [],
      "adjustments": []
    }
  ],
  "paymentPlan": {
    "initialAmount": 123,
    "chargeIds": [
      "<string>"
    ],
    "frequency": "WEEKLY",
    "installments": 123,
    "installmentAmount": 123,
    "locationId": "<string>",
    "startDate": "2023-12-25"
  },
  "rainforestPaymentMethodId": "<string>"
}
'
{
  "initialAmount": 123,
  "chargeIds": [
    "<string>"
  ],
  "frequency": "WEEKLY",
  "installments": 123,
  "installmentAmount": 123,
  "paymentMethodId": "<string>",
  "locationId": "<string>",
  "startDate": "2023-12-25",
  "id": "<string>"
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json

Request schema for creating payment plans with charges ($0 down payments).

charges
ChargeDetail · object[]
required
paymentPlan
PaymentPlanCreateWithoutID · object
required

Represents the creation of a payment plan without an ID.

This model defines the structure for creating a new payment plan, including details about the initial payment, associated charge, frequency of payments, number of installments, and the amount for each installment.

rainforestPaymentMethodId
string
required

Response

Successful Response

Represents the creation of a payment plan with an ID and associated payment method.

This model extends PaymentPlanCreateWithoutID by adding an automatically generated ID and a required payment method ID. It includes all the fields from the parent class along with these additional attributes.

Attributes: id (str): An automatically generated unique identifier for the payment plan. payment_method_id (str): The ID of the associated payment method used for installments.

initialAmount
integer
required

The initial payment amount for the payment plan

chargeIds
string[]
required

The IDs of the associated charges

frequency
enum<string>
required

The frequency of installment payments

Available options:
WEEKLY,
BIWEEKLY,
MONTHLY
installments
integer
required

The number of installment payments

installmentAmount
integer
required

The amount of each installment payment

paymentMethodId
string
required

The ID of the associated payment method

locationId
string | null

The ID of the associated location

startDate
string<date> | null

Optional start date for the first payment (only allowed for $0 down payment plans)

id
string

The ID of the payment plan