curl --request GET \
--url https://api.decodahealth.com/inventory/members/{member_id}/discounts \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/inventory/members/{member_id}/discounts"
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/members/{member_id}/discounts', 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/members/{member_id}/discounts",
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/members/{member_id}/discounts"
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/members/{member_id}/discounts")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/members/{member_id}/discounts")
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[
{
"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
}
},
"isRedeemable": false
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Member Issued Discounts
Get a member’s issued discount history with redeemability state.
curl --request GET \
--url https://api.decodahealth.com/inventory/members/{member_id}/discounts \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/inventory/members/{member_id}/discounts"
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/members/{member_id}/discounts', 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/members/{member_id}/discounts",
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/members/{member_id}/discounts"
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/members/{member_id}/discounts")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/members/{member_id}/discounts")
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[
{
"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
}
},
"isRedeemable": false
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Path Parameters
Response
Successful Response
Type of discount (CATEGORY, PRODUCT, SERVICE, ALL)
GLOBAL, CUSTOM, MEMBERSHIP, PACKAGE, SAVED_ITEM, PROMOTION, CASH_DISCOUNT Unique identifier for the discount
ID of the template this discount was created from
ID of the patient who owns this discount
ID of the member this discount belongs to
ID of the sold package that created this discount
ID of the charge item that created this discount (for saved items)
ID of the discount choice group
ID of the promotion this discount came from
ID of the specific item for this discount
Category name this discount applies to
Type of item this discount applies to
ITEM, SERVICE, PRODUCT, PACKAGE, MEMBERSHIP, MEDICATION, SERVICE_FEE, GIFT_CARD Discount percentage (0-100)
0 <= x <= 100Discount amount in cents
x >= 0Total quantity for this discount (None = infinite)
Quantity remaining in the discount
When this discount expires
Usages of this discount
Show child attributes
Show child attributes
Whether this discount can be combined with other discounts
Whether this is a prepayment (commissions on full price)
Whether this discount was chosen from a choice group
Whether the discount is archived
Optional comment for custom discounts
Group for choice-based discounts
Member this discount belongs to
Show child attributes
Show child attributes
Sold package this discount belongs to
Show child attributes
Show child attributes
Item this discount applies to
Show child attributes
Show child attributes
Discount template this discount was created from
Show child attributes
Show child attributes
Whether the discount can currently be redeemed in checkout/cart flows

