Store Prescriptions
1 min
POST
/api/v1/prescriptions/{id}/refills
Body Parameters
- bodyobjectrequired
- record_idintegerrequiredExample
- vet_idintegerrequiredExample
- typeintegerDescription
- labelstringExample
- refilled_atstring<date>requiredExample
- internal_notesstringExample
Responses
201
- object
- dataRefill
- idintegerExample
- prescription_idintegerExample
- record_idintegerExample
- vet_idintegerExample
- typeintegerDescription
- labelstringExample
- refilled_atstring<date-time>Example
- is_initialboolean
- numberintegerExample
- internal_notesstringExample
curl
curl --request POST \
--url /api/v1/prescriptions/{id}/refills \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"record_id": 1,
"vet_id": 1,
"refilled_at": "2020-01-01"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"record_id": 1,
"vet_id": 1,
"refilled_at": "2020-01-01"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("/api/v1/prescriptions/{id}/refills", 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/prescriptions/{id}/refills")
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({
"record_id": 1,
"vet_id": 1,
"refilled_at": "2020-01-01"
})
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/api/v1/prescriptions/{id}/refills"
payload = json.dumps({
"record_id": 1,
"vet_id": 1,
"refilled_at": "2020-01-01"
})
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,
"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"
}
}