---
title: Create Prescription for Pet
slug: create-prescription-for-pet
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "j3yIJGlTKZVczgXKjBPl-",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/pets/{id}/prescriptions",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/pets/{id}/prescriptions",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/pets/{id}/prescriptions",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Create Prescription for Pet",
    "description": "<p>Permissions needed: ACCESS_PATIENTS\nStore Prescriptions for a specific patient</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "record_id",
              "kind": "optional",
              "type": "integer",
              "nullable": true,
              "description": "",
              "example": 1
            },
            {
              "name": "clinic_id",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "vet_id",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "product_id",
              "kind": "optional",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "product_name",
              "kind": "optional",
              "type": "string",
              "description": "<p>(required when product_id is  null)</p>"
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "integer",
              "description": "<p><code>0</code> - External <code>1</code> - In House</p>",
              "example": 0,
              "enum": [
                "0",
                "1"
              ]
            },
            {
              "name": "quantity",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 5
            },
            {
              "name": "unit_id",
              "kind": "optional",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "unit",
              "kind": "optional",
              "type": "string",
              "description": "<p>(required when unit_id is  null)</p>",
              "example": "Tablet"
            },
            {
              "name": "label",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Label",
              "example": "1/2 Tablet every day"
            },
            {
              "name": "prescribed_at",
              "kind": "required",
              "type": "string<date>",
              "description": "",
              "example": "2020-01-01",
              "format": "date"
            },
            {
              "name": "expiration_date",
              "kind": "optional",
              "type": "string<date>",
              "description": "",
              "example": "2020-01-01",
              "format": "date"
            },
            {
              "name": "status",
              "kind": "required",
              "type": "string<ACTIVE | INACTIVE>",
              "description": "",
              "example": "ACTIVE",
              "enum": [
                "ACTIVE",
                "INACTIVE"
              ]
            },
            {
              "name": "internal_notes",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": "Internal notes"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "Prescriptions can be dispensed to patients for medications.",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "record_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "clinic_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "vet_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "pet_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "product_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "product_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Product name"
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "integer",
                    "description": "<p><code>0</code> - External <code>1</code> - In House</p>",
                    "example": 0,
                    "enum": [
                      "0",
                      "1"
                    ]
                  },
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "unit_id",
                    "kind": "optional",
                    "type": "integer",
                    "nullable": true,
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "unit",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Unit"
                  },
                  {
                    "name": "label",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Administer 1 tablet by mouth every 12 hours for 7 days"
                  },
                  {
                    "name": "prescribed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2020-01-01T00:00:00Z",
                    "format": "date-time"
                  },
                  {
                    "name": "expires_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2020-01-01T00:00:00Z",
                    "format": "date-time"
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "string<ACTIVE | INACTIVE>",
                    "description": "",
                    "example": "ACTIVE",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  {
                    "name": "delivery_status",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Complete"
                  },
                  {
                    "name": "delivery_provider",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "vetsource"
                  },
                  {
                    "name": "internal_notes",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Internal notes"
                  },
                  {
                    "name": "product_ext_id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "prescription_ext_id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "order_ext_id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "refills_received",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "max_refills",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 3
                  },
                  {
                    "name": "last_refill_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "",
                    "example": "2022-02-06T22:00:00.000000Z",
                    "format": "date-time"
                  },
                  {
                    "name": "refills",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1prescriptions~1%7Bid%7D~1refills/post/responses/201/content/application~1json/schema/properties/data",
                    "customType": "data[]",
                    "schema": []
                  },
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2022-02-06T22:00:00.000000Z",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2022-02-06T22:00:00.000000Z",
                    "format": "date-time"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-uCM5CN7AE7wZDWym1vm5",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/pets/{id}/prescriptions \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"clinic_id\": 1,\n     \"vet_id\": 1,\n     \"quantity\": 5,\n     \"prescribed_at\": \"2020-01-01\",\n     \"status\": \"ACTIVE\"\n     }'"
        },
        {
          "id": "cQ1QHE9hqza-TXftuctFN",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"clinic_id\": 1,\n   \"vet_id\": 1,\n   \"quantity\": 5,\n   \"prescribed_at\": \"2020-01-01\",\n   \"status\": \"ACTIVE\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/pets/{id}/prescriptions\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "SNZCt2c4MtzmiSLFLzcdC",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/pets/{id}/prescriptions\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"clinic_id\": 1,\n   \"vet_id\": 1,\n   \"quantity\": 5,\n   \"prescribed_at\": \"2020-01-01\",\n   \"status\": \"ACTIVE\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "VvkT8eoczhMkQCVgRnHoz",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/pets/{id}/prescriptions\"\n\npayload = json.dumps({\n   \"clinic_id\": 1,\n   \"vet_id\": 1,\n   \"quantity\": 5,\n   \"prescribed_at\": \"2020-01-01\",\n   \"status\": \"ACTIVE\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-uCM5CN7AE7wZDWym1vm5"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// successful operation\n{\n  \"data\": {\n    \"id\": 1,\n    \"record_id\": 1,\n    \"clinic_id\": 1,\n    \"vet_id\": 1,\n    \"pet_id\": 1,\n    \"product_id\": 1,\n    \"product_name\": \"Product name\",\n    \"type\": 0,\n    \"quantity\": 1,\n    \"unit_id\": 1,\n    \"unit\": \"Unit\",\n    \"label\": \"Administer 1 tablet by mouth every 12 hours for 7 days\",\n    \"prescribed_at\": \"2020-01-01T00:00:00Z\",\n    \"expires_at\": \"2020-01-01T00:00:00Z\",\n    \"status\": \"ACTIVE\",\n    \"delivery_status\": \"Complete\",\n    \"delivery_provider\": \"vetsource\",\n    \"internal_notes\": \"Internal notes\",\n    \"product_ext_id\": \"\",\n    \"prescription_ext_id\": \"\",\n    \"order_ext_id\": \"\",\n    \"refills_received\": 1,\n    \"max_refills\": 3,\n    \"last_refill_at\": \"2022-02-06T22:00:00.000000Z\",\n    \"refills\": [\n      \"\"\n    ],\n    \"created_at\": \"2022-02-06T22:00:00.000000Z\",\n    \"updated_at\": \"2022-02-06T22:00:00.000000Z\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}