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

> ## Agent Instructions
> Documentação oficial da sinnu, gateway de pagamento brasileiro: Pix e cartão de crédito. O índice de todas as páginas está em https://docs.sinnu.com.br/llms.txt.
> A API (https://api.sinnu.com.br) e o checkout (https://pay.sinnu.com.br) documentados são de produção. Não há ambiente público de testes: cada chamada cria ou altera dados reais.
> A chave secreta sk_live_ fica só no servidor. O navegador recebe apenas o slug do link ou a URL do checkout.
> Unidades: amountCents do link e os valores de /api/transactions/ estão em centavos (inteiro). data.amount do webhook e amount das transações de um link estão em reais. Compare na mesma unidade.
> Status: a API de transações usa approved; o corpo do webhook usa paid; o evento é transaction.approved.
> Libere o pedido só pelo webhook assinado (X-Sinnu-Signature, validado sobre o corpo cru com constructEvent({ payload, signature, secret })) e confirme com transactions.get. Nunca pelo evento completed do Sinnu Elements nem pelos parâmetros da URL de retorno.
> Estorno é sempre do valor total. Não invente métodos, campos ou eventos: confira na referência do SDK e da API.

# Consulte uma transação

> Confira o estado atual de um pagamento pelo identificador.

Use esta consulta para [conciliar um evento](https://docs.sinnu.com.br/guias/conciliacao.md). O `amount` retornado está em centavos.


## OpenAPI

````yaml GET /api/transactions/{id}/
openapi: 3.0.3
info:
  title: sinnu API
  version: 1.0.0
  description: >-
    API pública da sinnu para links, clientes e transações. Autentique com
    Bearer e a chave da empresa. Links usam amountCents em centavos; a API de
    transações usa centavos; webhooks e transações de um link usam reais.
    Consulte a unidade de cada recurso.
  x-source-sha256: 153c3fdb10dbb3d93407364e1d121b9565747a56c1b8db9ace49edcb2ef48d8a
servers:
  - url: https://api.sinnu.com.br
    description: Produção
security:
  - bearerAuth: []
paths:
  /api/transactions/{id}/:
    get:
      tags:
        - transactions
      summary: Consultar transação
      description: Retorna uma transação da empresa autenticada em formato flat.
      operationId: transactions_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 00000000-0000-4000-8000-000000000001
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SinnuTransactionDetail'
          description: ''
        '403':
          description: Sua chave de API não tem permissão para consultar transações.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --fail-with-body --request GET \
              'https://api.sinnu.com.br/api/transactions/ID_DO_RECURSO/' \
              --header "Authorization: Bearer $SINNU_API_KEY"
        - lang: javascript
          label: JavaScript · servidor
          source: >-
            const apiKey = process.env.SINNU_API_KEY;

            if (!apiKey) throw new Error("Configure SINNU_API_KEY no
            servidor.");

            const response = await
            fetch("https://api.sinnu.com.br/api/transactions/ID_DO_RECURSO/", {
              method: "GET",
              headers: {
                Authorization: `Bearer ${apiKey}`,
              },
            });

            if (!response.ok) throw new Error(`HTTP ${response.status}: ${await
            response.text()}`);

            console.log(response.status === 204 ? null : await response.json());
components:
  schemas:
    SinnuTransactionDetail:
      type: object
      description: >-
        Transação da empresa autenticada. Valores monetários são inteiros em
        centavos.
      properties:
        id:
          type: string
          readOnly: true
        amount:
          type: integer
          description: Valor bruto cobrado do pagador, em centavos.
          readOnly: true
        net:
          type: integer
          description: Valor líquido da empresa, em centavos.
          readOnly: true
        productAmount:
          type: integer
          description: Preço do produto, em centavos, antes dos juros de parcelamento.
          readOnly: true
        interestAmount:
          type: integer
          description: Juros do parcelamento, em centavos.
          readOnly: true
        interestMode:
          type: string
          nullable: true
          description: 'Quem paga os juros do parcelamento: `absorb` ou `pass_to_customer`.'
          readOnly: true
        mdrAmount:
          type: integer
          readOnly: true
        fixedFeeAmount:
          type: integer
          readOnly: true
        otherFeeAmount:
          type: integer
          readOnly: true
        totalFeeAmount:
          type: integer
          readOnly: true
        status:
          type: string
          description: >-
            Status da transação: pending, approved, refused, refunded ou
            chargeback.
          readOnly: true
        method:
          allOf:
            - $ref: '#/components/schemas/SinnuTransactionMethodEnum'
          readOnly: true
          description: 'Método de pagamento: pix ou credit_card.'
        customer:
          allOf:
            - $ref: '#/components/schemas/SinnuTransactionCustomer'
          readOnly: true
          description: 'Pagador da transação: `{ id, name, email }`.'
        description:
          type: string
          description: Descrição da venda. Vazia quando não informada.
          readOnly: true
        installments:
          type: integer
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        paidAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        refusal:
          allOf:
            - $ref: '#/components/schemas/SinnuTransactionRefusal'
          nullable: true
          readOnly: true
        splits:
          type: array
          items:
            $ref: '#/components/schemas/SinnuTransactionSplit'
          readOnly: true
        checkoutSlug:
          type: string
          nullable: true
          readOnly: true
          description: >-
            Slug do link de checkout desta venda, e SÓ quando esse link ainda
            aceita uma compra nova - é com ele que o painel/app monta a URL para
            o vendedor reenviar ao comprador. `null` quando não há para onde
            mandar ninguém: venda sem link (cobrança direta por API), link
            pausado/arquivado, ou link que só vende assinatura. Reabrir o
            checkout cria uma cobrança NOVA - não quita a pendente, que segue
            até expirar.
        disputedAt:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: >-
            Quando a disputa entrou (`Payment.chargedbackAt`). `null` fora de
            disputa - inclusive numa disputa já revertida, que volta a
            `approved` e não deve seguir marcada.
        link:
          allOf:
            - $ref: '#/components/schemas/SaleLink'
          nullable: true
          readOnly: true
        reference:
          type: string
          readOnly: true
          nullable: true
          description: >-
            Pedido do seu sistema para esta venda: o `?ref=` com que o checkout
            foi aberto, ou o `exId` da cobrança criada pela API. `null` quando
            não informado.
        items:
          type: array
          items:
            $ref: '#/components/schemas/SaleItemCents'
          readOnly: true
        salesperson:
          allOf:
            - $ref: '#/components/schemas/SaleSalesperson'
          nullable: true
          readOnly: true
        origin:
          allOf:
            - $ref: '#/components/schemas/TransactionOrigin'
          nullable: true
          readOnly: true
        attribution:
          allOf:
            - $ref: '#/components/schemas/TransactionAttribution'
          nullable: true
          readOnly: true
        trackingDeliveries:
          type: array
          items:
            $ref: '#/components/schemas/TrackingDeliveryRead'
          readOnly: true
      required:
        - amount
        - attribution
        - checkoutSlug
        - createdAt
        - customer
        - description
        - disputedAt
        - fixedFeeAmount
        - id
        - installments
        - interestAmount
        - interestMode
        - items
        - link
        - mdrAmount
        - method
        - net
        - origin
        - otherFeeAmount
        - paidAt
        - productAmount
        - reference
        - refusal
        - salesperson
        - splits
        - status
        - totalFeeAmount
        - trackingDeliveries
    SinnuTransactionMethodEnum:
      type: string
      enum:
        - pix
        - credit_card
        - threeDs
        - applepay
        - googlepay
    SinnuTransactionCustomer:
      type: object
      description: 'Cliente embutido na transação: `{ id, name, email, phone }`.'
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
          nullable: true
      required:
        - email
        - id
        - name
        - phone
    SinnuTransactionRefusal:
      type: object
      description: >-
        Motivo detalhado de recusa devolvido pelo emissor do cartão, com
        orientação para recuperar a venda.
      properties:
        code:
          type: string
          description: >-
            Código ABECS cru devolvido pelo emissor (ex.: `59`, `51`, `03`);
            vazio quando o emissor não devolveu código. Exibir em fonte mono
            para repasse ao suporte.
        title:
          type: string
          description: Título curto da causa, voz do seller.
        detail:
          type: string
          description: Explicação da causa (quem recusou e por quê).
        action:
          type: string
          description: Ação sugerida ao seller para recuperar a venda.
        retryable:
          type: boolean
          description: Se vale a pena retentar a MESMA forma de pagamento.
        irreversible:
          type: boolean
          description: >-
            Coluna "Tipo de código" da tabela ABECS oficial: True quando a
            recusa é IRREVERSÍVEL (não adianta retentar este cartão - peça outro
            ou Pix). False também quando o código não está na tabela.
      required:
        - action
        - code
        - detail
        - irreversible
        - retryable
        - title
    SinnuTransactionSplit:
      type: object
      description: >-
        Fatia de divisão do valor líquido da transação entre produtor,
        coprodutor ou afiliado.
      properties:
        type:
          type: string
          description: '`producer` | `coproducer` | `affiliate` (`payment.SplitType`).'
        recipientName:
          type: string
          description: >-
            Nome da empresa que recebe esta fatia. Vazio em split legado sem
            empresa carimbada. É o ÚNICO dado do parceiro exposto ao vendedor.
        percentage:
          type: number
          format: double
          description: >-
            Percentual EFETIVO desta fatia sobre o líquido da venda, como o
            settle gravou. 0 enquanto a venda não liquidou.
        amountCents:
          type: integer
          description: Parte liberável desta fatia, em centavos.
        reserveCents:
          type: integer
          description: >-
            Parte retida em reserva desta fatia, em centavos. O que o recebedor
            ganha nesta venda é `amountCents + reserveCents`.
      required:
        - amountCents
        - percentage
        - recipientName
        - reserveCents
        - type
    SaleLink:
      type: object
      properties:
        id:
          type: string
          description: ID do link de pagamento.
        title:
          type: string
          description: Título do link, que é o nome do produto.
      required:
        - id
        - title
    SaleItemCents:
      type: object
      properties:
        title:
          type: string
        quantity:
          type: integer
        unitPrice:
          type: integer
          nullable: true
          description: Preço unitário em centavos.
        externalRef:
          type: string
          nullable: true
      required:
        - externalRef
        - quantity
        - title
        - unitPrice
    SaleSalesperson:
      type: object
      properties:
        id:
          type: integer
          description: ID do membro da equipe.
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - email
        - id
        - name
    TransactionOrigin:
      type: object
      description: '``origin`` de cada linha da lista de transações do painel.'
      properties:
        channel:
          allOf:
            - $ref: '#/components/schemas/OriginChannelEnum'
          description: >-
            Canal derivado de `utm_source`: `meta` | `tiktok` | `whatsapp` |
            `instagram` | `google` | `direct` (sem atribuição) | `other`.


            * `meta` - meta

            * `tiktok` - tiktok

            * `whatsapp` - whatsapp

            * `instagram` - instagram

            * `google` - google

            * `direct` - direct

            * `other` - other
        source:
          type: string
          description: '`utm_source` como veio.'
        medium:
          type: string
          description: '`utm_medium` como veio.'
        campaign:
          type: string
          description: '`utm_campaign` como veio.'
      required:
        - campaign
        - channel
        - medium
        - source
    TransactionAttribution:
      type: object
      description: >-
        ``attribution`` no detalhe da transação: os UTMs e o contexto do clique.


        O que NÃO sai daqui, de propósito: IP, user agent, os cookies dos pixels

        (`fbp`/`fbc`/`ttp`) e os click-ids inteiros - é dado do comprador que só

        serve ao envio. `landingUrl` vai sem a query (é nela que o click-id
        viaja).
      properties:
        channel:
          $ref: '#/components/schemas/OriginChannelEnum'
        source:
          type: string
        medium:
          type: string
        campaign:
          type: string
        content:
          type: string
          description: '`utm_content`.'
        term:
          type: string
          description: '`utm_term`.'
        src:
          type: string
        sck:
          type: string
        landingUrl:
          type: string
          description: Página de entrada, SEM a query string.
        referrer:
          type: string
        firstSeenAt:
          type: string
          format: date-time
          description: Quando a atribuição foi gravada (primeiro clique que virou sessão).
        clickIds:
          type: array
          items:
            $ref: '#/components/schemas/TransactionClickId'
      required:
        - campaign
        - channel
        - clickIds
        - content
        - firstSeenAt
        - landingUrl
        - medium
        - referrer
        - sck
        - source
        - src
        - term
    TrackingDeliveryRead:
      type: object
      description: Um evento enviado (ou a enviar) a um pixel por esta venda.
      properties:
        id:
          type: integer
        pixel:
          $ref: '#/components/schemas/TrackingDeliveryPixel'
        event:
          type: string
          description: >-
            Nome do evento na plataforma: `Purchase` (também no Google Ads),
            `PixGerado`, `CompletePayment`, `PlaceAnOrder`.
        kind:
          allOf:
            - $ref: '#/components/schemas/TrackingDeliveryReadKindEnum'
          description: >-
            `purchase` (compra) ou `pix_generated` (Pix gerado, não é
            conversão).


            * `purchase` - purchase

            * `pix_generated` - pix_generated
        status:
          $ref: '#/components/schemas/TrackingDeliveryStatusEnum'
        attempts:
          type: integer
        sentAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        error:
          type: string
          description: Resumo do último erro (vazio quando enviado).
        canResend:
          type: boolean
          description: >-
            `true` só em envio que FALHOU e cujo evento ainda cabe na janela de
            7 dias da plataforma: é o que `POST
            /api/tracking/deliveries/{id}/resend` aceita.
      required:
        - attempts
        - canResend
        - createdAt
        - error
        - event
        - id
        - kind
        - pixel
        - sentAt
        - status
    OriginChannelEnum:
      enum:
        - meta
        - tiktok
        - whatsapp
        - instagram
        - google
        - direct
        - other
      type: string
      description: |-
        * `meta` - meta
        * `tiktok` - tiktok
        * `whatsapp` - whatsapp
        * `instagram` - instagram
        * `google` - google
        * `direct` - direct
        * `other` - other
    TransactionClickId:
      type: object
      properties:
        param:
          type: string
          description: '`fbclid` | `ttclid` | `gclid` | `gbraid` | `wbraid`.'
        masked:
          type: string
          description: 'Só o fim do identificador (ex.: `...a9f3`).'
      required:
        - masked
        - param
    TrackingDeliveryPixel:
      type: object
      properties:
        id:
          type: string
          format: uuid
        platform:
          $ref: '#/components/schemas/TrackingPixelPlatformEnum'
        name:
          type: string
      required:
        - id
        - name
        - platform
    TrackingDeliveryReadKindEnum:
      enum:
        - purchase
        - pix_generated
      type: string
      description: |-
        * `purchase` - purchase
        * `pix_generated` - pix_generated
    TrackingDeliveryStatusEnum:
      enum:
        - pending
        - sent
        - failed
        - skipped
      type: string
      description: |-
        * `pending` - Na fila
        * `sent` - Enviado
        * `failed` - Falhou
        * `skipped` - Não enviado
    TrackingPixelPlatformEnum:
      enum:
        - meta
        - tiktok
        - google_ads
      type: string
      description: |-
        * `meta` - Meta
        * `tiktok` - TikTok
        * `google_ads` - Google Ads
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Chave secreta sk_live_ da empresa. Use somente no servidor.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.