Usage examples
Get consultation details
Get information about a consultation with ID number 338.
GET Request
URL:
https://provetcloud.com/<provet_id>/api/0.1/consultation/338/
Headers:
Accept: application/json
Authorization: Token a8b8ca3886cd4775a44744e107e2239e
Response
Headers:
Content-Type: application/json
Body:
{
"url": "https://provetcloud.com/4/api/0.1/consultation/338/",
"client": "https://provetcloud.com/4/api/0.1/client/1/",
"patients": [
"https://provetcloud.com/4/api/0.1/patient/1/"
],
"complaint": "Test consultation",
"admitted_time": "2017-05-18T10:35:00Z",
"first_entry": null,
"started": "2017-05-18T10:35:00Z",
"finished": null,
"ended": null,
"status": 8,
"type": 0,
"invoice": "https://provetcloud.com/4/api/0.1/invoice/609/",
"supervising_veterinarian": "https://provetcloud.com/4/api/0.1/user/1/",
"department": "https://provetcloud.com/4/api/0.1/department/1/",
"consultation_items": [
"https://provetcloud.com/4/api/0.1/consultationitem/4558/",
"https://provetcloud.com/4/api/0.1/consultationitem/4559/",
"https://provetcloud.com/4/api/0.1/consultationitem/4560/"
],
"reporting_dimension_1": null,
"reporting_dimension_2": null
}
Create new patient
Add a new patient for client 218.
POST Request
URL:
https://provetcloud.com/<provet_id>/api/0.1/patient/
Headers:
Accept: application/json
Authorization: Token a8b8ca3886cd4775a44744e107e2239e
Content-Type: application/json
Body:
{
"name": "Fenton",
"client": "https://provetcloud.com/4/api/0.1/client/218/",
"species": 22001,
"gender": 2
}
Response
Headers:
Content-Type: application/json
Body:
{
"id": 2130,
"url": "https://provetcloud.com/4/api/0.1/patient/2130/",
"client": "https://provetcloud.com/4/api/0.1/client/218/",
"name": "Fenton",
"official_name": "",
"species": "Dog (Canine - Domestic)",
"breed": "None",
"gender": "Female",
"weight": null,
"old_patient_id": null,
"remarks": null,
"date_of_registration": "2021-11-10",
"date_of_birth": null,
"deceased": null,
"insurance": null,
"insurance_company": null,
"color": null,
"critical_notes": null,
"microchip": null,
"additional_identification": null,
"archived": false,
"reason_of_death": null,
"stable_name": "",
"street_address": "",
"street_address_2": null,
"zip_code": "",
"city": "",
"not_for_food": false,
"passport_number": "",
"register_number": "",
"home_department": null,
"date_imported": null,
"imported": false,
"tags_rel": [],
"fields_rel": [],
"holding_place_number": null,
"animal_code": null,
"herd_size": null,
"private": false,
"visible_departments": [],
"visible_department_groups": [],
"microchip_date": null,
"last_consultation": null,
"created": "2021-11-10T15:45:50.179386+02:00",
"modified": "2021-11-10T15:45:50.179414+02:00",
"species_code": 22001,
"breed_code": null,
"gender_code": 2,
"picture": null,
"patient_extras": null
}
Provet Pay payment links
Provet Pay payment links are part of postransaction objects as payment_link
. To find existing payment links for invoice, you first fetch the invoice object ane query through it’s postransactions
to find all related payment links. In payment_link
object you will find the URL for the link, expiration time, and the status of the payment.
For creating a new link, first check if the department allows Provet Pay processing. You can check it by fetching the department
object and checking the allow_nhp_processing
field. Then do postransaction POST with payment_link_data
object. When creating payment links, you specify duration
in minutes for the link, and whether you want Provet Cloud automatically to send the link to the client. This is configured by field delivery_method
. Additionally you can set email
and phone
, or if omitted, default using primary values from Provet Cloud data for the client. The description
field is shown in the payment link page for the client. Optionally you can also define return_url
which will be used after client completes the payment and clicks continue button on the payment link page.
You can create payment links for invoices or for prepayments. This is configured by either defining invoice_id
in payment_link_data
or providing prepayment_data
. Prepayment data should include department and client id and optionally description for the prepayment.
In order to save payment details (to make card-on-file payments possible) you can add field tokenize
with values yes/no/ask
, and in this case, you must also specify recurring_model
with subscription/one-off
. You MUST have consent from the shopper before you can request payment details to be saved. In many cases, the only way for this is to define tokenize with “ask” value, so the shopper can allow it directly on payment link page. Shopper can choose to pay the payment without agreeing the payment details to be saved. The recurring model should be specified based on how the saved payment details will be used in the future. For health plans type of payments, use always subscription.
Delivery methods:
- Do not send: 0
- Send by SMS and email: 1
- Email only: 2 (default)
- SMS only: 3
Payment statuses:
- Pending: 1
- Failed: 2
- Expired: 3
- Aborted: 4
- Accepted: 5
Delivery statuses:
- Not sent: 1
- Sent: 2
- Failed: 3
Payment type should be 5003
and transaction type 4
for Provet Pay payments. Terminal_id should be 0
.
Create payment link for prepayment
POST Request
URL:
https://provetcloud.com/<provet_id>/api/0.1/postransaction/
Headers:
Accept: application/json
Authorization: Token a8b8ca3886cd4775a44744e107e2239e
Content-Type: application/json
Body:
{
"amount": "120.50",
"terminal_id": 0,
"payment_type": 5003,
"transaction_type": 4,
"creator": "https://provetcloud.com/<provet_id>/api/0.1/user/<user id>/",
"department": "https://provetcloud.com/<provet_id>/api/0.1/department/<department id>/",
"payment_link_data": {
"duration": 2880,
"email": "example@local.dev",
"delivery_method": 0,
"description": "Prepayment for clinic X",
"return_url": "https://your-custom-successful-redirect-payment.url",
"tokenize": "ask",
"recurring_model": "subscription"
},
"prepayment_data": {
"client_id": 85616,
"department_id": 1,
"description": "Prepayment for surgery."
}
}
Response
Headers:
Content-Type: application/json
Body:
{
"id": 114,
"amount": 120.5,
"task_id": "",
"created": "2024-03-21T16:50:10.268675+02:00",
"modified": "2024-03-21T16:50:10.419440+02:00",
"aborted": null,
"cashier_desk": null,
"invoice": null,
"terminal_id": 0,
"department": "https://provetcloud.com/<provet_id>/api/0.1/department/<department id>/",
"transaction_type": 4,
"payment_type": 5003,
"payment_method": "https://provetcloud.com/<provet_id>/api/0.1/paymentmethod/27/",
"payment": null,
"unallocated_payment": "https://provetcloud.com/<provet_id>/api/0.1/unallocatedpayment/<payment id>/",
"refunded_transaction": null,
"creator": "https://provetcloud.com/<provet_id>/api/0.1/user/<user id>/",
"payment_link": {
"external_id": "1ded8e20-b7bd-4073-aff5-30767f0eef1f",
"url": "https://pay.nordhealth.com/<string>",
"expiration_time": "2024-03-23T14:50:11Z",
"payment_status": 1,
"delivery_status": 1
}
}
Create payment link for for invoice
POST Request
URL:
https://provetcloud.com/<provet_id>/api/0.1/postransaction/
Headers:
Accept: application/json
Authorization: Token a8b8ca3886cd4775a44744e107e2239e
Content-Type: application/json
Body:
{
"amount": 30.05,
"terminal_id": 0,
"payment_type": 5003,
"transaction_type": 4,
"creator": "https://provetcloud.com/<provet_id>/api/0.1/user/<user id>/",
"invoice": "https://provetcloud.com/<provet_id>/api/0.1/invoice/<invoice id>/",
"department": "https://provetcloud.com/<provet_id>/api/0.1/department/<department id>/",
"payment_link_data": {
"duration": 2880,
"phone": "+35812345567",
"email": "example@local.dev",
"delivery_method": 0,
"description": "Payment for invoice #12345 - Your Clinic",
"return_url": "https://your-custom-successful-redirect-payment.url"
}
}
Response
Headers:
Content-Type: application/json
Body:
{
"id": 117,
"amount": 30.05,
"task_id": "",
"created": "2024-03-21T16:58:26.606608+02:00",
"modified": "2024-03-21T16:58:26.606701+02:00",
"aborted": null,
"cashier_desk": null,
"invoice": "https://provetcloud.com/<provet_id>/api/0.1/invoice/<invoice id>/",
"terminal_id": 0,
"department": "https://provetcloud.com/<provet_id>/api/0.1/department/<department id>/",
"transaction_type": 4,
"payment_type": 5003,
"payment_method": "https://provetcloud.com/<provet_id>/api/0.1/paymentmethod/27/",
"payment": null,
"unallocated_payment": null,
"refunded_transaction": null,
"creator": "https://provetcloud.com/<provet_id>/api/0.1/user/<user id>/",
"payment_link": {
"external_id": "63893ecd-65db-40ae-bf7e-0de70a76216d",
"url": "https://pay.nordhealth.com/<string>",
"expiration_time": "2024-03-23T14:58:27Z",
"payment_status": 1,
"delivery_status": 1
}
}