Custom Drug Endpoints
Create custom drugs bulk
Bulk-creates organization-level custom drugs. Accepts a JSON array; returns a per-item success/failure summary.
POST
/
v1
/
organizations
/
{organization_id}
/
custom-drugs
cURL
curl --request POST \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
[
{
"item_generic_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
]
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs"
payload = [
{
"item_generic_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
]
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
item_generic_name: '<string>',
item_strength: '<string>',
item_form: '<string>',
route_of_administration: '<string>',
quantity: '<string>',
max_repeats: '<string>',
poison_class: '<string>',
item_trade_name: '<string>',
brand_name: '<string>',
custom_product_id: '<string>',
description: '<string>',
patient_instructions: '<string>',
doctor_instructions: '<string>'
}
])
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs', 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",
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([
[
'item_generic_name' => '<string>',
'item_strength' => '<string>',
'item_form' => '<string>',
'route_of_administration' => '<string>',
'quantity' => '<string>',
'max_repeats' => '<string>',
'poison_class' => '<string>',
'item_trade_name' => '<string>',
'brand_name' => '<string>',
'custom_product_id' => '<string>',
'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"
payload := strings.NewReader("[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 123,
"message": "<string>",
"code": "SUCCESS",
"data": {
"total": 123,
"successCount": 123,
"failureCount": 123,
"failures": [
{
"index": 123,
"error": "<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"
}
}Bulk-creates organization-level custom drugs (the shared org catalog, stored against
ORGANIZATION#{organization_id}).
Integration Notes
- Scope Requirement: Your API token must include the
create:custom_drugscope. - Organization admin/owner required: The acting user (the token’s
user_id) must be an organization owner or admin. A token that carries the correct scope but whose user is a non-admin (e.g. a prescriber) is rejected with401 Unauthorized. This restriction applies only to the organization-level (bulk) endpoints; the user-level custom-drug endpoints have no such requirement. - Level: This endpoint creates organization-level drugs. Use the user-level endpoint to add a drug for a specific prescriber.
- Body: A non-empty JSON array of custom drug objects (a single drug is a one-element array).
- Partial success: Each item is processed independently. The response reports
successCount,failureCount, and the first 50failures(with the 1-basedindexand error). HTTP 200 is returned if at least one item succeeded; 400 if all failed.
Example Request
[
{
"item_generic_name": "Amoxicillin",
"item_strength": "500mg",
"item_form": "Capsule",
"route_of_administration": "Oral",
"quantity": "20",
"max_repeats": "2",
"poison_class": "S4"
},
{
"item_generic_name": "Ibuprofen",
"item_strength": "200mg",
"item_form": "Tablet",
"route_of_administration": "Oral",
"quantity": "30",
"max_repeats": "1",
"poison_class": "S2"
}
]
Example Response
{
"success": true,
"statusCode": 200,
"message": "Created 2 of 2 custom drugs successfully",
"code": "SUCCESS",
"data": { "total": 2, "successCount": 2, "failureCount": 0, "failures": [] },
"timestamp": "2024-01-25T09:15:00.000Z",
"requestId": "req_1706171700000_abc123"
}
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
Body
application/json
Non-empty array of custom drugs to create at organization level
Maximum string length:
280Maximum string length:
100Maximum string length:
50Maximum string length:
50String or number; coerced to string
String or number; coerced to string
Maximum string length:
2Maximum string length:
280Maximum string length:
100Maximum string length:
50Maximum string length:
280Maximum string length:
250Maximum string length:
50Was this page helpful?
Previous
Read custom drugs bulkRetrieves the organization-level custom drug catalog (shared org drugs only).
Next
⌘I
cURL
curl --request POST \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
[
{
"item_generic_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
]
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs"
payload = [
{
"item_generic_name": "<string>",
"item_strength": "<string>",
"item_form": "<string>",
"route_of_administration": "<string>",
"quantity": "<string>",
"max_repeats": "<string>",
"poison_class": "<string>",
"item_trade_name": "<string>",
"brand_name": "<string>",
"custom_product_id": "<string>",
"description": "<string>",
"patient_instructions": "<string>",
"doctor_instructions": "<string>"
}
]
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
item_generic_name: '<string>',
item_strength: '<string>',
item_form: '<string>',
route_of_administration: '<string>',
quantity: '<string>',
max_repeats: '<string>',
poison_class: '<string>',
item_trade_name: '<string>',
brand_name: '<string>',
custom_product_id: '<string>',
description: '<string>',
patient_instructions: '<string>',
doctor_instructions: '<string>'
}
])
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs', 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",
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([
[
'item_generic_name' => '<string>',
'item_strength' => '<string>',
'item_form' => '<string>',
'route_of_administration' => '<string>',
'quantity' => '<string>',
'max_repeats' => '<string>',
'poison_class' => '<string>',
'item_trade_name' => '<string>',
'brand_name' => '<string>',
'custom_product_id' => '<string>',
'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"
payload := strings.NewReader("[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"item_generic_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\": \"<string>\",\n \"item_trade_name\": \"<string>\",\n \"brand_name\": \"<string>\",\n \"custom_product_id\": \"<string>\",\n \"description\": \"<string>\",\n \"patient_instructions\": \"<string>\",\n \"doctor_instructions\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 123,
"message": "<string>",
"code": "SUCCESS",
"data": {
"total": 123,
"successCount": 123,
"failureCount": 123,
"failures": [
{
"index": 123,
"error": "<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"
}
}
