Skip to main content
POST
/
billing
/
payment
/
patient-credit
/
create
Create Patient Credit Payment
curl --request POST \
  --url https://api.decodahealth.com/billing/payment/patient-credit/create \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "id": "<string>",
  "total": 123,
  "totalOutstanding": 123,
  "status": "OUTSTANDING",
  "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>"
  },
  "createdDate": "2023-11-07T05:31:56Z",
  "adjustments": [
    {
      "chargeId": "<string>",
      "id": "<string>",
      "amount": 123,
      "createdDate": "2023-11-07T05:31:56Z",
      "adjustmentType": "WRITE_OFF",
      "providerId": "<string>",
      "locationId": "<string>",
      "reason": "<string>"
    }
  ],
  "payments": [
    {
      "id": "<string>",
      "amount": 123,
      "status": "CANCELED",
      "createdDate": "2023-11-07T05:31:56Z",
      "paymentMedium": "<string>",
      "refunds": [
        {
          "id": "<string>",
          "amount": 123,
          "reason": "DUPLICATE",
          "createdDate": "2023-11-07T05:31:56Z",
          "description": "<string>",
          "creator": {
            "id": "<string>",
            "type": "PROVIDER",
            "firstName": "<string>",
            "lastName": "<string>",
            "phoneNumber": "<string>",
            "email": "<string>",
            "locationId": "<string>"
          }
        }
      ],
      "paymentMethod": {
        "id": "<string>",
        "patientId": "<string>",
        "rainforestPaymentMethodId": "<string>",
        "brand": "<string>",
        "last4": "<string>",
        "expMonth": 123,
        "expYear": 123,
        "accountHolderType": "<string>",
        "accountNumberLast4": 123,
        "bankName": "<string>",
        "routingNumber": 123,
        "description": "<string>",
        "type": "CARD",
        "isDefault": false,
        "isArchived": false
      }
    }
  ],
  "plannedPayments": [
    {
      "id": "<string>",
      "amount": 123,
      "status": "SCHEDULED",
      "paymentDate": "2023-11-07T05:31:56Z"
    }
  ],
  "items": [
    {
      "chargeId": "<string>",
      "quantity": 123,
      "price": 123,
      "id": "<string>",
      "itemId": "<string>",
      "name": "<string>",
      "description": "<string>",
      "discountAmount": 123,
      "discountPercentage": 123,
      "discountReason": "<string>",
      "soldPackageId": "<string>",
      "bankedQuantity": 123,
      "bankedItemId": "<string>",
      "issuedDiscountId": "<string>",
      "soldByProviderId": "<string>",
      "taxAmount": 123,
      "pricingId": "<string>",
      "shipmentIds": [
        "<string>"
      ]
    }
  ],
  "description": "<string>",
  "ruleSetId": "<string>",
  "externalCreatedDate": "2023-11-07T05:31:56Z",
  "externalId": "<string>",
  "creator": {
    "id": "<string>",
    "type": "PROVIDER",
    "firstName": "<string>",
    "lastName": "<string>",
    "phoneNumber": "<string>",
    "email": "<string>",
    "locationId": "<string>"
  },
  "comment": "<string>",
  "locationId": "<string>",
  "tips": []
}
'
{
  "id": "<string>",
  "amount": 123,
  "status": "CANCELED",
  "paymentMedium": "<string>",
  "createdDate": "2023-11-07T05:31:56Z",
  "feeToPatient": 123,
  "patientId": "<string>",
  "payinId": "<string>",
  "currency": "USD",
  "payinConfigId": "<string>",
  "paymentMethodId": "<string>",
  "stripePaymentIntentId": "<string>",
  "failedReason": "<string>",
  "updatedDate": "2023-11-07T05:31:56Z",
  "fee": 0
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json
id
string
required
total
integer
required
totalOutstanding
integer
required
status
enum<string>
required
Available options:
OUTSTANDING,
PAID,
EXTERNAL_SETTLEMENT,
VOID,
WRITE_OFF,
REFUNDED,
CHARGEBACK,
PAYMENT_PLAN,
COLLECTIONS
patient
PatientSummary · object
required
createdDate
string<date-time>
required
adjustments
AdjustmentSummary · object[]
required
payments
ChargeTablePayment · object[]
required
plannedPayments
ChargeTablePlannedPayment · object[]
required
items
ChargeItem · object[]
required
description
string | null
ruleSetId
string | null
externalCreatedDate
string<date-time> | null
externalId
string | null
creator
UserTiny · object
comment
string | null
locationId
string | null
tips
TipDetail · object[]

List of Tips in the Charge.

Response

Successful Response

id
string
required

The unique identifier for the payment.

amount
integer
required

The total amount of the payment.

status
enum<string>
required

The current status of the payment.

Available options:
CANCELED,
CREATED,
FAILED,
IN_REVIEW,
PRESENTING,
PROCESSING,
SUCCEEDED
paymentMedium
string
required

The name of the payment medium.

createdDate
string<date-time>
required

The date and time the payment was created.

feeToPatient
integer
required

The fee charged to the patient for the transaction.

patientId
string | null

The ID of the patient associated with the payment.

payinId
string | null

The ID of the payin associated with the payment.

currency
string
default:USD

The currency in which the payment was made.

payinConfigId
string | null

The configuration ID for the payin.

paymentMethodId
string | null

The ID of the payment method used.

stripePaymentIntentId
string | null

Stripe's payment intent ID if used.

failedReason
string | null

Reason for payment failure if applicable.

updatedDate
string<date-time> | null

The date and time the payment was last updated.

fee
integer
default:0

The fee charged by the payment processor.