---
title: Create Refill for Prescription
slug: create-refill-for-prescription
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "jvO8vhw8vdIdQ5NfH0bqy",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/prescriptions/{id}/refills",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/prescriptions/{id}/refills",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/prescriptions/{id}/refills",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Create Refill for Prescription",
    "description": "<p>Permissions needed: ACCESS_PATIENTS\nCreate a new refill for a said prescription</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": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "vet_id",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "integer",
              "description": "<p><code>0</code> - External <code>1</code> - In House</p>",
              "example": 0,
              "enum": [
                "0",
                "1"
              ]
            },
            {
              "name": "label",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": "1/2 Tablet every day"
            },
            {
              "name": "refilled_at",
              "kind": "required",
              "type": "string<date>",
              "description": "",
              "example": "2020-01-01",
              "format": "date"
            },
            {
              "name": "internal_notes",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": "Internal notes"
            },
            {
              "name": "quantity",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "<p>Overrides the dispensed quantity for this refill. Defaults to the prescription quantity when omitted. Ignored for external and treatment-based refills.</p>",
              "example": 10,
              "minimum": 0,
              "exclusiveMinimum": true
            },
            {
              "name": "max_refills",
              "kind": "optional",
              "type": "integer",
              "nullable": true,
              "description": "Overrides the prescription's maximum number of refills and is persisted on the prescription. Lowering it below the number of existing refills rejects the request.\n",
              "example": 3,
              "minimum": 0
            }
          ],
          "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": "An individual refill of a prescription.",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "prescription_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "record_id",
                    "kind": "optional",
                    "type": "integer",
                    "nullable": true,
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "vet_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "integer",
                    "description": "<p><code>0</code> - External <code>1</code> - In House</p>",
                    "example": 0,
                    "enum": [
                      "0",
                      "1"
                    ]
                  },
                  {
                    "name": "label",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Refill"
                  },
                  {
                    "name": "refilled_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2020-01-01T00:00:00.000Z",
                    "format": "date-time"
                  },
                  {
                    "name": "is_initial",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "",
                    "example": false
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "internal_notes",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Internal Notes"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "Ek5sX7ffYpgkM4zJGLNU3",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/prescriptions/{id}/refills \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"record_id\": 1,\n     \"vet_id\": 1,\n     \"refilled_at\": \"2020-01-01\"\n     }'"
        },
        {
          "id": "cs2kpLobmvs5Joie2-Tmy",
          "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   \"record_id\": 1,\n   \"vet_id\": 1,\n   \"refilled_at\": \"2020-01-01\"\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/prescriptions/{id}/refills\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "b7cRwQghoJ7K_cZQQ_ADI",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/prescriptions/{id}/refills\")\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   \"record_id\": 1,\n   \"vet_id\": 1,\n   \"refilled_at\": \"2020-01-01\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "h6pUUlEOs5yBi1uOHv-sc",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/prescriptions/{id}/refills\"\n\npayload = json.dumps({\n   \"record_id\": 1,\n   \"vet_id\": 1,\n   \"refilled_at\": \"2020-01-01\"\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": "Ek5sX7ffYpgkM4zJGLNU3"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// successful operation\n{\n  \"data\": {\n    \"id\": 1,\n    \"prescription_id\": 1,\n    \"record_id\": 1,\n    \"vet_id\": 1,\n    \"type\": 0,\n    \"label\": \"Refill\",\n    \"refilled_at\": \"2020-01-01T00:00:00.000Z\",\n    \"is_initial\": false,\n    \"number\": 1,\n    \"internal_notes\": \"Internal Notes\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}