Prescrypto Pharmacy API

Pharmacy-token operations to search and dispense prescriptions.

OpenAPI Specification

prescrypto-pharmacy-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Prescrypto Integration Hospitals Pharmacy 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: Pharmacy
  description: Pharmacy-token operations to search and dispense prescriptions.
paths:
  /api/v2/pharmacy/rx/{signature}:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
      description: The eRx electronic signature.
    get:
      operationId: pharmacySearchPrescription
      tags:
      - Pharmacy
      summary: Search a prescription by signature (pharmacy)
      description: Pharmacy-token operation. Returns the eRx detail including medication SKUs so the pharmacy can dispense.
      responses:
        '200':
          description: Prescription detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prescription'
        '404':
          description: Rx not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v1/prescriptions/burn/{signature}/:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
    post:
      operationId: pharmacyBurnMedication
      tags:
      - Pharmacy
      summary: Burn (mark as sold) medications on a prescription
      description: Pharmacy-token operation (legacy v1). Marks a quantity of a prescribed medication as sold.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sales_code:
                  type: string
                  description: Internal pharmacy identifier
                  e.g. the sales ticket.: null
                medications:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      bought_qty:
                        type: integer
      responses:
        '202':
          description: Medications burned
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
  /api/v1/prescriptions/reject/{signature}/:
    parameters:
    - name: signature
      in: path
      required: true
      schema:
        type: string
    post:
      operationId: pharmacyRejectPrescription
      tags:
      - Pharmacy
      summary: Reject a prescription
      description: Pharmacy or medic operation (legacy v1). A rejected prescription can no longer be used or modified.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rejected:
                  type: boolean
                reason_of_rejected:
                  type: string
      responses:
        '200':
          description: Prescription rejected
        '404':
          description: Rx not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
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
    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.
  responses:
    BadRequest:
      description: Bad request — malformed or missing required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    ServerError:
      description: An error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    Unauthorized:
      description: Authentication failed or invalid token.
      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>.'