Create Manual Invoice
curl --request POST \
--url https://api.decodahealth.com/billing/invoice/create \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"patientId": "<string>",
"message": "<string>",
"charges": [
{
"patientId": "<string>",
"totalOutstanding": 123,
"id": "<string>",
"patient": {
"id": "<string>",
"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": []
}
]
}
'import requests
url = "https://api.decodahealth.com/billing/invoice/create"
payload = {
"patientId": "<string>",
"message": "<string>",
"charges": [
{
"patientId": "<string>",
"totalOutstanding": 123,
"id": "<string>",
"patient": {
"id": "<string>",
"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": []
}
]
}
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
patientId: '<string>',
message: '<string>',
charges: [
{
patientId: '<string>',
totalOutstanding: 123,
id: '<string>',
patient: {
id: '<string>',
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: []
}
]
})
};
fetch('https://api.decodahealth.com/billing/invoice/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodahealth.com/billing/invoice/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'patientId' => '<string>',
'message' => '<string>',
'charges' => [
[
'patientId' => '<string>',
'totalOutstanding' => 123,
'id' => '<string>',
'patient' => [
'id' => '<string>',
'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' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json",
"TENANT: <tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/billing/invoice/create"
payload := strings.NewReader("{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decodahealth.com/billing/invoice/create")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/billing/invoice/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": 123,
"methodsAttempted": [
[
true,
"<string>"
]
],
"rule": {
"id": "<string>",
"name": "<string>",
"methods": [],
"delayInDays": 123,
"message": "<string>"
},
"sendTime": "2023-11-07T05:31:56Z",
"pausedDate": "2023-11-07T05:31:56Z",
"resumedDate": "2023-11-07T05:31:56Z",
"failedReason": "<string>",
"pdfPath": "<string>",
"emailStatus": "<string>",
"smsContent": "<string>",
"callStatus": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Invoices
Create Manual Invoice
Create and send a manual one-off invoice to a patient.
POST
/
billing
/
invoice
/
create
Create Manual Invoice
curl --request POST \
--url https://api.decodahealth.com/billing/invoice/create \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"patientId": "<string>",
"message": "<string>",
"charges": [
{
"patientId": "<string>",
"totalOutstanding": 123,
"id": "<string>",
"patient": {
"id": "<string>",
"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": []
}
]
}
'import requests
url = "https://api.decodahealth.com/billing/invoice/create"
payload = {
"patientId": "<string>",
"message": "<string>",
"charges": [
{
"patientId": "<string>",
"totalOutstanding": 123,
"id": "<string>",
"patient": {
"id": "<string>",
"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": []
}
]
}
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
patientId: '<string>',
message: '<string>',
charges: [
{
patientId: '<string>',
totalOutstanding: 123,
id: '<string>',
patient: {
id: '<string>',
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: []
}
]
})
};
fetch('https://api.decodahealth.com/billing/invoice/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodahealth.com/billing/invoice/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'patientId' => '<string>',
'message' => '<string>',
'charges' => [
[
'patientId' => '<string>',
'totalOutstanding' => 123,
'id' => '<string>',
'patient' => [
'id' => '<string>',
'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' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json",
"TENANT: <tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/billing/invoice/create"
payload := strings.NewReader("{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decodahealth.com/billing/invoice/create")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/billing/invoice/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"patientId\": \"<string>\",\n \"message\": \"<string>\",\n \"charges\": [\n {\n \"patientId\": \"<string>\",\n \"totalOutstanding\": 123,\n \"id\": \"<string>\",\n \"patient\": {\n \"id\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"locationId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"addressLineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"country\": \"<string>\",\n \"addressValid\": true,\n \"meta\": {},\n \"isArchived\": true,\n \"primaryLocationId\": \"<string>\",\n \"gender\": \"<string>\",\n \"dateOfBirth\": \"2023-12-25\",\n \"patientMedications\": [\n \"<string>\"\n ],\n \"onSchedulingBlacklist\": true,\n \"surchargeDisabled\": true,\n \"tags\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"emoji\": \"<string>\",\n \"color\": \"<string>\",\n \"updatedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"creditBalance\": 123,\n \"preferredProviderId\": \"<string>\"\n },\n \"total\": 0,\n \"description\": \"<string>\",\n \"status\": \"OUTSTANDING\",\n \"discountAmount\": 0,\n \"discountPercentage\": 0,\n \"externalId\": \"<string>\",\n \"externalCreatedDate\": \"2023-11-07T05:31:56Z\",\n \"ruleSetId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"creatorId\": \"<string>\",\n \"items\": [],\n \"tips\": [],\n \"locationId\": \"<string>\",\n \"eventId\": \"<string>\",\n \"memberId\": \"<string>\",\n \"comment\": \"<string>\",\n \"meta\": {},\n \"merchantAccountId\": \"<string>\",\n \"payments\": [],\n \"adjustments\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": 123,
"methodsAttempted": [
[
true,
"<string>"
]
],
"rule": {
"id": "<string>",
"name": "<string>",
"methods": [],
"delayInDays": 123,
"message": "<string>"
},
"sendTime": "2023-11-07T05:31:56Z",
"pausedDate": "2023-11-07T05:31:56Z",
"resumedDate": "2023-11-07T05:31:56Z",
"failedReason": "<string>",
"pdfPath": "<string>",
"emailStatus": "<string>",
"smsContent": "<string>",
"callStatus": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Body
application/json
Identifier of the patient to create the invoice for.
Custom message to be sent with the invoice.
Method to use for sending the invoice.
Available options:
CHARGE_CARD, SMS, EMAIL, CALL, MAIL, EXPIRY Optional charge to create before invoicing. If not provided, will invoice existing outstanding charges.
Show child attributes
Show child attributes
Response
Successful Response
The status of an invoice.
Available options:
PENDING, SENT, FAILED, PAUSED, CANCELLED Show child attributes
Show child attributes
The method used to send an invoice to a patient.
Available options:
CHARGE_CARD, SMS, EMAIL, CALL, MAIL, EXPIRY Show child attributes
Show child attributes
⌘I
