> ## 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.

# Criar uma cobrança Pix imediata (cob)

> Registra uma cobrança Pix dinâmica imediata. A chave Pix é validada antes da criação. A cobrança inclui seu payload EMV, a URL de localização e o momento de expiração.



## OpenAPI

````yaml pt/openapi/v3-current/pix-lerian-cob.yaml POST /collections/immediate
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: API pública para BR Codes Pix e cobranças imediatas e com vencimento.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — Cobranças
  version: release-candidate
servers:
  - url: https://api.example.com/cob-hub/v1
    description: Substitua o host de exemplo pela URL fornecida no onboarding do ambiente.
security:
  - BearerAuth: []
tags:
  - description: Criação, consulta, listagem e decodificação de BR Codes Pix estáticos.
    name: BR Codes
  - description: Criação, consulta, listagem e cancelamento de cobranças Pix imediatas.
    name: Immediate Collections
  - description: >-
      Criação, consulta, listagem e cancelamento de cobranças Pix com
      vencimento.
    name: Due-Date Collections
paths:
  /collections/immediate:
    post:
      tags:
        - Immediate Collections
      summary: Criar uma cobrança Pix imediata (cob)
      description: >-
        Registra uma cobrança Pix dinâmica imediata. A chave Pix é validada
        antes da criação. A cobrança inclui seu payload EMV, a URL de
        localização e o momento de expiração.
      operationId: createImmediateCollection
      parameters:
        - description: >-
            Chave criada pelo cliente para repetir com segurança exatamente a
            mesma requisição.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
            description: >-
              Chave criada pelo cliente para repetir com segurança exatamente a
              mesma requisição.
          example: pix-demo-20260903-000001
        - description: UUID da conta associada à operação.
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: UUID da conta associada à operação.
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
          example: 019606a1-3b4c-7d8e-9f01-234567890abc
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImmediateCollectionBody'
            examples:
              exemploFicticio:
                summary: Exemplo fictício
                value:
                  additionalInfo:
                    - key: orderId
                      value: '12345'
                  amount: '100.50'
                  currency: BRL
                  debtor:
                    document: '39053344705'
                    name: João da Silva
                  description: Pagamento do pedido 12345
                  expirationSeconds: 3600
                  keyType: EVP
                  keyValue: 123e4567-e12b-12d1-a456-426655440000
                  merchantCity: Goiania
                  merchantName: Loja Teste
                  txId: TX1234567890123456789012345
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImmediateCollectionOutput'
              examples:
                exemploFicticio:
                  summary: Exemplo fictício
                  value:
                    accountId: 0196a7b2-3e5f-7061-ac12-34567890abcd
                    additionalInfo:
                      - key: orderId
                        value: '12345'
                    amount: '100.50'
                    createdAt: '2026-05-06T10:30:00Z'
                    currency: BRL
                    debtor:
                      document: '39053344705'
                      name: João da Silva
                    description: Pagamento do pedido 12345
                    emvPayload: >-
                      00020101021226500014br.gov.bcb.pix2528pix.example.com/qr/v2/abc1235204000053039865802BR5910Loja
                      Teste6007Goiania62070503***63041206
                    expirationSeconds: 3600
                    expiresAt: '2026-05-06T11:30:00Z'
                    externalId: 0196a7b2-4f60-7172-bd23-4567890abcde
                    id: 0196a7b2-1c3d-7e4f-8a90-1234567890ab
                    keyType: EVP
                    keyValue: 123e4567-e12b-12d1-a456-426655440000
                    locationUrl: https://pix.example.com/qr/v2/abc123
                    merchantCity: Goiania
                    merchantDocument: '39053344705'
                    merchantName: Loja Teste
                    organizationId: 0196a7b2-2d4e-7f50-9b01-234567890abc
                    status: ACTIVE
                    txId: TX1234567890123456789012345
                    type: IMMEDIATE
                    updatedAt: '2026-05-06T10:30:00Z'
          description: Created
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  The Idempotency-Key header is required for this operation and
                  must be within the accepted length.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key absent or longer than 64 bytes (PIX-0030). Legacy
            {code,title,message} envelope, NOT problem+json.
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: The Idempotency-Key was already used with a different request.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key replayed with a divergent request -- a different
            method, URL or body, or a different X-Account-Id (PIX-0031).
            Evidence that an earlier request under this key already succeeded.
            Legacy {code,title,message} envelope, NOT problem+json.
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      x-codeSamples:
        - lang: bash
          label: cURL com dados fictícios
          source: |-
            curl --request POST \
              --url https://api.example.com/cob-hub/v1/collections/immediate \
              --header 'Authorization: Bearer demo-access-token' \
              --header 'Content-Type: application/json' \
              --header 'Idempotency-Key: pix-demo-20260903-000001' \
              --header 'X-Account-Id: 019606a1-3b4c-7d8e-9f01-234567890abc' \
              --data '{
              "additionalInfo": [
                {
                  "key": "orderId",
                  "value": "12345"
                }
              ],
              "amount": "100.50",
              "currency": "BRL",
              "debtor": {
                "document": "39053344705",
                "name": "João da Silva"
              },
              "description": "Pagamento do pedido 12345",
              "expirationSeconds": 3600,
              "keyType": "EVP",
              "keyValue": "123e4567-e12b-12d1-a456-426655440000",
              "merchantCity": "Goiania",
              "merchantName": "Loja Teste",
              "txId": "TX1234567890123456789012345"
            }'
