Make Payments Using Provet Pay¶
Provet Pay payment links are part of postransaction objects as payment_link.
To find existing payment links for an invoice, fetch the invoice object and query
through its postransactions to find all related payment links. The
payment_link object contains the URL, expiration time, and payment status.
Creating Payment Links¶
First check if the department allows Provet Pay processing by fetching the
department object and checking the allow_nhp_processing field.
Then create a postransaction with a payment_link_data object. When creating
payment links, specify:
duration— link validity in minutesdelivery_method— whether Provet automatically sends the link to the clientemailandphone— optional, defaults to client’s primary valuesdescription— shown on the payment link page for the clientreturn_url— optional redirect URL after the client completes payment
Payment links can be created for invoices or prepayments:
Invoice: define
invoice_idinpayment_link_dataPrepayment: provide
prepayment_datawith department and client ID
To save payment details for card-on-file payments, add tokenize
(yes/no/ask) and recurring_model (subscription/one-off).
You must have consent from the payer before saving payment details. For health
plan payments, always use subscription.
Create Payment Link for Prepayment¶
Request¶
POST https://provetcloud.com/<provet_id>/api/0.1/postransaction/ HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"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¶
HTTP/1.1 201 Created
Content-Type: application/json
{
"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 Invoice¶
Request¶
POST https://provetcloud.com/<provet_id>/api/0.1/postransaction/ HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"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¶
HTTP/1.1 201 Created
Content-Type: application/json
{
"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
}
}
Appendix: Enums and special values¶
Delivery methods¶
Value |
Description |
|---|---|
0 |
Do not send |
1 (default) |
Send by SMS and email |
2 |
Email only |
3 |
SMS only |
Payment statuses¶
Value |
Description |
|---|---|
1 |
Pending |
2 |
Failed |
3 |
Expired |
4 |
Aborted |
5 |
Accepted |
Delivery statuses¶
Value |
Description |
|---|---|
1 |
Not sent |
2 |
Sent |
3 |
Failed |
Other values¶
Payment type should be 5003 and transaction type 4 for Provet Pay payments.
Terminal_id should be 0.