Create Prescription for Pet
1 min
POST
https://developer.digitail.io/api/v1/pets/{id}/prescriptions
Body Parameters
- bodyobjectrequired
- record_idintegerExample
- clinic_idintegerrequiredExample
- vet_idintegerrequiredExample
- product_idintegerExample
- product_namestringDescription
- typeintegerDescriptionAllowed01
- quantityintegerrequiredExample
- unit_idintegerExample
- unitstringExampleDescription
- labelstringExampleDescription
- prescribed_atstring<date>requiredExampleFormatdate
- expiration_datestring<date>ExampleFormatdate
- statusstring<ACTIVE | INACTIVE>requiredExampleAllowedACTIVEINACTIVE
- internal_notesstringExample
Responses
201
- object
- dataobjectDescription
- idintegerExample
- record_idintegerExample
- clinic_idintegerExample
- vet_idintegerExample
- pet_idintegerExample
- product_idintegerExample
- product_namestringExample
- typeintegerDescriptionAllowed01
- quantityintegerExample
- unit_idintegerExample
- unitstringExample
- labelstringExample
- prescribed_atstring<date-time>ExampleFormatdate-time
- expires_atstring<date-time>ExampleFormatdate-time
- statusstring<ACTIVE | INACTIVE>ExampleAllowedACTIVEINACTIVE
- delivery_statusstringExample
- delivery_providerstringExample
- internal_notesstringExample
- product_ext_idstring
- prescription_ext_idstring
- order_ext_idstring
- refills_receivedintegerExample
- max_refillsintegerExample
- last_refill_atstring<date-time>ExampleFormatdate-time
- refillsdata[]
- created_atstring<date-time>ExampleFormatdate-time
- updated_atstring<date-time>ExampleFormatdate-time
curl
curl --request POST \
--url https://developer.digitail.io/api/v1/pets/{id}/prescriptions \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"clinic_id": 1,
"vet_id": 1,
"quantity": 5,
"prescribed_at": "2020-01-01",
"status": "ACTIVE"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"clinic_id": 1,
"vet_id": 1,
"quantity": 5,
"prescribed_at": "2020-01-01",
"status": "ACTIVE"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://developer.digitail.io/api/v1/pets/{id}/prescriptions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://developer.digitail.io/api/v1/pets/{id}/prescriptions")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"clinic_id": 1,
"vet_id": 1,
"quantity": 5,
"prescribed_at": "2020-01-01",
"status": "ACTIVE"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://developer.digitail.io/api/v1/pets/{id}/prescriptions"
payload = json.dumps({
"clinic_id": 1,
"vet_id": 1,
"quantity": 5,
"prescribed_at": "2020-01-01",
"status": "ACTIVE"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// successful operation
{
"data": {
"id": 1,
"record_id": 1,
"clinic_id": 1,
"vet_id": 1,
"pet_id": 1,
"product_id": 1,
"product_name": "Product name",
"type": 0,
"quantity": 1,
"unit_id": 1,
"unit": "Unit",
"label": "Administer 1 tablet by mouth every 12 hours for 7 days",
"prescribed_at": "2020-01-01T00:00:00Z",
"expires_at": "2020-01-01T00:00:00Z",
"status": "ACTIVE",
"delivery_status": "Complete",
"delivery_provider": "vetsource",
"internal_notes": "Internal notes",
"product_ext_id": "",
"prescription_ext_id": "",
"order_ext_id": "",
"refills_received": 1,
"max_refills": 3,
"last_refill_at": "2022-02-06T22:00:00.000000Z",
"refills": [
""
],
"created_at": "2022-02-06T22:00:00.000000Z",
"updated_at": "2022-02-06T22:00:00.000000Z"
}
}