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

# Create claim with receipt attachment

> Creates a dispute claim ("reclamo") with transfer receipt evidence attached as a base64-encoded PDF or JPEG.
All metadata fields must be supplied explicitly; the API does not parse or extract data from the file.
ADMIN callers must include `accountId`. USER callers may omit `accountId` or associate the claim to their own account only.
Requires the Claims feature (`canAccessClaims`) to be enabled for the caller.




## OpenAPI

````yaml /api-reference/openapi.yaml post /claims
openapi: 3.1.0
info:
  title: HG.Cash API
  description: >
    # 🚀 HG.Cash Transaction API


    Modern REST API for users to create outbound transactions from their
    accounts.


    ## 🧾 How it works


    - We assign accounts to your user in HG.Cash

    - When these accounts have transactions (inbound or outbound), HG.Cash will
    notify your backend using the webhook URL you configure in the HG.Cash
    dashboard

    - **Webhook signature (HMAC)**: In account settings you can generate a
    signing secret. When configured, each webhook POST includes the header
    `X-HG-Webhook-Signature: sha256=<hex>` where the value is HMAC-SHA256 of the
    raw JSON body using your secret. Verify this in your endpoint to ensure the
    request is authentic.

    - To create cash-outs (money leaving your accounts), you must call the
    **Cash Out** endpoint: **Create Transaction Request (Cash Out)** (`POST
    /transactions`)


    ## 📊 Getting Started


    1. **Generate your API token** in the account settings page

    2. **Test endpoints** using the interactive documentation below

    3. **Implement** in your backend services (never expose tokens in frontend)

    4. **Monitor** your integration and handle errors appropriately


    ## 🔐 Authentication


    This API uses **Bearer Token** authentication. Include your user API token
    in the Authorization header, for example `Authorization: Bearer
    cash_your_token_here`.


    ## ⚠️ Important Security Notes


    - Never share or expose your user API authentication token

    - Store tokens securely on your backend servers only

    - All API calls must be made from secure backend services

    - Contact administrators immediately if your token is compromised
  version: 1.0.0
  contact:
    name: HG.Cash API Support
    email: api-support@hg.cash
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://hg.cash/api/v1
    description: Production server
  - url: http://dev.hg.cash/api/v1
    description: Development server
security:
  - bearerAuth: []
tags:
  - name: Transactions
    description: >-
      Transaction Management - Create and manage transactions in the HG.Cash
      system. All transaction endpoints require authentication.
  - name: Accounts
    description: >-
      Accounts - Retrieve account information and balances for the authenticated
      user. All account endpoints require authentication.
  - name: Reference Data
    description: >-
      Reference Data - Get reference data like transaction statuses and types.
      These endpoints require authentication.
  - name: Webhooks
    description: Webhooks - Event notifications sent to your HTTP endpoint.
  - name: Brazil
    description: >-
      Transaction management - Create and manage transactions in Pix system for
      Brazil operations
  - name: Chile
    description: Hosted checkout and bank payouts for Chile (CLP)
  - name: Bolivia
    description: QR cash-in and ACH payouts for Bolivia (BOB)
  - name: Checkouts
    description: Hosted checkout sessions for AR, BR, CL, and BO
  - name: Claims
    description: Dispute claims with transfer receipt evidence
paths:
  /claims:
    post:
      tags:
        - Claims
      summary: Create claim with receipt attachment
      description: >
        Creates a dispute claim ("reclamo") with transfer receipt evidence
        attached as a base64-encoded PDF or JPEG.

        All metadata fields must be supplied explicitly; the API does not parse
        or extract data from the file.

        ADMIN callers must include `accountId`. USER callers may omit
        `accountId` or associate the claim to their own account only.

        Requires the Claims feature (`canAccessClaims`) to be enabled for the
        caller.
      operationId: createClaim
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClaimRequest'
            example:
              accountId: 550e8400-e29b-41d4-a716-446655440123
              from: Juan Pérez
              to: Mi cuenta HG
              operationNumber: '987654321'
              coelsaCode: 67REZ8NPQDQ460QK94KVGO
              amount: 1500
              currency: ARS
              file:
                contentBase64: <base64-encoded PDF or image bytes>
                mimeType: application/pdf
                filename: comprobante.pdf
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateClaimResponse'
        '400':
          description: >-
            Validation error (invalid fields, base64, MIME type, or oversize
            file)
        '401':
          description: Unauthorized
        '403':
          description: Forbidden — claims feature disabled or account out of scope
        '404':
          description: Account not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal Server Error
components:
  schemas:
    CreateClaimRequest:
      type: object
      description: >
        Payload to create a dispute claim ("reclamo") with a transfer receipt
        attached. All metadata is supplied explicitly; the API does not parse or
        extract data from the file.
      required:
        - from
        - to
        - operationNumber
        - coelsaCode
        - amount
        - currency
        - file
      properties:
        accountId:
          type: string
          format: uuid
          description: >-
            Required for ADMIN callers; optional for USER callers (associates
            the claim to your own account only).
          example: 550e8400-e29b-41d4-a716-446655440123
        from:
          type: string
          description: Origin account or payer name from the receipt.
          example: Juan Pérez
        to:
          type: string
          description: Destination account name from the receipt.
          example: Mi cuenta HG
        operationNumber:
          type: string
          description: Bank operation number from the receipt.
          example: '987654321'
        coelsaCode:
          type: string
          pattern: ^[A-Z0-9]{22}$
          description: >-
            COELSA identification code (exactly 22 uppercase alphanumeric
            characters).
          example: 67REZ8NPQDQ460QK94KVGO
        amount:
          oneOf:
            - type: number
            - type: string
          description: Positive amount with at most 2 decimal places.
          example: 1500
        currency:
          type: string
          enum:
            - ARS
            - USD
            - USDT
          example: ARS
        file:
          type: object
          required:
            - contentBase64
            - mimeType
            - filename
          properties:
            contentBase64:
              type: string
              description: >-
                Base64-encoded PDF or JPEG bytes (max 10 MB decoded). A `data:`
                URI prefix is stripped automatically.
              example: <base64-encoded PDF or image bytes>
            mimeType:
              type: string
              enum:
                - application/pdf
                - image/jpeg
                - image/jpg
              example: application/pdf
            filename:
              type: string
              description: Original filename; the extension must match `mimeType`.
              example: comprobante.pdf
    CreateClaimResponse:
      type: object
      required:
        - id
        - status
        - operationNumber
        - coelsaCode
        - amount
        - currency
        - extractedData
        - originalFilename
        - mimeType
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - OPEN
            - UNDER_REVIEW
            - RESOLVED
            - REJECTED
        accountId:
          type: string
          format: uuid
          nullable: true
        operationNumber:
          type: string
        coelsaCode:
          type: string
        amount:
          type: string
          description: Decimal amount formatted with 2 decimal places.
          example: '1500.00'
        currency:
          type: string
          enum:
            - ARS
            - USD
            - USDT
        extractedData:
          type: object
          properties:
            from:
              type: string
              nullable: true
            to:
              type: string
              nullable: true
        originalFilename:
          type: string
        mimeType:
          type: string
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        User API authentication token with format `cash_<64-char-hex>`. Sample
        value
        `cash_16cdc3b6f83c72d9d2680adca4f430962981f6bf32613a129dded0aa060387d2`.

````