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

# Add Transaction Details

> Use this API to input invoice details for a specific transaction. You have the flexibility to upload multiple invoices until the cumulative total of all invoice amounts matches the transaction amount.

Based on who you are, consider the below values in the API requests

<Note>
  | Cashfree Merchant | Cashfree Partner     |
  | :---------------- | :------------------- |
  | x-client-id       | x-partner-api-key    |
  | x-client-secret   | x-partner-merchantid |
</Note>


## OpenAPI

````yaml post /gc/transactions/{referenceId}/invoice-details
openapi: 3.0.3
info:
  title: Global Collections - Partners
  version: '4'
servers:
  - url: https://sandbox.cashfree.com/
    description: Sandbox server
  - url: https://api.cashfree.com/
    description: Production server
security: []
paths:
  /gc/transactions/{referenceId}/invoice-details:
    post:
      summary: Add Transaction Details for Partner Merchants
      description: >-
        Use this API to input invoice details for a specific transaction. You
        have the flexibility to upload multiple invoices until the cumulative
        total of all invoice amounts matches the transaction amount.
      operationId: add-transaction-details-partner
      parameters:
        - $ref: '#/components/parameters/PartnerApiKey'
        - $ref: '#/components/parameters/PartnerMerchantId'
        - $ref: '#/components/parameters/ApiVersion'
        - name: referenceId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceRequest'
      responses:
        '201':
          description: Success response for adding invoice details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceError'
        '403':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    PartnerApiKey:
      name: x-partner-api-key
      in: header
      description: Enter partner API keygit
      required: true
      schema:
        type: string
    PartnerMerchantId:
      name: x-partner-merchantid
      in: header
      description: >-
        Enter the merchant reference id used while creating merchant during
        onboarding
      required: true
      schema:
        type: string
    ApiVersion:
      name: x-api-version
      in: header
      description: API version
      required: true
      schema:
        type: string
  schemas:
    InvoiceRequest:
      type: object
      required:
        - invoiceNumber
        - invoiceAmount
        - invoiceFile
        - remitterName
      properties:
        invoiceNumber:
          type: string
        invoiceAmount:
          type: string
        invoiceFile:
          type: string
          format: binary
        remitterName:
          type: string
        purposeCode:
          type: string
    InvoiceResponse:
      type: object
      properties:
        cmsProfileId:
          type: integer
          example: 23802472
        cmsPaymentId:
          type: integer
          example: 310729
        invoiceNumber:
          type: string
          example: ABC123
        invoiceAmount:
          type: integer
          example: 1
        remitterName:
          type: string
          example: remitter
        status:
          type: string
          example: SUCCESS
    InvoiceError:
      oneOf:
        - title: Payment Not Found
          type: object
          properties:
            title:
              type: string
              example: PAYMENT_NOT_FOUND
            detail:
              type: string
              example: Payment with ID 11111 could not be found.
        - title: Payment not in Awaiting for Details state
          type: object
          properties:
            title:
              type: string
              example: REQUEST_INVALID
            detail:
              type: string
              example: Payment with ID 11111 is not in AWAITING_DETAILS state.
        - title: Total Invoice Sum Exceeds Transaction Amount
          type: object
          properties:
            title:
              type: string
              example: REQUEST_INVALID
            detail:
              type: string
              example: Total invoice sum (11) exceeds payment amount (10.00).
        - title: Duplicate Invoice
          type: object
          properties:
            title:
              type: string
              example: INVOICE_DUPLICATE
            detail:
              type: string
              example: >-
                Invoice with number inv_01_abc already exists for Payment ID
                11111
        - title: Invalid Purpose Code
          type: object
          properties:
            title:
              type: string
              example: REQUEST_INVALID
            detail:
              type: string
              example: >-
                Please reach out to your account manager as purpose code you are
                trying is not verified.
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          example: authentication_error
        message:
          type: string
          example: failed to authenticate
        code:
          type: string
          example: authentication_failed

````