TELECAN API Documentation
Data for sending to TELECAN
It is necessary to send all the information about the pharmacy, specifically:
- Name
- Commercial registry number
- Owner
- Phone number
- Street address
- Postal code
- City
Additionally, contact details for the contact person must be provided, including:
- First name
- Last name
- Contact email
- Phone number
Furthermore, an API needs to be created so that Telecan can send prescriptions to the pharmacy via this API.
The API must follow the format: /api/v1/prescription, and it is required to provide the domain and the bearer token.
How to Create an API
An API (Application Programming Interface) enables different software systems to communicate with each other. The TELECAN API follows REST (Representational State Transfer) principles, ensuring efficient and scalable interactions.
Understanding RESTful API Methods
- GET: Retrieve data from the API, such as fetching the product catalog.
- POST: Submit data to the API, such as uploading a prescription.
- PUT / DELETE: Modify or remove existing data when needed.
To ensure your API functions correctly, always follow standard HTTP methods and response codes for seamless integration.
API Endpoint Structure
To interact with the TELECAN system, your API should follow the following structure:
Endpoint:
https://domain/api/v1/prescription
This endpoint will allow you to send and manage prescriptions via the TELECAN API.
How to Generate a Bearer Token
In order for TELECAN to access your API and send prescriptions, you need to create a Bearer Token. This token serves as the authentication mechanism to ensure secure access to your API.
Steps to Create a Bearer Token:
1. Create a Bearer Token:
In order for TELECAN to communicate with your API, you need to create a Bearer Token. This token will allow TELECAN to securely send requests to your API. Please send us the Bearer Token so TELECAN can use it to send prescriptions.
2. Keep the Token Secure:
The Bearer Token is sensitive information and should be treated like a password. Do not share it publicly and avoid exposing it in code repositories or other insecure locations.
3. Send the Bearer Token to TELECAN:
Once you create the Bearer Token, send it to us so TELECAN can use it. TELECAN will include this token in each request made to your API.
4. Include the Bearer Token in Your API Requests:
Every request made by TELECAN to your API must include the Bearer Token in the authorization header. Use the following format in the header:
Authorization: Bearer {Token}
How to Structure API Endpoints
The following endpoints define how external applications interact with the TELECAN system.
Submit Prescription
POST /api/v1/prescription
Here’s an example of how TELECAN will send a POST request to your system. Please pay attention to the data types.
Required Request Parameters
| Parameter | Type | Description |
|---|---|---|
prescriptionURL |
string |
A base64-encoded PDF file containing the prescription details. |
internalPrescriptionId |
string |
A unique identifier for the prescription. |
products [id] |
string |
A unique product identifier sent to and received from TELECAN, allowing easy tracking within your system. |
products |
array of objects |
An array that contains a list of the ordered products. Each object in the array represents a single product and includes relevant details such as product ID, name, price, unit and quantity. |
Example Request
{
"method": "POST",
"url": "https://telecan.de/v1/prescriptions",
"headers": {
"Authorization": "Bearer {Token}",
"Content-Type": "application/json",
"Domain": "domain"
},
"body": {
"prescriptionURL": "base64_encoded_data",
"internalPrescriptionId": "987654",
"doctor": {
"name": "Dr. John Doe",
"phone": "+49 170 1234567",
"email": "doctor@example.com",
"cityOfSignature": "Berlin",
"dateOfSignature": "2025-01-24"
},
"customer": {
"firstname": "Jane",
"lastname": "Doe",
"email": "jane.doe@example.com",
"phone": "+49 170 9876543",
"homeAddress": {
"streetName": "Musterstrasse",
"houseNr": "123",
"postalCode": "10115",
"city": "Berlin"
},
"deliveryAddress": {
"streetName": "Hauptstrasse",
"houseNr": "45/2",
"postalCode": "10243",
"city": "Berlin"
}
},
"products": [
{
"id": "1245",
"name": "Product Name",
"price": 10.00, //float
"category": "extract",
"quantity": 5 //integer
}
]
}
}
Example Response
{
"status": "success",
"message": "Prescription received successfully."
}
API Response Codes
The TELECAN API follows standard HTTP response codes to indicate the status of each request.
| Code | Description |
|---|---|
200 |
Request was successful. |
400 |
Bad request due to missing or incorrect parameters. |
401 |
Unauthorized request (invalid API key). |
404 |
The requested resource was not found. |
500 |
Internal server error. Contact support if the issue persists. |
For further assistance, reach out to our support team for troubleshooting and best practices.
Sending Products to the TELECAN API
After creating the pharmacy in the TELECAN system, TELECAN will send you a bearer token and your pharmacy ID.
Sending Request
POST /api/v1/catalog/?include=PHARMACY_ID
You also need to include:
Authorization: Bearer {Token}
And the Body, which must be in JSON format. Please ensure you follow the specified data types. Manufacturer, terpenes and genotype are not mandatory.
Example Request
{
"products": [
{
"id": "string", //product ID that you send to us
"name": "string",
"price": 10.00, //float
"thc": 24.7, //float
"cbd": 0.9, //float
"strain": "string", //string
"category": "string", //'extract', 'flower'
"genotype": "hybrid", //'hybrid', 'sativa', 'indica'
"manufacturer": "string",
"terpenes": "string"
}
]
}
Only AVAILABLE products are always sent, as they are the ones we display. The product list in the TELECAN system will be updated accordingly.