curl --request POST \
--url https://api.decodahealth.com/inventory/members/enroll-deferred \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"patientId": "<string>",
"membershipId": "<string>",
"firstBillingDate": "2023-11-07T05:31:56Z",
"paymentMethodId": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"soldByProviderId": "<string>"
}
'{
"id": "<string>",
"patientId": "<string>",
"membershipId": "<string>",
"membership": {
"name": "<string>",
"price": 123,
"id": "<string>",
"externalId": "<string>",
"description": "<string>",
"globalDiscountPercentage": 0,
"patientCreditAmount": 0,
"patientCreditFrequency": "MONTHLY",
"patientCreditExpiryDays": 123,
"maxRenewals": 0,
"autoRenew": true,
"setupFee": 0,
"freezeFee": 0,
"minimumBillingCycles": 0,
"billingFrequency": "MONTHLY",
"textColor": "<string>",
"isArchived": false,
"ruleSetId": "<string>",
"discounts": [
{
"membershipId": "<string>",
"id": "<string>",
"itemId": "<string>",
"itemCategory": "<string>",
"isPhysical": true,
"discountPercentage": 123,
"discountAmount": 123,
"creditAmount": 123,
"quantity": 123,
"rollover": false,
"rolloverExpiryDays": 123,
"neverExpire": false,
"group": "<string>",
"isArchived": false
}
],
"memberCount": 0,
"totalRevenue": 0
},
"startDate": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"autoRenew": true,
"billingFrequency": "DAILY",
"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>"
},
"charges": [
{
"id": "<string>",
"patientId": "<string>"
}
],
"soldByProviderId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"nextBillingDate": "2023-11-07T05:31:56Z",
"unfreezeDate": "2023-11-07T05:31:56Z",
"soldByProvider": {
"id": "<string>",
"firstName": "<string>",
"lastName": "<string>"
},
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"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
},
"logs": [
{
"id": "<string>",
"logType": "STATUS_CHANGE",
"createdDate": "2023-11-07T05:31:56Z"
}
]
}Enroll a new member with deferred billing - they get benefits immediately but aren’t charged until the specified date.
curl --request POST \
--url https://api.decodahealth.com/inventory/members/enroll-deferred \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"patientId": "<string>",
"membershipId": "<string>",
"firstBillingDate": "2023-11-07T05:31:56Z",
"paymentMethodId": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"soldByProviderId": "<string>"
}
'{
"id": "<string>",
"patientId": "<string>",
"membershipId": "<string>",
"membership": {
"name": "<string>",
"price": 123,
"id": "<string>",
"externalId": "<string>",
"description": "<string>",
"globalDiscountPercentage": 0,
"patientCreditAmount": 0,
"patientCreditFrequency": "MONTHLY",
"patientCreditExpiryDays": 123,
"maxRenewals": 0,
"autoRenew": true,
"setupFee": 0,
"freezeFee": 0,
"minimumBillingCycles": 0,
"billingFrequency": "MONTHLY",
"textColor": "<string>",
"isArchived": false,
"ruleSetId": "<string>",
"discounts": [
{
"membershipId": "<string>",
"id": "<string>",
"itemId": "<string>",
"itemCategory": "<string>",
"isPhysical": true,
"discountPercentage": 123,
"discountAmount": 123,
"creditAmount": 123,
"quantity": 123,
"rollover": false,
"rolloverExpiryDays": 123,
"neverExpire": false,
"group": "<string>",
"isArchived": false
}
],
"memberCount": 0,
"totalRevenue": 0
},
"startDate": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"autoRenew": true,
"billingFrequency": "DAILY",
"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>"
},
"charges": [
{
"id": "<string>",
"patientId": "<string>"
}
],
"soldByProviderId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"nextBillingDate": "2023-11-07T05:31:56Z",
"unfreezeDate": "2023-11-07T05:31:56Z",
"soldByProvider": {
"id": "<string>",
"firstName": "<string>",
"lastName": "<string>"
},
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"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
},
"logs": [
{
"id": "<string>",
"logType": "STATUS_CHANGE",
"createdDate": "2023-11-07T05:31:56Z"
}
]
}The tenant you are making this request on behalf of
Your api key
Schema for enrolling a member with deferred billing.
ID of the patient to enroll
ID of the membership to enroll in
Date when the first billing should occur
ID of the payment method to use for future billing (not required for $0 memberships)
Start date for the membership (defaults to now)
ID of the provider who sold this membership
Successful Response
Unique identifier for the member
ID of the patient
ID of the membership
Membership information
Show child attributes
Name of the membership
Price of the membership in cents
Unique identifier for the membership
External system identifier for the membership
Optional description of the membership
Global discount percentage for all items
Amount of patient credit in cents
Frequency of patient credit
DAILY, WEEKLY, BIWEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, YEARLY Days until patient credit expires
Maximum number of renewals (null means unlimited)
Whether the membership auto-renews
Setup fee for the membership in cents
Fee to freeze the membership in cents
Minimum number of billing cycles required
Billing frequency for the membership
DAILY, WEEKLY, BIWEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, YEARLY Text color for the membership
Whether the membership is archived
ID of the rule set for the membership
Optional discounts for the membership
Show child attributes
ID of the membership this discount belongs to
Unique identifier for the membership discount
ID of the specific item for this discount (includes packages)
Category name for items in this discount (references category.name)
Whether this discount applies to physical items (True), services (False), or neither (None)
Discount percentage
Discount amount in cents
Credit amount in cents
Quantity for this discount
Whether to rollover unused quantities
Days until rollover items expire
Whether rollover items never expire
Group for this discount
Whether the discount is archived
Number of active members
Total revenue from this membership
When the patient joined the membership
Current status of the membership
ACTIVE, EXPIRED, CANCELLED, DELINQUENT, FROZEN Whether the membership auto-renews
Billing frequency for this member
DAILY, WEEKLY, BIWEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, YEARLY Patient information
Show child attributes
The unique identifier for the user.
The type of user.
PROVIDER, PATIENT, ASSISTANT The date and time when the user was created.
The user's first name.
The user's last name.
The user's phone number.
The user's email address.
The location of the user.
The user's external identifier if available.
The user's primary address.
Additional address information.
The city of the user's address.
The state of the user's address.
The postal code of the user's address.
The country of the user's address.
Whether the user's address is valid.
Any additional metadata about the user relevant to your system.
Whether the user is archived.
The primary location of the user.
The gender of the patient.
The date of birth of the patient.
List of patient's self-reported medications.
Whether the patient is on the scheduling blacklist.
Whether surcharges are disabled for this patient.
List of patient tags
Show child attributes
Unique identifier for the patient tag
Name of the patient tag
Whether the tag is active
Date and time when the tag was created
Emoji associated with the tag
Color code for the tag (hex format)
Date and time when the tag was last updated
Patient's credit balance in cents.
The preferred provider ID for this patient.
ID of the provider who sold this membership
When the membership ended (if applicable)
Next scheduled billing date (if custom)
When the membership should be automatically unfrozen
When the member record was created
When the member record was last updated
Payment method for this member
Show child attributes
CARD, ACH, APPLE_PAY Activity logs for this member
Show child attributes
Unique identifier for the log
Type of log
STATUS_CHANGE, MANUAL_PAYMENT, RENEWED, PAYMENT_METHOD_CHANGE, DISCOUNT_USED, DISCOUNT_RESTORED, DISCOUNT_MODIFIED, ENROLLED, BILLING_DATE_CHANGE When the log was created