Prescrypto Prescriptions API

Electronic prescriptions (eRx).

OpenAPI Specification

prescrypto-prescriptions-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Prescrypto Integration Hospitals Prescriptions API
  version: '2.0'
  description: 'REST API for the Prescrypto electronic-prescription (eRx) platform used across Mexico and LATAM. It lets integrated systems (EHRs, hospital software, telemedicine apps and pharmacies) manage medics, hospitals, patients and prescriptions, generate legally-valid electronic prescriptions (verified against NOM-151-SCFI-2016 via the RexChain blockchain notary), download prescription PDFs, and let pharmacies search and dispense (burn) prescribed medications. All responses are JSON. Authentication uses HTTP Token auth (Authorization: Token <key>); keys are issued through direct communication with Prescrypto.'
  contact:
    name: Prescrypto
    url: https://www.prescrypto.com/contact/
  x-apis-json-provenance:
    generated: '2026-07-20'
    method: generated
    source: github.com/wilsotobianco/prescrypto-docs (official Prescrypto API docs) + Prescrypto_Integration_Endpoints_V2 Postman collection (s3-us-west-2.amazonaws.com/precript-collections)
servers:
- url: https://integration.prescrypto.com
  description: Production integration API (documented base URL)
security:
- TokenAuth: []
tags:
- name: Prescriptions
  description: Electronic prescriptions (eRx).
paths:
  /api/v2/rx-endpoint/:
    get:
      operationId: listPrescriptions
      tags:
      - Prescriptions
      summary: List / search prescriptions
      description: List all prescriptions generated by the calling medic token. Searchable by folio, patient name and diagnosis.
      parameters:
      - name: search
        in: query
        schema:
          type: string
        description: Search by folio
        patient name and diagnosis.: null
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: Paginated list of prescriptions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPrescriptions'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createPrescription
      tags:
      - Prescriptions
      summary: Create a prescription (eRx)
      description: Create an electronic prescription for a patient with one or more medications. Only medics with a validated account may create prescriptions.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrescriptionCreate'
      responses:
        '201':
          description: Prescription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prescription'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v2/rx-endpoint/{rx_id}/:
    parameters:
    - name: rx_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getPrescription
      tags:
      - Prescriptions
      summary: Get prescription details
      responses:
        '200':
          description: Prescription detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prescription'
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v2/rx/pdf/{signature}/:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
      description: The eRx electronic signature (sello electronico).
    get:
      operationId: getPrescriptionPdf
      tags:
      - Prescriptions
      summary: Download a prescription PDF (base64)
      description: Returns the prescription's PDF representation encoded in base64.
      responses:
        '200':
          description: Base64-encoded PDF
          content:
            application/json:
              schema:
                type: object
                properties:
                  pdf:
                    type: string
                    description: PDF encoded in base64.
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v2/rx/resend/{signature}/:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
    post:
      operationId: resendPrescription
      tags:
      - Prescriptions
      summary: Resend a prescription to the patient
      responses:
        '200':
          description: Prescription resent
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v2/rx/patient-landing/{signature}/:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getPatientLanding
      tags:
      - Prescriptions
      summary: Get the patient landing (fulfillment) view for a prescription
      description: Returns the prescription fields plus any campaigns useful to patients fulfilling their medications.
      responses:
        '200':
          description: Patient landing payload
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Hospital:
      type: object
      properties:
        id:
          type: integer
        patron:
          type: string
          description: Hospital / clinic name.
        location:
          type: string
    SimpleError:
      type: object
      description: Prescrypto error envelope. Errors carry either an "error" or a "message" field.
      properties:
        error:
          type: string
        message:
          type: string
        status:
          type: string
    PrescriptionCreate:
      type: object
      required:
      - patient
      - medications
      properties:
        patient:
          $ref: '#/components/schemas/Patient'
        diagnosis:
          type: string
        extras:
          type: string
        medications:
          type: array
          items:
            $ref: '#/components/schemas/Medication'
    Prescription:
      type: object
      properties:
        id:
          type: integer
        hospital:
          $ref: '#/components/schemas/Hospital'
        clinic:
          type: string
          nullable: true
        medic:
          type: string
          description: Medic email.
        patient:
          $ref: '#/components/schemas/Patient'
        diagnosis:
          type: string
        medications:
          type: array
          items:
            $ref: '#/components/schemas/Medication'
        extras:
          type: string
          description: General indications not tied to a specific medication.
        signature:
          type: string
          description: Unique eRx electronic signature (sello electronico).
        created_at:
          type: string
        sent:
          type: boolean
          nullable: true
        rejected:
          type: boolean
        bought:
          type: boolean
        transaction_url:
          type: string
          description: Link verifying NOM-151-SCFI-2016 compliance (RexChain blockchain notary).
    Patient:
      type: object
      properties:
        uid:
          type: string
        name:
          type: string
        email:
          type: string
        phone:
          type: string
        date_of_birth:
          type: string
          format: date
        gender:
          type: string
    Medication:
      type: object
      properties:
        id:
          type: integer
        presentation:
          type: string
          description: Commercial name / presentation of the medication.
        instructions:
          type: string
          description: Dosage instructions (posologia).
        drug:
          type: string
        drug_upc:
          type: string
        sku:
          type: string
        cost:
          type: number
        bought:
          type: boolean
        qty:
          type: integer
        bought_qty:
          type: integer
        qty_label:
          type: string
        category:
          type: string
          description: e.g. standard_drug, unstructured_drug.
    PaginatedPrescriptions:
      type: object
      properties:
        count:
          type: integer
        next:
          type: string
          nullable: true
        previous:
          type: string
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/Prescription'
  parameters:
    Limit:
      name: limit
      in: query
      schema:
        type: integer
      description: Number of results to return per page.
    Offset:
      name: offset
      in: query
      schema:
        type: integer
      description: The initial index from which to return results.
  responses:
    BadRequest:
      description: Bad request — malformed or missing required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    Unauthorized:
      description: Authentication failed or invalid token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    NotFound:
      description: The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'HTTP Token auth. Send: Authorization: Token <your-key>. Keys are issued by Prescrypto via direct communication.'
    JWTAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'JWT auth for the standard-drug (products) endpoint. Send: Authorization: JWT <token>.'