> ## Documentation Index
> Fetch the complete documentation index at: https://muveya.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtener el historial de custodia de un pedido

> Lee el historial de custodia de un pedido, sin datos sensibles: el estado, los movimientos del registro y los registros de entrega, recepción y cierre. Requiere fulfillment:read. 404 cuando no existe o pertenece a otra clínica dental.



## OpenAPI

````yaml /openapi.es.json get /v1/fulfillments/{orderId}
openapi: 3.1.0
info:
  description: >-
    La API pública para desarrolladores de Muveya: recursos /v1 de solo lectura,
    limitados a un tenant y autenticados con una clave de API opaca. Un
    presupuesto de solicitudes por clave.
  title: API para desarrolladores de Muveya
  version: 0.1.0
servers:
  - description: Producción
    url: https://api.muveya.com
security: []
tags:
  - name: Clave de API
  - name: Clínicas
  - name: Bodegas
  - name: Catálogo
  - name: Inventario
  - name: Pedidos
  - name: Entregas
  - name: Analítica
paths:
  /v1/fulfillments/{orderId}:
    get:
      tags:
        - Entregas
      summary: Obtener el historial de custodia de un pedido
      description: >-
        Lee el historial de custodia de un pedido, sin datos sensibles: el
        estado, los movimientos del registro y los registros de entrega,
        recepción y cierre. Requiere fulfillment:read. 404 cuando no existe o
        pertenece a otra clínica dental.
      operationId: getCustodyHistory
      parameters:
        - name: orderId
          in: path
          required: true
          description: El id opaco del pedido.
          schema:
            type: string
      responses:
        '200':
          description: El recurso solicitado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustodyHistory'
          headers:
            X-RateLimit-Limit:
              description: El presupuesto de solicitudes por clave en la ventana actual.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana actual (0 cuando se agotan).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Segundos hasta que se reinicie la ventana actual.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                Estado del presupuesto de solicitudes según el borrador de la
                IETF, por ejemplo "limit=120, remaining=119, reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: >-
                Política según el borrador de la IETF, por ejemplo "120;w=60"
                (límite;segundos de la ventana).
              schema:
                type: string
        '401':
          description: >-
            La clave de API falta, no es válida, fue revocada, expiró o está
            vinculada a una clínica dental suspendida.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: La clave de API no tiene el scope que requiere esta ruta.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: El recurso no existe en esta clínica dental.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: >-
            La clave de API superó su límite de solicitudes en la ventana
            actual.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          headers:
            Retry-After:
              description: Segundos (valor positivo) hasta que se permita otra solicitud.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Limit:
              description: El presupuesto de solicitudes por clave en la ventana actual.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana actual (0 cuando se agotan).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Segundos hasta que se reinicie la ventana actual.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                Estado del presupuesto de solicitudes según el borrador de la
                IETF, por ejemplo "limit=120, remaining=119, reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: >-
                Política según el borrador de la IETF, por ejemplo "120;w=60"
                (límite;segundos de la ventana).
              schema:
                type: string
      security:
        - apiKeyBearer: []
components:
  schemas:
    CustodyHistory:
      type: object
      additionalProperties: false
      required:
        - orderId
        - status
        - movements
      properties:
        orderId:
          type: string
        status:
          type: string
          enum:
            - allocating
            - allocated
            - picking
            - dispatched
            - delivered
            - exception
            - received
            - partially_fulfilled
            - closed
        movements:
          type: array
          items:
            $ref: '#/components/schemas/StockMovement'
        delivery:
          type: object
          additionalProperties: false
          required:
            - actorUserId
            - deliveredAt
            - boxIds
          properties:
            actorUserId:
              type: string
            deliveredAt:
              type: string
              format: date-time
            boxIds:
              type: array
              items:
                type: string
            exception:
              type: object
              additionalProperties: false
              required:
                - reason
              properties:
                reason:
                  type: string
                note:
                  type: string
        receipt:
          type: object
          additionalProperties: false
          required:
            - actorUserId
            - receivedAt
            - acceptedBoxIds
            - disputed
          properties:
            actorUserId:
              type: string
            receivedAt:
              type: string
              format: date-time
            acceptedBoxIds:
              type: array
              items:
                type: string
            disputed:
              type: array
              items:
                type: object
                additionalProperties: false
                required:
                  - boxId
                  - reason
                  - quarantine
                properties:
                  boxId:
                    type: string
                  reason:
                    type: string
                  quarantine:
                    type: boolean
                  note:
                    type: string
        closure:
          type: object
          additionalProperties: false
          required:
            - actorUserId
            - closedAt
          properties:
            actorUserId:
              type: string
            closedAt:
              type: string
              format: date-time
    ProblemDetails:
      type: object
      additionalProperties: false
      required:
        - type
        - title
        - status
        - detail
        - instance
        - code
        - requestId
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          minimum: 400
          maximum: 599
        detail:
          type: string
        instance:
          type: string
        code:
          type: string
        requestId:
          type: string
    StockMovement:
      type: object
      additionalProperties: false
      required:
        - movementId
        - type
        - boxId
        - catalogItemId
        - quantityDelta
        - actorId
        - occurredAt
        - recordedAt
      properties:
        movementId:
          type: string
        type:
          type: string
          enum:
            - receive
            - reserve
            - release
            - pick
            - dispatch
            - transfer_in
            - transfer_out
            - split_out
            - split_in
            - consume
            - return
            - adjust_gain
            - adjust_loss
            - expire
            - quarantine
            - dispose
        boxId:
          type: string
        catalogItemId:
          type: string
        quantityDelta:
          type: integer
        actorId:
          type: string
        occurredAt:
          type: string
          format: date-time
        recordedAt:
          type: string
          format: date-time
        reservedDelta:
          type: integer
        secondActorId:
          type: string
        fromWarehouseId:
          type: string
        toWarehouseId:
          type: string
        reasonCode:
          type: string
        idempotencyKey:
          type: string
        correlationId:
          type: string
        splitId:
          type: string
          description: >-
            Lo comparten los movimientos de una misma separación en un
            contenedor derivado.
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Clave de API opaca mvy_test_ enviada como token Bearer. El servidor
        deriva de ella exactamente una clínica dental; la ruta nunca lleva un
        selector de clínica dental.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.