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

# Issue invoice replacement

> Issues replacement serials for a completed serial-based invoice. By default, replacements cannot exceed the original purchased quantity. Set `override_remaining_quantity` to `true` for a manual support override when a previous replacement also failed.



## OpenAPI

````yaml /openapi.json post /dev/v1/invoices/{uniqid}/replacements
openapi: 3.0.3
info:
  title: Shoppex Developer API
  description: Mintlify-compatible Developer API reference for Shoppex.
  version: 1.0.0
  contact:
    name: Shoppex Support
    email: support@shoppex.io
    url: https://shoppex.io
servers:
  - url: https://api.shoppex.io
security:
  - bearerAuth: []
paths:
  /dev/v1/invoices/{uniqid}/replacements:
    post:
      tags:
        - Invoices
      summary: Issue invoice replacement
      description: >-
        Issues replacement serials for a completed serial-based invoice. By
        default, replacements cannot exceed the original purchased quantity. Set
        `override_remaining_quantity` to `true` for a manual support override
        when a previous replacement also failed.
      operationId: postDevV1InvoicesByUniqidReplacements
      parameters:
        - name: uniqid
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                full:
                  nullable: true
                  anyOf:
                    - type: string
                      enum:
                        - 'true'
                    - type: string
                      enum:
                        - 'false'
                quantity:
                  nullable: true
                  type: number
                product_id:
                  nullable: true
                  type: string
                  maxLength: 50
                reason:
                  nullable: true
                  type: string
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
          multipart/form-data:
            schema:
              type: object
              properties:
                full:
                  nullable: true
                  anyOf:
                    - type: string
                      enum:
                        - 'true'
                    - type: string
                      enum:
                        - 'false'
                quantity:
                  nullable: true
                  type: number
                product_id:
                  nullable: true
                  type: string
                  maxLength: 50
                reason:
                  nullable: true
                  type: string
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
          text/plain:
            schema:
              type: object
              properties:
                full:
                  nullable: true
                  anyOf:
                    - type: string
                      enum:
                        - 'true'
                    - type: string
                      enum:
                        - 'false'
                quantity:
                  nullable: true
                  type: number
                product_id:
                  nullable: true
                  type: string
                  maxLength: 50
                reason:
                  nullable: true
                  type: string
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    additionalProperties: true
                example:
                  data:
                    id: replacement_1
                    invoice_id: 33333333-3333-4333-8333-333333333333
                    product_id: prod_2
                    quantity: 1
                    message: Replacement issued.
                    created_at: 1712059800
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use your Shoppex API key in the Authorization header.

````