Skip to main content
PUT
/
medications
/
bulk
Bulk Update Medications
curl --request PUT \
  --url https://api.decodahealth.com/medications/bulk \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "updates": [
    {
      "id": "<string>",
      "name": "<string>",
      "brandName": "<string>",
      "price": 123,
      "cost": 123,
      "category": "<string>",
      "sortOrder": 123,
      "allowCustomPricing": true
    }
  ]
}
'
import requests

url = "https://api.decodahealth.com/medications/bulk"

payload = { "updates": [
{
"id": "<string>",
"name": "<string>",
"brandName": "<string>",
"price": 123,
"cost": 123,
"category": "<string>",
"sortOrder": 123,
"allowCustomPricing": True
}
] }
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updates: [
{
id: '<string>',
name: '<string>',
brandName: '<string>',
price: 123,
cost: 123,
category: '<string>',
sortOrder: 123,
allowCustomPricing: true
}
]
})
};

fetch('https://api.decodahealth.com/medications/bulk', 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/medications/bulk",
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([
'updates' => [
[
'id' => '<string>',
'name' => '<string>',
'brandName' => '<string>',
'price' => 123,
'cost' => 123,
'category' => '<string>',
'sortOrder' => 123,
'allowCustomPricing' => true
]
]
]),
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/medications/bulk"

payload := strings.NewReader("{\n \"updates\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"brandName\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"category\": \"<string>\",\n \"sortOrder\": 123,\n \"allowCustomPricing\": true\n }\n ]\n}")

req, _ := http.NewRequest("PUT", 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.put("https://api.decodahealth.com/medications/bulk")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"brandName\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"category\": \"<string>\",\n \"sortOrder\": 123,\n \"allowCustomPricing\": true\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.decodahealth.com/medications/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"brandName\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"category\": \"<string>\",\n \"sortOrder\": 123,\n \"allowCustomPricing\": true\n }\n ]\n}"

response = http.request(request)
puts response.read_body
[
  {
    "name": "<string>",
    "allowCustomPricing": true,
    "id": "<string>",
    "createdDate": "2023-11-07T05:31:56Z",
    "isPhysical": true,
    "isArchived": true,
    "brandName": "<string>",
    "description": "<string>",
    "price": 0,
    "cost": 123,
    "category": "<string>",
    "internalNotes": "<string>",
    "sortOrder": 123,
    "isUsedAsTemplate": false,
    "externalId": "<string>",
    "templateAmount": 123,
    "templateAdministrationLocation": "<string>",
    "templateFrequency": "<string>",
    "templateQuantity": 123,
    "templateComment": "<string>",
    "templateLotNumber": "<string>",
    "updatedDate": "2023-11-07T05:31:56Z",
    "template": {
      "name": "<string>",
      "id": "<string>",
      "amount": 123,
      "administrationLocation": "<string>",
      "frequency": "<string>",
      "quantity": 1,
      "comment": "<string>",
      "lotNumber": "<string>"
    },
    "stocks": [
      {
        "itemId": "<string>",
        "stockId": "<string>",
        "quantityUsed": 123,
        "stock": {
          "name": "<string>",
          "id": "<string>",
          "description": "<string>",
          "notes": "<string>",
          "category": "<string>",
          "minStockLevel": 123,
          "isArchived": false,
          "shipments": [
            {
              "stockId": "<string>",
              "supplierId": "<string>",
              "locationId": "<string>",
              "quantity": 123,
              "remainingQuantity": 123,
              "locationName": "<string>",
              "id": "<string>",
              "poLineItemId": "<string>",
              "lotNumber": "<string>",
              "expiryDate": "2023-11-07T05:31:56Z",
              "sku": "<string>",
              "actualConversionFactor": 123,
              "cost": 123,
              "supplier": {
                "name": "<string>",
                "description": "<string>",
                "website": "<string>",
                "email": "<string>",
                "preferredContactMethod": "<string>",
                "phoneNumber": "<string>",
                "addressLineOne": "<string>",
                "addressLineTwo": "<string>",
                "city": "<string>",
                "state": "<string>",
                "zipCode": "<string>",
                "country": "<string>",
                "shipmentTime": 123,
                "isArchived": false,
                "defaultNotes": [
                  {
                    "content": "<string>",
                    "id": "<string>",
                    "supplierId": "<string>",
                    "name": "<string>"
                  }
                ],
                "id": "<string>"
              },
              "createdDate": "2023-11-07T05:31:56Z",
              "note": "<string>"
            }
          ]
        }
      }
    ]
  }
]
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json
updates
BulkMedicationUpdateItem · object[]
required
Maximum array length: 200

Response

Successful Response

name
string
required
allowCustomPricing
boolean
required
id
string
required
createdDate
string<date-time>
required
isPhysical
boolean
required
isArchived
boolean
required
unit
enum<string> | null
Available options:
AMPOULES,
APPLICATORS,
BOTTLES,
BOXES,
CAPSULES,
CUPS,
DOSES,
G_PER_ML,
GRAMS,
IU,
IU_PER_ML,
OUNCES,
FLUID_OUNCES,
KG,
KITS,
LITERS,
MCG,
MG,
MG_PER_ML,
ML,
MMOL,
MICROGRAM_PER_ML,
PACKS,
PAIRS,
PATCHES,
PERCENTAGE,
PIECES,
POUCHES,
ROLLS,
SACHETS,
SHEETS,
SPRAYS,
STRIPS,
SYRINGES,
TABLETS,
TABLETS_PER_DAY,
TESTS,
TUBES,
UNITS,
VIALS,
TREATMENTS,
SESSIONS,
PULSES,
JOULES,
CENTIMETERS,
THREAD_COUNT,
INJECTIONS,
WRINKLE_UNITS,
POUNDS,
FEET,
INCHES
brandName
string | null
description
string | null
price
integer
default:0
cost
integer | null
category
string | null
internalNotes
string | null
sortOrder
integer | null
isUsedAsTemplate
boolean
default:false
externalId
string | null
templateAmount
number | null
templateAdministrationLocation
string | null
templateFrequency
string | null
templateQuantity
number | null
templateComment
string | null
templateLotNumber
string | null
updatedDate
string<date-time> | null
template
MedicationTemplateSummary · object | null

Schema for returning medication template information.

stocks
ItemStockDetail · object[] | null