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.string
required
Unique identifier for the shop
create_prescription_checkout
Request Body
buyerIdentity.customerAccessToken only applies when checkout_type is checkout_link, because Shopify uses it on Storefront carts. It does not attach a customer account to Shopify draft orders.Send
buyerIdentity when using checkout_type: "draft_order_without_checkout_request". RxScale rejects the request without it because no Shopify checkout request is sent to collect customer details later.Shipping Method Mapping
delivery.delivery_type is your own identifier for a shipping method. An RxScale admin can map each of your delivery_type values to one of the store’s Shopify shipping methods. When you send delivery, RxScale looks up a mapping for the exact value you sent — matching is case- and whitespace-sensitive, so "Express" and "express" are treated as different values — and one of three things happens:
- A mapped Shopify shipping method is found, and
delivery.delivery_priceis absent or matches that method’s own price. The shipping line carries that method’s name and price. It appears in your Shopify admin as a custom shipping line — not the store’s own live rate object — even though the name and price match the mapped method exactly. delivery.delivery_pricediffers from the mapped method’s price, Shopify currently has no live rate under the mapped method’s title, or no mapping exists for yourdelivery_type. A shipping line is created with thedelivery_priceyou sent. Its name is the mapped Shopify shipping method’s name whenever a mapping exists — including when only the price differs — and is thedelivery_typeyou sent only when no mapping exists.- No mapping exists for your
delivery_type— or one exists but Shopify currently has no live rate under that method’s title (for example it was renamed or deactivated in Shopify) — and nodelivery.delivery_priceis supplied. No shipping line is added to the order.
delivery.delivery_type and delivery.delivery_price continue to be attached as Shopify order attributes exactly as before, regardless of which of the three outcomes above applies. This is additive — if your integration already reads these attributes, it keeps working unchanged.Shipping method mapping only applies when
checkout_type is draft_order or draft_order_without_checkout_request. With checkout_type: "checkout_link", RxScale returns a Shopify Storefront cart, which has no shipping line — the customer chooses their delivery option during Shopify’s own checkout."express" to a Shopify shipping method, the resulting order’s shipping line carries that method’s name and price (shown in your Shopify admin as a custom shipping line, not the store’s live rate). The checkout response is unaffected by which outcome applies — the resolved shipping line is visible on the Shopify draft order or order itself, not in this response:
Checkout Types
Thecheckout_type field controls how the order is created in Shopify:
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 (not order-level attributes). Matching is based on the Shopify variant resolved from sku_uid; duplicate sku_uid values are rejected because they are ambiguous. Keys starting with _ are private Shopify properties and are often hidden in the Shopify Admin UI — verify via the Admin GraphQL API if needed. When buyerIdentity.email and/or buyerIdentity.phone are provided (and non-empty), they overwrite the reserved draft order’s buyer contact details; empty values are ignored so existing contact details are never cleared. The request’s billing_address and shipping_address are forwarded to the draft order, with the patient’s name from patient_data filled into each address where none is supplied (Shopify draft orders have no separate customer-name field). 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.
Error Responses
Duplicate
prescriptions[].id:
external_order_id (even when prescriptions[].id is new):
code matches the Management API order-intake duplicate response so retries can share the same handling. Use prescription_uid with the Orders endpoint when order_uid is still null (typical right after injection, before Shopify creates the order).
A
prescriptions[].id or external_order_id is only blocked once it has been successfully accepted. If an earlier request failed (for example, it returned a 4xx/5xx before completing), resubmitting the same value is not blocked and is processed normally. This makes prescription injection safe to retry after a failed or uncertain request — a repeat submission of an already-accepted id returns 409 instead of silently creating a duplicate order, so it can be treated as an idempotent no-op rather than an error to alert on.reserved_draft_order_id).
Create Treatment Checkout
Create a checkout for treatment-based orders (no prescription required).string
required
Unique identifier for the shop
create_treatment_checkout
Request Body
buyerIdentity.customerAccessToken only applies when checkout_type is checkout_link, because Shopify uses it on Storefront carts. It does not attach a customer account to Shopify draft orders.Send
buyerIdentity when using checkout_type: "draft_order_without_checkout_request". RxScale rejects the request without it because no Shopify checkout request is sent to collect customer details later.