Prescrypto Memberships API

Medic-to-hospital memberships.

OpenAPI Specification

prescrypto-memberships-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Prescrypto Integration Hospitals Memberships 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: Memberships
  description: Medic-to-hospital memberships.
paths:
  /api/v2/management/memberships/:
    get:
      operationId: listMemberships
      tags:
      - Memberships
      summary: List memberships
      responses:
        '200':
          description: List of memberships
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Membership'
    post:
      operationId: createMembership
      tags:
      - Memberships
      summary: Create a membership
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Membership'
      responses:
        '201':
          description: Membership created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Membership'
        '400':
          $ref: '#/components/responses/BadRequest'
  /api/v2/management/memberships/{membership_id}:
    parameters:
    - name: membership_id
      in: path
      required: true
      schema:
        type: integer
    get:
      operationId: getMembership
      tags:
      - Memberships
      summary: Get a membership
      responses:
        '200':
          description: Membership detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Membership'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateMembership
      tags:
      - Memberships
      summary: Update a membership
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Membership'
      responses:
        '200':
          description: Membership updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Membership'
    delete:
      operationId: deleteMembership
      tags:
      - Memberships
      summary: Delete a membership
      responses:
        '204':
          description: Membership deleted
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v2/memberships/{hospital_id}:
    parameters:
    - name: hospital_id
      in: path
      required: true
      schema:
        type: integer
    get:
      operationId: listHospitalMemberships
      tags:
      - Memberships
      summary: List memberships for a hospital
      responses:
        '200':
          description: List of hospital memberships
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Membership'
components:
  responses:
    BadRequest:
      description: Bad request — malformed or missing required parameters.
      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'
  schemas:
    Membership:
      type: object
      properties:
        id:
          type: integer
        medic:
          type: string
        hospital:
          type: integer
    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
  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>.'