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

# Crear un código BR estático

> Crea un código BR estático y reutilizable de Pix y devuelve su payload EMV. La clave Pix informada debe pertenecer a la cuenta identificada por `X-Account-Id` y se valida antes de generar el código.



## OpenAPI

````yaml es/openapi/v3-current/pix-lerian-cob.yaml POST /brcodes/static
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    API pública para códigos BR Pix y cobros inmediatos y con fecha de
    vencimiento.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — Cobros
  version: release-candidate
servers:
  - url: https://api.example.com/cob-hub/v1
    description: >-
      El host de ejemplo debe reemplazarse por la URL proporcionada durante el
      onboarding del entorno.
security:
  - BearerAuth: []
tags:
  - description: >-
      Creación, consulta, listado y decodificación de códigos BR estáticos de
      Pix.
    name: BR Codes
  - description: Creación, consulta, listado y cancelación de cobros Pix inmediatos.
    name: Immediate Collections
  - description: Creación, consulta, listado y cancelación de cobros Pix con vencimiento.
    name: Due-Date Collections
paths:
  /brcodes/static:
    post:
      tags:
        - BR Codes
      summary: Crear un código BR estático
      description: >-
        Crea un código BR estático y reutilizable de Pix y devuelve su payload
        EMV. La clave Pix informada debe pertenecer a la cuenta identificada por
        `X-Account-Id` y se valida antes de generar el código.
      operationId: createStaticBRCode
      parameters:
        - description: >-
            Clave generada por el cliente para reintentar exactamente la misma
            solicitud de forma segura.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
            description: >-
              Clave generada por el cliente para reintentar exactamente la misma
              solicitud de forma segura.
          example: pix-demo-20260903-000001
        - description: UUID de la cuenta asociada a la operación.
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: UUID de la cuenta asociada a la operación.
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
          example: 019606a1-3b4c-7d8e-9f01-234567890abc
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStaticBRCodeBody'
            examples:
              ejemploFicticio:
                summary: Ejemplo ficticio
                value:
                  amount: '100.50'
                  description: Pagamento
                  keyType: CPF
                  keyValue: '39053344705'
                  merchantCity: Goiania
                  merchantName: Loja Teste
                  postalCode: '74000000'
                  txId: TX12345
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateStaticBRCodeOutput'
              examples:
                ejemploFicticio:
                  summary: Ejemplo ficticio
                  value:
                    amount: '100.50'
                    createdAt: '2026-05-06T10:30:00Z'
                    currency: BRL
                    description: Pagamento do pedido 12345
                    emvPayload: >-
                      00020101021126330014br.gov.bcb.pix0111390533447055204000053039865406100.505802BR5910Loja
                      Teste6007Goiania62110507TX123456304AA54
                    id: 0196a7b2-1c3d-7e4f-8a90-1234567890ab
                    keyType: CPF
                    keyValue: '39053344705'
                    merchantCity: Goiania
                    merchantName: Loja Teste
                    organizationId: 0196a7b2-2d4e-7f50-9b01-234567890abc
                    status: ACTIVE
                    type: STATIC
                    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 con datos ficticios
          source: |-
            curl --request POST \
              --url https://api.example.com/cob-hub/v1/brcodes/static \
              --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 '{
              "amount": "100.50",
              "description": "Pagamento",
              "keyType": "CPF",
              "keyValue": "39053344705",
              "merchantCity": "Goiania",
              "merchantName": "Loja Teste",
              "postalCode": "74000000",
              "txId": "TX12345"
            }'
components:
  schemas:
    CreateStaticBRCodeBody:
      additionalProperties: false
      properties:
        amount:
          description: Fixed amount in BCB-canonical decimal form (omit for open value)
          examples:
            - '100.50'
          type: string
        description:
          description: Free-form description
          examples:
            - Pagamento
          type: string
        keyType:
          description: Pix key type
          examples:
            - CPF
          type: string
        keyValue:
          description: Pix key value
          examples:
            - '39053344705'
          type: string
        merchantCity:
          description: Merchant city
          examples:
            - Goiania
          type: string
        merchantName:
          description: Merchant name
          examples:
            - Loja Teste
          type: string
        postalCode:
          description: 8-digit postal code
          examples:
            - '74000000'
          type: string
        txId:
          description: Optional merchant transaction identifier
          examples:
            - TX12345
          type: string
      required:
        - keyType
        - keyValue
        - merchantName
        - merchantCity
      type: object
    CreateStaticBRCodeOutput:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '100.50'
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        currency:
          enum:
            - BRL
          examples:
            - BRL
          type: string
        description:
          examples:
            - Pagamento do pedido 12345
          type: string
        emvPayload:
          examples:
            - >-
              00020101021126330014br.gov.bcb.pix0111390533447055204000053039865406100.505802BR5910Loja
              Teste6007Goiania62110507TX123456304AA54
          type: string
        id:
          examples:
            - 0196a7b2-1c3d-7e4f-8a90-1234567890ab
          type: string
        keyType:
          enum:
            - CPF
            - CNPJ
            - PHONE
            - EMAIL
            - EVP
          examples:
            - CPF
          type: string
        keyValue:
          examples:
            - '39053344705'
          type: string
        merchantCity:
          examples:
            - Goiania
          type: string
        merchantName:
          examples:
            - Loja Teste
          type: string
        organizationId:
          examples:
            - 0196a7b2-2d4e-7f50-9b01-234567890abc
          type: string
        status:
          enum:
            - ACTIVE
            - CANCELLED
          examples:
            - ACTIVE
          type: string
        type:
          enum:
            - STATIC
          examples:
            - STATIC
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
      required:
        - id
        - organizationId
        - type
        - keyType
        - keyValue
        - merchantName
        - merchantCity
        - emvPayload
        - status
        - 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
    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
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````