> ## 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 Pix collection (cob)

> Registers an immediate dynamic Pix collection. The Pix key is validated before creation. The collection includes its EMV payload, location URL, and expiration time.



## OpenAPI

````yaml /es/openapi/v3-current/pix-lerian-cob.yaml post /collections/immediate
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Public API for Pix BR Codes and immediate and due-date collections. This
    release provides a mock-provider integration for testing; live BACEN
    connectivity is not included.
  license:
    name: Lerian Studio General License
  title: Pix Lerian — Collections
  version: 1.0.0
servers:
  - url: https://api.example.com/cob-hub/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, retrieve, list, and decode static Pix BR Codes.
    name: BR Codes
  - description: Create, retrieve, list, and cancel due-date Pix collections.
    name: Due-Date Collections
  - description: Create, retrieve, list, and cancel immediate Pix collections.
    name: Immediate Collections
paths:
  /collections/immediate:
    post:
      tags:
        - Immediate Collections
      summary: Create an immediate Pix collection (cob)
      description: >-
        Registers an immediate dynamic Pix collection. The Pix key is validated
        before creation. The collection includes its EMV payload, location URL,
        and expiration time.
      operationId: createImmediateCollection
      parameters:
        - description: >-
            REQUIRED. Client-supplied replay key, at most 64 bytes. A request
            without it is refused with PIX-0030 @ 400 before the handler runs.
            Replaying the same key returns the ORIGINAL response at 200, even
            when the body differs from the first request under this key -- the
            key alone decides replay for collection creation. To create a
            different collection, use a new X-Idempotency key and a new txId.
          in: header
          name: X-Idempotency
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
        - description: Receiver merchant account UUID (scopes DICT key validation)
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: Receiver merchant account UUID (scopes DICT key validation)
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImmediateCollectionBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImmediateCollectionOutput'
          description: >-
            Replay of an already-completed request under this X-Idempotency key
            -- the ORIGINAL response, verbatim, even when this request's body or
            txId differs from the first ( Never re-executes the command and
            never calls the provider a second time.
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImmediateCollectionOutput'
          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'
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0200
                title: Bad Request
                status: 400
                detail: Missing or malformed required fields.
                code: PIX-0200
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Missing or malformed headers/body fields, invalid collection input
            (PIX-0001-0003, PIX-0010, PIX-0017, PIX-0200), or provider-side
            request validation rejection (PIX-0224). X-Idempotency absent or
            longer than 64 bytes (PIX-0030) uses the legacy {code,title,message}
            envelope; other 400 errors use application/problem+json.
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0225
                title: Not Found
                status: 404
                detail: >-
                  The requested collection resource was not found at the
                  provider.
                code: PIX-0225
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The provider reports that the addressed collection resource does not
            exist (PIX-0225).
        '409':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0244
                title: Conflict
                status: 409
                detail: >-
                  The creation for this key is already being processed; retry
                  shortly.
                code: PIX-0244
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The txId is already claimed, the provider reports a conflicting
            state, or an earlier create operation is still in progress
            (PIX-0012, PIX-0226, PIX-0244). An earlier request for this BACEN
            key (organization, merchant_document, txId) or this X-Idempotency
            key is still being processed (PIX-0244). Retry shortly with the same
            key.
        '415':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0016
                title: Unsupported Media Type
                status: 415
                detail: >-
                  The request body must be sent with Content-Type:
                  application/json.
                code: PIX-0016
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The non-empty request body is missing an accepted JSON Content-Type
            (PIX-0016).
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0245
                title: Unprocessable Entity
                status: 422
                detail: >-
                  The creation for this key can no longer be completed; use a
                  new tx_id or contact support.
                code: PIX-0245
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The Pix key is absent or inactive, or an earlier create operation
            reached a terminal outcome (PIX-0201, PIX-0245). An earlier request
            for this BACEN key or this X-Idempotency key reached a terminal
            outcome that can never complete (PIX-0245). Use a new X-Idempotency
            key and a new txId.
        '500':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server encountered an unexpected error. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Unexpected internal failure comparing, recovering, or persisting the
            collection (PIX-0000).
        '502':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0223
                title: Bad Gateway
                status: 502
                detail: Provider adapter is unreachable.
                code: PIX-0223
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The DICT Hub or provider adapter is unreachable, or a successful
            provider response violates its contract (PIX-0223).
        '504':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0054
                title: Gateway Timeout
                status: 504
                detail: The request timed out. Please try again later.
                code: PIX-0054
              schema:
                $ref: '#/components/schemas/Detail'
          description: The provider timed out handling the create request (PIX-0054).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
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: BACEN 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

````