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

# Update Prior Authorization NDP Submission

> Update the preferred pharmacy NCPDP ID for a prior authorization's NDP
submission. Only allowed while the PA request is active and no transfer
attempts have been made.

## Overview

This endpoint allows you to update the preferred pharmacy for a prior authorization request with a non-dispensing pharmacy submission. The prescription transferred to the NDP will be transferred to the preferred pharmacy once the prior authorization is approved.

This endpoint will return an error if called for prior authorization requests that are in a terminal state (e.g. completed, cancelled) or for which the transfer has already been initiated.


## OpenAPI

````yaml patch /prior-authorization/{id}/ndp-submission
openapi: 3.1.0
info:
  title: Develop Health Public API
  description: Develop Health Public API
  version: '1.0'
servers:
  - url: https://api.develophealth.ai
security: []
paths:
  /prior-authorization/{id}/ndp-submission:
    patch:
      tags:
        - public-api
        - public-api
      summary: Update Ndp Submission By Id
      description: |-
        Update the preferred pharmacy NCPDP ID for a prior authorization's NDP
        submission. Only allowed while the PA request is active and no transfer
        attempts have been made.
      operationId: >-
        update_ndp_submission_by_id_prior_authorization__id__ndp_submission_patch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: Request Data
              allOf:
                - $ref: '#/components/schemas/UpdateNDPSubmissionRequest'
      responses:
        '200':
          description: Successfully updated preferred pharmacy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateNDPSubmissionResponse'
              example:
                status: success
                data:
                  preferred_pharmacy_ncpdp_id: '1234567'
        '400':
          content:
            application/json:
              example:
                detail: >-
                  Cannot update preferred pharmacy for a prior authorization
                  request with status: COMPLETED
          description: Cannot update preferred pharmacy for terminal PA requests.
        '404':
          content:
            application/json:
              example:
                detail: Prior Authorization Request does not exist.
          description: Prior Authorization Request does not exist.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggJWTAuthentication: []
components:
  schemas:
    UpdateNDPSubmissionRequest:
      properties:
        preferred_pharmacy_ncpdp_id:
          type: string
          pattern: ^\d{7}$
          title: Preferred Pharmacy Ncpdp Id
          description: >-
            The new NCPDP ID of the preferred pharmacy where the prescription
            will be transferred after the PA request has been approved.
      type: object
      title: UpdateNDPSubmissionRequest
      description: |-
        Request to update the NDP submission details of a prior authorization.
        Currently only supports updating the preferred pharmacy NCPDP ID.
    UpdateNDPSubmissionResponse:
      properties:
        status:
          anyOf:
            - type: string
              enum:
                - success
            - type: string
              enum:
                - error
          title: Status
          default: success
        error:
          $ref: '#/components/schemas/ApiError'
        data:
          allOf:
            - $ref: '#/components/schemas/UpdateNDPSubmissionResponseData'
          title: Data
          description: >-
            Contains the updated NDP submission data, or None if an error
            occurred.
      type: object
      title: UpdateNDPSubmissionResponse
      description: >-
        Represents the response structure for a PATCH
        /prior-authorization/:id/ndp-submission request.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiError:
      properties:
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
        code:
          type: string
          title: Code
      type: object
      required:
        - title
        - description
        - code
      title: ApiError
    UpdateNDPSubmissionResponseData:
      properties:
        preferred_pharmacy_ncpdp_id:
          type: string
          title: Preferred Pharmacy Ncpdp Id
          description: The updated NCPDP ID of the preferred pharmacy.
      type: object
      title: UpdateNDPSubmissionResponseData
      description: Data payload returned after a successful NDP submission update.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    FronteggJWTAuthentication:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````