> ## 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:
                  type: string
                  nullable: true
                  enum:
                    - 'true'
                    - 'false'
                quantity:
                  type: number
                  nullable: true
                product_id:
                  type: string
                  nullable: true
                  maxLength: 50
                reason:
                  type: string
                  nullable: true
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                full:
                  type: string
                  nullable: true
                  enum:
                    - 'true'
                    - 'false'
                quantity:
                  type: number
                  nullable: true
                product_id:
                  type: string
                  nullable: true
                  maxLength: 50
                reason:
                  type: string
                  nullable: true
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
          multipart/form-data:
            schema:
              type: object
              properties:
                full:
                  type: string
                  nullable: true
                  enum:
                    - 'true'
                    - 'false'
                quantity:
                  type: number
                  nullable: true
                product_id:
                  type: string
                  nullable: true
                  maxLength: 50
                reason:
                  type: string
                  nullable: true
                  maxLength: 500
                override_remaining_quantity:
                  type: boolean
              example:
                full: 'false'
                quantity: 1
                product_id: prod_2
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - invoice_id
                      - product_id
                      - quantity
                      - message
                      - created_at
                    properties:
                      id:
                        type: string
                        description: Replacement record id.
                      invoice_id:
                        type: string
                      product_id:
                        type: string
                      quantity:
                        type: number
                      message:
                        type: string
                      created_at:
                        type: number
                        description: Unix timestamp in seconds.
                    additionalProperties: true
                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
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
        '403':
          description: Response for status 403
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
        '422':
          description: Response for status 422
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
        '429':
          description: Response for status 429
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
        '500':
          description: Response for status 500
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
                          additionalProperties: true
                      subcode:
                        type: string
                    additionalProperties: true
                additionalProperties: true
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use your Shoppex API key in the Authorization header.

````