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.Unique identifier for the shop
create_prescription_checkout
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
reserved_draft_order_id | string | No | Shopify legacy DraftOrder ID returned by the product reservation endpoint. When present, RxScale updates that draft order instead of creating a new checkout |
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 |
prepaid | boolean | No | Whether the order has already been paid externally. Defaults to false and is attached to Shopify order attributes as prepaid=true or prepaid=false. It does not change checkout_type behavior |
external_order_id | string | No | Your external order identifier. When present, RxScale attaches it to Shopify order attributes as external_order_id |
delivery | object | No | Delivery metadata to attach to the Shopify order attributes |
delivery.delivery_type | string | No | Delivery type. The store owner maps this value to their own shipping methods |
delivery.delivery_price | integer | No | Delivery price to attach to the Shopify order attributes |
transaction | object | No | Transaction metadata to attach to the Shopify order attributes |
transaction.transaction_id | string | No | Transaction identifier to attach to the Shopify order attributes |
transaction.transaction_amount | integer | No | Transaction amount to attach to the Shopify order attributes |
Checkout Types
Thecheckout_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 |
If
reserved_draft_order_id is present, checkout_type is ignored. RxScale stores the signed prescriptions and adds _prescription_uid metadata to the matching reserved draft-order line items. Matching is based on the Shopify variant resolved from sku_uid; duplicate sku_uid values are rejected because they are ambiguous. The reserved draft order must belong to the telemedicine provider linked to the API key.Example Request
Response
reserved_draft_order_id is used, no new checkout or draft order is created. The existing reserved draft order is updated and can continue through the normal Shopify order and fulfillment process after payment.
Create Treatment Checkout
Create a checkout for treatment-based orders (no prescription required).Unique identifier for the shop
create_treatment_checkout
Request Body
| 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 |