Skip to main content

Webhooks

In order to catch responses from certain actions on our platform, we allow you to receive data on webhooks.

Currently we have one specific moment you can track: "Creation of a prescription". If your integration needs to track other events please contact us. As an integrator you can track as follows and with these recommendations.

Requirements and recommendations:

  • Create or enable an endpoint that receives a POST METHOD
  • Save the response

How to create a webhook

To create a webhook, your integration team must first request this action from the Prescrypto admin team. Once set up, the webhook will trigger a POST event every time a prescription is created by a user registered through the integration.

Listening the webhook post event

Prescrypto sends a simple json that indicates the creation of a Prescription, only from your registered medic users(who previously were created by API using "create medic endpoint" and your respective integration credentials).

Let's assume that your webhook URL is:

Every time a user that belongs to your integration creates a prescription, you will receive a webhook notification event; You will receive the following request:

# Event: Post Rx(prescripttion) creation
POST https://mycompany.com/prescrypto-webhooks/
HEADERS 'Content-Type': 'application/json; chartset=UTF-8'

{
"signature": "<signature-str>"
}

If your integration needs more context data on the payload, please contact us.

Generally speaking with the signature you can get all the data on the specific "Prescription Endpoint" with signature as param or hitting the "Patient Landing endpoint" in order to get the details for the patient to buy their medications.

FAQ About Integration flows with webhook

How to add a webhook to a new created user(medic)?

There are two ways to create a medic and link them to a webhook:

  1. Via Sign-Up Page with a Promo Code Share our sign-up page with your medics, along with a specific PROMO_CODE, to ensure they are linked to the webhook and any associated campaigns upon registration.

  2. Via API Integration This method is generally recommended for users of the API. First, create the hospital, then assign the new medic to that hospital.

Once either of these processes is completed, the webhook will automatically send a POST event to your specified endpoint every time the medic creates a new prescription.

How to generate a PROMO CODE?

If your integration requires a PROMO_CODE, simply request it from the Prescrypto team. This code allows medics who sign up via our page to automatically be registered to a hospital and linked to a webhook campaign.

[EOF]