components:
  schemas:
    CreateImmediateCollectionBody:
      additionalProperties: false
      properties:
        additionalInfo:
          description: Free-form key/value metadata (max 50 entries)
          items:
            $ref: '#/components/schemas/AdditionalInfoEntry'
          type:
            - array
            - 'null'
        amount:
          description: Collection amount in BRL
          type: string
        currency:
          description: Currency (BRL only)
          examples:
            - BRL
          type: string
        debtor:
          $ref: '#/components/schemas/DebtorRequest'
          description: Optional debtor block
        description:
          description: Free-form description
          examples:
            - Pagamento do pedido 12345
          type: string
        expirationSeconds:
          description: Seconds until the collection expires
          examples:
            - 3600
          format: int64
          type: integer
        keyType:
          description: Pix key type
          examples:
            - EVP
          type: string
        keyValue:
          description: Pix key value
          examples:
            - 123e4567-e12b-12d1-a456-426655440000
          type: string
        merchantCity:
          description: Merchant city
          examples:
            - Goiania
          type: string
        merchantName:
          description: Merchant name
          examples:
            - Loja Teste
          type: string
        txId:
          description: BCB transaction identifier
          examples:
            - TX1234567890123456789012345
          type: string
      required:
        - txId
        - keyType
        - keyValue
        - merchantName
        - merchantCity
        - amount
        - expirationSeconds
      type: object
    ImmediateCollectionOutput:
      additionalProperties: false
      properties:
        accountId:
          examples:
            - 0196a7b2-3e5f-7061-ac12-34567890abcd
          type: string
        additionalInfo:
          items:
            $ref: '#/components/schemas/KVDTO'
          type:
            - array
            - 'null'
        amount:
          examples:
            - '100.50'
          type: string
        cancelledAt:
          examples:
            - '2026-05-06T10:40:00Z'
          format: date-time
          type: string
        cancelledReason:
          examples:
            - Customer requested cancellation
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        currency:
          enum:
            - BRL
          examples:
            - BRL
          type: string
        debtor:
          $ref: '#/components/schemas/DebtorDTO'
        description:
          examples:
            - Pagamento do pedido 12345
          type: string
        emvPayload:
          examples:
            - >-
              00020101021226500014br.gov.bcb.pix2528pix.example.com/qr/v2/abc1235204000053039865802BR5910Loja
              Teste6007Goiania62070503***63041206
          type: string
        expirationSeconds:
          examples:
            - 3600
          format: int64
          type: integer
        expiresAt:
          examples:
            - '2026-05-06T11:30:00Z'
          format: date-time
          type: string
        externalId:
          examples:
            - 0196a7b2-4f60-7172-bd23-4567890abcde
          type: string
        id:
          examples:
            - 0196a7b2-1c3d-7e4f-8a90-1234567890ab
          type: string
        keyType:
          enum:
            - CPF
            - CNPJ
            - PHONE
            - EMAIL
            - EVP
          examples:
            - EVP
          type: string
        keyValue:
          examples:
            - 123e4567-e12b-12d1-a456-426655440000
          type: string
        locationUrl:
          examples:
            - https://pix.example.com/qr/v2/abc123
          type: string
        merchantCity:
          examples:
            - Goiania
          type: string
        merchantDocument:
          examples:
            - '39053344705'
          type: string
        merchantName:
          examples:
            - Loja Teste
          type: string
        organizationId:
          examples:
            - 0196a7b2-2d4e-7f50-9b01-234567890abc
          type: string
        payment:
          $ref: '#/components/schemas/PaymentDTO'
        status:
          enum:
            - ACTIVE
            - COMPLETED
            - CANCELLED
          examples:
            - ACTIVE
          type: string
        txId:
          examples:
            - TX1234567890123456789012345
          type: string
        type:
          enum:
            - IMMEDIATE
            - DUE_DATE
          examples:
            - IMMEDIATE
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
      required:
        - id
        - organizationId
        - accountId
        - merchantDocument
        - type
        - status
        - txId
        - keyType
        - keyValue
        - merchantName
        - merchantCity
        - amount
        - currency
        - expirationSeconds
        - externalId
        - locationUrl
        - emvPayload
        - expiresAt
        - createdAt
        - updatedAt
      type: object
    LegacyErrorEnvelope:
      additionalProperties: false
      properties:
        code:
          description: PIX-XXXX error code
          type: string
        message:
          description: Human-readable error message
          type: string
        title:
          description: Short error title
          type: string
      required:
        - code
        - title
        - message
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    AdditionalInfoEntry:
      additionalProperties: false
      properties:
        key:
          description: Metadata key
          examples:
            - orderId
          type: string
        value:
          description: Metadata value
          examples:
            - '12345'
          type: string
      required:
        - key
        - value
      type: object
    DebtorRequest:
      additionalProperties: false
      properties:
        document:
          description: Debtor CPF (11 digits) or CNPJ (14 chars, digits or alphanumeric)
          examples:
            - '39053344705'
          type: string
        name:
          description: Debtor name
          examples:
            - João da Silva
          type: string
      type: object
    KVDTO:
      additionalProperties: false
      properties:
        key:
          examples:
            - orderId
          type: string
        value:
          examples:
            - '12345'
          type: string
      required:
        - key
        - value
      type: object
    DebtorDTO:
      additionalProperties: false
      properties:
        document:
          examples:
            - '39053344705'
          type: string
        name:
          examples:
            - João da Silva
          type: string
      type: object
    PaymentDTO:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '100.50'
          type: string
        endToEndId:
          examples:
            - E12345678202605061030abcdef12345
          type: string
        paidAt:
          examples:
            - '2026-05-06T10:35:00Z'
          format: date-time
          type: string
        payer:
          $ref: '#/components/schemas/PayerDTO'
      required:
        - endToEndId
        - amount
        - paidAt
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
    PayerDTO:
      additionalProperties: false
      properties:
        ispb:
          examples:
            - '12345678'
          type: string
        name:
          examples:
            - João da Silva
          type: string
        taxId:
          examples:
            - '39053344705'
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````