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

> Duplicate a membership with all its discounts.



## OpenAPI

````yaml post /inventory/memberships/{membership_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:
  /inventory/memberships/{membership_id}/duplicate:
    post:
      tags:
        - provider
        - inventory
      summary: Duplicate Membership
      description: Duplicate a membership with all its discounts.
      operationId: >-
        duplicate_membership_inventory_memberships__membership_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: membership_id
          in: path
          required: true
          schema:
            type: string
            title: Membership Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MembershipDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MembershipDetail:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the membership
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: External system identifier for the membership
        name:
          type: string
          title: Name
          description: Name of the membership
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the membership
        price:
          type: integer
          title: Price
          description: Price of the membership in cents
        globalDiscountPercentage:
          anyOf:
            - type: number
            - type: 'null'
          title: Globaldiscountpercentage
          description: Global discount percentage for all items
          default: 0
        patientCreditAmount:
          type: integer
          title: Patientcreditamount
          description: Amount of patient credit in cents
          default: 0
        patientCreditFrequency:
          $ref: '#/components/schemas/MembershipFrequency'
          description: Frequency of patient credit
          default: MONTHLY
        patientCreditExpiryDays:
          anyOf:
            - type: integer
            - type: 'null'
          title: Patientcreditexpirydays
          description: Days until patient credit expires
        maxRenewals:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maxrenewals
          description: Maximum number of renewals (null means unlimited)
          default: 0
        autoRenew:
          type: boolean
          title: Autorenew
          description: Whether the membership auto-renews
          default: true
        setupFee:
          type: integer
          title: Setupfee
          description: Setup fee for the membership in cents
          default: 0
        freezeFee:
          type: integer
          title: Freezefee
          description: Fee to freeze the membership in cents
          default: 0
        minimumBillingCycles:
          type: integer
          title: Minimumbillingcycles
          description: Minimum number of billing cycles required
          default: 0
        billingFrequency:
          $ref: '#/components/schemas/MembershipFrequency'
          description: Billing frequency for the membership
          default: MONTHLY
        textColor:
          anyOf:
            - type: string
            - type: 'null'
          title: Textcolor
          description: Text color for the membership
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the membership is archived
          default: false
        ruleSetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rulesetid
          description: ID of the rule set for the membership
        merchantAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Merchantaccountid
          description: Bank account (merchant account) that membership deposits go to
        feeSchedule:
          anyOf:
            - items:
                $ref: '#/components/schemas/MembershipFeeScheduleEntry'
              type: array
            - type: 'null'
          title: Feeschedule
          description: Cycle-specific price overrides
        discounts:
          anyOf:
            - items:
                $ref: '#/components/schemas/MembershipDiscount'
              type: array
            - type: 'null'
          title: Discounts
          description: Optional discounts for the membership
        memberCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Membercount
          description: Number of active members
          default: 0
        totalRevenue:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totalrevenue
          description: Total revenue from this membership
          default: 0
      type: object
      required:
        - name
        - price
      title: MembershipDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MembershipFrequency:
      type: string
      enum:
        - DAILY
        - WEEKLY
        - BIWEEKLY
        - MONTHLY
        - QUARTERLY
        - SEMI_ANNUALLY
        - YEARLY
      title: MembershipFrequency
    MembershipFeeScheduleEntry:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the fee schedule entry
        membershipId:
          type: string
          title: Membershipid
          description: ID of the membership
          default: ''
        cycleNumber:
          type: integer
          minimum: 1
          title: Cyclenumber
          description: Billing cycle number (1-indexed)
        price:
          type: integer
          minimum: 0
          title: Price
          description: Price in cents for this cycle
      type: object
      required:
        - cycleNumber
        - price
      title: MembershipFeeScheduleEntry
    MembershipDiscount:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the membership discount
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: External system identifier for the discount
        membershipId:
          type: string
          title: Membershipid
          description: ID of the membership this discount belongs to
        itemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemid
          description: ID of the specific item for this discount (includes packages)
        itemCategory:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemcategory
          description: Category name for items in this discount (references category.name)
        isPhysical:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isphysical
          description: >-
            Whether this discount applies to physical items (True), services
            (False), or neither (None)
        discountPercentage:
          anyOf:
            - type: number
            - type: 'null'
          title: Discountpercentage
          description: Discount percentage
        discountAmount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Discountamount
          description: Discount amount in cents
        creditAmount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Creditamount
          description: Credit amount in cents
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity for this discount
        rollover:
          type: boolean
          title: Rollover
          description: Whether to rollover unused quantities
          default: false
        rolloverExpiryDays:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rolloverexpirydays
          description: Days until rollover items expire
        neverExpire:
          type: boolean
          title: Neverexpire
          description: Whether rollover items never expire
          default: false
        group:
          anyOf:
            - type: string
            - type: 'null'
          title: Group
          description: Group for this discount
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the discount is archived
          default: false
      type: object
      required:
        - membershipId
      title: MembershipDiscount
    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

````