Prescriptions & Treatments
Create checkout sessions for prescriptions or treatments. These endpoints handle prescription validation, checkout creation, and return a checkout URL or draft order for the patient to complete their purchase.
Create Prescription Checkout
Upload one or more signed prescriptions (as base64 PDFs) along with line items and patient data to create a checkout.
POST /v2/public/prescriptions/{shop_identifier}
Unique identifier for the shop
Required permission: create_prescription_checkout
Request Body
{
"prescriptions": [
{
"id": "my-prescription-001",
"pdf_base64": "JVBERi0xLjQK..."
}
],
"lines": [
{
"sku_uid": "sku-456",
"quantity": 1,
"prescription_id": "my-prescription-001"
}
],
"patient_data": {
"first_name": "Max",
"last_name": "Mustermann",
"date_of_birth": 631152000,
"gender": "male"
},
"checkout_type": "draft_order"
}
| Field | Type | Required | Description |
|---|
prescriptions | array | No | List of prescription objects with id and pdf_base64 |
prescriptions[].id | string | Yes | Your internal ID for this prescription (used to link line items) |
prescriptions[].pdf_base64 | string | Yes | Base64-encoded PDF of the signed prescription |
lines | array | No | Line items for the checkout |
lines[].sku_uid | string | Yes | SKU UID from the product catalog |
lines[].quantity | integer | Yes | Quantity to order |
lines[].prescription_id | string | No | Links the line item to a prescription by its id |
patient_data | object | Yes | Patient demographic data |
patient_data.first_name | string | Yes | Patient first name |
patient_data.last_name | string | Yes | Patient last name |
patient_data.date_of_birth | integer | Yes | Date of birth as Unix timestamp |
patient_data.gender | string | Yes | Patient gender (male, female, divers) |
checkout_type | string | No | Checkout type: checkout_link, draft_order (default), or draft_order_without_checkout_request |
Checkout Types
The checkout_type field controls how the order is created in Shopify:
| Value | Description |
|---|
draft_order | Creates a Shopify draft order and sends a checkout request to the customer (default) |
checkout_link | Returns a Shopify checkout link for the customer to complete payment directly |
draft_order_without_checkout_request | Creates a Shopify draft order without sending a checkout request to the customer. Useful when you handle customer communication separately |
Example Request
curl -X POST "https://api.rxscale.com/v2/public/prescriptions/my-shop" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"prescriptions": [
{
"id": "rx-001",
"pdf_base64": "JVBERi0xLjQK..."
}
],
"lines": [
{
"sku_uid": "sku-456",
"quantity": 1,
"prescription_id": "rx-001"
}
],
"patient_data": {
"first_name": "Max",
"last_name": "Mustermann",
"date_of_birth": 631152000,
"gender": "male"
}
}'
Response
{
"status": "success",
"prescriptions": [
{
"id": "rx-001",
"prescription_uid": "px-abc123"
}
]
}
The response maps your prescription IDs to the RxScale prescription UIDs. Use these UIDs to query order status via the Orders endpoint.
Error Responses
| Status Code | Description |
|---|
400 | Validation error in the request body |
404 | SKU not found in the specified shop |
422 | Invalid PDF or unsigned prescription |
QES Validation
Prescription PDFs are validated for qualified electronic signatures (QES). If a prescription does not contain a valid qualified electronic signature, the API returns a 422 error.
Prescriptions must be digitally signed with a qualified electronic signature (QES). Unsigned or invalidly signed prescriptions will be rejected with a 422 response. Some telemedicine providers may have this requirement relaxed based on their configuration — contact RxScale support if you need to discuss QES requirements for your integration.
Create Treatment Checkout
Create a checkout for treatment-based orders (no prescription required).
POST /v2/public/treatments/{shop_identifier}
Unique identifier for the shop
Required permission: create_treatment_checkout
Request Body
{
"lines": [
{
"sku_uid": "sku-789",
"quantity": 1,
"anamnesis_id": "anam-001"
}
],
"checkout_type": "draft_order"
}
| Field | Type | Required | Description |
|---|
lines | array | Yes | Line items for the checkout |
lines[].sku_uid | string | Yes | SKU UID from the product catalog |
lines[].quantity | integer | Yes | Quantity to order |
lines[].anamnesis_id | string | No | Anamnesis ID for linking to a patient questionnaire |
checkout_type | string | No | Checkout type: checkout_link, draft_order (default), or draft_order_without_checkout_request |
See Checkout Types above for details on each option.
Example Request
curl -X POST "https://api.rxscale.com/v2/public/treatments/my-shop" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"lines": [
{
"sku_uid": "sku-789",
"quantity": 1
}
]
}'
Response
{
"status": "success",
"checkout_url": "https://shop.example.com/checkout/abc123"
}