> ## 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.

# Get an order custody history

> Reads the redacted custody history of one order: status, the ledger movements and the delivery/receipt/closure records. Requires fulfillment:read. 404 when absent or in another workspace.



## OpenAPI

````yaml /openapi.en.json get /v1/fulfillments/{orderId}
openapi: 3.1.0
info:
  description: >-
    The Muveya public developer API: opaque-API-key-authenticated,
    tenant-scoped, read-only /v1 resources. One rate-limit budget per key.
  title: Muveya Developer API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.muveya.com
security: []
tags:
  - name: API key
  - name: Clinics
  - name: Warehouses
  - name: Catalog
  - name: Inventory
  - name: Orders
  - name: Fulfillments
  - name: Analytics
paths:
  /v1/fulfillments/{orderId}:
    get:
      tags:
        - Fulfillments
      summary: Get an order custody history
      description: >-
        Reads the redacted custody history of one order: status, the ledger
        movements and the delivery/receipt/closure records. Requires
        fulfillment:read. 404 when absent or in another workspace.
      operationId: getCustodyHistory
      parameters:
        - name: orderId
          in: path
          required: true
          description: The opaque order id.
          schema:
            type: string
      responses:
        '200':
          description: The requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustodyHistory'
          headers:
            X-RateLimit-Limit:
              description: The per-key request budget for the current window.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Requests left in the current window (0 when exhausted).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                IETF draft budget snapshot, e.g. "limit=120, remaining=119,
                reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: IETF draft policy, e.g. "120;w=60" (limit;window-seconds).
              schema:
                type: string
        '401':
          description: >-
            The API key is missing, invalid, revoked, expired, or bound to a
            suspended workspace.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: The API key lacks the scope this route requires.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: The resource does not exist in this workspace.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: The API key exceeded its rate limit for the current window.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          headers:
            Retry-After:
              description: Positive delta-seconds until another request is allowed.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Limit:
              description: The per-key request budget for the current window.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Requests left in the current window (0 when exhausted).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                IETF draft budget snapshot, e.g. "limit=120, remaining=119,
                reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: IETF draft policy, e.g. "120;w=60" (limit;window-seconds).
              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: Shared by the movements of one separation into a derived container.
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Opaque mvy_test_ API key sent as a Bearer token. It derives exactly one
        workspace server-side; the path never carries a workspace selector.

````

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