Custom Drug Endpoints
Update Organization Custom Drug
Updates one organization-level custom drug. Send only the fields to change.
PUT
/
v1
/
organizations
/
{organization_id}
/
custom-drugs
/
{custom_drug_id}
cURL
curl --request PUT \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
{
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "S4",
"custom_product_id": "EK-12345",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
payload = {
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "S4",
"custom_product_id": "EK-12345",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
item_generic_name: '<string>',
item_trade_name: '<string>',
brand_name: '<string>',
item_strength: '<string>',
item_form: '<string>',
route_of_administration: '<string>',
quantity: '<string>',
max_repeats: '<string>',
poison_class: 'S4',
custom_product_id: 'EK-12345',
description: '<string>',
patient_instructions: '<string>',
doctor_instructions: '<string>'
})
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}', 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.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'item_generic_name' => '<string>',
'item_trade_name' => '<string>',
'brand_name' => '<string>',
'item_strength' => '<string>',
'item_form' => '<string>',
'route_of_administration' => '<string>',
'quantity' => '<string>',
'max_repeats' => '<string>',
'poison_class' => 'S4',
'custom_product_id' => 'EK-12345',
'description' => '<string>',
'patient_instructions' => '<string>',
'doctor_instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-secret: <x-organization-secret>"
],
]);
$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.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
payload := strings.NewReader("{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 123,
"message": "<string>",
"code": "SUCCESS",
"data": {
"custom_drug_id": "<string>",
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
},
"timestamp": "<string>",
"requestId": "<string>"
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}Updates one organization-level custom drug. Send only the fields to change. Omitted fields are left as they are.
custom_drug_id is the custom_drug_id from the catalog list or the bulk-create created[] array. It must exist in this organization’s catalog, or 404 is returned.
Example Request
{
"item_strength": "250mg",
"quantity": "30"
}
Example Response
{
"success": true,
"statusCode": 200,
"message": "Custom drug updated successfully",
"code": "SUCCESS",
"data": {
"custom_drug_id": "3b99ce35-844c-4925-93ff-5b8ec13be5f5",
"item_generic_name": "Amoxicillin",
"item_strength": "250mg",
"item_form": "Capsule",
"route_of_administration": "Oral",
"quantity": "30",
"max_repeats": "2",
"poison_class": "S4",
"custom_product_id": "EK-12345"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123"
}
Status Codes
| Code | Meaning |
|---|---|
| 200 | Updated — data is the full drug |
| 400 | Body has no updatable fields |
| 401 | Authentication failed, or the token’s user is not an organization owner or admin |
| 404 | No drug with this custom_drug_id in this organization’s catalog |
| 422 | Validation failed — see error.validation |
| 500 | Unexpected server error |
Notes
- Requires the
update:custom_drugscope. - Organization-level only. Use the user-level endpoint for a prescriber’s personal drugs.
- Fields not set on the drug are omitted from
data.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Organization secret for authentication - provided by Parchment
Path Parameters
Organization ID
custom_drug_id from the catalog or bulk-create response
Body
application/json
Partial custom drug fields to update
Partial custom drug fields to update. Send only the fields to change.
Maximum string length:
280Maximum string length:
280Maximum string length:
100Maximum string length:
100Maximum string length:
50Maximum string length:
50Schedule with the S prefix, S2 to S9. A bare digit is rejected.
Maximum string length:
2Pattern:
^S[2-9]$Example:
"S4"
Your own identifier for this drug. Never generated by Parchment. Not checked for uniqueness.
Maximum string length:
50Example:
"EK-12345"
Maximum string length:
280Maximum string length:
250Maximum string length:
50Was this page helpful?
⌘I
cURL
curl --request PUT \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
{
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "S4",
"custom_product_id": "EK-12345",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
payload = {
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "S4",
"custom_product_id": "EK-12345",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
item_generic_name: '<string>',
item_trade_name: '<string>',
brand_name: '<string>',
item_strength: '<string>',
item_form: '<string>',
route_of_administration: '<string>',
quantity: '<string>',
max_repeats: '<string>',
poison_class: 'S4',
custom_product_id: 'EK-12345',
description: '<string>',
patient_instructions: '<string>',
doctor_instructions: '<string>'
})
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}', 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.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'item_generic_name' => '<string>',
'item_trade_name' => '<string>',
'brand_name' => '<string>',
'item_strength' => '<string>',
'item_form' => '<string>',
'route_of_administration' => '<string>',
'quantity' => '<string>',
'max_repeats' => '<string>',
'poison_class' => 'S4',
'custom_product_id' => 'EK-12345',
'description' => '<string>',
'patient_instructions' => '<string>',
'doctor_instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-secret: <x-organization-secret>"
],
]);
$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.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
payload := strings.NewReader("{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item_generic_name\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"item_strength\": \"<string>\",\n \"item_form\": \"<string>\",\n \"route_of_administration\": \"<string>\",\n \"quantity\": \"<string>\",\n \"max_repeats\": \"<string>\",\n \"poison_class\": \"S4\",\n \"custom_product_id\": \"EK-12345\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 123,
"message": "<string>",
"code": "SUCCESS",
"data": {
"custom_drug_id": "<string>",
"item_generic_name": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
},
"timestamp": "<string>",
"requestId": "<string>"
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}
