Store Prescriptions
1 min
POST
/api/v1/pets/{id}/prescriptions
Body Parameters
- bodyobjectrequired
- record_idintegerExample
- clinic_idintegerrequiredExample
- vet_idintegerrequiredExample
- product_idintegerExample
- product_namestringDescription
- typeintegerDescription
- quantityintegerrequiredExample
- unit_idintegerExample
- unitstringExampleDescription
- labelstringExampleDescription
- prescribed_atstring<date>requiredExample
- expiration_datestring<date>Example
- statusstring<ACTIVE | INACTIVE>requiredExample
- internal_notesstringExample
Responses
201
- object
- dataPrescription
- idintegerExample
- record_idintegerExample
- clinic_idintegerExample
- vet_idintegerExample
- pet_idintegerExample
- product_idintegerExample
- product_namestringExample
- typeintegerDescription
- quantityintegerExample
- unit_idintegerExample
- unitstringExample
- labelstringExample
- prescribed_atstring<date-time>Example
- expires_atstring<date-time>Example
- statusstring<ACTIVE | INACTIVE>Example
- internal_notesstringExample
- refills_receivedintegerExample
- max_refillsintegerExample
- last_refill_atstring<date-time>Example
- refillsRefill[]
- idintegerExample
- prescription_idintegerExample
- record_idintegerExample
- vet_idintegerExample
- typeintegerDescription
- labelstringExample
- refilled_atstring<date-time>Example
- is_initialboolean
- numberintegerExample
- internal_notesstringExample
- created_atstring<date-time>Example
- updated_atstring<date-time>Example
curl
curl --request POST \
--url /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("/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("/api/v1/pets/{id}/prescriptions")
http = Net::HTTP.new(url.host, url.port);
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 = http.request(request)
puts response.read_body
python
import requests
import json
url = "/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",
"internal_notes": "Internal notes",
"refills_received": 1,
"max_refills": 3,
"last_refill_at": "2020-01-01T00:00:00Z",
"refills": [
{
"id": 1,
"prescription_id": 1,
"record_id": 1,
"vet_id": 1,
"type": 0,
"label": "Refill",
"refilled_at": "2020-01-01T00:00:00.000Z",
"is_initial": false,
"number": 1,
"internal_notes": "Internal Notes"
}
],
"created_at": "2022-02-06T22:00:00.000000Z",
"updated_at": "2022-02-06T22:00:00.000000Z"
}
}