curl --request GET \
--url https://api.decodahealth.com/inventory/packages/sold \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/inventory/packages/sold"
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>'}};
fetch('https://api.decodahealth.com/inventory/packages/sold', 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/inventory/packages/sold",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/inventory/packages/sold"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.decodahealth.com/inventory/packages/sold")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/packages/sold")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"packageId": "<string>",
"patientId": "<string>",
"chargeItemId": "<string>",
"status": "USED",
"package": {
"name": "<string>",
"price": 123,
"id": "<string>",
"description": "<string>",
"image": "<string>",
"imageUrl": "<string>",
"isArchived": false,
"allowCustomPricing": false,
"commissionable": true,
"showInCheckOut": true,
"hiddenInOnlineShop": true,
"externalId": "<string>",
"defaultCptCode": "<string>",
"defaultModifiers": [
"<string>"
],
"defaultIcd10Codes": [
"<string>"
],
"internalNotes": "<string>",
"category": "<string>",
"discountTemplates": [
{
"id": "<string>",
"createdByItemId": "<string>",
"discountChoiceId": "<string>",
"itemId": "<string>",
"category": "<string>",
"itemType": "ITEM",
"type": "GLOBAL",
"percentage": 123,
"amount": 123,
"quantity": 123,
"expiryTimeDays": 123,
"renewalCycleInterval": 2,
"isStackable": true,
"isPrepayment": false,
"group": "<string>",
"isArchived": false,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
}
}
],
"exemptedTaxIds": [
"<string>"
],
"expiryDays": 2,
"expiryAnchor": "PURCHASE",
"numberOfActivePatients": 0,
"numberOfPatients": 0,
"createdDate": "2023-11-07T05:31:56Z"
},
"createdDate": "2023-11-07T05:31:56Z",
"patient": {
"id": "<string>",
"type": "PROVIDER",
"createdDate": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"locationId": "<string>",
"preferredName": "<string>",
"externalId": "<string>",
"address": "<string>",
"addressLineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"addressValid": true,
"meta": {},
"isArchived": true,
"primaryLocationId": "<string>",
"middleName": "<string>",
"gender": "<string>",
"pronouns": "<string>",
"dateOfBirth": "2023-12-25",
"patientMedications": [
"<string>"
],
"patientSource": "SELF_SCHEDULING",
"leadSource": "<string>",
"onSchedulingBlacklist": true,
"surchargeDisabled": true,
"optedInToSmsMarketing": true,
"optedInToEmailMarketing": true,
"optedInToSocialMedia": true,
"aiScribeConsent": 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>",
"dosespotPatientId": "<string>"
},
"chargeItem": {
"id": "<string>",
"chargeId": "<string>",
"quantity": 123,
"price": 123,
"itemId": "<string>",
"name": "<string>",
"soldByProviderId": "<string>",
"taxAmount": 123
},
"id": "<string>",
"cancellationReason": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"lastActivityDate": "2023-11-07T05:31:56Z",
"discounts": [
{
"type": "GLOBAL",
"id": "<string>",
"discountTemplateId": "<string>",
"patientId": "<string>",
"memberId": "<string>",
"soldPackageId": "<string>",
"createdByChargeItemId": "<string>",
"discountChoiceId": "<string>",
"promotionId": "<string>",
"itemId": "<string>",
"category": "<string>",
"itemType": "ITEM",
"percentage": 50,
"amount": 1,
"quantity": 123,
"quantityRemaining": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"uses": [
{
"id": "<string>",
"discountId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"chargeItemId": "<string>",
"amount": 123,
"order": 123,
"quantity": 123
}
],
"isStackable": true,
"isPrepayment": false,
"isChosen": true,
"isArchived": false,
"comment": "<string>",
"group": "<string>",
"member": {
"id": "<string>",
"membership": {
"id": "<string>",
"name": "<string>",
"textColor": "<string>"
},
"startDate": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"freezeDate": "2023-11-07T05:31:56Z",
"unfreezeDate": "2023-11-07T05:31:56Z"
},
"soldPackage": {
"id": "<string>",
"packageId": "<string>",
"package": {
"id": "<string>",
"name": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
},
"discountTemplate": {
"id": "<string>",
"itemId": "<string>",
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
}
}
}
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}List Sold Packages
Get sold packages with optional filtering by patient_id or package_id and other filters.
curl --request GET \
--url https://api.decodahealth.com/inventory/packages/sold \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/inventory/packages/sold"
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>'}};
fetch('https://api.decodahealth.com/inventory/packages/sold', 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/inventory/packages/sold",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/inventory/packages/sold"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.decodahealth.com/inventory/packages/sold")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/packages/sold")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"packageId": "<string>",
"patientId": "<string>",
"chargeItemId": "<string>",
"status": "USED",
"package": {
"name": "<string>",
"price": 123,
"id": "<string>",
"description": "<string>",
"image": "<string>",
"imageUrl": "<string>",
"isArchived": false,
"allowCustomPricing": false,
"commissionable": true,
"showInCheckOut": true,
"hiddenInOnlineShop": true,
"externalId": "<string>",
"defaultCptCode": "<string>",
"defaultModifiers": [
"<string>"
],
"defaultIcd10Codes": [
"<string>"
],
"internalNotes": "<string>",
"category": "<string>",
"discountTemplates": [
{
"id": "<string>",
"createdByItemId": "<string>",
"discountChoiceId": "<string>",
"itemId": "<string>",
"category": "<string>",
"itemType": "ITEM",
"type": "GLOBAL",
"percentage": 123,
"amount": 123,
"quantity": 123,
"expiryTimeDays": 123,
"renewalCycleInterval": 2,
"isStackable": true,
"isPrepayment": false,
"group": "<string>",
"isArchived": false,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
}
}
],
"exemptedTaxIds": [
"<string>"
],
"expiryDays": 2,
"expiryAnchor": "PURCHASE",
"numberOfActivePatients": 0,
"numberOfPatients": 0,
"createdDate": "2023-11-07T05:31:56Z"
},
"createdDate": "2023-11-07T05:31:56Z",
"patient": {
"id": "<string>",
"type": "PROVIDER",
"createdDate": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"locationId": "<string>",
"preferredName": "<string>",
"externalId": "<string>",
"address": "<string>",
"addressLineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"addressValid": true,
"meta": {},
"isArchived": true,
"primaryLocationId": "<string>",
"middleName": "<string>",
"gender": "<string>",
"pronouns": "<string>",
"dateOfBirth": "2023-12-25",
"patientMedications": [
"<string>"
],
"patientSource": "SELF_SCHEDULING",
"leadSource": "<string>",
"onSchedulingBlacklist": true,
"surchargeDisabled": true,
"optedInToSmsMarketing": true,
"optedInToEmailMarketing": true,
"optedInToSocialMedia": true,
"aiScribeConsent": 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>",
"dosespotPatientId": "<string>"
},
"chargeItem": {
"id": "<string>",
"chargeId": "<string>",
"quantity": 123,
"price": 123,
"itemId": "<string>",
"name": "<string>",
"soldByProviderId": "<string>",
"taxAmount": 123
},
"id": "<string>",
"cancellationReason": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"lastActivityDate": "2023-11-07T05:31:56Z",
"discounts": [
{
"type": "GLOBAL",
"id": "<string>",
"discountTemplateId": "<string>",
"patientId": "<string>",
"memberId": "<string>",
"soldPackageId": "<string>",
"createdByChargeItemId": "<string>",
"discountChoiceId": "<string>",
"promotionId": "<string>",
"itemId": "<string>",
"category": "<string>",
"itemType": "ITEM",
"percentage": 50,
"amount": 1,
"quantity": 123,
"quantityRemaining": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"uses": [
{
"id": "<string>",
"discountId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"chargeItemId": "<string>",
"amount": 123,
"order": 123,
"quantity": 123
}
],
"isStackable": true,
"isPrepayment": false,
"isChosen": true,
"isArchived": false,
"comment": "<string>",
"group": "<string>",
"member": {
"id": "<string>",
"membership": {
"id": "<string>",
"name": "<string>",
"textColor": "<string>"
},
"startDate": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"freezeDate": "2023-11-07T05:31:56Z",
"unfreezeDate": "2023-11-07T05:31:56Z"
},
"soldPackage": {
"id": "<string>",
"packageId": "<string>",
"package": {
"id": "<string>",
"name": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
},
"discountTemplate": {
"id": "<string>",
"itemId": "<string>",
"item": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"category": "<string>",
"unit": "AMPOULES",
"type": "ITEM",
"isPhysical": true,
"isArchived": true,
"allowCustomPricing": true,
"showInCheckOut": true
}
}
}
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Query Parameters
Filter by patient ID
Filter by package ID
Filter by patient name
Filter by last activity date range
Filter by purchased date range
Filter by package status
Filter by purchase location IDs
Clinic timezone for date range bounds
Sort field
Sort direction (asc or desc)
Response
Successful Response
Package ID that was sold
Patient ID who purchased the package
Charge item ID associated with the package purchase
Status of the sold package
USED, ACTIVE, CANCELLED Details of the package
Show child attributes
Show child attributes
Date the package was created
Details of the patient
Show child attributes
Show child attributes
Simplified details of the charge item
Show child attributes
Show child attributes
Unique identifier for the sold package
Reason for cancellation if the package is cancelled
When this sold copy expires. Stamped at purchase for PURCHASE-anchored packages and on the first redemption for FIRST_REDEMPTION-anchored ones. Null means it has no expiry yet.
Date the package was updated
Most recent package usage date
Discounts applied to the sold package
Show child attributes
Show child attributes

