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

# Create an Immediate Charge

> Use this endpoint to create an immediate Pix collection (cobrança imediata) with a dynamic QR Code that expires after a defined period.

**Notes:**
- Each immediate collection is unique and can only be paid once
- Amount and expiration time are required
- Transaction ID (txId) must be unique across all collections
- Status automatically transitions to CONCLUDED when payment is received
- Collection expires automatically after the specified time period



## OpenAPI

````yaml en/openapi/v3-current/indirect-pix.yaml POST /v1/collections/immediate
openapi: 3.0.3
info:
  title: Plugin BR Pix Indirect - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-indirect.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/collections/immediate:
    post:
      tags:
        - Collections API
      summary: Create an Immediate Charge
      description: >-
        Use this endpoint to create an immediate Pix collection (cobrança
        imediata) with a dynamic QR Code that expires after a defined period.


        **Notes:**

        - Each immediate collection is unique and can only be paid once

        - Amount and expiration time are required

        - Transaction ID (txId) must be unique across all collections

        - Status automatically transitions to CONCLUDED when payment is received

        - Collection expires automatically after the specified time period
      parameters:
        - name: X-Account-Id
          in: header
          description: Account ID (UUID format)
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImmediateCollectionInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImmediateCollectionOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
      deprecated: false
      security:
        - bearerAuth: []
components:
  schemas:
    CreateImmediateCollectionInput:
      properties:
        additionalInfo:
          additionalProperties:
            type: string
          description: AdditionalInfo is a key-value map for additional information
          example:
            customerId: '67890'
            orderId: '12345'
          type: object
        amount:
          description: >-
            Amount is the collection amount in decimal format with 2 decimal
            places
          example: '100.00'
          type: string
        debtorDocument:
          description: >-
            DebtorDocument is the CPF or CNPJ of the payer (optional, must be
            provided with DebtorName)
          example: '12345678901'
          type: string
        debtorName:
          description: >-
            DebtorName is the name of the payer (optional, must be provided with
            DebtorDocument)
          example: João da Silva
          type: string
        description:
          description: Description is a custom message or description for the collection
          example: 'Payment for order #12345'
          type: string
        expirationSeconds:
          description: >-
            ExpirationSeconds is the time in seconds until the collection
            expires
          example: 3600
          type: integer
        locationInformation:
          allOf:
            - $ref: '#/components/schemas/LocationInformationDTO'
          description: >-
            LocationInformation contains merchant location data for QR code
            generation
        metadata:
          additionalProperties: {}
          description: Metadata is an optional map for custom key-value pairs (max 50 keys)
          type: object
        receiverKey:
          description: Pix key that will receive the payment
          example: '+5511999999999'
          type: string
        tags:
          description: Tags is an array of custom tags for categorization
          example:
            - ecommerce
            - subscription
          items:
            type: string
          type: array
        transactionAmount:
          description: Purchase amount for Pix Troco (change service)
          example: '150.00'
          type: string
        txId:
          description: TxID is the unique transaction identifier for this collection
          example: TXabcdefghijklmno123456789
          type: string
        withdrawalAmount:
          description: Withdrawal amount for Pix Saque or Pix Troco
          example: '50.00'
          type: string
      required:
        - amount
        - expirationSeconds
        - receiverKey
        - txId
      type: object
    ImmediateCollectionOutput:
      properties:
        additionalInfo:
          additionalProperties:
            type: string
          description: AdditionalInfo contains additional key-value information
          example:
            customerId: '67890'
            orderId: '12345'
          type: object
        amount:
          description: Amount is the collection amount in decimal format
          example: '100.00'
          type: string
        createdAt:
          description: CreatedAt is the timestamp when the collection was created
          example: '2024-01-15T10:30:00Z'
          type: string
        debtorDocument:
          description: DebtorDocument is the CPF or CNPJ of the payer
          example: '12345678901'
          type: string
        debtorName:
          description: DebtorName is the name of the payer
          example: João da Silva
          type: string
        description:
          description: Description is the custom description of the collection
          example: 'Payment for order #12345'
          type: string
        emv:
          description: EMV is the QR code payload in EMV format
          example: 00020126580014br.gov.bcb.pix...
          type: string
        expirationSeconds:
          description: ExpirationSeconds is the time in seconds until expiration
          example: 3600
          type: integer
        id:
          description: ID is the unique identifier of the collection
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        locationUrl:
          description: LocationURL is the URL to access the collection location/QR code
          example: https://api.example.com/qr/550e8400
          type: string
        metadata:
          additionalProperties: {}
          description: Metadata is the custom metadata associated with this collection
          type: object
        receiverKey:
          description: Pix key that will receive the payment
          example: '+5511999999999'
          type: string
        status:
          description: Status is the current status of the collection
          example: ACTIVE
          type: string
        tags:
          description: Tags is an array of custom tags
          example:
            - ecommerce
            - subscription
          items:
            type: string
          type: array
        txId:
          description: TxID is the transaction identifier
          example: TXN123456789
          type: string
        updatedAt:
          description: UpdatedAt is the timestamp of the last update
          example: '2024-01-15T10:30:00Z'
          type: string
      type: object
    ErrorFormat:
      type: object
      description: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
    LocationInformationDTO:
      properties:
        categoryCode:
          description: CategoryCode is the merchant category code (MCC)
          example: '5411'
          type: string
        merchantCity:
          description: MerchantCity is the city where the merchant is located
          example: São Paulo
          type: string
        merchantName:
          description: MerchantName is the name of the merchant
          example: Loja ABC
          type: string
        postalCode:
          description: PostalCode is the merchant's postal code (CEP)
          example: 01310-100
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````