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

# Duplicate Superbill

> Copy a Super Bill's claim document onto a new bill linked to `note_id`.

Backs "Duplicate" on a note. A duplicated note is a new *chain*, and
UNIQUE(parent_note_id) allows one bill per chain — so re-pointing the source
bill would take it away from the note it was built for. The bill is copied
instead.

Carried over: `payload` (service lines, codes, service details, insurance,
notes) and `name`. Deliberately not carried over:
  - `superbill_charge` links. They name the *original's* charges, so the copy
    would inherit money already collected against them and, on save, fight
    the original over the same charge_items' denormalized billing codes. The
    copy is a claim to be re-billed, not a second claim on a paid visit.
  - per-line `charge_item_id`, which points into those same charge items.
    Cleared, so the copy's lines are their own (the editor treats them like
    hand-entered ones and `save_superbill` writes back to nothing).
  - `event_id`: duplicating a note drops its appointment, so the bill must
    not stay pinned to a visit the new note isn't on.
  - `external_id` / `is_imported`, which belong to the importer.
A payload that isn't a saved editor document — a never-opened bill still
holds the `{"event_ids": …}` stub written at creation — copies as nothing
rather than as a stub naming the source's events.



## OpenAPI

````yaml post /billing/superbill/{superbill_id}/duplicate
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/superbill/{superbill_id}/duplicate:
    post:
      tags:
        - Superbills
      summary: Duplicate Superbill
      description: >-
        Copy a Super Bill's claim document onto a new bill linked to `note_id`.


        Backs "Duplicate" on a note. A duplicated note is a new *chain*, and

        UNIQUE(parent_note_id) allows one bill per chain — so re-pointing the
        source

        bill would take it away from the note it was built for. The bill is
        copied

        instead.


        Carried over: `payload` (service lines, codes, service details,
        insurance,

        notes) and `name`. Deliberately not carried over:
          - `superbill_charge` links. They name the *original's* charges, so the copy
            would inherit money already collected against them and, on save, fight
            the original over the same charge_items' denormalized billing codes. The
            copy is a claim to be re-billed, not a second claim on a paid visit.
          - per-line `charge_item_id`, which points into those same charge items.
            Cleared, so the copy's lines are their own (the editor treats them like
            hand-entered ones and `save_superbill` writes back to nothing).
          - `event_id`: duplicating a note drops its appointment, so the bill must
            not stay pinned to a visit the new note isn't on.
          - `external_id` / `is_imported`, which belong to the importer.
        A payload that isn't a saved editor document — a never-opened bill still

        holds the `{"event_ids": …}` stub written at creation — copies as
        nothing

        rather than as a stub naming the source's events.
      operationId: duplicate_superbill_billing_superbill__superbill_id__duplicate_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: superbill_id
          in: path
          required: true
          schema:
            type: string
            title: Superbill Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DuplicateSuperbillRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperbillSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DuplicateSuperbillRequest:
      properties:
        noteId:
          type: string
          title: Noteid
      type: object
      required:
        - noteId
      title: DuplicateSuperbillRequest
      description: >-
        Copy a Super Bill onto the note that a note-duplicate just produced.


        `note_id` is required: the copy exists to carry a duplicated note's
        billing,

        and an unlinked copy would just be a stray bill on the patient's chart.
    SuperbillSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          type: string
          title: Patientid
        eventId:
          anyOf:
            - type: string
            - type: 'null'
          title: Eventid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        createdDate:
          type: string
          format: date-time
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        chargeCount:
          type: integer
          title: Chargecount
        totalBilledCents:
          type: integer
          title: Totalbilledcents
          default: 0
      type: object
      required:
        - id
        - patientId
        - createdDate
        - chargeCount
      title: SuperbillSummary
      description: List-view row on the patient Billing tab.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````