Update Discount
curl --request POST \
--url https://api.decodahealth.com/inventory/members/update-discount \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"issuedDiscountId": "<string>",
"quantity": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"comment": "<string>"
}
'import requests
url = "https://api.decodahealth.com/inventory/members/update-discount"
payload = {
"issuedDiscountId": "<string>",
"quantity": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"comment": "<string>"
}
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({
issuedDiscountId: '<string>',
quantity: 123,
expiryDate: '2023-11-07T05:31:56Z',
comment: '<string>'
})
};
fetch('https://api.decodahealth.com/inventory/members/update-discount', 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/update-discount",
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([
'issuedDiscountId' => '<string>',
'quantity' => 123,
'expiryDate' => '2023-11-07T05:31:56Z',
'comment' => '<string>'
]),
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/inventory/members/update-discount"
payload := strings.NewReader("{\n \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\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/inventory/members/update-discount")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/members/update-discount")
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 \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"memberId": "<string>",
"membershipDiscountId": "<string>",
"quantityRemaining": 123,
"membershipDiscount": {
"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,
"item": {
"name": "<string>",
"price": 123,
"id": "<string>",
"brandName": "<string>",
"description": "<string>",
"category": "<string>",
"isPhysical": true,
"isArchived": false,
"internalNotes": "<string>",
"taxable": false,
"sortOrder": 123,
"allowCustomPricing": false,
"type": "PRODUCT"
}
},
"expiryDate": "2023-11-07T05:31:56Z",
"usageCount": 0,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "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>"
]
}
],
"packages": [
{
"packageId": "<string>",
"patientId": "<string>",
"chargeItemId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"id": "<string>",
"package": {
"name": "<string>",
"price": 123,
"id": "<string>",
"description": "<string>",
"isArchived": false,
"internalNotes": "<string>",
"items": [
{
"packageId": "<string>",
"itemId": "<string>",
"price": 123,
"id": "<string>",
"quantity": 123,
"item": {
"name": "<string>",
"price": 123,
"id": "<string>",
"brandName": "<string>",
"description": "<string>",
"category": "<string>",
"isPhysical": true,
"isArchived": false,
"internalNotes": "<string>",
"taxable": false,
"sortOrder": 123,
"allowCustomPricing": false,
"type": "PRODUCT"
}
}
],
"category": "<string>"
},
"updatedDate": "2023-11-07T05:31:56Z"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Inventory
Update Discount
Update a member’s discount.
POST
/
inventory
/
members
/
update-discount
Update Discount
curl --request POST \
--url https://api.decodahealth.com/inventory/members/update-discount \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"issuedDiscountId": "<string>",
"quantity": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"comment": "<string>"
}
'import requests
url = "https://api.decodahealth.com/inventory/members/update-discount"
payload = {
"issuedDiscountId": "<string>",
"quantity": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"comment": "<string>"
}
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({
issuedDiscountId: '<string>',
quantity: 123,
expiryDate: '2023-11-07T05:31:56Z',
comment: '<string>'
})
};
fetch('https://api.decodahealth.com/inventory/members/update-discount', 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/update-discount",
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([
'issuedDiscountId' => '<string>',
'quantity' => 123,
'expiryDate' => '2023-11-07T05:31:56Z',
'comment' => '<string>'
]),
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/inventory/members/update-discount"
payload := strings.NewReader("{\n \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\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/inventory/members/update-discount")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/inventory/members/update-discount")
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 \"issuedDiscountId\": \"<string>\",\n \"quantity\": 123,\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"memberId": "<string>",
"membershipDiscountId": "<string>",
"quantityRemaining": 123,
"membershipDiscount": {
"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,
"item": {
"name": "<string>",
"price": 123,
"id": "<string>",
"brandName": "<string>",
"description": "<string>",
"category": "<string>",
"isPhysical": true,
"isArchived": false,
"internalNotes": "<string>",
"taxable": false,
"sortOrder": 123,
"allowCustomPricing": false,
"type": "PRODUCT"
}
},
"expiryDate": "2023-11-07T05:31:56Z",
"usageCount": 0,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "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>"
]
}
],
"packages": [
{
"packageId": "<string>",
"patientId": "<string>",
"chargeItemId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"id": "<string>",
"package": {
"name": "<string>",
"price": 123,
"id": "<string>",
"description": "<string>",
"isArchived": false,
"internalNotes": "<string>",
"items": [
{
"packageId": "<string>",
"itemId": "<string>",
"price": 123,
"id": "<string>",
"quantity": 123,
"item": {
"name": "<string>",
"price": 123,
"id": "<string>",
"brandName": "<string>",
"description": "<string>",
"category": "<string>",
"isPhysical": true,
"isArchived": false,
"internalNotes": "<string>",
"taxable": false,
"sortOrder": 123,
"allowCustomPricing": false,
"type": "PRODUCT"
}
}
],
"category": "<string>"
},
"updatedDate": "2023-11-07T05:31:56Z"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Body
application/json
Response
Successful Response
Unique identifier for the discount bank entry
ID of the member
ID of the membership discount
Quantity remaining in the bank
Details of the membership discount
Show child attributes
Show child attributes
When this bank entry expires
Number of times this discount has been used
When the bank entry was created
When the bank entry was last updated
Items that have been used from this bank entry
Show child attributes
Show child attributes
Packages that have been used from this bank entry
Show child attributes
Show child attributes
⌘I
