# Update external prescription

Partially updates an existing External Prescription. Only provided fields will be updated.

Endpoint: PATCH /site/{siteId}/ahds/v1/external-prescription/{externalPrescriptionId}
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Path parameters:

  - `siteId` (number, required)
    Site identifier

  - `externalPrescriptionId` (string, required)
    External Prescription unique identifier (UUID)

## Request fields (application/json):

  - `animalId` (string)
    Reference to the animal for which the prescription was written.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `consultId` (string)
    Reference to the consult/visit associated with this prescription.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `contactId` (string)
    Reference to the client/owner contact associated with this prescription.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `extensions` (object)
    Vendor- or practice-specific extensions.

  - `externalReference` (string)
    External system reference or identifier for this prescription (e.g., pharmacy system ID).
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items` (array)
    List of externally prescribed items.

  - `items.class` (string)
    Classification of the diagnostic item (e.g., lab, imaging).
    Example: example

  - `items.code` (object)
    Coded representation of the diagnostic item.

  - `items.code.code` (string, required)
    Code value
    Example: 12345

  - `items.code.system` (string, required)
    Code system URI
    Example: http://example.com/codesystem

  - `items.code.display` (string)
    Human-readable display
    Example: Example Display Name

  - `items.createdAt` (string)
    Timestamp when this diagnostic item was created.
    Example: 2025-01-01T00:00:00.000Z

  - `items.diagnosticDefinitionId` (string)
    Reference to the diagnostic definition/catalog entry.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.diagnosticItemId` (string, required)
    Canonical identifier for this diagnostic item within the request.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.isActive` (boolean)
    Whether this diagnostic item is currently active.
    Example: true

  - `items.name` (string)
    Human-readable name of the diagnostic item.
    Example: Example Name

  - `items.productId` (string)
    Linked billable product, if applicable.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.updatedAt` (string)
    Timestamp when this diagnostic item was last updated.
    Example: 2025-01-01T00:00:00.000Z

  - `prescribingVetUserId` (string)
    Reference to the user (veterinarian) who prescribed the medication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `totalPrice` (object)
    Total price for all items on the prescription.

  - `prescribedAt` (string)
    Timestamp when the prescription was written (RFC 3339).
    Example: 2025-01-01T00:00:00.000Z

## Response 200:

  - `200` (unknown)
    External Prescription updated successfully

## Response 200 fields (application/json):

  - `animalId` (string, required)
    Reference to the animal for which the prescription was written.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `consultId` (string, required)
    Reference to the consult/visit associated with this prescription.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `contactId` (string, required)
    Reference to the client/owner contact associated with this prescription.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `createdAt` (string, required)
    Timestamp when the external prescription record was created.
    Example: 2025-01-01T00:00:00.000Z

  - `extensions` (object, required)
    Vendor- or practice-specific extensions.

  - `externalPrescriptionId` (string, required)
    Canonical identifier for the external prescription.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `externalReference` (string, required)
    External system reference or identifier for this prescription (e.g., pharmacy system ID).
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items` (array, required)
    List of externally prescribed items.

  - `items.class` (string)
    Classification of the diagnostic item (e.g., lab, imaging).
    Example: example

  - `items.code` (object)
    Coded representation of the diagnostic item.

  - `items.code.code` (string, required)
    Code value
    Example: 12345

  - `items.code.system` (string, required)
    Code system URI
    Example: http://example.com/codesystem

  - `items.code.display` (string)
    Human-readable display
    Example: Example Display Name

  - `items.createdAt` (string)
    Timestamp when this diagnostic item was created.
    Example: 2025-01-01T00:00:00.000Z

  - `items.diagnosticDefinitionId` (string)
    Reference to the diagnostic definition/catalog entry.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.diagnosticItemId` (string, required)
    Canonical identifier for this diagnostic item within the request.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.isActive` (boolean)
    Whether this diagnostic item is currently active.
    Example: true

  - `items.name` (string)
    Human-readable name of the diagnostic item.
    Example: Example Name

  - `items.productId` (string)
    Linked billable product, if applicable.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `items.updatedAt` (string)
    Timestamp when this diagnostic item was last updated.
    Example: 2025-01-01T00:00:00.000Z

  - `prescribingVetUserId` (string, required)
    Reference to the user (veterinarian) who prescribed the medication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `totalPrice` (object, required)
    Total price for all items on the prescription.

  - `updatedAt` (string, required)
    Timestamp when the external prescription record was last updated.
    Example: 2025-01-01T00:00:00.000Z

  - `prescribedAt` (string, required)
    Timestamp when the prescription was written (RFC 3339).
    Example: 2025-01-01T00:00:00.000Z

## Response 400:

  - `400` (unknown)
    Invalid request body

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 404:

  - `404` (unknown)
    External Prescription not found

